diff --git a/_demo/package.json b/_demo/package.json index 63d099de..d125d4f2 100644 --- a/_demo/package.json +++ b/_demo/package.json @@ -11,7 +11,7 @@ "@nuxt/ui": "^2.13.0", "drizzle-orm": "^0.29.3", "nuxt": "^3.10.0", - "nuxt-hub": "latest" + "@atinux/nuxthub": "latest" }, "devDependencies": { "@nuxt/devtools": "^1.0.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 785b52fe..854a2b69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,9 @@ importers: _demo: dependencies: + '@atinux/nuxthub': + specifier: latest + version: link:.. '@iconify-json/simple-icons': specifier: ^1.1.90 version: 1.1.90 @@ -64,9 +67,6 @@ importers: nuxt: specifier: ^3.10.0 version: 3.10.0(eslint@8.56.0)(typescript@5.3.3)(vite@5.0.12)(vue-tsc@1.8.27) - nuxt-hub: - specifier: latest - version: link:.. devDependencies: '@nuxt/devtools': specifier: ^1.0.8 @@ -544,8 +544,8 @@ packages: mime: 3.0.0 dev: false - /@cloudflare/kv-asset-handler@0.3.0: - resolution: {integrity: sha512-9CB/MKf/wdvbfkUdfrj+OkEwZ5b7rws0eogJ4293h+7b6KX5toPwym+VQKmILafNB9YiehqY0DlNrDcDhdWHSQ==} + /@cloudflare/kv-asset-handler@0.3.1: + resolution: {integrity: sha512-lKN2XCfKCmpKb86a1tl4GIwsJYDy9TGuwjhDELLmpKygQhw8X2xR4dusgpC5Tg7q1pB96Eb0rBo81kxSILQMwA==} dependencies: mime: 3.0.0 @@ -1447,7 +1447,7 @@ packages: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.4 + semver: 7.6.0 tar: 6.2.0 transitivePeerDependencies: - encoding @@ -1621,7 +1621,7 @@ packages: semver: 7.5.4 simple-git: 3.22.0 sirv: 2.0.4 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) vite: 5.0.12 vite-plugin-inspect: 0.8.1(@nuxt/kit@3.10.0)(vite@5.0.12) vite-plugin-vue-inspector: 4.0.2(vite@5.0.12) @@ -1669,7 +1669,7 @@ packages: semver: 7.5.4 ufo: 1.3.2 unctx: 2.3.1 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) untyped: 1.4.2 transitivePeerDependencies: - rollup @@ -1695,7 +1695,7 @@ packages: semver: 7.5.4 ufo: 1.3.2 unctx: 2.3.1 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) untyped: 1.4.0 transitivePeerDependencies: - rollup @@ -1715,7 +1715,7 @@ packages: scule: 1.2.0 std-env: 3.7.0 ufo: 1.3.2 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) untyped: 1.4.2 transitivePeerDependencies: - rollup @@ -1734,7 +1734,7 @@ packages: scule: 1.2.0 std-env: 3.7.0 ufo: 1.3.2 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) untyped: 1.4.0 transitivePeerDependencies: - rollup @@ -1824,7 +1824,7 @@ packages: vue: ^3.3.4 dependencies: '@nuxt/kit': 3.10.0 - '@rollup/plugin-replace': 5.0.5(rollup@4.9.6) + '@rollup/plugin-replace': 5.0.5(rollup@4.11.0) '@vitejs/plugin-vue': 5.0.3(vite@5.0.12)(vue@3.4.15) '@vitejs/plugin-vue-jsx': 3.1.0(vite@5.0.12)(vue@3.4.15) autoprefixer: 10.4.17(postcss@8.4.33) @@ -1847,7 +1847,7 @@ packages: perfect-debounce: 1.0.0 pkg-types: 1.0.3 postcss: 8.4.33 - rollup-plugin-visualizer: 5.12.0(rollup@4.9.6) + rollup-plugin-visualizer: 5.12.0(rollup@4.11.0) std-env: 3.7.0 strip-literal: 2.0.0 ufo: 1.3.2 @@ -2177,7 +2177,7 @@ packages: resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} dev: false - /@rollup/plugin-alias@5.1.0(rollup@4.9.6): + /@rollup/plugin-alias@5.1.0(rollup@4.11.0): resolution: {integrity: sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2186,10 +2186,10 @@ packages: rollup: optional: true dependencies: - rollup: 4.9.6 + rollup: 4.11.0 slash: 4.0.0 - /@rollup/plugin-commonjs@25.0.7(rollup@4.9.6): + /@rollup/plugin-commonjs@25.0.7(rollup@4.11.0): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2198,15 +2198,15 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 - magic-string: 0.30.5 - rollup: 4.9.6 + magic-string: 0.30.7 + rollup: 4.11.0 - /@rollup/plugin-inject@5.0.5(rollup@4.9.6): + /@rollup/plugin-inject@5.0.5(rollup@4.11.0): resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2215,12 +2215,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) estree-walker: 2.0.2 - magic-string: 0.30.5 - rollup: 4.9.6 + magic-string: 0.30.7 + rollup: 4.11.0 - /@rollup/plugin-json@6.1.0(rollup@4.9.6): + /@rollup/plugin-json@6.1.0(rollup@4.11.0): resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2229,10 +2229,10 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) - rollup: 4.9.6 + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) + rollup: 4.11.0 - /@rollup/plugin-node-resolve@15.2.3(rollup@4.9.6): + /@rollup/plugin-node-resolve@15.2.3(rollup@4.11.0): resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2241,15 +2241,15 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 - rollup: 4.9.6 + rollup: 4.11.0 - /@rollup/plugin-replace@5.0.5(rollup@4.9.6): + /@rollup/plugin-replace@5.0.5(rollup@4.11.0): resolution: {integrity: sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2258,11 +2258,11 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) magic-string: 0.30.5 - rollup: 4.9.6 + rollup: 4.11.0 - /@rollup/plugin-terser@0.4.4(rollup@4.9.6): + /@rollup/plugin-terser@0.4.4(rollup@4.11.0): resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2271,7 +2271,7 @@ packages: rollup: optional: true dependencies: - rollup: 4.9.6 + rollup: 4.11.0 serialize-javascript: 6.0.1 smob: 1.4.0 terser: 5.19.2 @@ -2283,7 +2283,7 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 - /@rollup/pluginutils@5.1.0(rollup@4.9.6): + /@rollup/pluginutils@5.1.0(rollup@4.11.0): resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2295,7 +2295,14 @@ packages: '@types/estree': 1.0.1 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 4.9.6 + rollup: 4.11.0 + + /@rollup/rollup-android-arm-eabi@4.11.0: + resolution: {integrity: sha512-BV+u2QSfK3i1o6FucqJh5IK9cjAU6icjFFhvknzFgu472jzl0bBojfDAkJLBEsHFMo+YZg6rthBvBBt8z12IBQ==} + cpu: [arm] + os: [android] + requiresBuild: true + optional: true /@rollup/rollup-android-arm-eabi@4.9.6: resolution: {integrity: sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==} @@ -2304,6 +2311,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-android-arm64@4.11.0: + resolution: {integrity: sha512-0ij3iw7sT5jbcdXofWO2NqDNjSVVsf6itcAkV2I6Xsq4+6wjW1A8rViVB67TfBEan7PV2kbLzT8rhOVWLI2YXw==} + cpu: [arm64] + os: [android] + requiresBuild: true + optional: true + /@rollup/rollup-android-arm64@4.9.6: resolution: {integrity: sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==} cpu: [arm64] @@ -2311,6 +2325,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-darwin-arm64@4.11.0: + resolution: {integrity: sha512-yPLs6RbbBMupArf6qv1UDk6dzZvlH66z6NLYEwqTU0VHtss1wkI4UYeeMS7TVj5QRVvaNAWYKP0TD/MOeZ76Zg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + optional: true + /@rollup/rollup-darwin-arm64@4.9.6: resolution: {integrity: sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==} cpu: [arm64] @@ -2318,6 +2339,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-darwin-x64@4.11.0: + resolution: {integrity: sha512-OvqIgwaGAwnASzXaZEeoJY3RltOFg+WUbdkdfoluh2iqatd090UeOG3A/h0wNZmE93dDew9tAtXgm3/+U/B6bw==} + cpu: [x64] + os: [darwin] + requiresBuild: true + optional: true + /@rollup/rollup-darwin-x64@4.9.6: resolution: {integrity: sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==} cpu: [x64] @@ -2325,6 +2353,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.11.0: + resolution: {integrity: sha512-X17s4hZK3QbRmdAuLd2EE+qwwxL8JxyVupEqAkxKPa/IgX49ZO+vf0ka69gIKsaYeo6c1CuwY3k8trfDtZ9dFg==} + cpu: [arm] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.9.6: resolution: {integrity: sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==} cpu: [arm] @@ -2332,6 +2367,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm64-gnu@4.11.0: + resolution: {integrity: sha512-673Lu9EJwxVB9NfYeA4AdNu0FOHz7g9t6N1DmT7bZPn1u6bTF+oZjj+fuxUcrfxWXE0r2jxl5QYMa9cUOj9NFg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-arm64-gnu@4.9.6: resolution: {integrity: sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==} cpu: [arm64] @@ -2339,6 +2381,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm64-musl@4.11.0: + resolution: {integrity: sha512-yFW2msTAQNpPJaMmh2NpRalr1KXI7ZUjlN6dY/FhWlOclMrZezm5GIhy3cP4Ts2rIAC+IPLAjNibjp1BsxCVGg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-arm64-musl@4.9.6: resolution: {integrity: sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==} cpu: [arm64] @@ -2346,6 +2395,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-riscv64-gnu@4.11.0: + resolution: {integrity: sha512-kKT9XIuhbvYgiA3cPAGntvrBgzhWkGpBMzuk1V12Xuoqg7CI41chye4HU0vLJnGf9MiZzfNh4I7StPeOzOWJfA==} + cpu: [riscv64] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-riscv64-gnu@4.9.6: resolution: {integrity: sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==} cpu: [riscv64] @@ -2353,6 +2409,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-x64-gnu@4.11.0: + resolution: {integrity: sha512-6q4ESWlyTO+erp1PSCmASac+ixaDv11dBk1fqyIuvIUc/CmRAX2Zk+2qK1FGo5q7kyDcjHCFVwgGFCGIZGVwCA==} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-x64-gnu@4.9.6: resolution: {integrity: sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==} cpu: [x64] @@ -2360,6 +2423,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-x64-musl@4.11.0: + resolution: {integrity: sha512-vIAQUmXeMLmaDN78HSE4Kh6xqof2e3TJUKr+LPqXWU4NYNON0MDN9h2+t4KHrPAQNmU3w1GxBQ/n01PaWFwa5w==} + cpu: [x64] + os: [linux] + requiresBuild: true + optional: true + /@rollup/rollup-linux-x64-musl@4.9.6: resolution: {integrity: sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==} cpu: [x64] @@ -2367,6 +2437,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-arm64-msvc@4.11.0: + resolution: {integrity: sha512-LVXo9dDTGPr0nezMdqa1hK4JeoMZ02nstUxGYY/sMIDtTYlli1ZxTXBYAz3vzuuvKO4X6NBETciIh7N9+abT1g==} + cpu: [arm64] + os: [win32] + requiresBuild: true + optional: true + /@rollup/rollup-win32-arm64-msvc@4.9.6: resolution: {integrity: sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==} cpu: [arm64] @@ -2374,6 +2451,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-ia32-msvc@4.11.0: + resolution: {integrity: sha512-xZVt6K70Gr3I7nUhug2dN6VRR1ibot3rXqXS3wo+8JP64t7djc3lBFyqO4GiVrhNaAIhUCJtwQ/20dr0h0thmQ==} + cpu: [ia32] + os: [win32] + requiresBuild: true + optional: true + /@rollup/rollup-win32-ia32-msvc@4.9.6: resolution: {integrity: sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==} cpu: [ia32] @@ -2381,6 +2465,13 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-x64-msvc@4.11.0: + resolution: {integrity: sha512-f3I7h9oTg79UitEco9/2bzwdciYkWr8pITs3meSDSlr1TdvQ7IxkQaaYN2YqZXX5uZhiYL+VuYDmHwNzhx+HOg==} + cpu: [x64] + os: [win32] + requiresBuild: true + optional: true + /@rollup/rollup-win32-x64-msvc@4.9.6: resolution: {integrity: sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==} cpu: [x64] @@ -2430,6 +2521,10 @@ packages: resolution: {integrity: sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==} engines: {node: '>=18'} + /@sindresorhus/merge-streams@2.2.1: + resolution: {integrity: sha512-255V7MMIKw6aQ43Wbqp9HZ+VHn6acddERTLiiLnlcPLU9PdTq9Aijl12oklAgUEblLWye+vHLzmqBx6f2TGcZw==} + engines: {node: '>=18'} + /@szmarczak/http-timer@5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -2705,8 +2800,8 @@ packages: unhead: 1.8.10 vue: 3.4.15(typescript@5.3.3) - /@vercel/nft@0.26.2: - resolution: {integrity: sha512-bxe2iShmKZi7476xYamyKvhhKwQ6JPEtQ2FSq1AjMUH2buMd8LQMkdoHinTqZYc+1sMTh3G0ARdjzNvV1FEisA==} + /@vercel/nft@0.26.4: + resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} engines: {node: '>=16'} hasBin: true dependencies: @@ -2777,7 +2872,7 @@ packages: optional: true dependencies: '@babel/types': 7.23.9 - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) '@vue/compiler-sfc': 3.4.15 ast-kit: 0.11.2 local-pkg: 0.4.3 @@ -3202,7 +3297,7 @@ packages: engines: {node: '>=16.14.0'} dependencies: '@babel/parser': 7.23.9 - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) pathe: 1.1.2 transitivePeerDependencies: - rollup @@ -3212,7 +3307,7 @@ packages: engines: {node: '>=16.14.0'} dependencies: '@babel/parser': 7.23.9 - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) pathe: 1.1.2 transitivePeerDependencies: - rollup @@ -3434,6 +3529,23 @@ packages: pkg-types: 1.0.3 rc9: 2.1.1 + /c12@1.8.0: + resolution: {integrity: sha512-93U6RndoaAwFQPBcS9F/6lwtgBfrWh4695sQ/ChILkbj0C7zOZVptOU3Sxp0I/9xvfW/lzBWD90AXDQz4muSkA==} + dependencies: + chokidar: 3.6.0 + defu: 6.1.4 + dotenv: 16.4.4 + giget: 1.2.1 + jiti: 1.21.0 + json5: 2.2.3 + jsonc-parser: 3.2.1 + mlly: 1.5.0 + ohash: 1.1.3 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.0.3 + rc9: 2.1.1 + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -3585,6 +3697,20 @@ packages: optionalDependencies: fsevents: 2.3.3 + /chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + /chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} @@ -4213,6 +4339,10 @@ packages: resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} + /dotenv@16.4.4: + resolution: {integrity: sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==} + engines: {node: '>=12'} + /drizzle-orm@0.29.3(@cloudflare/workers-types@4.20240129.0): resolution: {integrity: sha512-uSE027csliGSGYD0pqtM+SAQATMREb3eSM/U8s6r+Y0RFwTKwftnwwSkqx3oS65UBgqDOM0gMTl5UGNpt6lW0A==} peerDependencies: @@ -5175,6 +5305,17 @@ packages: slash: 5.1.0 unicorn-magic: 0.1.0 + /globby@14.0.1: + resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} + engines: {node: '>=18'} + dependencies: + '@sindresorhus/merge-streams': 2.2.1 + fast-glob: 3.3.2 + ignore: 5.3.0 + path-type: 5.0.0 + slash: 5.1.0 + unicorn-magic: 0.1.0 + /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: @@ -5950,6 +6091,9 @@ packages: /jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -6115,7 +6259,7 @@ packages: node-forge: 1.3.1 pathe: 1.1.2 std-env: 3.7.0 - ufo: 1.3.2 + ufo: 1.4.0 untun: 0.1.3 uqr: 0.1.2 @@ -6263,6 +6407,12 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + /magic-string@0.30.7: + resolution: {integrity: sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + /magicast@0.3.2: resolution: {integrity: sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==} dependencies: @@ -6585,8 +6735,8 @@ packages: type-fest: 2.19.0 dev: true - /nitropack-nightly@2.9.0-28437792.77796df: - resolution: {integrity: sha512-jDt0Sy4F+tYk8Y3VMVI7x3uUzJnScGvPDm2SV1Nsc8GdURvemCIcL62wzw64dlkAHli5SFIuFdoCmrtXpkLgiA==} + /nitropack-nightly@2.9.0-28463674.e9975ac: + resolution: {integrity: sha512-FJlNJ+N2c8ikXMctO9ChPHteOxV8CBFU5L5V2fVo7WaU+huY8DS8pbZexEDotfx2a32GLr2zjUJjSXb/yVb4XA==} engines: {node: ^16.11.0 || >=17.0.0} hasBin: true peerDependencies: @@ -6595,33 +6745,33 @@ packages: xml2js: optional: true dependencies: - '@cloudflare/kv-asset-handler': 0.3.0 + '@cloudflare/kv-asset-handler': 0.3.1 '@netlify/functions': 2.5.1 - '@rollup/plugin-alias': 5.1.0(rollup@4.9.6) - '@rollup/plugin-commonjs': 25.0.7(rollup@4.9.6) - '@rollup/plugin-inject': 5.0.5(rollup@4.9.6) - '@rollup/plugin-json': 6.1.0(rollup@4.9.6) - '@rollup/plugin-node-resolve': 15.2.3(rollup@4.9.6) - '@rollup/plugin-replace': 5.0.5(rollup@4.9.6) - '@rollup/plugin-terser': 0.4.4(rollup@4.9.6) - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/plugin-alias': 5.1.0(rollup@4.11.0) + '@rollup/plugin-commonjs': 25.0.7(rollup@4.11.0) + '@rollup/plugin-inject': 5.0.5(rollup@4.11.0) + '@rollup/plugin-json': 6.1.0(rollup@4.11.0) + '@rollup/plugin-node-resolve': 15.2.3(rollup@4.11.0) + '@rollup/plugin-replace': 5.0.5(rollup@4.11.0) + '@rollup/plugin-terser': 0.4.4(rollup@4.11.0) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) '@types/http-proxy': 1.17.14 - '@vercel/nft': 0.26.2 + '@vercel/nft': 0.26.4 archiver: 6.0.1 - c12: 1.6.1 + c12: 1.8.0 chalk: 5.3.0 - chokidar: 3.5.3 + chokidar: 3.6.0 citty: 0.1.5 consola: 3.2.3 cookie-es: 1.0.0 defu: 6.1.4 destr: 2.0.2 dot-prop: 8.0.2 - esbuild: 0.19.11 + esbuild: 0.20.0 escape-string-regexp: 5.0.0 etag: 1.8.1 fs-extra: 11.2.0 - globby: 14.0.0 + globby: 14.0.1 gzip-size: 7.0.0 h3: /h3-nightly@1.10.2-1706531092.e38d444 hookable: 5.5.3 @@ -6631,11 +6781,11 @@ packages: klona: 2.0.6 knitwork: 1.0.0 listhen: 1.6.0 - magic-string: 0.30.5 + magic-string: 0.30.7 mime: 4.0.1 mlly: 1.5.0 mri: 1.2.0 - node-fetch-native: 1.6.1 + node-fetch-native: 1.6.2 ofetch: 1.3.3 ohash: 1.1.3 openapi-typescript: 6.7.4 @@ -6644,18 +6794,18 @@ packages: pkg-types: 1.0.3 pretty-bytes: 6.1.1 radix3: 1.1.0 - rollup: 4.9.6 - rollup-plugin-visualizer: 5.12.0(rollup@4.9.6) - scule: 1.2.0 - semver: 7.5.4 + rollup: 4.11.0 + rollup-plugin-visualizer: 5.12.0(rollup@4.11.0) + scule: 1.3.0 + semver: 7.6.0 serve-placeholder: 2.0.1 serve-static: 1.15.0 std-env: 3.7.0 - ufo: 1.3.2 + ufo: 1.4.0 uncrypto: 0.1.3 unctx: 2.3.1 unenv: 1.9.0 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) unstorage: 1.10.1 unwasm: 0.3.7 transitivePeerDependencies: @@ -6685,6 +6835,9 @@ packages: /node-fetch-native@1.6.1: resolution: {integrity: sha512-bW9T/uJDPAJB2YNYEpWzE54U5O3MQidXsOyTfnbKYtTtFexRvGzb1waphBN4ZwP6EcIvYYEOwW0b72BpAqydTw==} + /node-fetch-native@1.6.2: + resolution: {integrity: sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==} + /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -6941,7 +7094,7 @@ packages: knitwork: 1.0.0 magic-string: 0.30.5 mlly: 1.5.0 - nitropack: /nitropack-nightly@2.9.0-28437792.77796df + nitropack: /nitropack-nightly@2.9.0-28463674.e9975ac nuxi: 3.10.0 nypm: 0.3.6 ofetch: 1.3.3 @@ -6958,7 +7111,7 @@ packages: uncrypto: 0.1.3 unctx: 2.3.1 unenv: 1.9.0 - unimport: 3.7.1(rollup@4.9.6) + unimport: 3.7.1(rollup@4.11.0) unplugin: 1.6.0 unplugin-vue-router: 0.7.0(vue-router@4.2.5)(vue@3.4.15) untyped: 1.4.2 @@ -8121,7 +8274,7 @@ packages: rollup-plugin-inject: 3.0.2 dev: false - /rollup-plugin-visualizer@5.12.0(rollup@4.9.6): + /rollup-plugin-visualizer@5.12.0(rollup@4.11.0): resolution: {integrity: sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==} engines: {node: '>=14'} hasBin: true @@ -8133,7 +8286,7 @@ packages: dependencies: open: 8.4.2 picomatch: 2.3.1 - rollup: 4.9.6 + rollup: 4.11.0 source-map: 0.7.4 yargs: 17.7.2 @@ -8143,6 +8296,28 @@ packages: estree-walker: 0.6.1 dev: false + /rollup@4.11.0: + resolution: {integrity: sha512-2xIbaXDXjf3u2tajvA5xROpib7eegJ9Y/uPlSFhXLNpK9ampCczXAhLEb5yLzJyG3LAdI1NWtNjDXiLyniNdjQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.11.0 + '@rollup/rollup-android-arm64': 4.11.0 + '@rollup/rollup-darwin-arm64': 4.11.0 + '@rollup/rollup-darwin-x64': 4.11.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.11.0 + '@rollup/rollup-linux-arm64-gnu': 4.11.0 + '@rollup/rollup-linux-arm64-musl': 4.11.0 + '@rollup/rollup-linux-riscv64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-musl': 4.11.0 + '@rollup/rollup-win32-arm64-msvc': 4.11.0 + '@rollup/rollup-win32-ia32-msvc': 4.11.0 + '@rollup/rollup-win32-x64-msvc': 4.11.0 + fsevents: 2.3.3 + /rollup@4.9.6: resolution: {integrity: sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -8227,6 +8402,9 @@ packages: /scule@1.2.0: resolution: {integrity: sha512-CRCmi5zHQnSoeCik9565PONMg0kfkvYmcSqrbOJY4txFfy1wvVULV4FDaiXhUblUgahdqz3F2NwHZ8i4eBTwUw==} + /scule@1.3.0: + resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} + /selfsigned@2.4.1: resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} engines: {node: '>=10'} @@ -8253,6 +8431,13 @@ packages: dependencies: lru-cache: 6.0.0 + /semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -8954,6 +9139,9 @@ packages: /ufo@1.3.2: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} + /ufo@1.4.0: + resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} + /ultrahtml@1.5.2: resolution: {integrity: sha512-qh4mBffhlkiXwDAOxvSGxhL0QEQsTbnP9BozOK3OYPEGvPvdWzvAUaXNtUSMdNsKDtuyjEbyVUPFZ52SSLhLqw==} @@ -9004,10 +9192,10 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - /unimport@3.7.1(rollup@4.9.6): + /unimport@3.7.1(rollup@4.11.0): resolution: {integrity: sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==} dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) acorn: 8.11.3 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 @@ -9064,7 +9252,7 @@ packages: optional: true dependencies: '@babel/types': 7.23.9 - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) '@vue-macros/common': 1.8.0(vue@3.4.15) ast-walker-scope: 0.5.0 chokidar: 3.5.3 @@ -9139,16 +9327,16 @@ packages: optional: true dependencies: anymatch: 3.1.3 - chokidar: 3.5.3 + chokidar: 3.6.0 destr: 2.0.2 h3: /h3-nightly@1.10.2-1706531092.e38d444 ioredis: 5.3.2 listhen: 1.6.0 lru-cache: 10.1.0 mri: 1.2.0 - node-fetch-native: 1.6.1 + node-fetch-native: 1.6.2 ofetch: 1.3.3 - ufo: 1.3.2 + ufo: 1.4.0 transitivePeerDependencies: - supports-color @@ -9196,7 +9384,7 @@ packages: /unwasm@0.3.7: resolution: {integrity: sha512-+s4iWvHHYnLuwNo+9mqVFLBmBzGc3gIuzkVZ8fdMN9K/kWopCnfaUVnDagd2OX3It5nRR5EenI5nSQb8FOd0fA==} dependencies: - magic-string: 0.30.5 + magic-string: 0.30.7 mlly: 1.5.0 pathe: 1.1.2 pkg-types: 1.0.3 @@ -9362,7 +9550,7 @@ packages: dependencies: '@antfu/utils': 0.7.7 '@nuxt/kit': 3.10.0 - '@rollup/pluginutils': 5.1.0(rollup@4.9.6) + '@rollup/pluginutils': 5.1.0(rollup@4.11.0) debug: 4.3.4 error-stack-parser-es: 0.1.1 fs-extra: 11.2.0 diff --git a/server/utils/blob.ts b/server/utils/blob.ts index ef3fac17..a06227ec 100644 --- a/server/utils/blob.ts +++ b/server/utils/blob.ts @@ -1,7 +1,7 @@ +import type { extensions } from '@uploadthing/mime-types' import type { R2Bucket } from '@cloudflare/workers-types/experimental' import { ofetch } from 'ofetch' import mime from 'mime' -// import { imageMeta } from 'image-meta' import type { H3Event } from 'h3' import { defu } from 'defu' import { randomUUID } from 'uncrypto' @@ -149,49 +149,10 @@ export function useProxyBlob(projectUrl: string, secretKey?: string) { } } -// Final intentions -// export default hub.blob.uploadHandler({ -// async authorize (event) { -// await requireUserSession(event) -// }, -// contentType: ['image/jpg'], -// maxFileSize: '16MB', -// bucket: '', -// prefix: '' -// }) - function getContentType(pathOrExtension?: string) { return (pathOrExtension && mime.getType(pathOrExtension)) || 'application/octet-stream' } -// function getMetadata (filename: string, buffer: Buffer) { -// const metadata: Record = { -// contentType: getContentType(filename) -// } - -// if (metadata.contentType.startsWith('image/')) { -// Object.assign(metadata, imageMeta(buffer)) -// } - -// return metadata -// } - -// export async function readFiles (event: any) { -// const files = (await readMultipartFormData(event) || []) - -// // Filter only files -// return files.filter((file) => Boolean(file.filename)) -// } - -// export function toArrayBuffer (buffer: Buffer) { -// const arrayBuffer = new ArrayBuffer(buffer.length) -// const view = new Uint8Array(arrayBuffer) -// for (let i = 0; i < buffer.length; ++i) { -// view[i] = buffer[i] -// } -// return arrayBuffer -// } - function mapR2ObjectToBlob(object: R2Object): BlobObject { return { pathname: object.key, @@ -200,3 +161,57 @@ function mapR2ObjectToBlob(object: R2Object): BlobObject { uploadedAt: object.uploaded, } } + +// Credits from shared utils of https://github.com/pingdotgg/uploadthing +type PowOf2 = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 | 1024; +type SizeUnit = 'B' | 'KB' | 'MB' | 'GB'; +type BlobSize = `${PowOf2}${SizeUnit}`; +type BlobType = 'image' | 'video' | 'audio' | 'pdf' | 'text' | 'blob' | keyof typeof extensions +const FILESIZE_UNITS = ['B', 'KB', 'MB', 'GB'] +type FileSizeUnit = (typeof FILESIZE_UNITS)[number]; + +function fileSizeToBytes(input: string) { + const regex = new RegExp( + `^(\\d+)(\\.\\d+)?\\s*(${FILESIZE_UNITS.join('|')})$`, + 'i', + ) + const match = input.match(regex) + + if (!match) { + throw createError({ statusCode: 400, message: `Invalid file size format: ${input}` }) + } + + const sizeValue = parseFloat(match[1]) + const sizeUnit = match[3].toUpperCase() as FileSizeUnit + + if (!FILESIZE_UNITS.includes(sizeUnit)) { + throw createError({ statusCode: 400, message: `Invalid file size unit: ${sizeUnit}` }) + } + const bytes = sizeValue * Math.pow(1024, FILESIZE_UNITS.indexOf(sizeUnit)) + return Math.floor(bytes) +} + +export function ensureBlob(blob: Blob, options: { maxSize?: BlobSize, types?: BlobType[] }) { + if (!options.maxSize && !options.types?.length) { + throw createError({ + statusCode: 400, + message: 'ensureBlob() requires at least one of maxSize or types to be set.' + }) + } + if (options.maxSize) { + const maxFileSizeBytes = fileSizeToBytes(options.maxSize) + if (blob.size > maxFileSizeBytes) { + throw createError({ + statusCode: 400, + message: `File size must be less than ${options.maxSize}` + }) + } + } + const blobShortType = blob.type.split('/')[0] + if (options.types?.length && !options.types.includes(blob.type as BlobType) && !options.types.includes(blobShortType as BlobType)) { + throw createError({ + statusCode: 400, + message: `File type is invalid, must be: ${options.types.join(', ')}` + }) + } +}