From 2d34f975bc40449d2d1088032fc6d5cdaf8450cb Mon Sep 17 00:00:00 2001 From: flo <> Date: Tue, 29 Apr 2025 14:38:06 +0200 Subject: [PATCH] add high score feature and update dependencies --- datas/database.db | Bin 0 -> 12288 bytes datas/histories/florian 22025-04-27.json | 1 + datas/histories/florian2025-04-27.json | 1 + datas/histories/historyZone | 0 index.js | 412 ++++++ package-lock.json | 1457 +++++++++++++++++++++- package.json | 4 +- public/index.html | 19 + public/script/index.js | 113 +- public/script/view.js | 28 + public/style/index.css | 20 +- 11 files changed, 2018 insertions(+), 37 deletions(-) create mode 100644 datas/database.db create mode 100644 datas/histories/florian 22025-04-27.json create mode 100644 datas/histories/florian2025-04-27.json create mode 100644 datas/histories/historyZone diff --git a/datas/database.db b/datas/database.db new file mode 100644 index 0000000000000000000000000000000000000000..6e0d715b4bf96d0eae709c1fde74801e99be40e2 GIT binary patch literal 12288 zcmeI&!A{#i5C-5~rwVGM62t{X2z8DiATbVAqnvQlEe%aVFdK;+P*{jjTqSX1y9bU{ z`y_paz6Gz-2k6>0Nrwjxr z`GFgT$!OfKkbI-f9Hrs)sos*}P&m|f>P_3}(kIa+yCaY5EuGpFEx9w@{bi_b+@Keq zOH!Q8tt5xtm6}UX(cq&OMt*R!kkD7Uo0s*bIF)v@P4C4AyVHo|@+vNv5x&)!OU z^L(G>f9U}M0SG_<0uX=z1Rwwb2tWV=5P-m=1zJXyy*5<&dguq98k6<1QY`64U4^AV z(!_giSehAE>owRm*1F o|MUEBrY{5pAOHafKmY;|fB*y_009U<00PfQAjdNWp8m%02kI!4NB{r; literal 0 HcmV?d00001 diff --git a/datas/histories/florian 22025-04-27.json b/datas/histories/florian 22025-04-27.json new file mode 100644 index 0000000..844f82d --- /dev/null +++ b/datas/histories/florian 22025-04-27.json @@ -0,0 +1 @@ +[[7,1],[7,3],[6,0],[3,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,4],[6,0],[4,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[5,0],[7,2],[6,0],[4,0],[2,0],[2,0],[2,0],[3,0],[4,0],[4,0],[5,0],[7,2],[6,0],[2,0],[2,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[2,0],[5,0],[7,3],[6,0],[2,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[4,0],[3,0],[1,0],[1,0],[4,0],[2,0],[3,0],[3,0],[5,0],[7,2],[6,0],[4,0],[3,0],[1,0],[1,0],[5,0],[7,5],[6,0],[4,0],[2,0],[3,0],[2,0],[2,0],[2,0],[5,0],[7,0],[6,0],[4,0],[3,0],[2,0],[4,0],[4,0],[3,0],[4,0],[5,0],[7,3],[6,0],[4,0],[2,0],[3,0],[5,0],[7,3],[6,0],[5,0],[7,0],[6,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[5,0],[7,4],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[3,0],[4,0],[1,0],[5,0],[7,2],[6,0],[4,0],[4,0],[3,0],[2,0],[2,0],[2,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,3],[6,0],[4,0],[2,0],[2,0],[4,0],[4,0],[3,0],[2,0],[5,0],[7,2],[6,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[2,0],[5,0],[7,6],[6,0],[2,0],[2,0],[3,0],[2,0],[2,0],[5,0],[7,1],[6,0],[2,0],[2,0],[2,0],[2,0],[5,0],[7,2],[6,0],[4,0],[3,0],[1,0],[1,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[4,0],[4,0],[3,0],[4,0],[1,0],[1,0],[1,0],[2,0],[2,0],[2,0],[3,0],[2,0],[2,0],[2,0],[4,0],[3,0],[4,0],[4,0],[3,0],[1,0],[5,0],[7,6],[6,0],[1,0],[1,0],[3,0],[4,0],[1,0],[1,0],[5,0],[7,2],[6,0],[2,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,4],[6,0],[4,0],[4,0],[1,0],[1,0],[1,0],[3,0],[4,0],[4,0],[4,0],[1,0],[3,0],[4,0],[5,0],[7,0],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[4,0],[2,0],[1,0],[2,0],[1,0],[3,0],[2,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,4],[6,0],[2,0],[2,0],[4,0],[3,0],[2,0],[5,0],[7,6],[6,0],[1,0],[5,0],[7,3],[6,0],[2,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,1],[6,0],[4,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,6],[6,0],[4,0],[3,0],[1,0],[1,0],[4,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[2,0],[2,0],[2,0],[5,0],[7,4],[6,0],[2,0],[2,0],[3,0],[1,0],[1,0],[4,0],[1,0],[1,0],[3,0],[1,0],[1,0],[5,0],[7,5],[6,0],[1,0],[4,0],[3,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[2,0],[2,0],[1,0],[3,0],[5,0],[7,2],[6,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[4,0],[3,0],[4,0],[1,0],[5,0],[7,2],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[4,0],[3,0],[5,0],[7,1],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[4,0],[3,0],[4,0],[1,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,3],[6,0],[2,0],[2,0],[3,0],[3,0],[5,0],[7,1],[6,0],[4,0],[3,0],[1,0],[1,0],[1,0],[1,0],[5,0],[7,3],[6,0],[4,0],[4,0],[3,0],[1,0],[4,0],[4,0],[3,0],[5,0],[7,3],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,3],[6,0],[1,0],[4,0],[3,0],[1,0],[1,0],[1,0],[5,0],[7,3],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,4],[6,0],[4,0],[3,0],[4,0],[3,0],[4,0],[3,0],[1,0],[5,0],[7,3],[6,0],[2,0],[3,0],[2,0],[4,0],[4,0],[3,0],[5,0],[7,6],[6,0],[4,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[2,0],[2,0],[2,0],[5,0],[7,6],[6,0],[4,0],[4,0],[3,0],[4,0],[3,0],[2,0],[2,0],[2,0],[5,0],[7,0],[6,0],[2,0],[2,0],[2,0],[2,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[1,0],[2,0],[5,0],[7,4],[6,0],[1,0],[4,0],[3,0],[1,0],[1,0],[5,0],[7,0],[6,0],[2,0],[5,0],[7,3],[6,0],[4,0],[1,0],[1,0],[5,0],[7,2],[6,0],[2,0],[2,0],[4,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[1,0],[4,0],[3,0],[1,0],[1,0],[4,0],[3,0],[2,0],[2,0],[5,0],[7,2],[6,0],[4,0],[1,0],[1,0],[1,0],[4,0],[3,0],[4,0],[1,0],[5,0],[7,5],[6,0],[4,0],[3,0],[4,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[5,0],[7,0],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[5,0],[7,3],[6,0],[1,0],[1,0],[3,0],[1,0],[4,0],[5,0],[7,1],[6,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,2],[6,0],[4,0],[3,0],[5,0],[7,3],[6,0],[4,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,6],[6,0],[2,0],[2,0],[3,0],[1,0],[1,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,5],[6,0],[2,0],[5,0],[7,5],[6,0],[2,0],[2,0],[2,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[3,0],[1,0],[1,0],[4,0],[1,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[5,0],[7,0],[6,0],[4,0],[2,0],[2,0],[3,0],[3,0],[1,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,1],[6,0],[1,0],[3,0],[2,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[1,0],[1,0],[3,0],[4,0],[2,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[4,0],[2,0],[5,0],[7,1],[6,0],[4,0],[2,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[4,0],[3,0],[4,0],[2,0],[5,0],[7,2],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[4,0],[5,0],[7,6],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,3],[6,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[3,0],[3,0],[4,0],[2,0],[2,0],[3,0],[2,0],[2,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[3,0],[5,0],[7,0],[6,0],[2,0],[3,0],[5,0],[7,4],[6,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[3,0],[2,0],[2,0],[5,0],[7,3],[6,0],[4,0],[3,0],[2,0],[2,0],[3,0],[1,0],[5,0],[7,5],[6,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[4,0],[1,0],[1,0],[3,0],[2,0],[3,0],[5,0],[7,4],[6,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[4,0],[3,0],[1,0],[1,0],[3,0],[2,0],[5,0],[7,0],[6,0],[4,0],[3,0],[5,0],[7,4],[6,0],[2,0],[2,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[5,0],[7,0],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,1],[6,0],[4,0],[2,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[1,0],[4,0],[3,0],[1,0],[2,0],[3,0],[5,0],[7,4],[6,0],[3,0],[2,0],[3,0],[5,0],[7,0],[6,0],[3,0],[2,0],[3,0],[4,0],[2,0],[2,0],[1,0],[3,0],[5,0],[7,6],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[2,0],[3,0],[2,0],[2,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[1,0],[1,0],[3,0],[2,0],[2,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[1,0],[3,0],[5,0],[7,0],[6,0],[1,0],[3,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,5],[6,0],[4,0],[1,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[3,0],[4,0],[4,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,5],[6,0],[4,0],[1,0],[1,0],[1,0],[3,0],[1,0],[4,0],[4,0],[2,0],[3,0],[2,0],[4,0],[2,0],[2,0],[4,0],[3,0],[2,0],[4,0],[3,0],[2,0],[5,0],[7,3],[6,0],[4,0],[4,0],[3,0],[4,0],[5,0],[7,1],[6,0],[4,0],[1,0],[3,0],[1,0],[2,0],[2,0],[2,0],[3,0],[4,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[4,0],[4,0],[2,0],[3,0],[4,0],[5,0],[7,0],[6,0],[3,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,1],[6,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[1,0],[4,0],[3,0],[4,0],[2,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[3,0],[4,0],[7,0],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[4,0],[4,0],[3,0],[1,0],[5,0],[7,5],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,2],[6,0],[1,0],[4,0],[1,0],[3,0],[1,0],[5,0],[7,0],[6,0],[3,0],[4,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,4],[6,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,6],[6,0],[3,0],[4,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[2,0],[2,0],[3,0],[5,0],[7,1],[6,0],[4,0],[1,0],[1,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[4,0],[3,0],[2,0],[2,0],[2,0],[4,0],[3,0],[4,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[1,0],[1,0],[1,0],[3,0],[1,0],[4,0],[3,0],[5,0],[7,4],[6,0],[3,0],[3,0],[2,0],[4,0],[2,0],[1,0],[1,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[3,0],[2,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,0],[6,0],[1,0],[3,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,3],[6,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,2],[6,0],[3,0],[3,0],[3,0],[3,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[3,0],[1,0],[4,0],[4,0],[3,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[1,0],[3,0],[1,0],[1,0],[1,0],[1,0],[1,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[1,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[3,0],[1,0],[5,0],[7,3],[6,0],[3,0],[1,0],[1,0],[4,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,6],[6,0],[3,0],[1,0],[5,0],[7,3],[6,0],[3,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,1],[6,0],[3,0],[4,0],[1,0],[3,0],[2,0],[2,0],[3,0],[2,0],[1,0],[3,0],[5,0],[7,1],[6,0],[4,0],[3,0],[2,0],[3,0],[2,0],[2,0],[2,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[3,0],[1,0],[1,0],[1,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[4,0],[4,0],[4,0],[1,0],[7,6],[6,0],[3,0],[1,0],[4,0],[1,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,1],[6,0],[2,0],[2,0],[3,0],[2,0],[2,0],[3,0],[1,0],[3,0],[5,0],[7,4],[6,0],[4,0],[3,0],[4,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,2],[6,0],[4,0],[2,0],[2,0],[3,0],[2,0],[2,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[1,0],[1,0],[4,0],[1,0],[3,0],[4,0],[2,0],[2,0],[3,0],[3,0],[7,3],[6,0],[1,0],[1,0],[2,0],[3,0],[4,0],[4,0],[7,6],[6,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[5,0]] \ No newline at end of file diff --git a/datas/histories/florian2025-04-27.json b/datas/histories/florian2025-04-27.json new file mode 100644 index 0000000..83b45dc --- /dev/null +++ b/datas/histories/florian2025-04-27.json @@ -0,0 +1 @@ +[[7,4],[7,6],[6,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[2,0],[2,0],[2,0],[5,0],[7,0],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[5,0],[7,0],[6,0],[4,0],[4,0],[1,0],[3,0],[1,0],[2,0],[3,0],[2,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[3,0],[1,0],[7,2],[6,0],[2,0],[4,0],[2,0],[1,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[4,0],[4,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[1,0],[4,0],[3,0],[5,0],[7,5],[6,0],[3,0],[3,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[1,0],[1,0],[4,0],[3,0],[1,0],[1,0],[4,0],[1,0],[1,0],[4,0],[1,0],[4,0],[3,0],[4,0],[4,0],[1,0],[5,0],[7,4],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,4],[6,0],[4,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[2,0],[4,0],[2,0],[3,0],[4,0],[2,0],[3,0],[5,0],[7,3],[6,0],[1,0],[5,0],[7,5],[6,0],[2,0],[2,0],[4,0],[1,0],[3,0],[1,0],[4,0],[1,0],[1,0],[5,0],[7,3],[6,0],[4,0],[4,0],[3,0],[4,0],[4,0],[4,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[2,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[1,0],[1,0],[1,0],[3,0],[1,0],[4,0],[2,0],[5,0],[7,1],[6,0],[2,0],[2,0],[5,0],[7,6],[6,0],[3,0],[3,0],[1,0],[1,0],[4,0],[3,0],[2,0],[2,0],[1,0],[5,0],[7,4],[6,0],[2,0],[2,0],[5,0],[7,1],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[4,0],[5,0],[7,2],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,2],[6,0],[1,0],[4,0],[1,0],[1,0],[4,0],[3,0],[4,0],[2,0],[5,0],[7,5],[6,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[4,0],[5,0],[7,6],[6,0],[2,0],[2,0],[3,0],[4,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,4],[6,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[1,0],[5,0],[7,4],[6,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[4,0],[4,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[4,0],[4,0],[4,0],[3,0],[1,0],[5,0],[7,0],[6,0],[1,0],[4,0],[4,0],[3,0],[4,0],[1,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[5,0],[7,1],[6,0],[2,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[4,0],[5,0],[7,1],[6,0],[3,0],[3,0],[2,0],[4,0],[2,0],[4,0],[4,0],[3,0],[1,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,3],[6,0],[2,0],[2,0],[4,0],[2,0],[2,0],[3,0],[4,0],[5,0],[7,3],[6,0],[4,0],[1,0],[3,0],[5,0],[7,4],[6,0],[1,0],[4,0],[3,0],[1,0],[1,0],[1,0],[5,0],[7,2],[6,0],[1,0],[4,0],[1,0],[2,0],[3,0],[2,0],[2,0],[4,0],[2,0],[2,0],[4,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[4,0],[3,0],[4,0],[2,0],[5,0],[7,1],[6,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[1,0],[1,0],[1,0],[3,0],[4,0],[4,0],[2,0],[4,0],[2,0],[3,0],[1,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[5,0],[7,4],[6,0],[4,0],[1,0],[1,0],[3,0],[3,0],[5,0],[7,2],[6,0],[3,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[2,0],[4,0],[2,0],[2,0],[4,0],[3,0],[4,0],[2,0],[5,0],[7,1],[6,0],[3,0],[1,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,0],[6,0],[3,0],[4,0],[4,0],[1,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[1,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,1],[6,0],[4,0],[3,0],[4,0],[3,0],[4,0],[1,0],[3,0],[1,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[2,0],[4,0],[3,0],[2,0],[4,0],[2,0],[1,0],[3,0],[5,0],[7,0],[6,0],[1,0],[3,0],[4,0],[3,0],[5,0],[7,0],[6,0],[4,0],[1,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[4,0],[5,0],[7,3],[6,0],[3,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[4,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[4,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[4,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,1],[6,0],[4,0],[3,0],[4,0],[3,0],[2,0],[5,0],[7,3],[6,0],[4,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[1,0],[4,0],[1,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[3,0],[4,0],[2,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,0],[6,0],[4,0],[3,0],[3,0],[1,0],[4,0],[3,0],[1,0],[1,0],[5,0],[7,0],[6,0],[4,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[3,0],[1,0],[1,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[3,0],[4,0],[3,0],[5,0],[7,0],[6,0],[4,0],[3,0],[5,0],[7,4],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,4],[6,0],[4,0],[2,0],[4,0],[3,0],[2,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[4,0],[1,0],[1,0],[3,0],[4,0],[5,0],[7,2],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,4],[6,0],[3,0],[1,0],[5,0],[7,0],[6,0],[3,0],[1,0],[4,0],[3,0],[1,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[3,0],[1,0],[1,0],[3,0],[2,0],[2,0],[2,0],[2,0],[3,0],[2,0],[2,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[3,0],[4,0],[2,0],[1,0],[1,0],[4,0],[1,0],[3,0],[1,0],[1,0],[4,0],[1,0],[5,0],[7,6],[6,0],[3,0],[4,0],[3,0],[1,0],[4,0],[1,0],[4,0],[3,0],[2,0],[2,0],[3,0],[5,0],[7,6],[6,0],[3,0],[1,0],[5,0],[7,3],[6,0],[3,0],[1,0],[5,0],[7,3],[6,0],[3,0],[2,0],[2,0],[3,0],[5,0],[7,6],[6,0],[2,0],[2,0],[2,0],[3,0],[2,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,6],[6,0],[4,0],[1,0],[3,0],[1,0],[1,0],[1,0],[3,0],[2,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,1],[6,0],[3,0],[2,0],[2,0],[2,0],[3,0],[1,0],[5,0],[7,6],[6,0],[2,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,6],[6,0],[2,0],[2,0],[2,0],[3,0],[1,0],[5,0],[7,3],[6,0],[2,0],[3,0],[1,0],[1,0],[5,0],[7,5],[6,0],[2,0],[4,0],[3,0],[5,0],[7,5],[6,0],[3,0],[3,0],[1,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[3,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[1,0],[1,0],[4,0],[3,0],[4,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,0],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[4,0],[4,0],[3,0],[2,0],[5,0],[7,0],[6,0],[4,0],[1,0],[1,0],[3,0],[3,0],[3,0],[1,0],[5,0],[7,5],[6,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[1,0],[1,0],[1,0],[3,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,5],[6,0],[1,0],[3,0],[5,0],[7,2],[6,0],[5,0],[7,1],[6,0],[3,0],[2,0],[4,0],[2,0],[3,0],[4,0],[1,0],[1,0],[4,0],[3,0],[4,0],[2,0],[2,0],[3,0],[1,0],[3,0],[5,0],[7,3],[6,0],[1,0],[3,0],[1,0],[4,0],[1,0],[1,0],[3,0],[2,0],[2,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,4],[6,0],[3,0],[2,0],[3,0],[4,0],[2,0],[2,0],[1,0],[1,0],[1,0],[3,0],[1,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[3,0],[1,0],[1,0],[3,0],[3,0],[3,0],[5,0],[7,3],[6,0],[4,0],[1,0],[3,0],[1,0],[2,0],[3,0],[5,0],[7,1],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[1,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[2,0],[4,0],[2,0],[3,0],[4,0],[3,0],[3,0],[5,0],[7,3],[6,0],[3,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[4,0],[4,0],[3,0],[2,0],[2,0],[3,0],[1,0],[5,0],[7,1],[6,0],[3,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[3,0],[4,0],[2,0],[5,0],[7,6],[6,0],[3,0],[1,0],[4,0],[5,0],[7,3],[6,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,4],[6,0],[4,0],[2,0],[3,0],[5,0],[7,5],[6,0],[3,0],[1,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,6],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[4,0],[4,0],[1,0],[3,0],[5,0],[7,5],[6,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,3],[6,0],[4,0],[2,0],[3,0],[1,0],[1,0],[5,0],[7,6],[6,0],[1,0],[3,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[2,0],[2,0],[3,0],[2,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[4,0],[4,0],[3,0],[2,0],[5,0],[7,4],[6,0],[3,0],[2,0],[4,0],[2,0],[3,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[3,0],[4,0],[1,0],[3,0],[3,0],[3,0],[5,0],[7,2],[6,0],[2,0],[3,0],[5,0],[7,6],[6,0],[3,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[4,0],[3,0],[4,0],[2,0],[4,0],[3,0],[5,0],[7,6],[6,0],[2,0],[2,0],[3,0],[2,0],[2,0],[5,0],[7,1],[6,0],[2,0],[3,0],[5,0],[7,4],[6,0],[3,0],[3,0],[2,0],[3,0],[4,0],[2,0],[2,0],[2,0],[4,0],[5,0],[7,1],[6,0],[3,0],[3,0],[1,0],[4,0],[1,0],[2,0],[3,0],[5,0],[7,1],[6,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[3,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[4,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,5],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[3,0],[3,0],[5,0],[7,5],[6,0],[3,0],[5,0],[7,5],[6,0],[2,0],[2,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[2,0],[4,0],[3,0],[5,0],[7,6],[6,0],[3,0],[4,0],[1,0],[3,0],[1,0],[4,0],[1,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[3,0],[2,0],[2,0],[2,0],[3,0],[7,5],[6,0],[4,0],[1,0],[1,0],[3,0],[1,0],[4,0],[3,0],[5,0],[7,3],[6,0],[3,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,6],[6,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,0],[6,0],[3,0],[1,0],[1,0],[3,0],[2,0],[2,0],[2,0],[2,0],[3,0],[7,1],[6,0],[2,0],[3,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,0],[6,0],[2,0],[2,0],[3,0],[1,0],[1,0],[4,0],[1,0],[1,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,1],[6,0],[4,0],[1,0],[1,0],[3,0],[5,0],[7,3],[6,0],[3,0],[1,0],[4,0],[1,0],[3,0],[1,0],[1,0],[4,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,0],[6,0],[4,0],[3,0],[5,0],[7,3],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,5],[6,0],[4,0],[1,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[5,0],[7,6],[6,0],[3,0],[2,0],[2,0],[1,0],[3,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,2],[6,0],[2,0],[3,0],[5,0],[7,5],[6,0],[3,0],[3,0],[3,0],[2,0],[4,0],[2,0],[7,4],[6,0],[3,0],[4,0],[4,0],[2,0],[2,0],[1,0],[1,0],[4,0],[1,0],[1,0],[1,0],[1,0],[3,0],[2,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[2,0],[2,0],[2,0],[3,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[3,0],[4,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,3],[6,0],[3,0],[1,0],[4,0],[1,0],[3,0],[5,0],[7,5],[6,0],[3,0],[4,0],[1,0],[1,0],[1,0],[3,0],[1,0],[5,0],[7,0],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,2],[6,0],[4,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,2],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[1,0],[4,0],[1,0],[1,0],[1,0],[4,0],[1,0],[3,0],[1,0],[2,0],[3,0],[5,0],[7,6],[6,0],[2,0],[4,0],[3,0],[2,0],[1,0],[1,0],[1,0],[4,0],[1,0],[4,0],[4,0],[4,0],[1,0],[3,0],[3,0],[3,0],[7,3],[6,0],[1,0],[1,0],[1,0],[1,0],[3,0],[3,0],[7,6],[6,0],[4,0],[3,0],[5,0],[7,5],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[1,0],[1,0],[1,0],[3,0],[1,0],[3,0],[7,2],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[4,0],[2,0],[3,0],[4,0],[3,0],[5,0],[7,2],[6,0],[3,0],[4,0],[1,0],[1,0],[4,0],[2,0],[2,0],[3,0],[7,0],[6,0],[4,0],[1,0],[1,0],[4,0],[1,0],[4,0],[4,0],[4,0],[1,0],[4,0],[3,0],[7,0],[6,0],[2,0],[4,0],[2,0],[3,0],[1,0],[3,0],[5,0],[7,5],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,4],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[3,0],[2,0],[4,0],[2,0],[1,0],[3,0],[5,0],[7,3],[6,0],[3,0],[4,0],[1,0],[3,0],[1,0],[7,1],[6,0],[1,0],[4,0],[4,0],[4,0],[1,0],[3,0],[7,0],[6,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,5],[6,0],[3,0],[2,0],[4,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[3,0],[2,0],[3,0],[5,0],[7,2],[6,0],[3,0],[2,0],[4,0],[2,0],[3,0],[4,0],[4,0],[3,0],[5,0],[7,4],[6,0],[2,0],[3,0],[4,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,3],[6,0],[2,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[5,0],[7,1],[6,0],[3,0],[3,0],[1,0],[1,0],[3,0],[5,0],[7,6],[6,0],[4,0],[3,0],[3,0],[5,0],[7,0],[6,0],[3,0],[2,0],[5,0],[7,3],[6,0],[2,0],[4,0],[2,0],[3,0],[5,0],[7,2],[6,0],[3,0],[4,0],[1,0],[3,0],[3,0],[1,0],[4,0],[1,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[1,0],[1,0],[3,0],[1,0],[3,0],[5,0],[7,5],[6,0],[2,0],[4,0],[2,0],[3,0],[2,0],[2,0],[2,0],[3,0],[5,0],[7,3],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[2,0],[4,0],[4,0],[3,0],[4,0],[7,2],[6,0],[3,0],[2,0],[3,0],[5,0],[7,3],[6,0],[3,0],[4,0],[1,0],[1,0],[1,0],[4,0],[3,0],[5,0],[7,3],[6,0],[3,0],[4,0],[1,0],[3,0],[5,0],[7,2],[6,0],[2,0],[4,0],[3,0],[2,0],[3,0],[7,0],[6,0],[3,0],[1,0],[4,0],[1,0],[1,0],[1,0],[3,0],[3,0],[3,0],[7,2],[6,0],[3,0],[2,0],[4,0],[2,0],[2,0],[3,0],[2,0],[3,0],[3,0],[5,0],[7,4],[6,0],[2,0],[3,0],[4,0],[2,0],[3,0],[1,0],[1,0],[1,0],[1,0],[4,0],[1,0],[3,0],[3,0],[7,3],[6,0],[3,0],[3,0],[1,0],[4,0],[1,0],[3,0],[7,5],[6,0],[4,0],[3,0],[2,0],[3,0],[3,0],[3,0],[7,3],[6,0],[3,0],[3,0],[4,0],[3,0],[7,2],[6,0],[2,0],[3,0],[4,0],[2,0],[2,0],[1,0],[1,0],[3,0],[7,2],[6,0],[2,0],[4,0],[4,0],[4,0],[1,0],[1,0],[3,0],[4,0],[4,0],[1,0],[3,0],[2,0],[1,0],[2,0],[7,2],[6,0],[2,0],[2,0],[2,0],[4,0],[2,0],[3,0],[4,0],[2,0],[4,0],[2,0],[1,0],[3,0],[3,0],[7,4],[6,0],[1,0],[4,0]] \ No newline at end of file diff --git a/datas/histories/historyZone b/datas/histories/historyZone new file mode 100644 index 0000000..e69de29 diff --git a/index.js b/index.js index b749a5b..d8c7b46 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,36 @@ import express from 'express'; +import sqlite3 from 'sqlite3'; +import { open } from 'sqlite'; +import fs from 'fs'; + +// Déclaration de la variable db pour qu'elle soit accessible dans tout le script +let db; + +// Fonction pour initialiser la base de données +async function initializeDatabase() { + // open the database - SQLite créera automatiquement le fichier s'il n'existe pas + db = await open({ + filename: './datas/database.db', + driver: sqlite3.Database + }); + + // Créer les tables nécessaires si elles n'existent pas + await db.exec(` + CREATE TABLE IF NOT EXISTS scores ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + player_name TEXT, + score INTEGER, + pathHistory TEXT, + date TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ); + `); + + console.log('Database initialized'); +} + +initializeDatabase().catch(err => { + console.error('Error initializing database:', err); +}); const app = express(); const port = 3000; @@ -6,6 +38,386 @@ const port = 3000; app.use(express.static('public')); app.use(express.json()); +app.get('/', (req, res) => { + res.sendFile('index.html', { root: '.' }); +}); + +const templatePiece = [ + [ // ok + [3, 0], + [4, 0], + [5, 0], + [6, 0], + [4.5, 0.5] + ], + [ + [3, 1], + [4, 1], + [5, 1], + [5, 0], + [4, 1] + ], + [ // ok + [3, 1], + [4, 1], + [5, 1], + [3, 0], + [4, 1] + ], + [ // ok + [3, 0], + [4, 0], + [4, 1], + [5, 1], + [4, 1] + ], + [ + [3, 1], + [4, 1], + [4, 0], + [5, 0], + [4, 1] + ], + [ // ok + [3, 0], + [4, 0], + [4, 1], + [5, 0], + [4, 0] + ], + [ // ok + [4, 0], + [5, 0], + [4, 1], + [5, 1], + [4.5, 0.5] + ] +]; + +const templateColor = [ + [240, 87, 84, 255], + [254, 223, 92, 255], + [27, 148, 118, 255], + [36, 115, 155, 255], + [106, 190, 178, 255], + [164, 199, 218, 255], + [177, 225, 218, 255] +]; + +const MOVELEFT = 1; +const MOVERIGHT = 2; +const MOVEDOWN = 3; +const ROTATE = 4; +const MOVEDOWNFAST = 5; +const RESPAWN = 6; +const CHANGENEXTPIECE = 7; + +function ifPiece(x, y, board) { + if (x < 0 || x >= 10 || y >= 20) { + return true; + } + + if (y < 0) { + return false; + } + + if (board[x][y][0] == 0 && board[x][y][1] == 0 && board[x][y][2] == 0) { + return false; + } + + return true; +} + +function canMoveTo(x, y, piece, board) { + for (let i = 0; i < piece.length - 1; i++) { + if (piece[i][0] + x < 0 || piece[i][0] + x >= 10 || piece[i][1] + y >= 20 || ifPiece(piece[i][0] + x, piece[i][1] + y, board)) { + return false; + } + } + return true; +} + +function ifRotate(piece, board) { + for (let i = 0; i < piece.length - 1; i++) { + if (piece[i][0] < 0 || piece[i][0] >= 10 || piece[i][1] >= 20 || ifPiece(piece[i][0], piece[i][1], board)) { + return false; + } + } + return true; +} + +function moveDown(piece, board) { + if (canMoveTo(0, 1, piece, board)) { + for (let i = 0; i < piece.length; i++) { + piece[i][1]++; + } + } +} + +function moveLeft(piece, board) { + if (canMoveTo(-1, 0, piece, board)) { + for (let i = 0; i < piece.length; i++) { + piece[i][0]--; + } + } +} + +function moveRight(piece, board) { + if (canMoveTo(1, 0, piece, board)) { + for (let i = 0; i < piece.length; i++) { + piece[i][0]++; + } + } +} + +function rotate(piece, board) { + if (piece.length == 0) { + return; + } + + let currentPieceCopy = []; + + for (let i = 0; i < piece.length; i++) { + currentPieceCopy.push([piece[i][0], piece[i][1]]); + } + + const center = currentPieceCopy[currentPieceCopy.length - 1]; + for (let i = 0; i < piece.length - 1; i++) { + const x = currentPieceCopy[i][0] - center[0]; + const y = currentPieceCopy[i][1] - center[1]; + + currentPieceCopy[i][0] = center[0] - y; + currentPieceCopy[i][1] = center[1] + x; + } + + + if (ifRotate(currentPieceCopy, board)) { + piece = currentPieceCopy; + // Don't modify history in verification function + } + else { + for (let x = -1; x <= 1; x++) { + for (let y = 0; y >= -1; y--) { + if (canMoveTo(x, y, currentPieceCopy, board)) { + moveToPiece(x, y, currentPieceCopy); + piece = currentPieceCopy; + + x = 2; + y = -2; + } + } + } + } +} + +function moveToPiece(x, y, piece) { + for (let i = 0; i < piece.length; i++) { + piece[i][0] += x; + piece[i][1] += y; + } +} + +function checkLine(board, scoreObject) { + let lineFilled = 0; + let score = 0; + let lines = 0; + let level = 0; + + for (let i = 0; i < 20; i++) { + let check = true; + + for (let j = 0; j < 10; j++) { + if (board[j][i][0] == 0 && board[j][i][1] == 0 && board[j][i][2] == 0) { + check = false; + break; + } + } + + if (check) { + for (let j = i; j > 0; j--) { + for (let k = 0; k < 10; k++) { + board[k][j] = board[k][j - 1]; + } + } + + for (let k = 0; k < 10; k++) { + board[k][0] = [0, 0, 0, 255]; + } + + lineFilled++; + } + } + + if (lineFilled == 1) { + score += 40; + } + else if (lineFilled == 2) { + score += 100; + } + else if (lineFilled == 3) { + score += 300; + } + else if (lineFilled == 4) { + score += 1200; + } + + lines += lineFilled; + level = Math.floor(lines / 10); + + scoreObject.score += score; + scoreObject.lines += lineFilled; + scoreObject.level = Math.floor(scoreObject.lines / 10); +} + +function verifieHystoryAndScore(score, history) { + let board = []; + + for (let i = 0; i < 10; i++) { + board[i] = []; + for (let j = 0; j < 20; j++) { + board[i][j] = [0, 0, 0, 255]; + } + } + + let piece = []; + let nextPiece = []; + let nextIndex = 0; + + let scoreObject = { + score: 0, + lines: 0, + level: 0 + }; + + for (let i = 0; i < history.length; i++) { + if (history[i][0] === CHANGENEXTPIECE) { + // Only place non-fractional coordinates on the board + for (let j = 0; j < piece.length - 1; j++) { + if (Number.isInteger(piece[j][0]) && Number.isInteger(piece[j][1]) && + piece[j][0] >= 0 && piece[j][0] < 10 && + piece[j][1] >= 0 && piece[j][1] < 20) { + board[piece[j][0]][piece[j][1]] = [templateColor[nextIndex][0], templateColor[nextIndex][1], templateColor[nextIndex][2], templateColor[nextIndex][3]]; + } + } + + checkLine(board, scoreObject); + + nextIndex = history[i][1]; + + // Reset piece and copy from template + piece = []; + for (let j = 0; j < templatePiece[nextIndex].length; j++) { + piece.push([templatePiece[nextIndex][j][0], templatePiece[nextIndex][j][1]]); + } + + // Set up next piece + nextPiece = []; + let nextNextIndex = (i+1 < history.length && history[i+1][0] === CHANGENEXTPIECE) ? history[i+1][1] : 0; + for (let j = 0; j < templatePiece[nextNextIndex].length; j++) { + nextPiece.push([templatePiece[nextNextIndex][j][0], templatePiece[nextNextIndex][j][1]]); + } + } + else if (history[i][0] === MOVEDOWN) { + moveDown(piece, board); + } + else if (history[i][0] === MOVELEFT) { + moveLeft(piece, board); + } + else if (history[i][0] === MOVERIGHT) { + moveRight(piece, board); + } + else if (history[i][0] === ROTATE) { + rotate(piece, board); + } + } + + console.log("Calculated score:", scoreObject.score, "Submitted score:", score); + return score === scoreObject.score; +} + +app.put('/api/sendScore', (req, res) => { + + let score = req.body.score; + let history = req.body.history; + let playerName = req.body.playerName; + + // if (score === null || history === null || playerName === null) { + // return res.status(400).send('Missing required fields'); + // } + + // if (score < 0) { + // return res.status(400).send('Score cannot be negative'); + // } + + // if (history.length === 0) { + // return res.status(400).send('History cannot be empty'); + // } + + if (!verifieHystoryAndScore(score, history)) { + return res.status(400).send('Invalid history or score'); + } + + // Vérifier si le dossier des historiques existe, le créer si nécessaire + const historyDir = './datas/histories'; + if (!fs.existsSync(historyDir)) { + fs.mkdirSync(historyDir, { recursive: true }); + } + + // Date du jour + + const date = new Date(); + const dateString = date.toISOString().split('T')[0]; // Format YYYY-MM-DD + + // Vérifier si un fichier avec ce nom existe déjà et ajouter un chiffre si nécessaire + let finalPlayerName = playerName + dateString; + let counter = 0; + let historyFilePath = `${historyDir}/${finalPlayerName}.json`; + + while (fs.existsSync(historyFilePath)) { + counter++; + finalPlayerName = `${playerName}${dateString}${counter}`; + historyFilePath = `${historyDir}/${finalPlayerName}.json`; + } + + // Écrire l'historique dans le fichier + try { + fs.writeFileSync(historyFilePath, JSON.stringify(history)); + console.log(`History written to ${historyFilePath}`); + } catch (err) { + console.error('Error writing history file:', err); + return res.status(500).send('Error writing history file'); + } + + // + db.run('INSERT INTO scores (player_name, score, pathHistory) VALUES (?, ?, ?)', [playerName, score, historyFilePath]) + .then(() => { + console.log(`Score inserted for ${playerName}`); + }) + .then(() => { + console.log('History path inserted in database'); + res.status(200).json({ + success: true, + playerName: playerName, + message: 'Score and history saved' + }); + }) + .catch(err => { + console.error('Database error:', err); + res.status(500).send('Error inserting data'); + }); +}); + +app.get('/api/getHighScores', async (req, res) => { + try { + const scores = await db.all('SELECT player_name, score FROM scores ORDER BY score DESC LIMIT 10'); + res.json(scores); + } catch (err) { + console.error('Database error:', err); + res.status(500).send('Error retrieving high scores'); + } +} +); + app.listen(port, () => { console.log(`Server listening at http://localhost:${port}`); }); diff --git a/package-lock.json b/package-lock.json index 40c343f..1c6ad0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,64 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "express": "^4.21.2" + "express": "^4.21.2", + "sqlite": "^5.1.1", + "sqlite3": "^5.1.7" }, "devDependencies": { "nodemon": "^3.1.9" } }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", + "optional": true + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -28,6 +80,81 @@ "node": ">= 0.6" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -42,6 +169,28 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -52,7 +201,27 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, + "devOptional": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "license": "MIT" }, "node_modules/binary-extensions": { @@ -68,6 +237,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", @@ -96,7 +285,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -116,6 +305,30 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -125,6 +338,36 @@ "node": ">= 0.8" } }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -179,13 +422,49 @@ "fsevents": "~2.3.2" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, + "devOptional": true, "license": "MIT" }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -231,6 +510,37 @@ "ms": "2.0.0" } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -250,6 +560,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -270,6 +589,13 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "optional": true + }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", @@ -279,6 +605,55 @@ "node": ">= 0.8" } }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", + "optional": true + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -324,6 +699,15 @@ "node": ">= 0.6" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/express": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", @@ -370,6 +754,12 @@ "url": "https://opencollective.com/express" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -419,6 +809,31 @@ "node": ">= 0.6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC", + "optional": true + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -443,6 +858,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -480,6 +916,34 @@ "node": ">= 0.4" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -505,6 +969,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC", + "optional": true + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -527,6 +998,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -539,6 +1017,13 @@ "node": ">= 0.4" } }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "license": "BSD-2-Clause", + "optional": true + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -555,6 +1040,95 @@ "node": ">= 0.8" } }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -567,6 +1141,26 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -574,12 +1168,71 @@ "dev": true, "license": "ISC" }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "optional": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -612,6 +1265,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -625,6 +1288,13 @@ "node": ">=0.10.0" } }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", + "optional": true + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -635,6 +1305,61 @@ "node": ">=0.12.0" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC", + "optional": true + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT", + "optional": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -704,11 +1429,23 @@ "node": ">= 0.6" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -717,12 +1454,140 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -732,6 +1597,49 @@ "node": ">= 0.6" } }, + "node_modules/node-abi": { + "version": "3.74.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", + "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, "node_modules/nodemon": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", @@ -786,6 +1694,22 @@ "dev": true, "license": "MIT" }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -796,6 +1720,23 @@ "node": ">=0.10.0" } }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -820,6 +1761,31 @@ "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -829,6 +1795,16 @@ "node": ">= 0.8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-to-regexp": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", @@ -848,6 +1824,53 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -868,6 +1891,16 @@ "dev": true, "license": "MIT" }, + "node_modules/pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -907,6 +1940,35 @@ "node": ">= 0.8" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -920,6 +1982,33 @@ "node": ">=8.10.0" } }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -950,7 +2039,6 @@ "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1013,6 +2101,13 @@ "node": ">= 0.8.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", + "optional": true + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -1091,6 +2186,58 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-update-notifier": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", @@ -1104,6 +2251,122 @@ "node": ">=10" } }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause", + "optional": true + }, + "node_modules/sqlite": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-5.1.1.tgz", + "integrity": "sha512-oBkezXa2hnkfuJwUo44Hl9hS3er+YFtueifoajrgidvqsJRQFpc5fKoAkAor1O5ZnLoa28GBScfHXs8j0K358Q==", + "license": "MIT" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -1113,6 +2376,52 @@ "node": ">= 0.8" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1126,6 +2435,66 @@ "node": ">=4" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1158,6 +2527,18 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1178,6 +2559,26 @@ "dev": true, "license": "MIT" }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -1187,6 +2588,12 @@ "node": ">= 0.8" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -1204,6 +2611,44 @@ "engines": { "node": ">= 0.8" } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" } } } diff --git a/package.json b/package.json index b6fa2ba..01f18cd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "author": "", "license": "ISC", "dependencies": { - "express": "^4.21.2" + "express": "^4.21.2", + "sqlite": "^5.1.1", + "sqlite3": "^5.1.7" }, "devDependencies": { "nodemon": "^3.1.9" diff --git a/public/index.html b/public/index.html index a02c5fd..ff17cd2 100644 --- a/public/index.html +++ b/public/index.html @@ -10,6 +10,22 @@ + + + +
+

High Scores

+
+
+
+
+
+

@@ -54,6 +70,9 @@

+
+ +
\ No newline at end of file diff --git a/public/script/index.js b/public/script/index.js index bdc30b5..3135ef0 100644 --- a/public/script/index.js +++ b/public/script/index.js @@ -19,6 +19,10 @@ const previewContainer = document.getElementById('preview-container'); const buttonContainer = document.getElementById('pause-container'); +const highScoreTemplate = document.getElementById('high-score-template'); + +const highScoresList = document.getElementById('high-scores-list'); + restartButton.addEventListener('click', () => { displayGameBoard(); @@ -174,6 +178,7 @@ const MOVEDOWN = 3; const ROTATE = 4; const MOVEDOWNFAST = 5; const RESPAWN = 6; +const CHANGENEXTPIECE = 7; let history = []; @@ -185,6 +190,7 @@ function startGame() { currentPiece = []; color = []; history = []; + keyPress = []; for (let i = 0; i < 10; i++) { boardData[i] = []; @@ -246,7 +252,7 @@ function loadTetris() { checkLine(); spawnPiece(); - checkEndDrop(); + //checkEndDrop(); } function currentPieceToBoard() { @@ -259,42 +265,100 @@ function currentPieceToBoard() { } function spawnPiece() { - const random = Math.floor(Math.random() * templatePiece.length); + let random = 0; if (nextPiece.length == 0) { + random = Math.floor(Math.random() * templatePiece.length); + for (let i = 0; i < templatePiece[random].length; i++) { nextPiece.push([templatePiece[random][i][0], templatePiece[random][i][1]]); } nextColor = templateColor[random]; + + history.push([CHANGENEXTPIECE, random]); } currentPiece = nextPiece; + + if (gameOver) { + return; + } + for (let i = 0; i < currentPiece.length - 1; i++) { if (boardData[currentPiece[i][0]][currentPiece[i][1]][0] != 0 && boardData[currentPiece[i][0]][currentPiece[i][1]][1] != 0 && boardData[currentPiece[i][0]][currentPiece[i][1]][2] != 0) { - - gameOver = true; - clearDownInterval(); - clearInterval(endDownInterval); - oppacity = 255; - displayGameOver(); - return; + + gameOver = true; + clearDownInterval(); + clearInterval(endDownInterval); + oppacity = 255; + displayGameOver(); + sendScore(); + return; } } - + + random = Math.floor(Math.random() * templatePiece.length); nextPiece = []; for (let i = 0; i < templatePiece[random].length; i++) { nextPiece.push([templatePiece[random][i][0], templatePiece[random][i][1]]); } + history.push([CHANGENEXTPIECE, random]); + color = nextColor; nextColor = templateColor[random]; - - history.push([RESPAWN, random]); } +async function sendScore() { + const playerName = prompt('Enter your name:'); + if (playerName) { + + const data = { + score, + history, + playerName + }; + console.log(data); + + try { + // Send a PUT request to the server + const query = await fetch('/api/sendScore', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + }); + + // Check if the response is ok before parsing + if (!query.ok) { + throw new Error(`Server returned ${query.status}: ${query.statusText}`); + } + + // Check the content type to ensure it's JSON + const contentType = query.headers.get('content-type'); + if (!contentType || !contentType.includes('application/json')) { + throw new Error('Server did not return JSON'); + } + + // Get the response body + const response = await query.json(); + + if (response.success) { + console.log('Score and history saved successfully'); + } + else { + console.error('Error saving score and history:', response.error); + } + } catch (error) { + console.error('Failed to save score:', error.message); + alert('Could not save your score. Please try again later.'); + } + } +} function ifMoveTo(x, y) { return canMoveTo(x, y, currentPiece); @@ -518,7 +582,7 @@ function moveRight() { return true; } -function fasteDrop() { +function fastDrop() { while (ifMoveTo(0, 1)) { moveDown(); } @@ -528,7 +592,6 @@ function fasteDrop() { oppacity = 255; loadTetris(); - history.push([MOVEDOWNFAST, 0]); } document.addEventListener('keydown', (event) => { @@ -568,7 +631,7 @@ document.addEventListener('keydown', (event) => { refresh(); }, 100); } else if (event.key == ' ' && !keyPress.includes(' ')) { - fasteDrop(); + fastDrop(); } refresh(); @@ -579,18 +642,14 @@ document.addEventListener('keydown', (event) => { }); document.addEventListener('keyup', (event) => { - if (pause) { - return; - } - if (gameOver) { - return; - } - if (event.key == 'ArrowDown' || event.key == 's') { - initAndChangeSpeedDrop(); - } else if (event.key == 'ArrowLeft' || event.key == 'a' || event.key == 'q') { - clearInterval(leftInterval); - } else if (event.key == 'ArrowRight' || event.key == 'd') { - clearInterval(rightInterval); + if (!pause && !gameOver) { + if (event.key == 'ArrowDown' || event.key == 's') { + initAndChangeSpeedDrop(); + } else if (event.key == 'ArrowLeft' || event.key == 'a' || event.key == 'q') { + clearInterval(leftInterval); + } else if (event.key == 'ArrowRight' || event.key == 'd') { + clearInterval(rightInterval); + } } keyPress = keyPress.filter((key) => { diff --git a/public/script/view.js b/public/script/view.js index 3e23f54..964f6e7 100644 --- a/public/script/view.js +++ b/public/script/view.js @@ -187,4 +187,32 @@ function displayGameOver() { buttonContainer.classList.add('hidden'); gameOverMenu.classList.remove('hidden'); +} + +let intervalDisplayScoreBoard = null; + +displayScoreBoard(); + +function displayScoreBoard() { + if (intervalDisplayScoreBoard) { + clearInterval(intervalDisplayScoreBoard); + intervalDisplayScoreBoard = null; + } + + intervalDisplayScoreBoard = setInterval(() => { + fetch('/api/getHighScores') + .then(response => response.json()) + .then(data => { + highScoresList.innerHTML = ''; + + data.forEach(score => { + // Clone template content properly + const scoreElement = document.importNode(highScoreTemplate.content, true).firstElementChild; + scoreElement.querySelector('.high-score-name').innerHTML = score.player_name; + scoreElement.querySelector('.high-score-score').innerHTML = score.score; + highScoresList.appendChild(scoreElement); + }); + }) + .catch(error => console.error('Error fetching high scores:', error)); + }, 1000); } \ No newline at end of file diff --git a/public/style/index.css b/public/style/index.css index 8fedf26..1ec2ed2 100644 --- a/public/style/index.css +++ b/public/style/index.css @@ -16,6 +16,8 @@ body { justify-content: center; flex-direction: row; + justify-content: space-evenly; + gap: 1rem; } @@ -128,9 +130,6 @@ body { left: 0; right: 0; bottom: 0; - - - } .pauseContainer { @@ -174,4 +173,19 @@ body { .hidden { display: none; +} + +.scoreboard { + width: 200px; + height: 600px; + + display: flex; + flex-direction: column; + gap: 1rem; + align-items: center; +} + +.options { + width: 200px; + height: 600px; } \ No newline at end of file