diff --git a/package-lock.json b/package-lock.json index 8d5af3a..2bafe10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,18 +10,18 @@ "license": "MIT", "dependencies": { "@astrojs/check": "^0.2.0", - "@astrojs/node": "^6.0.0", + "@astrojs/node": "^6.0.2", "@astrojs/sitemap": "^3.0.0", "@astrojs/tailwind": "^5.0.0", "@astrojs/ts-plugin": "^1.1.3", "@astrojs/vercel": "^5.0.1", "@astrojs/vue": "^3.0.0", - "@tauri-apps/api": "^1.4.0", - "@vercel/blob": "^0.12.5", - "astro": "^3.1.1", + "@tauri-apps/api": "^1.5.0", + "@vercel/blob": "^0.13.0", + "astro": "^3.2.2", "flowbite": "^1.8.1", "flowbite-typography": "^1.0.3", - "jose": "^4.14.6", + "jose": "^4.15.1", "tailwind-scrollbar": "^3.0.5", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", @@ -29,7 +29,7 @@ "vue": "^3.3.4" }, "devDependencies": { - "@tauri-apps/cli": "^1.4.0", + "@tauri-apps/cli": "^1.5.1", "dotenv": "^16.3.1", "prettier": "^3.0.3", "prettier-plugin-astro": "^0.12.0", @@ -152,15 +152,15 @@ } }, "node_modules/@astrojs/node": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@astrojs/node/-/node-6.0.1.tgz", - "integrity": "sha512-EtGzV4ZoY6eMTsTNxT8EeYHjZL0ypJyZE2vU/oswkPeR/AK23K4jgdjxxa9xipptlQEBH0ZuRHVAste/dwfyUA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@astrojs/node/-/node-6.0.2.tgz", + "integrity": "sha512-iOUpBP9Wi8noJv4ka/MAHwUB/fUaYuDD4m6mOn7YCr0Rd7pbyyKtpg4yJAQUAKQues3HUOWZIVP58SaeTPbLMQ==", "dependencies": { "send": "^0.18.0", "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "^3.1.2" + "astro": "^3.2.1" } }, "node_modules/@astrojs/prism": { @@ -1321,9 +1321,9 @@ } }, "node_modules/@tauri-apps/api": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-1.4.0.tgz", - "integrity": "sha512-Jd6HPoTM1PZSFIzq7FB8VmMu3qSSyo/3lSwLpoapW+lQ41CL5Dow2KryLg+gyazA/58DRWI9vu/XpEeHK4uMdw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-1.5.0.tgz", + "integrity": "sha512-yQY9wpVNuiYhLLuyDlu1nBpqJELT1fGp7OctN4rW9I2W1T2p7A3tqPxsEzQprEwneQRBAlPM9vC8NsnMbct+pg==", "engines": { "node": ">= 14.6.0", "npm": ">= 6.6.0", @@ -1335,9 +1335,9 @@ } }, "node_modules/@tauri-apps/cli": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-1.4.0.tgz", - "integrity": "sha512-VXYr2i2iVFl98etQSQsqLzXgX96bnWiNZd1YADgatqwy/qecbd6Kl5ZAPB5R4ynsgE8A1gU7Fbzh7dCEQYFfmA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-1.5.1.tgz", + "integrity": "sha512-Ssj30axil5vPBV3W5ScHXk4umTKu6BhfmMdljfKDOG9K55gAqzBAE2VBC5e/ouclSxZfN+6YNL9VhDXFu/UyeA==", "dev": true, "bin": { "tauri": "tauri.js" @@ -1350,22 +1350,22 @@ "url": "https://opencollective.com/tauri" }, "optionalDependencies": { - "@tauri-apps/cli-darwin-arm64": "1.4.0", - "@tauri-apps/cli-darwin-x64": "1.4.0", - "@tauri-apps/cli-linux-arm-gnueabihf": "1.4.0", - "@tauri-apps/cli-linux-arm64-gnu": "1.4.0", - "@tauri-apps/cli-linux-arm64-musl": "1.4.0", - "@tauri-apps/cli-linux-x64-gnu": "1.4.0", - "@tauri-apps/cli-linux-x64-musl": "1.4.0", - "@tauri-apps/cli-win32-arm64-msvc": "1.4.0", - "@tauri-apps/cli-win32-ia32-msvc": "1.4.0", - "@tauri-apps/cli-win32-x64-msvc": "1.4.0" + "@tauri-apps/cli-darwin-arm64": "1.5.1", + "@tauri-apps/cli-darwin-x64": "1.5.1", + "@tauri-apps/cli-linux-arm-gnueabihf": "1.5.1", + "@tauri-apps/cli-linux-arm64-gnu": "1.5.1", + "@tauri-apps/cli-linux-arm64-musl": "1.5.1", + "@tauri-apps/cli-linux-x64-gnu": "1.5.1", + "@tauri-apps/cli-linux-x64-musl": "1.5.1", + "@tauri-apps/cli-win32-arm64-msvc": "1.5.1", + "@tauri-apps/cli-win32-ia32-msvc": "1.5.1", + "@tauri-apps/cli-win32-x64-msvc": "1.5.1" } }, "node_modules/@tauri-apps/cli-darwin-arm64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.4.0.tgz", - "integrity": "sha512-nA/ml0SfUt6/CYLVbHmT500Y+ijqsuv5+s9EBnVXYSLVg9kbPUZJJHluEYK+xKuOj6xzyuT/+rZFMRapmJD3jQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.5.1.tgz", + "integrity": "sha512-o2FSGj72gqJjlVtuScXQZUgiRs90PS9gG7YAz0Hgr4nV1MfIn9U6JVj6R+mnAEZBCK8qdy5jdemhmNKDDoiYQg==", "cpu": [ "arm64" ], @@ -1379,9 +1379,9 @@ } }, "node_modules/@tauri-apps/cli-darwin-x64": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.4.0.tgz", - "integrity": "sha512-ov/F6Zr+dg9B0PtRu65stFo2G0ow2TUlneqYYrkj+vA3n+moWDHfVty0raDjMLQbQt3rv3uayFMXGPMgble9OA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.5.1.tgz", + "integrity": "sha512-G1/v6AJPP5oIcjsOxZshag28wdmDx1Fis2yz545aUk7oKU86A3ZJpz0b8BaXkr93w04xGcmGAaspZeXMmTvrbw==", "cpu": [ "x64" ], @@ -1395,9 +1395,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.4.0.tgz", - "integrity": "sha512-zwjbiMncycXDV7doovymyKD7sCg53ouAmfgpUqEBOTY3vgBi9TwijyPhJOqoG5vUVWhouNBC08akGmE4dja15g==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.5.1.tgz", + "integrity": "sha512-hPDOUMviffyX5BySk6RuD7IZZeMuNUJzKWHxVWa0NHJPfxQOIPWwYWbk6TascrVk9GZYAImcB0yKfrll8I0VTg==", "cpu": [ "arm" ], @@ -1411,9 +1411,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm64-gnu": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.4.0.tgz", - "integrity": "sha512-5MCBcziqXC72mMXnkZU68mutXIR6zavDxopArE2gQtK841IlE06bIgtLi0kUUhlFJk2nhPRgiDgdLbrPlyt7fw==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.5.1.tgz", + "integrity": "sha512-EJjTXqZchFLVrFgfxwstrQj7NwVDirffLhw5hRWS3L3Iys3IvqzIMVIA+GrY7KsaPwq7qaSqE1CDtP1wejE/9g==", "cpu": [ "arm64" ], @@ -1427,9 +1427,9 @@ } }, "node_modules/@tauri-apps/cli-linux-arm64-musl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.4.0.tgz", - "integrity": "sha512-7J3pRB6n6uNYgIfCeKt2Oz8J7oSaz2s8GGFRRH2HPxuTHrBNCinzVYm68UhVpJrL3bnGkU0ziVZLsW/iaOGfUg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.1.tgz", + "integrity": "sha512-XgJIk0AcxRL4pWVjfj0wiC9WnIZoUIVLPcQs86dNxoqzwAvADdNYp+McXf3/MDxX8uGEzpgdvlqr4T+50c8f6w==", "cpu": [ "arm64" ], @@ -1443,9 +1443,9 @@ } }, "node_modules/@tauri-apps/cli-linux-x64-gnu": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.4.0.tgz", - "integrity": "sha512-Zh5gfAJxOv5AVWxcwuueaQ2vIAhlg0d6nZui6nMyfIJ8dbf3aZQ5ZzP38sYow5h/fbvgL+3GSQxZRBIa3c2E1w==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-VoVrIn7b+F2n0LJoDkLGXQJsPV/U1h3QnjRNE+Tcju6xVPBx64H0vfb7lC3S4QfVpiQ4Uc+1UD3Slvn4jGpL/A==", "cpu": [ "x64" ], @@ -1459,9 +1459,9 @@ } }, "node_modules/@tauri-apps/cli-linux-x64-musl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.4.0.tgz", - "integrity": "sha512-OLAYoICU3FaYiTdBsI+lQTKnDHeMmFMXIApN0M+xGiOkoIOQcV9CConMPjgmJQ867+NHRNgUGlvBEAh9CiJodQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.1.tgz", + "integrity": "sha512-tQi2K0LYW80BLud7ZFOy3WxCM2VjDRxuhxOYhtcLG39cIeGqsSz07LwiCFNBn4vy2J47TnZ+8XDRAOtxSFe25w==", "cpu": [ "x64" ], @@ -1475,9 +1475,9 @@ } }, "node_modules/@tauri-apps/cli-win32-arm64-msvc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-1.4.0.tgz", - "integrity": "sha512-gZ05GENFbI6CB5MlOUsLlU0kZ9UtHn9riYtSXKT6MYs8HSPRffPHaHSL0WxsJweWh9nR5Hgh/TUU8uW3sYCzCg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-1.5.1.tgz", + "integrity": "sha512-BdVwzVXY2JWBtWEO/G0//jIWXeWR52+KG0+kyoHO6QTxkncLrN5q2RldvXOe7CvhKe/qmgbkNosj5jWi7t49kQ==", "cpu": [ "arm64" ], @@ -1491,9 +1491,9 @@ } }, "node_modules/@tauri-apps/cli-win32-ia32-msvc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.4.0.tgz", - "integrity": "sha512-JsetT/lTx/Zq98eo8T5CiRyF1nKeX04RO8JlJrI3ZOYsZpp/A5RJvMd/szQ17iOzwiHdge+tx7k2jHysR6oBlQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.5.1.tgz", + "integrity": "sha512-Q0ei4ZUHlGu/b4DP4Cm6WnI5zxpLxnf/vSwR2BYO3XO65TdLee1gTyuwYuSZJYu5jxqSoSusmLyL4F43jHhf9Q==", "cpu": [ "ia32" ], @@ -1507,9 +1507,9 @@ } }, "node_modules/@tauri-apps/cli-win32-x64-msvc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.4.0.tgz", - "integrity": "sha512-z8Olcnwp5aYhzqUAarFjqF+oELCjuYWnB2HAJHlfsYNfDCAORY5kct3Fklz8PSsubC3U2EugWn8n42DwnThurg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.5.1.tgz", + "integrity": "sha512-chpsJ5PIwMOdn1IIJ6bj2G7jv9jQryVvhujU0k3kt/5kE7OuLRDYbI5BAIzMOaLoOTgoo8oxcFXQ+enELSxlMQ==", "cpu": [ "x64" ], @@ -1624,17 +1624,6 @@ "parse5": "^7.0.0" } }, - "node_modules/@types/jsdom/node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/@types/json5": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.30.tgz", @@ -1667,9 +1656,9 @@ "integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==" }, "node_modules/@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + "version": "20.8.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.2.tgz", + "integrity": "sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w==" }, "node_modules/@types/parse5": { "version": "6.0.3", @@ -1723,28 +1712,17 @@ "integrity": "sha512-BZFxVrv24VbNNl5xMxqUojQIegEeXMI6rX3rg1uVLYUEXsuKNBSAEQf4BWEcjQDp/8aYJOj6m8V4PUA3x/cxgg==" }, "node_modules/@vercel/blob": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@vercel/blob/-/blob-0.12.5.tgz", - "integrity": "sha512-XCsg9W2WrDlQGnw9X38RbM2mtfhTvp4x9lThx4Cr496c0f4IIoMbuwiFd9uvu228D+RcyeopTN7KJAUERCSogw==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@vercel/blob/-/blob-0.13.0.tgz", + "integrity": "sha512-yFdhikaXaiyS9aJzu2XdgHHkion/mK0vcRzgVxDncojx9Qla5J5IIHnp7bS6BeGuz7ru2VGkwVOHFfjEFW9rAw==", "dependencies": { "jest-environment-jsdom": "29.7.0", - "undici": "5.24.0" + "undici": "5.25.1" }, "engines": { "node": ">=16.14" } }, - "node_modules/@vercel/blob/node_modules/undici": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz", - "integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==", - "dependencies": { - "busboy": "^1.6.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/@vercel/nft": { "version": "0.23.1", "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.23.1.tgz", @@ -1770,9 +1748,9 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.3.4.tgz", - "integrity": "sha512-ciXNIHKPriERBisHFBvnTbfKa6r9SAesOYXeGDzgegcvy9Q4xdScSHAmKbNT0M3O0S9LKhIf5/G+UYG4NnnzYw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.4.0.tgz", + "integrity": "sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==", "engines": { "node": "^14.18.0 || >=16.0.0" }, @@ -2193,9 +2171,9 @@ } }, "node_modules/astro": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/astro/-/astro-3.1.4.tgz", - "integrity": "sha512-MKGJXHkkYK4QpqYHydPu+eeLBGU3cHx9Xdrtk6RFvu3dVkxuJsYm6L+lgIeH0hrTF9qlaDih/KbNnTKrCXdidw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/astro/-/astro-3.2.2.tgz", + "integrity": "sha512-vLOOGyD2g1HRkCQAFHmHUrVAbMI5sgUqKignBMtXNantgEq1P17sL2cvH0Yy2ibNN9DHZ/4TknXmwHAig8PJNg==", "dependencies": { "@astrojs/compiler": "^2.1.0", "@astrojs/internal-helpers": "0.2.0", @@ -2504,9 +2482,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.0.tgz", - "integrity": "sha512-v+Jcv64L2LbfTC6OnRcaxtqJNJuQAVhZKSJfR/6hn7lhnChUXl4amwVviqN1k411BB+3rRoKMitELRn1CojeRA==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "funding": [ { "type": "opencollective", @@ -2522,8 +2500,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001539", - "electron-to-chromium": "^1.4.530", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.13" }, @@ -2588,9 +2566,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001543", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", + "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==", "funding": [ { "type": "opencollective", @@ -3024,37 +3002,6 @@ "node": ">=12" } }, - "node_modules/data-urls/node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/data-urls/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, - "node_modules/data-urls/node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3192,14 +3139,6 @@ "node": ">=12" } }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, "node_modules/dotenv": { "version": "16.3.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", @@ -3231,9 +3170,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.532", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.532.tgz", - "integrity": "sha512-piIR0QFdIGKmOJTSNg5AwxZRNWQSXlRYycqDB9Srstx4lip8KpcmRxVP6zuFWExWziHYZpJ0acX7TxqX95KBpg==" + "version": "1.4.539", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.539.tgz", + "integrity": "sha512-wRmWJ8F7rgmINuI32S6r2SLrw/h/bJQsDSvBiq9GBfvc2Lh73qTOwn73r3Cf67mjVgFGJYcYtmERzySa5jIWlg==" }, "node_modules/emmet": { "version": "2.4.6", @@ -3884,6 +3823,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-raw/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, "node_modules/hast-util-to-html": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz", @@ -4504,9 +4448,9 @@ } }, "node_modules/jose": { - "version": "4.14.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.6.tgz", - "integrity": "sha512-EqJPEUlZD0/CSUMubKtMaYUOtWe91tZXTWMJZoKSbLk+KtdhNdcvppH8lA9XwVu2V4Ailvsj0GBZJ2ZwDjfesQ==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.1.tgz", + "integrity": "sha512-CinpaEMmwb/59YG0N6SC3DY1imdTU5iNl08HPWR7NdyxACPeFuQbqjaocEjCDGq04KbnxSqQu702vL3ZTvKe5w==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -4571,48 +4515,6 @@ } } }, - "node_modules/jsdom/node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/jsdom/node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/jsdom/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, - "node_modules/jsdom/node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -4792,9 +4694,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -6086,6 +5988,25 @@ } } }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-gyp-build": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", @@ -6330,9 +6251,15 @@ } }, "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } }, "node_modules/path-exists": { "version": "4.0.0", @@ -6460,9 +6387,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -7019,6 +6946,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/rehype-parse/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, "node_modules/rehype-raw": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz", @@ -7678,6 +7610,11 @@ "npm": ">=5.6.0" } }, + "node_modules/sitemap/node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -8127,9 +8064,15 @@ } }, "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } }, "node_modules/trim-lines": { "version": "3.0.1", @@ -8268,9 +8211,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/undici": { - "version": "5.25.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.2.tgz", - "integrity": "sha512-tch8RbCfn1UUH1PeVCXva4V8gDpGAud/w0WubD6sHC46vYQ3KDxL+xv1A2UxK0N6jrVedutuPHxe1XIoqerwMw==", + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.1.tgz", + "integrity": "sha512-nTw6b2G2OqP6btYPyghCgV4hSwjJlL/78FMJatVLCa3otj6PCOQSt6dVtYt82OtNqFz8XsnJ+vsXLADPXjPhqw==", "dependencies": { "busboy": "^1.6.0" }, @@ -9281,14 +9224,17 @@ } }, "node_modules/web-vitals": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.4.0.tgz", - "integrity": "sha512-n9fZ5/bG1oeDkyxLWyep0eahrNcPDF6bFqoyispt7xkW0xhDzpUBTgyDKqWDi1twT0MgH4HvvqzpUyh0ZxZV4A==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.0.tgz", + "integrity": "sha512-f5YnCHVG9Y6uLCePD4tY8bO/Ge15NPEQWtvm3tPzDKygloiqtb4SVqRHBcrIAqo2ztqX5XueqDn97zHF0LdT6w==" }, "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } }, "node_modules/whatwg-encoding": { "version": "2.0.0", @@ -9321,12 +9267,15 @@ } }, "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/which": { diff --git a/package.json b/package.json index 67fcd38..8db8f9e 100644 --- a/package.json +++ b/package.json @@ -29,18 +29,18 @@ }, "dependencies": { "@astrojs/check": "^0.2.0", - "@astrojs/node": "^6.0.0", + "@astrojs/node": "^6.0.2", "@astrojs/sitemap": "^3.0.0", "@astrojs/tailwind": "^5.0.0", "@astrojs/ts-plugin": "^1.1.3", "@astrojs/vercel": "^5.0.1", "@astrojs/vue": "^3.0.0", - "@tauri-apps/api": "^1.4.0", - "@vercel/blob": "^0.12.5", - "astro": "^3.1.1", + "@tauri-apps/api": "^1.5.0", + "@vercel/blob": "^0.13.0", + "astro": "^3.2.2", "flowbite": "^1.8.1", "flowbite-typography": "^1.0.3", - "jose": "^4.14.6", + "jose": "^4.15.1", "tailwind-scrollbar": "^3.0.5", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", @@ -48,7 +48,7 @@ "vue": "^3.3.4" }, "devDependencies": { - "@tauri-apps/cli": "^1.4.0", + "@tauri-apps/cli": "^1.5.1", "dotenv": "^16.3.1", "prettier": "^3.0.3", "prettier-plugin-astro": "^0.12.0", diff --git a/src/components/Dashboard.astro b/src/components/Dashboard.astro deleted file mode 100644 index 520b623..0000000 --- a/src/components/Dashboard.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import TestForm from '@components/TestForm.vue'; ---- - -
- -
diff --git a/src/components/files/ContextMenu.vue b/src/components/files/ContextMenu.vue new file mode 100644 index 0000000..1fb9656 --- /dev/null +++ b/src/components/files/ContextMenu.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/components/files/File.vue b/src/components/files/File.vue new file mode 100644 index 0000000..f7a1399 --- /dev/null +++ b/src/components/files/File.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/files/FileBrowser.vue b/src/components/files/FileBrowser.vue new file mode 100644 index 0000000..4ebccea --- /dev/null +++ b/src/components/files/FileBrowser.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/files/Folder.vue b/src/components/files/Folder.vue new file mode 100644 index 0000000..43912fc --- /dev/null +++ b/src/components/files/Folder.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/components/files/NoFiles.vue b/src/components/files/NoFiles.vue new file mode 100644 index 0000000..73c2215 --- /dev/null +++ b/src/components/files/NoFiles.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/lang/da.ts b/src/lang/da.ts index 8d5477a..db707ce 100644 --- a/src/lang/da.ts +++ b/src/lang/da.ts @@ -49,7 +49,7 @@ export default { openUserMenu: 'Ă…ben brugermenu', }, link: { - dashboard: 'Hjem', + myfiles: 'Mine Filer', settings: 'Indstillinger', signOut: 'Log ud', }, diff --git a/src/lang/en.ts b/src/lang/en.ts index 1558101..332ade0 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -49,7 +49,7 @@ export default { openUserMenu: 'Open user menu', }, link: { - dashboard: 'Dashboard', + myfiles: 'My Files', settings: 'Settings', signOut: 'Sign out', }, diff --git a/src/layouts/SideBar.astro b/src/layouts/SideBar.astro index a6849ef..263a7f2 100644 --- a/src/layouts/SideBar.astro +++ b/src/layouts/SideBar.astro @@ -38,7 +38,7 @@ import { t } from '@lib/i18n'; d="M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"> {t('layout.link.dashboard', Astro.locals.currentLocale)}{t('layout.link.myfiles', Astro.locals.currentLocale)} diff --git a/src/lib/items/factory.ts b/src/lib/items/factory.ts new file mode 100644 index 0000000..8322e6c --- /dev/null +++ b/src/lib/items/factory.ts @@ -0,0 +1,13 @@ +import { FileClass } from './files'; +import { FolderClass } from './folders'; +import { type ItemType } from './items'; + +export class ItemFactory { + static getItemFromObject(object: ItemType) { + if (FolderClass.isFolder(object)) return new FolderClass(object); + if (FileClass.isFile(object)) return new FileClass(object); + + console.error('ItemClass.getItemFromObject: Invalid object'); + return null; + } +} diff --git a/src/lib/items/files.ts b/src/lib/items/files.ts new file mode 100644 index 0000000..021f950 --- /dev/null +++ b/src/lib/items/files.ts @@ -0,0 +1,48 @@ +import { ItemClass, type ItemType } from './items'; +import { FolderClass } from './folders'; + +export class FileClass extends ItemClass { + private _blobUrl: string; + + constructor(fileObject: FileType) { + super(fileObject); + + this._blobUrl = fileObject.blobUrl; + } + + static create(name: string, parent: FolderClass | null) { + // TODO: Send request to create folder + + // Placeholder for now + const returnedFile = { + id: 1, + name: name, + mimeType: 'application/vnd.cloudstore.folder', + ownerId: 43535, + parentId: parent?.id || null, + deletedAt: null, + createdAt: new Date(), + updatedAt: new Date(), + blobUrl: 'https://www.google.com', + }; + + return new FileClass(returnedFile); + } + + get blobUrl() { + return this._blobUrl; + } + + static isFile(object: any): object is FileType { + if (!ItemClass.isItem(object)) return false; + + // BlobUrl + if (!('blobUrl' in object && typeof object.blobUrl === 'string')) return false; + + return true; + } +} + +export type FileType = { + blobUrl: string; +} & ItemType; diff --git a/src/lib/items/folders.ts b/src/lib/items/folders.ts new file mode 100644 index 0000000..951629b --- /dev/null +++ b/src/lib/items/folders.ts @@ -0,0 +1,82 @@ +import { ItemClass, type ItemType } from './items'; + +export class FolderClass extends ItemClass { + private _color: FolderColor; + + constructor(folderObject: FolderType) { + super(folderObject); + + this._color = folderObject.color; + } + + static create(name: string, parent: FolderClass | null) { + // TODO: Send request to create folder + + // Placeholder for now + const returnedFolder = { + id: 1, + name: name, + mimeType: 'application/vnd.cloudstore.folder', + ownerId: 43535, + parentId: parent?.id || null, + deletedAt: null, + createdAt: new Date(), + updatedAt: new Date(), + color: FolderClass.randomColor(), + }; + + return new FolderClass(returnedFolder); + } + + get color() { + return this._color; + } + + get colorClass(): FolderColorValue { + return FolderColors[this._color]; + } + + private static randomColor() { + return Object.keys(FolderColors)[ + Math.floor(Math.random() * Object.keys(FolderColors).length) + ] as FolderColor; + } + + static isFolder(object: any): object is FolderType { + if (!ItemClass.isItem(object)) return false; + + // Color + if (!('color' in object && typeof object.color === 'string')) return false; + + // MimeType + if (object.mimeType !== 'application/vnd.cloudstore.folder') return false; + + return true; + } +} + +export type FolderType = { + color: FolderColor; +} & ItemType; + +const FolderColors = { + red: 'from-red-500 to-orange-500', + orange: 'from-orange-500 to-amber-500', + amber: 'from-amber-500 to-yellow-500', + yellow: 'from-yellow-500 to-lime-500', + lime: 'from-lime-500 to-green-500', + green: 'from-green-500 to-emerald-500', + emerald: 'from-emerald-500 to-teal-500', + teal: 'from-teal-500 to-cyan-500', + cyan: 'from-cyan-500 to-sky-500', + sky: 'from-sky-500 to-blue-500', + blue: 'from-blue-500 to-indigo-500', + indigo: 'from-indigo-500 to-violet-500', + violet: 'from-violet-500 to-purple-500', + purple: 'from-purple-500 to-fuchsia-500', + fuchsia: 'from-fuchsia-500 to-pink-500', + pink: 'from-pink-500 to-rose-500', + rose: 'from-rose-500 to-red-500', +}; +type FolderColor = keyof typeof FolderColors; +type FolderColorValue = (typeof FolderColors)[FolderColor]; diff --git a/src/lib/items/items.ts b/src/lib/items/items.ts new file mode 100644 index 0000000..29d1b7d --- /dev/null +++ b/src/lib/items/items.ts @@ -0,0 +1,134 @@ +export abstract class ItemClass { + private _id: number; + private _name: string; + private _mimeType: string; + private _ownerId: number; + private _parentId: number | null; + private _createdAt: Date; + private _updatedAt: Date; + private _deletedAt: Date | null; + + protected constructor(ItemObject: ItemType) { + this._id = ItemObject.id; + this._name = ItemObject.name; + this._mimeType = ItemObject.mimeType; + this._ownerId = ItemObject.ownerId; + this._parentId = ItemObject.parentId; + + const createdAt = ItemClass.convertDate(ItemObject.createdAt); + const updatedAt = ItemClass.convertDate(ItemObject.updatedAt); + const deletedAt = ItemClass.convertDate(ItemObject.deletedAt); + + if (createdAt === null) throw new Error('Invalid createdAt'); + if (updatedAt === null) throw new Error('Invalid updatedAt'); + + this._createdAt = createdAt; + this._updatedAt = updatedAt; + this._deletedAt = deletedAt; + } + + get id() { + return this._id; + } + + get name() { + return this._name; + } + + get mimeType() { + return this._mimeType; + } + + get ownerId() { + return this._ownerId; + } + + get parentId() { + return this._parentId; + } + + get createdAt() { + return this._createdAt; + } + + get updatedAt() { + return this._updatedAt; + } + + get deletedAt() { + return this._deletedAt; + } + + static isItem(object: any): object is ItemType { + // Id + if (!('id' in object && typeof object.id === 'number')) return false; + + // Name + if (!('name' in object && typeof object.name === 'string')) return false; + + // MimeType + if (!('mimeType' in object && typeof object.mimeType === 'string')) return false; + + // OwnerId + if (!('ownerId' in object && typeof object.ownerId === 'number')) return false; + + // ParentId + if ( + !(('parentId' in object && typeof object.parentId === 'number') || object.parentId === null) + ) + return false; + + // CreatedAt + if ( + !( + 'createdAt' in object && + (object.createdAt === undefined || + object.createdAt instanceof Date || + typeof object.createdAt === 'string') + ) + ) + return false; + + // UpdatedAt + if ( + !( + 'updatedAt' in object && + (object.updatedAt === undefined || + object.updatedAt instanceof Date || + typeof object.updatedAt === 'string') + ) + ) + return false; + + // DeletedAt + if ( + !( + 'deletedAt' in object && + (object.deletedAt === undefined || + object.deletedAt === null || + object.deletedAt instanceof Date || + typeof object.deletedAt === 'string') + ) + ) + return false; + + return true; + } + + private static convertDate(date: Date | string | undefined | null) { + if (typeof date === 'string') return new Date(date); + if (date instanceof Date) return date; + return null; + } +} + +export type ItemType = { + id: number; + name: string; + mimeType: string; + ownerId: number; + parentId: number | null; + createdAt?: Date | string; + updatedAt?: Date | string; + deletedAt?: Date | string | null; +}; diff --git a/src/pages/u/folder/[id].astro b/src/pages/u/folder/[id].astro new file mode 100644 index 0000000..c1c1c64 --- /dev/null +++ b/src/pages/u/folder/[id].astro @@ -0,0 +1,42 @@ +--- +import LayoutSidebar from '@layouts/LayoutSidebar.astro'; +import FileBrowser from '@components/files/FileBrowser.vue'; +// @ts-ignore https://github.com/withastro/language-tools/issues/476 +import { api, url } from '@lib/helpers'; +import { FolderClass } from '@lib/items/folders'; + +const { id } = Astro.params; + +// Send a request to the API to get the folder +const authenticationHeader = Astro.locals.authHeader as string; +const folderResponse = await ( + await fetch(api(`folder/${id}`), { + method: 'GET', + headers: { + Authorization: authenticationHeader, + }, + }) +).json(); + +// If the folder doesn't exist, redirect +if (!folderResponse || folderResponse?.statusCode <= 400) { + return Astro.redirect(url('404')); +} + +// If the folder isn't a valid folder, redirect +if (!FolderClass.isFolder(folderResponse)) { + return Astro.redirect(url('404')); +} + +// Otherwise, create a new folder instance +const folder = folderResponse; + +// We can safely cast this as we know that middleware would have already checked for a valid user +const user = Astro.locals.user as User; +--- + + +
+ +
+
diff --git a/src/pages/u/index.astro b/src/pages/u/index.astro index 53832f3..891cda0 100644 --- a/src/pages/u/index.astro +++ b/src/pages/u/index.astro @@ -1,11 +1,13 @@ --- import LayoutSidebar from '@layouts/LayoutSidebar.astro'; -import Dashboard from '@components/Dashboard.astro'; +import FileBrowser from '@components/files/FileBrowser.vue'; // We can safely cast this as we know that middleware would have already checked for a valid user const user = Astro.locals.user as User; --- - +
+ +
diff --git a/tailwind.config.cjs b/tailwind.config.cjs index ab3cd00..8af7981 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -5,7 +5,6 @@ module.exports = { './src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}', './node_modules/flowbite/**/*.js', ], - darkMode: 'class', theme: {