The minimalistic document archiving platform.
feat(apps): setup client app
Corentin Thomasset863276668808
diff --git a/.gitignore b/.gitignoreindex 0940f166..6fd76f62 100644--- a/.gitignore+++ b/.gitignore@@ -34,4 +34,6 @@ cache*.db*.db-shm*.db-wal-*.sqlite\ No newline at end of file+*.sqlite++local-documents\ No newline at end of filediff --git a/.nvmrc b/.nvmrcnew file mode 100644index 00000000..8fdd954d--- /dev/null+++ b/.nvmrc@@ -0,0 +1 @@+22\ No newline at end of filediff --git a/apps/app-client/.env.example b/apps/app-client/.env.examplenew file mode 100644index 00000000..e6e16f9f--- /dev/null+++ b/apps/app-client/.env.example@@ -0,0 +1 @@+VITE_BASE_API_URL=http://localhost:1221diff --git a/apps/app-client/.gitignore b/apps/app-client/.gitignorenew file mode 100644index 00000000..7922244c--- /dev/null+++ b/apps/app-client/.gitignore@@ -0,0 +1,35 @@++dist+.solid+.output+.vercel+.netlify+.vinxi++# Environment+.env+.env*.local++# dependencies+/node_modules++# IDEs and editors+/.idea+.project+.classpath+*.launch+.settings/++# Temp+gitignore++# System Files+.DS_Store+Thumbs.db++cache++/test-results/+/playwright-report/+/blob-report/+/playwright/.cache/diff --git a/apps/app-client/README.md b/apps/app-client/README.mdnew file mode 100644index 00000000..8f0fd03b--- /dev/null+++ b/apps/app-client/README.md@@ -0,0 +1 @@+# App Clientdiff --git a/apps/app-client/components.json b/apps/app-client/components.jsonnew file mode 100644index 00000000..8c5b7a12--- /dev/null+++ b/apps/app-client/components.json@@ -0,0 +1,17 @@+{+ "$schema": "https://shadcn-solid.com/schema.json",+ "uno": {+ "config": "uno.config.ts",+ "css": {+ "path": "src/app.css",+ "variable": true+ },+ "color": "neutral",+ "prefix": ""+ },+ "alias": {+ "component": "@/modules/ui/components",+ "ui": "@/modules/ui/components",+ "cn": "@/modules/shared/style/cn"+ }+}diff --git a/apps/app-client/eslint.config.js b/apps/app-client/eslint.config.jsnew file mode 100644index 00000000..e0175daf--- /dev/null+++ b/apps/app-client/eslint.config.js@@ -0,0 +1,21 @@+import antfu from '@antfu/eslint-config';++export default antfu({+ stylistic: {+ semi: true,+ },++ rules: {+ // To allow export on top of files+ 'ts/no-use-before-define': ['error', { allowNamedExports: true, functions: false }],+ 'curly': ['error', 'all'],+ 'vitest/consistent-test-it': ['error', { fn: 'test' }],+ 'ts/consistent-type-definitions': ['error', 'type'],+ 'style/brace-style': ['error', '1tbs', { allowSingleLine: false }],+ 'unused-imports/no-unused-vars': ['error', {+ argsIgnorePattern: '^_',+ varsIgnorePattern: '^_',+ caughtErrorsIgnorePattern: '^_',+ }],+ },+});diff --git a/apps/app-client/index.html b/apps/app-client/index.htmlnew file mode 100644index 00000000..ef887259--- /dev/null+++ b/apps/app-client/index.html@@ -0,0 +1,65 @@+<!DOCTYPE html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <meta name="theme-color" content="#000000" />+ <title>Papra - Document archiving and sharing platform</title>++ <meta name="title" content="Papra - Document archiving and sharing platform">+ <meta name="description" content="Papra, the document archiving and sharing platform.">++ <link rel="author" href="humans.txt" />+ <link rel="canonical" href="https://papra.app/" />++ <!-- Open Graph / Facebook -->+ <meta property="og:type" content="website">+ <meta property="og:url" content="https://papra.app/">+ <meta property="og:title" content="Papra - Document archiving and sharing platform">+ <meta property="og:description" content="Papra, the document archiving and sharing platform.">+ <meta property="og:image" content="https://papra.app/og-image.png">++ <!-- Twitter -->+ <meta property="twitter:card" content="summary_large_image">+ <meta property="twitter:url" content="https://papra.app/">+ <meta property="twitter:title" content="Papra - Document archiving and sharing platform">+ <meta property="twitter:description" content="Papra, the document archiving and sharing platform.">+ <meta property="twitter:image" content="https://papra.app/og-image.png">++ <!-- Favicon and Icons -->+ <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />+ <link rel="manifest" href="/site.webmanifest" />++ <!-- Structured Data (JSON-LD for rich snippets) -->+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebApplication",+ "name": "Papra",+ "url": "https://papra.app/",+ "description": "Papra, the document archiving and sharing platform.",+ "applicationCategory": "Utilities",+ "operatingSystem": "Web",+ "browserRequirements": "Requires JavaScript",+ "image": "https://papra.app/og-image.png",+ "creator": {+ "@type": "Organization",+ "name": "Papra"+ }+ }+ </script>++ <style>.sr-only {position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0, 0, 0, 0);white-space: nowrap;border-width: 0;}</style>+ </head>+ <body>+ <h1 class="sr-only">Papra - Document archiving and sharing platform</h1>+ <p class="sr-only">Papra, the document archiving and sharing platform.</p>++ <noscript>You need to enable JavaScript to run this app.</noscript>+ <div id="root"></div>++ <script src="/src/index.tsx" type="module"></script>+ </body>+</html>diff --git a/apps/app-client/package.json b/apps/app-client/package.jsonnew file mode 100644index 00000000..97408989--- /dev/null+++ b/apps/app-client/package.json@@ -0,0 +1,68 @@+{+ "name": "@papra/app-client",+ "type": "module",+ "version": "1.11.0",+ "packageManager": "[email protected]",+ "description": "Papra frontend client",+ "author": "Corentin Thomasset <[email protected]> (https://corentin.tech)",+ "license": "Apache-2.0",+ "repository": {+ "type": "git",+ "url": "https://github.com/papra-app/papra"+ },+ "engines": {+ "node": ">=22.0.0"+ },+ "scripts": {+ "start": "vite",+ "dev": "vite",+ "build": "vite build",+ "serve": "vite preview",+ "lint": "eslint .",+ "lint:fix": "eslint --fix .",+ "test": "pnpm run test:unit",+ "test:unit": "vitest run",+ "test:unit:watch": "vitest watch",+ "test:e2e": "playwright test",+ "typecheck": "tsc --noEmit",+ "script:get-missing-i18n-keys": "tsx src/scripts/get-missing-i18n-keys.script.ts"+ },+ "dependencies": {+ "@corentinth/chisels": "^1.0.2",+ "@kobalte/core": "^0.13.4",+ "@solid-primitives/i18n": "^2.1.1",+ "@solid-primitives/storage": "^4.2.1",+ "@solidjs/router": "^0.14.3",+ "@tanstack/solid-query": "^5.61.5",+ "@tanstack/solid-table": "^8.20.5",+ "@unocss/reset": "^0.64.0",+ "class-variance-authority": "^0.7.0",+ "clsx": "^2.1.1",+ "date-fns": "^4.1.0",+ "jszip": "^3.10.1",+ "lodash-es": "^4.17.21",+ "shiki": "^1.24.0",+ "solid-js": "^1.8.11",+ "solid-sonner": "^0.2.8",+ "tailwind-merge": "^2.6.0",+ "ts-pattern": "^5.5.0",+ "unocss-preset-animations": "^1.1.0",+ "uqr": "^0.1.2",+ "zod": "^3.23.8"+ },+ "devDependencies": {+ "@antfu/eslint-config": "catalog:",+ "@iconify-json/tabler": "^1.1.120",+ "@playwright/test": "^1.46.1",+ "@types/lodash-es": "^4.17.12",+ "@types/node": "catalog:",+ "eslint": "catalog:",+ "jsdom": "^25.0.0",+ "tsx": "^4.19.1",+ "typescript": "catalog:",+ "unocss": "0.65.0-beta.2",+ "vite": "^5.0.11",+ "vite-plugin-solid": "^2.8.2",+ "vitest": "catalog:"+ }+}diff --git a/apps/app-client/playwright.config.ts b/apps/app-client/playwright.config.tsnew file mode 100644index 00000000..184d60d1--- /dev/null+++ b/apps/app-client/playwright.config.ts@@ -0,0 +1,67 @@+import process from 'node:process';+import { defineConfig, devices } from '@playwright/test';++const port = process.env.PORT ?? '3999';+const baseURL = process.env.BASE_URL ?? `http://localhost:${port}/`;+const isCI = Boolean(process.env.CI);+const startPreviewServer = Boolean(process.env.USE_PREVIEW_SERVER);++/**+ * See https://playwright.dev/docs/test-configuration.+ */+export default defineConfig({+ testDir: './e2e-tests',+ /* Run tests in files in parallel */+ fullyParallel: true,+ /* Fail the build on CI if you accidentally left test.only in the source code. */+ forbidOnly: isCI,+ /* Retry on CI only */+ retries: isCI ? 2 : 0,+ /* Opt out of parallel tests on CI. */+ workers: isCI ? 1 : undefined,+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */+ reporter: 'html',+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */+ use: {+ /* Base URL to use in actions like `await page.goto('/')`. */+ baseURL,++ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */+ trace: 'on-first-retry',++ testIdAttribute: 'data-test-id',+ locale: 'en-GB',+ timezoneId: 'Europe/Paris',+ },++ /* Configure projects for major browsers */+ projects: [+ {+ name: 'chromium',+ use: { ...devices['Desktop Chrome'] },+ },++ {+ name: 'firefox',+ use: { ...devices['Desktop Firefox'] },+ },++ {+ name: 'webkit',+ use: { ...devices['Desktop Safari'] },+ },+ ],++ ...(startPreviewServer+ ? {+ webServer: {+ command: 'cd dist-app && node index.cjs',+ reuseExistingServer: true,+ env: {+ PORT: port,+ },+ },+ }+ : {}),++});diff --git a/apps/app-client/public/apple-touch-icon.png b/apps/app-client/public/apple-touch-icon.pngnew file mode 100644index 00000000..437b4a92Binary files /dev/null and b/apps/app-client/public/apple-touch-icon.png differdiff --git a/apps/app-client/public/favicon-96x96.png b/apps/app-client/public/favicon-96x96.pngnew file mode 100644index 00000000..620be44dBinary files /dev/null and b/apps/app-client/public/favicon-96x96.png differdiff --git a/apps/app-client/public/favicon.ico b/apps/app-client/public/favicon.iconew file mode 100644index 00000000..3fbe3114Binary files /dev/null and b/apps/app-client/public/favicon.ico differdiff --git a/apps/app-client/public/humans.txt b/apps/app-client/public/humans.txtnew file mode 100644index 00000000..dd34e209--- /dev/null+++ b/apps/app-client/public/humans.txt@@ -0,0 +1,5 @@+/* TEAM */+Developer: Corentin Thomasset+Site: https://corentin.tech+Twitter: @cthmsst+BlueSky: @corentin.tech\ No newline at end of filediff --git a/apps/app-client/public/og-image.png b/apps/app-client/public/og-image.pngnew file mode 100644index 00000000..9f28257fBinary files /dev/null and b/apps/app-client/public/og-image.png differdiff --git a/apps/app-client/public/robots.txt b/apps/app-client/public/robots.txtnew file mode 100644index 00000000..c2a49f4f--- /dev/null+++ b/apps/app-client/public/robots.txt@@ -0,0 +1,2 @@+User-agent: *+Allow: /diff --git a/apps/app-client/public/site.webmanifest b/apps/app-client/public/site.webmanifestnew file mode 100644index 00000000..6e9a6236--- /dev/null+++ b/apps/app-client/public/site.webmanifest@@ -0,0 +1,21 @@+{+ "name": "Papra",+ "short_name": "Papra",+ "icons": [+ {+ "src": "/web-app-manifest-192x192.png",+ "sizes": "192x192",+ "type": "image/png",+ "purpose": "maskable"+ },+ {+ "src": "/web-app-manifest-512x512.png",+ "sizes": "512x512",+ "type": "image/png",+ "purpose": "maskable"+ }+ ],+ "theme_color": "#ffffff",+ "background_color": "#ffffff",+ "display": "standalone"+}\ No newline at end of filediff --git a/apps/app-client/public/web-app-manifest-192x192.png b/apps/app-client/public/web-app-manifest-192x192.pngnew file mode 100644index 00000000..47c26877Binary files /dev/null and b/apps/app-client/public/web-app-manifest-192x192.png differdiff --git a/apps/app-client/public/web-app-manifest-512x512.png b/apps/app-client/public/web-app-manifest-512x512.pngnew file mode 100644index 00000000..71146d56Binary files /dev/null and b/apps/app-client/public/web-app-manifest-512x512.png differdiff --git a/apps/app-client/src/app.css b/apps/app-client/src/app.cssnew file mode 100644index 00000000..ca101c77--- /dev/null+++ b/apps/app-client/src/app.css@@ -0,0 +1,75 @@+:root {+ --background: 0 0% 100%;+ --foreground: 0 0% 3.9%;++ --card: 0 0% 98%;+ --card-foreground: 0 0% 3.9%;++ --popover: 0 0% 100%;+ --popover-foreground: 0 0% 3.9%;++ --primary: 252 94% 69%;+ --primary-foreground: 0 0% 98%;++ --secondary: 0 0% 96.1%;+ --secondary-foreground: 0 0% 9%;++ --muted: 0 0% 96.1%;+ --muted-foreground: 0 0% 45.1%;++ --accent: 0 0% 96.1%;+ --accent-foreground: 0 0% 9%;++ --destructive: 0 84.2% 60.2%;+ --destructive-foreground: 0 0% 98%;++ --warning: 31 98% 50%;+ --warning-foreground: 0 0% 98%;++ --border: 0 0% 89.8%;+ --input: 0 0% 89.8%;+ --ring: 0 0% 3.9%;++ --radius: 0.5rem;+}++[data-kb-theme="dark"] {+ --background: 240 4% 10%;+ --foreground: 0 0% 98%;++ --card: 240 4% 8%;+ --card-foreground: 0 0% 98%;++ --popover: 0 0% 3.9%;+ --popover-foreground: 0 0% 98%;++ --primary: 256 100% 73%;+ --primary-foreground: 0 0% 9%;++ --secondary: 0 0% 14.9%;+ --secondary-foreground: 0 0% 98%;++ --muted: 0 0% 14.9%;+ --muted-foreground: 0 0% 63.9%;++ --accent: 0 0% 14.9%;+ --accent-foreground: 0 0% 98%;++ --destructive: 0 62.8% 30.6%;+ --destructive-foreground: 0 0% 98%;++ --warning: 31 98% 50%;+ --warning-foreground: 0 0% 98%;++ --border: 0 0% 14.9%;+ --input: 0 0% 14.9%;+ --ring: 0 0% 83.1%;+}+++* {+ @apply border-border;+}+body {+ @apply bg-background text-foreground;+}\ No newline at end of filediff --git a/apps/app-client/src/index.tsx b/apps/app-client/src/index.tsxnew file mode 100644index 00000000..987157a0--- /dev/null+++ b/apps/app-client/src/index.tsx@@ -0,0 +1,48 @@+/* @refresh reload */++import { ColorModeProvider, ColorModeScript, createLocalStorageManager } from '@kobalte/core/color-mode';+import { Router } from '@solidjs/router';+import { QueryClientProvider } from '@tanstack/solid-query';++import { render, Suspense } from 'solid-js/web';+import { ConfirmModalProvider } from './modules/shared/confirm';+import { queryClient } from './modules/shared/query/query-client';+import { Toaster } from './modules/ui/components/sonner';+import { routes } from './routes';+import '@unocss/reset/tailwind.css';+import 'virtual:uno.css';+import './app.css';++++render(+ () => {+ const initialColorMode = 'system';+ const colorModeStorageKey = 'papra_color_mode';+ const localStorageManager = createLocalStorageManager(colorModeStorageKey);++ return (+ <Router+ children={routes}+ root={props => (+ <QueryClientProvider client={queryClient}>+ <Suspense>+ <ConfirmModalProvider>+ <ColorModeScript storageType={localStorageManager.type} storageKey={colorModeStorageKey} initialColorMode={initialColorMode} />+ <ColorModeProvider+ initialColorMode={initialColorMode}+ storageManager={localStorageManager}+ >+ <div class="min-h-screen font-sans text-sm font-400">{props.children}</div>+ <Toaster />++ </ColorModeProvider>+ </ConfirmModalProvider>+ </Suspense>+ </QueryClientProvider>+ )}+ />+ );+ },+ document.getElementById('root')!,+);diff --git a/apps/app-client/src/modules/auth/auth.models.ts b/apps/app-client/src/modules/auth/auth.models.tsnew file mode 100644index 00000000..b222a79c--- /dev/null+++ b/apps/app-client/src/modules/auth/auth.models.ts@@ -0,0 +1,12 @@+export {+ isAccessTokenExpired,+};++function isAccessTokenExpired({ accessToken }: { accessToken: string }) {+ try {+ const token = JSON.parse(atob(accessToken.split('.')[1]));+ return token.exp < Date.now() / 1000;+ } catch {+ return true;+ }+}diff --git a/apps/app-client/src/modules/auth/auth.services.ts b/apps/app-client/src/modules/auth/auth.services.tsnew file mode 100644index 00000000..af58295b--- /dev/null+++ b/apps/app-client/src/modules/auth/auth.services.ts@@ -0,0 +1,69 @@+import { buildUrl } from '@corentinth/chisels';+import { config } from '../config/config';+import { apiClient } from '../shared/http/http-client';++export { login };++async function login({ email, password }: { email: string; password: string }) {+ const { accessToken } = await apiClient<{ accessToken: string }>({+ path: 'api/auth/login',+ method: 'POST',+ body: {+ email,+ password,+ },+ });++ return { accessToken };+}++export async function requestAuthTokensRefresh() {+ // Do not use apiClient here top prevent infinite loop++ const url = buildUrl({+ baseUrl: config.baseApiUrl,+ path: '/api/auth/refresh',+ });++ const response = await fetch(url, {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/json',+ },+ // set http only cookie+ credentials: 'include',+ });++ if (!response.ok) {+ throw new Error('Failed to refresh tokens');+ }++ const { accessToken } = await response.json();++ return { accessToken };+}++export async function logout() {+ await apiClient({+ path: '/api/auth/logout',+ method: 'POST',+ });+}++export async function requestMagicLink({ email }: { email: string }) {+ await apiClient({+ path: '/api/auth/magic-link',+ method: 'POST',+ body: { email },+ });+}++export async function verifyMagicLink({ token }: { token: string }) {+ const { accessToken } = await apiClient<{ accessToken: string }>({+ path: '/api/auth/magic-link/verification',+ method: 'POST',+ body: { token },+ });++ return { accessToken };+}diff --git a/apps/app-client/src/modules/auth/auth.store.ts b/apps/app-client/src/modules/auth/auth.store.tsnew file mode 100644index 00000000..62c14f5b--- /dev/null+++ b/apps/app-client/src/modules/auth/auth.store.ts@@ -0,0 +1,87 @@+import { safely } from '@corentinth/chisels';+import { makePersisted } from '@solid-primitives/storage';+import { createRoot, createSignal } from 'solid-js';+import { createHook, createWaitForHook } from '../shared/hooks/hooks';+import { isAccessTokenExpired } from './auth.models';+import { logout, requestAuthTokensRefresh } from './auth.services';++export const authStore = createRoot(() => {+ const [getAccessToken, setAccessTokenValue] = makePersisted(createSignal<string | null>(null), { name: 'papra_access_token', storage: localStorage });+ const onAuthChangeHook = createHook<{ isAuthenticated: boolean }>();+ const [getRedirectUrl, setRedirectUrl] = makePersisted(createSignal<string | null>(null), { name: 'papra_redirect_url', storage: localStorage });+ const [getIsRefreshTokenInProgress, setIsRefreshTokenInProgress] = createSignal(false);+ const [getMagicLinkRequestEmail, setMagicLinkRequestEmail] = createSignal<string | undefined>(undefined);++ const waitForRefreshTokenHook = createWaitForHook();++ const refreshToken = async () => {+ setIsRefreshTokenInProgress(true);++ const { accessToken } = await requestAuthTokensRefresh();++ setAccessTokenValue(accessToken);+ setIsRefreshTokenInProgress(false);+ waitForRefreshTokenHook.trigger();+ await onAuthChangeHook.trigger({ isAuthenticated: false });+ };++ const getIsAuthenticated = async () => {+ const accessToken = getAccessToken();++ if (!accessToken) {+ return false;+ }++ const isExpired = isAccessTokenExpired({ accessToken });++ if (isExpired && !getIsRefreshTokenInProgress()) {+ await safely(refreshToken());+ }++ return Boolean(getAccessToken());+ };++ const setAccessToken = async ({ accessToken }: { accessToken: string }) => {+ setAccessTokenValue(accessToken);+ await onAuthChangeHook.trigger({ isAuthenticated: true });+ };++ const clearAccessToken = async () => {+ setAccessTokenValue(null);+ await onAuthChangeHook.trigger({ isAuthenticated: false });+ };++ return {+ setAccessToken,+ getAccessToken,+ clearAccessToken,+ getIsAuthenticated,+ getRedirectUrl,+ setRedirectUrl,++ getIsRefreshTokenInProgress,+ setIsRefreshTokenInProgress,++ getMagicLinkRequestEmail,+ setMagicLinkRequestEmail,++ async waitForRefreshTokenToBeRefreshed() {+ if (!getIsRefreshTokenInProgress()) {+ return;+ }++ return waitForRefreshTokenHook.waitFor();+ },++ refreshToken,++ async logout() {+ await safely(logout());+ await clearAccessToken();++ window.location.href = '/login';+ },++ onAuthChange: onAuthChangeHook.on,+ };+});diff --git a/apps/app-client/src/modules/auth/magic-link/magic-link.models.ts b/apps/app-client/src/modules/auth/magic-link/magic-link.models.tsnew file mode 100644index 00000000..6ae960b1--- /dev/null+++ b/apps/app-client/src/modules/auth/magic-link/magic-link.models.ts@@ -0,0 +1,241 @@+const providers = [+ {+ name: 'Gmail',+ url: 'https://mail.google.com/',+ search: 'https://mail.google.com/mail/u/%{email}/#search/from%3A%{sender}+in%3Aanywhere+newer_than%3A1h',+ hosts: ['gmail.com', 'googlemail.com'],+ },++ {+ name: 'Yahoo!',+ url: 'https://mail.yahoo.com/',+ search: 'https://mail.yahoo.com/d/search/keyword=from%253A%{sender}',+ hosts: [+ 'yahoo.com',+ 'yahoo.es',+ 'yahoo.it',+ 'yahoo.de',+ 'yahoo.fr',+ 'yahoo.in',+ 'yahoo.ca',+ 'yahoo.com.br',+ 'yahoo.com.au',+ 'yahoo.com.ar',+ 'yahoo.com.mx',+ 'yahoo.com.sg',+ 'yahoo.co.id',+ 'yahoo.co.in',+ 'yahoo.co.jp',+ 'yahoo.co.uk',+ ],+ },++ {+ name: 'Fastmail',+ url: 'https://www.fastmail.com/mail/',+ search: 'https://app.fastmail.com/mail/search:from%3A%{sender}+date%3Atoday/',+ hosts: [+ '123mail.org',+ '150mail.com',+ '150ml.com',+ '16mail.com',+ '2-mail.com',+ '4email.net',+ '50mail.com',+ 'airpost.net',+ 'allmail.net',+ 'bestmail.us',+ 'cluemail.com',+ 'elitemail.org',+ 'emailcorner.net',+ 'emailengine.net',+ 'emailengine.org',+ 'emailgroups.net',+ 'emailplus.org',+ 'emailuser.net',+ 'eml.cc',+ 'f-m.fm',+ 'fast-email.com',+ 'fast-mail.org',+ 'fastem.com',+ 'fastemail.us',+ 'fastemailer.com',+ 'fastest.cc',+ 'fastimap.com',+ 'fastmail.cn',+ 'fastmail.co.uk',+ 'fastmail.com',+ 'fastmail.com.au',+ 'fastmail.de',+ 'fastmail.es',+ 'fastmail.fm',+ 'fastmail.fr',+ 'fastmail.im',+ 'fastmail.in',+ 'fastmail.jp',+ 'fastmail.mx',+ 'fastmail.net',+ 'fastmail.nl',+ 'fastmail.org',+ 'fastmail.se',+ 'fastmail.to',+ 'fastmail.tw',+ 'fastmail.uk',+ 'fastmail.us',+ 'fastmailbox.net',+ 'fastmessaging.com',+ 'fea.st',+ 'fmail.co.uk',+ 'fmailbox.com',+ 'fmgirl.com',+ 'fmguy.com',+ 'ftml.net',+ 'h-mail.us',+ 'hailmail.net',+ 'imap-mail.com',+ 'imap.cc',+ 'imapmail.org',+ 'inoutbox.com',+ 'internet-e-mail.com',+ 'internet-mail.org',+ 'internetemails.net',+ 'internetmailing.net',+ 'jetemail.net',+ 'justemail.net',+ 'letterboxes.org',+ 'mail-central.com',+ 'mail-page.com',+ 'mailandftp.com',+ 'mailas.com',+ 'mailbolt.com',+ 'mailc.net',+ 'mailcan.com',+ 'mailforce.net',+ 'mailftp.com',+ 'mailhaven.com',+ 'mailingaddress.org',+ 'mailite.com',+ 'mailmight.com',+ 'mailnew.com',+ 'mailsent.net',+ 'mailservice.ms',+ 'mailup.net',+ 'mailworks.org',+ 'ml1.net',+ 'mm.st',+ 'myfastmail.com',+ 'mymacmail.com',+ 'nospammail.net',+ 'ownmail.net',+ 'petml.com',+ 'postinbox.com',+ 'postpro.net',+ 'proinbox.com',+ 'promessage.com',+ 'realemail.net',+ 'reallyfast.biz',+ 'reallyfast.info',+ 'rushpost.com',+ 'sent.as',+ 'sent.at',+ 'sent.com',+ 'speedpost.net',+ 'speedymail.org',+ 'ssl-mail.com',+ 'swift-mail.com',+ 'the-fastest.net',+ 'the-quickest.com',+ 'theinternetemail.com',+ 'veryfast.biz',+ 'veryspeedy.net',+ 'warpmail.net',+ 'xsmail.com',+ 'yepmail.net',+ 'your-mail.com',+ ],+ },+ {+ name: 'ProtonMail',+ url: 'https://mail.proton.me/',+ search: 'https://mail.proton.me/u/0/all-mail#from=%{sender}&begin=%{timestamp}',+ hosts: ['protonmail.com', 'protonmail.ch', 'pm.me', 'proton.me'],+ },+ {+ name: 'Apple iCloud',+ url: 'https://www.icloud.com/mail/',+ search: 'https://www.icloud.com/mail/',+ hosts: ['icloud.com', 'me.com', 'mac.com'],+ },+ {+ name: 'Mail.ru',+ url: 'https://mail.ru/',+ search: 'https://mail.ru/',+ hosts: ['mail.ru', 'bk.ru', 'inbox.ru', 'list.ru'],+ },+ {+ name: 'AOL',+ url: 'https://aol.com/',+ search: 'https://aol.com/',+ hosts: ['aol.com'],+ },+ {+ name: 'Zoho',+ url: 'https://mail.zoho.com/',+ search: 'https://mail.zoho.com/',+ hosts: ['zohomail.com', 'zoho.com'],+ },+ {+ name: 'BOL',+ url: 'https://email.bol.uol.com.br/',+ search: 'https://email.bol.uol.com.br/',+ hosts: ['bol.com.br'],+ },+ {+ name: 'UOL',+ url: 'https://email.uol.com.br/',+ search: 'https://email.uol.com.br/',+ hosts: ['uol.com.br'],+ },+ {+ name: 'Outlook',+ url: 'https://outlook.live.com/mail/',+ search: 'https://outlook.live.com/mail/?login_hint=%{email}',+ hosts: ['outlook.com', 'hotmail.com'],+ },+ {+ name: 'Hey',+ url: 'https://app.hey.com/',+ search: 'https://app.hey.com/',+ hosts: ['hey.com'],+ },+ {+ name: 'Yandex',+ url: 'https://mail.yandex.com/',+ search: 'https://mail.yandex.com/',+ hosts: ['yandex.com'],+ },+ {+ name: 'Tuta',+ url: 'https://app.tuta.com/',+ search: 'https://app.tuta.com/search/mail?query=%{sender}&end=%{timestamp}',+ hosts: ['tutanota.com', 'tutanota.de', 'tutamail.com', 'tuta.io', 'tuta.com', 'keemail.me'],+ },+ {+ name: 'GMX',+ url: 'https://navigator-bs.gmx.com/mail',+ search: 'https://navigator-bs.gmx.com/mail',+ hosts: ['gmx.com', 'gmx.us'],+ },+];++export function getEmailProvider({ email }: { email?: string }) {+ if (!email) {+ return { provider: undefined };+ }++ const [, host] = email.trim().split('@');++ const provider = providers.find(provider => provider.hosts.includes(host));++ return { provider };+}diff --git a/apps/app-client/src/modules/auth/middleware/protected-page.middleware.tsx b/apps/app-client/src/modules/auth/middleware/protected-page.middleware.tsxnew file mode 100644index 00000000..304fa384--- /dev/null+++ b/apps/app-client/src/modules/auth/middleware/protected-page.middleware.tsx@@ -0,0 +1,30 @@+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';+import { Navigate } from '@solidjs/router';+import { type Component, createResource, Suspense } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { match } from 'ts-pattern';+import { authStore } from '../auth.store';++export function createProtectedPage({ authType, component }: { authType: 'public' | 'private' | 'public-only' | 'admin'; component: Component }) {+ return () => {+ const [getIsAuthenticated] = createResource(async () => await authStore.getIsAuthenticated());+ const { user } = ['public', 'public-only'].includes(authType) ? {} : useCurrentUser();++ return (+ <Suspense>+ {+ match({+ authType,+ isAuthenticated: getIsAuthenticated(),+ isAdmin: user?.roles.includes('admin'),+ })+ .with({ authType: 'private', isAuthenticated: false }, () => <Navigate href="/login" />)+ .with({ authType: 'public-only', isAuthenticated: true }, () => <Navigate href="/" />)+ .with({ authType: 'admin', isAuthenticated: false }, () => <Navigate href="/login" />)+ .with({ authType: 'admin', isAuthenticated: true, isAdmin: false }, () => <Navigate href="/" />)+ .otherwise(() => <Dynamic component={component} />)+ }+ </Suspense>+ );+ };+}diff --git a/apps/app-client/src/modules/auth/pages/confirm.page.tsx b/apps/app-client/src/modules/auth/pages/confirm.page.tsxnew file mode 100644index 00000000..2e263668--- /dev/null+++ b/apps/app-client/src/modules/auth/pages/confirm.page.tsx@@ -0,0 +1,43 @@+import type { Component } from 'solid-js';+import { useLocation, useNavigate } from '@solidjs/router';+import { createSignal, onMount } from 'solid-js';+import { authStore } from '../auth.store';++export const ConfirmPage: Component = () => {+ const [getError, setError] = createSignal<string | null>(null);++ const location = useLocation();+ const navigate = useNavigate();++ onMount(async () => {+ if (await authStore.getIsAuthenticated()) {+ navigate('/', { replace: true });+ return;+ }++ const { hash } = location;++ // Parse the hash to get the access token (same format as query string)+ const hashParams = new URLSearchParams(hash.slice(1));++ const accessToken = hashParams.get('accessToken');++ if (!accessToken) {+ setError('Access token not found');+ return;+ }++ await authStore.setAccessToken({ accessToken });++ navigate('/', { replace: true });+ });++ return (+ <div class="flex items-center justify-center h-screen flex-col gap-4">+ <div class="i-tabler-loader-2 animate-spin text-4xl text-muted-foreground"></div>+ <div class="text-lg font-semibold">Authenticating...</div>++ {getError() && <div class="text-red-500">{getError()}</div>}+ </div>+ );+};diff --git a/apps/app-client/src/modules/auth/pages/generic-auth.page.tsx b/apps/app-client/src/modules/auth/pages/generic-auth.page.tsxnew file mode 100644index 00000000..b7aa2ce1--- /dev/null+++ b/apps/app-client/src/modules/auth/pages/generic-auth.page.tsx@@ -0,0 +1,188 @@+import type { Component, ParentComponent } from 'solid-js';+import { config } from '@/modules/config/config';+import { createForm } from '@/modules/shared/form/form';+import { isHttpErrorWithStatusCode } from '@/modules/shared/http/http-errors';+import { useAsyncState } from '@/modules/shared/signals/async-state';+import { cn } from '@/modules/shared/style/cn';+import { createVitrineUrl } from '@/modules/shared/utils/urls';+import { Button } from '@/modules/ui/components/button';+import { Separator } from '@/modules/ui/components/separator';+import { toast } from '@/modules/ui/components/sonner';+import { TextField, TextFieldLabel, TextFieldRoot } from '@/modules/ui/components/textfield';+import { A, useNavigate } from '@solidjs/router';+import { createSignal, For, Show } from 'solid-js';+import { z } from 'zod';+import { requestMagicLink } from '../auth.services';+import { authStore } from '../auth.store';++const InlineLink: ParentComponent<{ href: string }> = props => (+ <Button variant="link" as={A} href={props.href} class="inline px-0">+ {props.children}+ </Button>+);++const SsoProviderButton: Component<{ name: string; icon: string; url: string; label: string }> = (props) => {+ const [getIsLoading, setIsLoading] = createSignal(false);++ const navigateToProvider = () => {+ setIsLoading(true);+ window.location.href = props.url;+ };++ return (+ <Button variant="secondary" class="block w-full flex items-center justify-center" onClick={navigateToProvider} disabled={getIsLoading()}>+ <span class={cn(`mr-2 text-lg inline-block`, getIsLoading() ? 'i-tabler-loader-2 animate-spin' : props.icon)} />+ {props.label}+ </Button>+ );+};++export const MagicLinkLinkForm: Component = () => {+ const navigate = useNavigate();++ const { getInputBindings, submit, onSubmit, getFieldError, getForm } = createForm({+ fields: {+ email: {+ schema: z.string().trim().email('Please enter a valid email address'),+ },+ },+ });++ const { execute: requestLink, getIsLoading, onSuccess, onError } = useAsyncState(requestMagicLink);++ onSubmit(async ({ email }) => {+ await requestLink({ email });+ });++ onSuccess(() => {+ authStore.setMagicLinkRequestEmail(getForm().email);+ navigate('/magic-link');+ });++ onError(({ error }) => {+ if (isHttpErrorWithStatusCode({ error, statusCode: 429 })) {+ toast.error('Too many magic link requests. Please try again later.');+ return;+ }++ toast.error('An error occurred while requesting the magic link. Please try again later.');+ });++ return (+ <div class="flex flex-col gap-3 w-full">+ <TextFieldRoot class="flex flex-col gap-2">+ <TextFieldLabel for="email">Email address</TextFieldLabel>+ <TextField type="email" id="email" placeholder="Eg. [email protected]" {...getInputBindings('email')} />+ <Show when={getFieldError('email')}>{getErrorMessage => <div class="text-red-500 text-sm">{getErrorMessage()}</div>}</Show>+ </TextFieldRoot>++ <Button onClick={submit} isLoading={getIsLoading()}>+ Continue with email++ <span class="i-tabler-arrow-right ml-2" />+ </Button>+ </div>+ );+};++export const GenericAuthPage: Component<{ type: 'login' | 'register' }> = (props) => {+ const { baseApiUrl } = config;++ const ssoProviders = [+ // {+ // name: 'Google',+ // icon: 'i-tabler-brand-google-filled',+ // url: new URL('/api/auth/google', baseApiUrl).toString(),+ // labels: {+ // login: 'Login with Google',+ // register: 'Register with Google',+ // },+ // },+ {+ name: 'GitHub',+ icon: 'i-tabler-brand-github',+ url: new URL('/api/auth/github', baseApiUrl).toString(),+ labels: {+ login: 'Login with GitHub',+ register: 'Register with GitHub',+ },+ },+ ];++ const byType = <L, R>({ login, register }: { login: L; register: R }): L | R => (props.type === 'login' ? login : register);++ if (!config.isRegistrationEnabled && props.type === 'register') {+ return (+ <div class="flex items-center justify-center min-h-screen p-6">+ <div class="max-w-sm w-full">+ <h1 class="text-xl font-bold">+ Registration is disabled+ </h1>+ <p class="text-muted-foreground mt-1 mb-2">+ Registration is disabled on this instance. Please contact your administrator for more information.+ </p>+ <p class="text-muted-foreground">+ Already have an account?+ {' '}+ <InlineLink href="/login">Login</InlineLink>+ </p>+ </div>+ </div>+ );+ }++ return (+ <div class="flex items-center justify-center min-h-screen p-6">+ <div class="max-w-sm w-full">+ <h1 class="text-xl font-bold">+ {byType({+ login: 'Login to Papra',+ register: 'Register to Papra',+ })}+ </h1>+ <p class="text-muted-foreground mt-1 mb-6">+ {byType({+ login: 'Enter your email or use social login to access your Papra account.',+ register: 'Enter your email or use social login to create your Papra account.',+ })}+ </p>++ <div class=" w-full flex flex-col gap-2">+ <For each={ssoProviders}>+ {provider => (+ <SsoProviderButton label={byType(provider.labels)} {...provider} />+ )}+ </For>+ </div>++ <Separator class="my-6" />++ {/* <MagicLinkLinkForm /> */}++ {/* <Separator class="my-6" /> */}++ <p class="text-muted-foreground">+ {byType({+ login: 'Don\'t have an account?',+ register: 'Already have an account?',+ })}+ {' '}+ <InlineLink href={byType({ login: '/register', register: '/login' })}>+ {byType({ login: 'Register', register: 'Login' })}+ </InlineLink>+ </p>++ <p class="text-muted-foreground mt-2">+ By continuing, you acknowledge that you understand and agree to the+ {' '}+ <InlineLink href={createVitrineUrl({ path: 'terms-of-service' })}>Terms of Service</InlineLink>+ {' '}+ and+ {' '}+ <InlineLink href={createVitrineUrl({ path: 'privacy-policy' })}>Privacy Policy</InlineLink>+ .+ </p>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/auth/pages/magic-link-sent.page.tsx b/apps/app-client/src/modules/auth/pages/magic-link-sent.page.tsxnew file mode 100644index 00000000..c35e5a47--- /dev/null+++ b/apps/app-client/src/modules/auth/pages/magic-link-sent.page.tsx@@ -0,0 +1,58 @@+import { Button } from '@/modules/ui/components/button';+import { A } from '@solidjs/router';+import { Show } from 'solid-js';+import { authStore } from '../auth.store';+import { getEmailProvider } from '../magic-link/magic-link.models';+import { createProtectedPage } from '../middleware/protected-page.middleware';++export const MagicLinkSentPage = createProtectedPage({+ authType: 'public-only',+ component: () => {+ const { getMagicLinkRequestEmail } = authStore;++ const getProvider = () => {+ const { provider } = getEmailProvider({ email: getMagicLinkRequestEmail() });++ if (!provider) {+ return undefined;+ }++ return provider;+ };++ return (+ <div class="flex items-center justify-center min-h-screen">+ <div class="max-w-sm w-full">+ <div class="flex flex-col items-start py-8">+ <div class="i-tabler-mail-check text-7xl text-primary" />+ <h2 class="text-2xl font-semibold my-3">Magic link sent</h2>+ <p class="text-muted-foreground">+ We've sent you a magic link to+ {' '}+ <span class="text-primary">{getMagicLinkRequestEmail() ?? 'your email'}</span>+ .+ </p>+ <p class="text-muted-foreground">Click on the link in the email to login.</p>++ <div class="w-full flex gap-2 mt-6">+ <Show when={getProvider()}>+ {providerUrl => (+ <Button as="a" href={providerUrl().url} target="_blank" rel="noopener noreferrer">+ Open+ {' '}+ {providerUrl().name}+ <span class="i-tabler-external-link ml-2 text-lg" />+ </Button>+ )}+ </Show>++ <Button as={A} href="/login" variant="secondary" class="flex items-center justify-center">+ Go back to login+ </Button>+ </div>+ </div>+ </div>+ </div>+ );+ },+});diff --git a/apps/app-client/src/modules/auth/pages/verify-magic-link.page.tsx b/apps/app-client/src/modules/auth/pages/verify-magic-link.page.tsxnew file mode 100644index 00000000..506b7156--- /dev/null+++ b/apps/app-client/src/modules/auth/pages/verify-magic-link.page.tsx@@ -0,0 +1,56 @@+import { useAsyncState } from '@/modules/shared/signals/async-state';+import { Button } from '@/modules/ui/components/button';+import { A, useNavigate, useParams } from '@solidjs/router';+import { createSignal } from 'solid-js';+import { verifyMagicLink } from '../auth.services';+import { authStore } from '../auth.store';+import { createProtectedPage } from '../middleware/protected-page.middleware';++export const PendingMagicLinkPage = createProtectedPage({+ authType: 'public-only',+ component: () => {+ const params = useParams();+ const navigate = useNavigate();++ const [getHasError, setHasError] = createSignal(false);++ const { execute, onSuccess, onError } = useAsyncState(verifyMagicLink);++ execute({ token: params.token });++ onSuccess(async ({ data: { accessToken } }) => {+ await authStore.setAccessToken({ accessToken });++ navigate('/', { replace: true });+ });++ onError(() => {+ setHasError(true);+ });++ return (+ <div class="flex items-center justify-center h-screen flex-col gap-4">+ {getHasError()+ ? (+ <>+ <div class="i-tabler-alert-triangle text-4xl text-red-500" />+ <div class="text-lg font-semibold">Invalid or expired magic link</div>++ <div>+ <Button as={A} href="/login" variant="secondary" class="block w-full flex items-center justify-center">+ Go back to login+ <span class="i-tabler-arrow-right ml-2 text-lg " />+ </Button>+ </div>+ </>+ )+ : (+ <>+ <div class="i-tabler-loader-2 animate-spin text-4xl text-muted-foreground"></div>+ <div class="text-lg font-semibold">Authenticating...</div>+ </>+ )}+ </div>+ );+ },+});diff --git a/apps/app-client/src/modules/config/config.ts b/apps/app-client/src/modules/config/config.tsnew file mode 100644index 00000000..977bee7e--- /dev/null+++ b/apps/app-client/src/modules/config/config.ts@@ -0,0 +1,7 @@+export const config = {+ baseApiUrl: (import.meta.env.VITE_BASE_API_URL ?? 'http://localhost:1221/') as string,+ vitrineBaseUrl: (import.meta.env.VITE_VITRINE_BASE_URL ?? 'http://localhost:3000/') as string,+ isRegistrationEnabled: import.meta.env.VITE_IS_REGISTRATION_ENABLED === 'true',+} as const;++export type Config = typeof config;diff --git a/apps/app-client/src/modules/documents/components/document-upload-area.component.tsx b/apps/app-client/src/modules/documents/components/document-upload-area.component.tsxnew file mode 100644index 00000000..17e35d98--- /dev/null+++ b/apps/app-client/src/modules/documents/components/document-upload-area.component.tsx@@ -0,0 +1,76 @@+import type { Component } from 'solid-js';+import { queryClient } from '@/modules/shared/query/query-client';+import { cn } from '@/modules/shared/style/cn';+import { Button } from '@/modules/ui/components/button';+import { useParams } from '@solidjs/router';+import { createSignal } from 'solid-js';+import { uploadDocument } from '../documents.services';++export const DocumentUploadArea: Component<{ organizationId?: string }> = (props) => {+ const [isDragging, setIsDragging] = createSignal(false);+ const params = useParams();++ const getOrganizationId = () => props.organizationId ?? params.organizationId;++ const uploadFiles = async ({ files }: { files: File[] }) => {+ for (const file of files) {+ await uploadDocument({ file, organizationId: getOrganizationId() });+ }++ await queryClient.invalidateQueries({+ queryKey: ['organizations', getOrganizationId(), 'documents'],+ refetchType: 'all',+ });+ };++ const promptImport = () => {+ const input = document.createElement('input');+ input.type = 'file';+ input.accept = '.pdf';+ input.multiple = true;+ input.onchange = async () => {+ if (!input.files) {+ return;+ }+ await uploadFiles({ files: [...input.files] });+ };+ input.click();+ };++ const handleDragOver = (event: DragEvent) => {+ event.preventDefault();+ setIsDragging(true);+ };++ const handleDragLeave = () => {+ setIsDragging(false);+ };++ const handleDrop = async (event: DragEvent) => {+ event.preventDefault();+ setIsDragging(false);+ if (!event.dataTransfer?.files) {+ return;+ }++ const files = [...event.dataTransfer.files].filter(file => file.type === 'application/pdf');+ await uploadFiles({ files });+ };++ return (+ <div+ class={cn('border border-[2px] border-dashed text-muted-foreground rounded-lg p-6 sm:py-16 flex flex-col items-center justify-center text-center', { 'border-primary': isDragging() })}+ onDragOver={handleDragOver}+ onDragLeave={handleDragLeave}+ onDrop={handleDrop}+ >+ <div class="i-tabler-cloud-upload size-12 mb-4"></div>+ <p>{isDragging() ? 'Drop files to upload' : 'Drag and drop files here to upload'}</p>++ <Button class="mt-4" variant="outline" onClick={promptImport}>+ <div class="i-tabler-upload mr-2"></div>+ Select files+ </Button>+ </div>+ );+};diff --git a/apps/app-client/src/modules/documents/document.models.test.ts b/apps/app-client/src/modules/documents/document.models.test.tsnew file mode 100644index 00000000..141e731a--- /dev/null+++ b/apps/app-client/src/modules/documents/document.models.test.ts@@ -0,0 +1,82 @@+import { icons as tablerIconSet } from '@iconify-json/tabler';+import { values } from 'lodash-es';+import { describe, expect, test } from 'vitest';+import { getDocumentIcon, iconByFileType } from './document.models';++describe('files models', () => {+ describe('iconByFileType', () => {+ const icons = values(iconByFileType);++ test('they must at least have the default icon', () => {+ expect(iconByFileType['*']).toBeDefined();+ });++ test('all the icons should be from tabler icon set', () => {+ for (const icon of icons) {+ expect(icon).to.match(/^i-tabler-/, `Icon ${icon} is not from tabler icon set`);+ }+ });++ test('icons should not contain any spaces', () => {+ for (const icon of icons) {+ expect(icon).not.to.match(/\s/, `Icon ${icon} contains spaces`);+ }+ });++ test('the icons used for showing file types should exists with current iconify configuration', () => {+ for (const icon of icons) {+ const iconName = icon.replace('i-tabler-', '');+ const iconData = tablerIconSet.icons[iconName] ?? tablerIconSet.aliases?.[iconName];++ expect(iconData).to.not.eql(undefined, `Icon ${icon} does not exist in tabler icon set`);+ }+ });+ });++ describe('getFileIcon', () => {+ test('a file icon is selected based on the file type', () => {+ const document = { mimeType: 'text/plain' };+ const iconsMap = {+ '*': 'i-tabler-file',+ 'text/plain': 'i-tabler-file-text',+ };+ const icon = getDocumentIcon({ document, iconsMap });++ expect(icon).to.eql('i-tabler-file-text');+ });++ test('if a file type is not associated with an icon, the default icon is used', () => {+ const document = { mimeType: 'text/html' };+ const iconsMap = {+ '*': 'i-tabler-file',+ 'text/plain': 'i-tabler-file-text',+ };+ const icon = getDocumentIcon({ document, iconsMap });++ expect(icon).to.eql('i-tabler-file');+ });++ test('a file icon can be selected based on the file type group', () => {+ const document = { mimeType: 'text/html' };+ const iconsMap = {+ '*': 'i-tabler-file',+ 'text': 'i-tabler-file-text',+ };+ const icon = getDocumentIcon({ document, iconsMap });++ expect(icon).to.eql('i-tabler-file-text');+ });++ test('when an icon is defined for both the whole type and the group type, the file type icon is used', () => {+ const document = { mimeType: 'text/html' };+ const iconsMap = {+ '*': 'i-tabler-file',+ 'text': 'i-tabler-file-text',+ 'text/html': 'i-tabler-file-type-html',+ };+ const icon = getDocumentIcon({ document, iconsMap });++ expect(icon).to.eql('i-tabler-file-type-html');+ });+ });+});diff --git a/apps/app-client/src/modules/documents/document.models.ts b/apps/app-client/src/modules/documents/document.models.tsnew file mode 100644index 00000000..cc394559--- /dev/null+++ b/apps/app-client/src/modules/documents/document.models.ts@@ -0,0 +1,37 @@+export const iconByFileType = {+ '*': 'i-tabler-file',+ 'image': 'i-tabler-photo',+ 'video': 'i-tabler-video',+ 'audio': 'i-tabler-file-music',+ 'application': 'i-tabler-file-code',+ 'application/pdf': 'i-tabler-file-type-pdf',+ 'application/zip': 'i-tabler-file-zip',+ 'application/vnd.ms-excel': 'i-tabler-file-excel',+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'i-tabler-file-excel',+ 'application/msword': 'i-tabler-file-word',+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'i-tabler-file-word',+ 'application/json': 'i-tabler-file-code',+ 'application/xml': 'i-tabler-file-code',+ 'application/javascript': 'i-tabler-file-type-js',+ 'application/typescript': 'i-tabler-file-type-ts',+ 'application/vnd.ms-powerpoint': 'i-tabler-file-type-ppt',+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'i-tabler-file-type-ppt',+ 'text/plain': 'i-tabler-file-text',+ 'text/html': 'i-tabler-file-type-html',+ 'text/css': 'i-tabler-file-type-css',+ 'text/csv': 'i-tabler-file-type-csv',+ 'text/xml': 'i-tabler-file-type-xml',+ 'text/javascript': 'i-tabler-file-type-js',+ 'text/typescript': 'i-tabler-file-type-ts',+};++type FileTypes = keyof typeof iconByFileType;++export function getDocumentIcon({ document, iconsMap = iconByFileType }: { document: { mimeType: string }; iconsMap?: Record<string, string> & { '*': string } }): string {+ const { mimeType } = document;+ const fileTypeGroup = mimeType?.split('/')[0];++ const icon = iconsMap[mimeType as FileTypes] ?? iconsMap[fileTypeGroup as FileTypes] ?? iconsMap['*'];++ return icon;+}diff --git a/apps/app-client/src/modules/documents/documents.services.ts b/apps/app-client/src/modules/documents/documents.services.tsnew file mode 100644index 00000000..e4d90f31--- /dev/null+++ b/apps/app-client/src/modules/documents/documents.services.ts@@ -0,0 +1,54 @@+import type { Document } from './documents.types';+import { apiClient } from '../shared/http/http-client';++export async function uploadDocument({+ file,+ organizationId,++}: {+ file: File;+ organizationId: string;+}) {+ const { document } = await apiClient<{ document: Document }>({+ method: 'POST',+ path: `/api/organizations/${organizationId}/documents`,+ formData: {+ file,+ },+ });++ return {+ document: {+ ...document,+ createdAt: new Date(document.createdAt),+ updatedAt: document.updatedAt ? new Date(document.updatedAt) : undefined,+ },+ };+}++export async function fetchOrganizationDocuments({+ organizationId,+ pageIndex,+ pageSize,+}: {+ organizationId: string;+ pageIndex: number;+ pageSize: number;+}) {+ const { documents } = await apiClient<{ documents: Document[] }>({+ method: 'GET',+ path: `/api/organizations/${organizationId}/documents`,+ queryParams: {+ pageIndex,+ pageSize,+ },+ });++ return {+ documents: documents.map(document => ({+ ...document,+ createdAt: new Date(document.createdAt),+ updatedAt: document.updatedAt ? new Date(document.updatedAt) : undefined,+ })),+ };+}diff --git a/apps/app-client/src/modules/documents/documents.types.ts b/apps/app-client/src/modules/documents/documents.types.tsnew file mode 100644index 00000000..5d0986cf--- /dev/null+++ b/apps/app-client/src/modules/documents/documents.types.ts@@ -0,0 +1,8 @@+export type Document = {+ id: string;+ organizationId: string;+ name: string;+ mimeType: string;+ createdAt: Date;+ updatedAt?: Date;+};diff --git a/apps/app-client/src/modules/documents/pages/documents.page.tsx b/apps/app-client/src/modules/documents/pages/documents.page.tsxnew file mode 100644index 00000000..724c2987--- /dev/null+++ b/apps/app-client/src/modules/documents/pages/documents.page.tsx@@ -0,0 +1,103 @@+import { timeAgo } from '@/modules/shared/date/time-ago';+import { cn } from '@/modules/shared/style/cn';+import { Badge } from '@/modules/ui/components/badge';+import { Card } from '@/modules/ui/components/card';+import { Tooltip, TooltipContent, TooltipTrigger } from '@/modules/ui/components/tooltip';+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';+import { A, useParams } from '@solidjs/router';+import { createQueries, createQuery, keepPreviousData } from '@tanstack/solid-query';+import { type Component, createSignal } from 'solid-js';+import { DocumentUploadArea } from '../components/document-upload-area.component';+import { getDocumentIcon } from '../document.models';+import { fetchOrganizationDocuments } from '../documents.services';++export const DocumentsPage: Component = () => {+ const [getPagination] = createSignal({ pageIndex: 0, pageSize: 100 });+ const params = useParams();++ const query = createQueries(() => ({+ queries: [+ {+ queryKey: ['organizations', params.organizationId, 'documents', getPagination()],+ queryFn: () => fetchOrganizationDocuments({+ organizationId: params.organizationId,+ ...getPagination(),+ }),+ placeholderData: keepPreviousData,+ },+ ],+ }));++ return (+ <div class="p-6 mt-4 pb-32">++ {query[0].data?.documents.length === 0+ ? (+ <>+ <h2 class="text-xl font-bold ">+ No documents+ </h2>++ <p class="text-muted-foreground mt-1 mb-6">+ There are no documents in this organization yet. Start by uploading some documents.+ </p>++ <DocumentUploadArea />++ </>+ )+ : (+ <>+ <h2 class="text-xl font-bold mb-6">+ Latest imports+ </h2>+ <div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 xl:grid-cols-6">+ {query[0].data?.documents.map(document => (+ <div class="border rounded-lg overflow-hidden">+ <div class="bg-card border-b flex items-center justify-center p-6">+ <div class={cn(getDocumentIcon({ document }), 'size-16 text-muted-foreground')}></div>+ </div>++ <div class="p-4">++ <Tooltip>+ <TooltipTrigger class="w-full text-left">+ <A+ href={`/organizations/${params.organizationId}/documents/${document.id}`}+ class="text-xs font-bold truncate block"+ >+ {document.name.split('.').shift()}+ </A>+ </TooltipTrigger>+ <TooltipContent>+ {document.name}+ </TooltipContent>+ </Tooltip>++ <div class="text-xs text-muted-foreground mt-1">+ <Badge variant="secondary" class="px-2">+ {document.name.split('.').pop()?.toUpperCase()}+ </Badge>+ {' '}+ -+ {' '}+ <Tooltip>+ <TooltipTrigger>+ {timeAgo({ date: document.createdAt })}+ </TooltipTrigger>+ <TooltipContent>+ {document.createdAt.toLocaleString()}+ </TooltipContent>+ </Tooltip>+ </div>+ </div>+ </div>+ ))}++ </div>+ </>++ )}+ </div>+ );+};diff --git a/apps/app-client/src/modules/organizations/composables/useCurrentOrganization.tsx b/apps/app-client/src/modules/organizations/composables/useCurrentOrganization.tsxnew file mode 100644index 00000000..7ad7804e--- /dev/null+++ b/apps/app-client/src/modules/organizations/composables/useCurrentOrganization.tsx@@ -0,0 +1,49 @@+import type { ParentComponent } from 'solid-js';+import type { Organization } from '../organizations.types';+import { makePersisted } from '@solid-primitives/storage';+import { createQuery } from '@tanstack/solid-query';+import { createContext, createEffect, createSignal, onCleanup, onMount, Show, useContext } from 'solid-js';+import { fetchOrganizations } from '../organizations.services';++const currentOrganizationContext = createContext<{+ organizations: Organization[];+ getCurrentOrganization: () => Organization;+ setCurrentOrganization: ({ organizationId }: { organizationId: string }) => void;+}>();++export function useCurrentOrganization() {+ const context = useContext(currentOrganizationContext);++ if (!context) {+ throw new Error('useCurrentOrganization must be used within a CurrentOrganizationProvider');+ }++ return context;+}++export const CurrentOrganizationProvider: ParentComponent = (props) => {+ const [getCurrentOrganizationId, setCurrentOrganizationId] = makePersisted(createSignal<string | null>(null), { name: 'papra_current_organization_id', storage: localStorage });++ const query = createQuery(() => ({+ queryKey: ['organizations'],+ queryFn: fetchOrganizations,+ }));++ return (+ <Show when={query.data}>+ {getData => (+ <currentOrganizationContext.Provider+ value={{+ organizations: getData().organizations,+ getCurrentOrganization: () => getData().organizations.find(organization => organization.id === getCurrentOrganizationId()) ?? getData().organizations[0],+ setCurrentOrganization: ({ organizationId }) => {+ setCurrentOrganizationId(organizationId);+ },+ }}+ >+ {props.children}+ </currentOrganizationContext.Provider>+ )}+ </Show>+ );+};diff --git a/apps/app-client/src/modules/organizations/organizations.services.ts b/apps/app-client/src/modules/organizations/organizations.services.tsnew file mode 100644index 00000000..74c624a9--- /dev/null+++ b/apps/app-client/src/modules/organizations/organizations.services.ts@@ -0,0 +1,33 @@+import type { Organization } from './organizations.types';+import { apiClient } from '../shared/http/http-client';++export async function fetchOrganizations() {+ const { organizations } = await apiClient<{ organizations: Organization[] }>({+ path: '/api/organizations',+ method: 'GET',+ });++ return {+ organizations: organizations.map(organization => ({+ ...organization,+ createdAt: new Date(organization.createdAt),+ updatedAt: organization.updatedAt ? new Date(organization.updatedAt) : undefined,+ })),+ };+}++export async function createOrganization({ name }: { name: string }) {+ const { organization } = await apiClient<{ organization: Organization }>({+ path: '/api/organizations',+ method: 'POST',+ body: { name },+ });++ return {+ organization: {+ ...organization,+ createdAt: new Date(organization.createdAt),+ updatedAt: organization.updatedAt ? new Date(organization.updatedAt) : undefined,+ },+ };+}diff --git a/apps/app-client/src/modules/organizations/organizations.types.ts b/apps/app-client/src/modules/organizations/organizations.types.tsnew file mode 100644index 00000000..ac9cdac3--- /dev/null+++ b/apps/app-client/src/modules/organizations/organizations.types.ts@@ -0,0 +1,2 @@++export type Organization = { id: string; name: string, createdAt: Date, updatedAt?: Date };diff --git a/apps/app-client/src/modules/organizations/pages/create-organization.page.tsx b/apps/app-client/src/modules/organizations/pages/create-organization.page.tsxnew file mode 100644index 00000000..5b3d7899--- /dev/null+++ b/apps/app-client/src/modules/organizations/pages/create-organization.page.tsx@@ -0,0 +1,60 @@+import { createForm } from '@/modules/shared/form/form';+import { Button } from '@/modules/ui/components/button';+import { TextField, TextFieldLabel, TextFieldRoot } from '@/modules/ui/components/textfield';+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';+import { A, useNavigate } from '@solidjs/router';+import { type Component, Show } from 'solid-js';+import { z } from 'zod';+import { createOrganization } from '../organizations.services';++export const CreateOrganizationPage: Component = () => {+ const navigate = useNavigate();++ const { getInputBindings, submit, onSubmit, getFieldError, getIsSubmitting } = createForm({+ fields: {+ name: {+ schema: z.string()+ .min(3, 'Organization name must be at least 3 characters')+ .max(50, 'Organization name must be at most 50 characters'),+ },+ },+ });++ onSubmit(async ({ name }) => {+ const { organization } = await createOrganization({ name });++ navigate(`/organizations/${organization.id}`);+ });++ return (+ <div>+ <div class="max-w-lg mx-auto sm:mt-16 p-6">++ <Button as={A} href="/" class="mb-4" variant="outline">+ <div class="i-tabler-arrow-left mr-2"></div>+ Back+ </Button>++ <h1 class="text-xl font-bold">+ Create a new organization+ </h1>++ <p class="text-muted-foreground mb-6">+ Your documents will be grouped by organization. You can create multiple organizations to separate your documents.+ </p>++ <form onSubmit={submit}>+ <TextFieldRoot class="flex flex-col gap-1 mb-6">+ <TextFieldLabel for="name">Organization name</TextFieldLabel>+ <TextField type="text" id="name" placeholder="Eg. Acme Inc." {...getInputBindings('name')} />+ <Show when={getFieldError('name')}>{getErrorMessage => <div class="text-red-500 text-sm">{getErrorMessage()}</div>}</Show>+ </TextFieldRoot>++ <Button onClick={submit} isLoading={getIsSubmitting()} type="submit">+ Create organization+ </Button>+ </form>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/organizations/pages/organizations.page.tsx b/apps/app-client/src/modules/organizations/pages/organizations.page.tsxnew file mode 100644index 00000000..7cfb51a4--- /dev/null+++ b/apps/app-client/src/modules/organizations/pages/organizations.page.tsx@@ -0,0 +1,41 @@+import type { Component } from 'solid-js';+import { A } from '@solidjs/router';+import { createQuery } from '@tanstack/solid-query';+import { fetchOrganizations } from '../organizations.services';++export const OrganizationsPage: Component = () => {+ const queries = createQuery(() => ({+ queryKey: ['organizations'],+ queryFn: fetchOrganizations,+ }));++ return (+ <div class="p-6 mt-4 pb-32">+ <h2 class="text-xl font-bold mb-6">+ Organizations+ </h2>++ <div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">+ {queries.data?.organizations.map(organization => (+ <div class="border rounded-lg overflow-hidden">+ <div class="bg-card border-b flex items-center justify-center p-6">+ <div class="size-16 text-muted-foreground"></div>+ </div>++ <div class="p-4">++ <div class="w-full text-left">+ <A+ href={`/organizations/${organization.id}`}+ class="text-xs font-bold truncate block"+ >+ {organization.name}+ </A>+ </div>+ </div>+ </div>+ ))}+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/payments/pages/checkout-cancel.page.tsx b/apps/app-client/src/modules/payments/pages/checkout-cancel.page.tsxnew file mode 100644index 00000000..dfd1d0f7--- /dev/null+++ b/apps/app-client/src/modules/payments/pages/checkout-cancel.page.tsx@@ -0,0 +1,14 @@+import type { Component } from 'solid-js';+import { Navigate } from '@solidjs/router';+import { onMount } from 'solid-js';+import { toast } from '../../ui/components/sonner';++export const CheckoutCancelPage: Component = () => {+ onMount(() => {+ toast.error('Payment canceled');+ });++ return (+ <Navigate href="/upgrade-plan" />+ );+};diff --git a/apps/app-client/src/modules/payments/pages/checkout-success.page.tsx b/apps/app-client/src/modules/payments/pages/checkout-success.page.tsxnew file mode 100644index 00000000..adfe7049--- /dev/null+++ b/apps/app-client/src/modules/payments/pages/checkout-success.page.tsx@@ -0,0 +1,57 @@+import { createProtectedPage } from '@/modules/auth/middleware/protected-page.middleware';+import { useAsyncState } from '@/modules/shared/signals/async-state';+import { useNavigate, useSearchParams } from '@solidjs/router';+import { onMount, Suspense } from 'solid-js';+import { match, P } from 'ts-pattern';+import { getCheckoutSessionStatus } from '../payments.services';++export const CheckoutSuccessPage = createProtectedPage({+ authType: 'private',+ component: () => {+ const [searchParams] = useSearchParams();+ const { execute, getStatus, onSuccess } = useAsyncState(getCheckoutSessionStatus);+ const navigate = useNavigate();++ onMount(() => {+ const sessionId = searchParams.sessionId;++ if (!sessionId || typeof sessionId !== 'string') {+ return console.error('No sessionId found in search params');+ }++ execute({ sessionId });+ });++ onSuccess(async () => {+ setTimeout(() => navigate('/'), 2000);+ });++ return (+ <div class="text-center">+ <Suspense>+ {match({ status: getStatus() })+ .with({ status: P.union('idle', 'loading') }, () => (+ <div class="flex items-center justify-center h-screen flex-col gap-2">+ <div class="i-tabler-loader-2 animate-spin text-4xl text-neutral-600" />+ <div class="text-lg font-semibold">Processing payment...</div>+ </div>+ ))+ .with({ status: 'error' }, () => (+ <div class="flex items-center justify-center h-screen flex-col gap-2">+ <div class="i-tabler-alert-triangle text-4xl text-red-500" />+ <div class="text-lg font-semibold">An error occurred, please try again later</div>+ </div>+ ))+ .with({ status: 'success' }, () => (+ <div class="flex items-center justify-center h-screen flex-col gap-2">+ <div class="i-tabler-check text-4xl text-green-500" />+ <div class="text-lg font-semibold">Payment successful</div>+ <p class="text-neutral-500">Redirecting to your dashboard...</p>+ </div>+ ))+ .exhaustive()}+ </Suspense>+ </div>+ );+ },+});diff --git a/apps/app-client/src/modules/payments/pages/upgrade-plan.page.tsx b/apps/app-client/src/modules/payments/pages/upgrade-plan.page.tsxnew file mode 100644index 00000000..f82624ac--- /dev/null+++ b/apps/app-client/src/modules/payments/pages/upgrade-plan.page.tsx@@ -0,0 +1,189 @@+import type { Component, ComponentProps, ParentComponent } from 'solid-js';+import { isHttpErrorWithCode } from '@/modules/shared/http/http-errors';+import { Badge } from '@/modules/ui/components/badge';+import { Button } from '@/modules/ui/components/button';+import { Card } from '@/modules/ui/components/card';+import { toast } from '@/modules/ui/components/sonner';+import { Tabs, TabsIndicator, TabsList, TabsTrigger } from '@/modules/ui/components/tabs';+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';+import { createSignal, splitProps } from 'solid-js';+import { getCheckoutUrl } from '../payments.services';++const plansDetails = [+ {+ id: 'free',+ name: 'Free',+ prices: {+ monthly: 0,+ yearly: 0,+ },+ features: [+ '500 docs renderings per month',+ 'No watermark',+ 'Privacy and security',+ 'Customer support',+ ],+ drawbacks: [+ 'Rendering priority',+ ],+ tags: [],+ },+ {+ id: 'starter',+ name: 'Starter',+ prices: {+ monthly: 15,+ yearly: 10, // 120 / 12,+ },+ features: [+ '5,000 docs renderings per month',+ 'No watermark',+ 'Privacy and security',+ 'Customer support',+ 'Rendering priority',+ ],+ drawbacks: [],+ tags: ['Popular'],+ },+ {+ id: 'enterprise',+ name: 'Enterprise',+ prices: {+ monthly: 120,+ yearly: 100, // 1200 / 12,+ },+ features: [+ '15,000 docs renderings per month',+ 'No watermark',+ 'Privacy and security',+ 'Priority customer support',+ 'Rendering priority',+ ],+ drawbacks: [],+ tags: [],+ },+];++const PlanButton: ParentComponent<ComponentProps<typeof Button>> = (props) => {+ const [getIsLoading, setIsLoading] = createSignal(false);+ const [local, rest] = splitProps(props, ['onClick']);++ const handleClick = async () => {+ setIsLoading(true);+ await local.onClick();+ setIsLoading(false);+ };++ return (+ <Button class="w-full" {...rest} onClick={handleClick} isLoading={getIsLoading()} />+ );+};++export const UpgradePlanPage: Component = () => {+ const { user } = useCurrentUser();+ const [getBillingInterval, setBillingInterval] = createSignal<'monthly' | 'yearly'>('yearly');++ const onPlanChoose = async ({ planId }: { planId: string }) => {+ try {+ const { checkoutUrl } = await getCheckoutUrl({ planId, billingInterval: getBillingInterval() });++ window.location.href = checkoutUrl;+ } catch (error) {+ if (isHttpErrorWithCode({ error, code: 'payment.customer_already_has_subscription' })) {+ toast.error('You already have an active subscription');+ return;+ }++ toast.error('An error occurred while processing your request');+ }+ };++ return (+ <div class="p-6 max-w-5xl mx-auto mt-4">+ <h1 class="text-3xl font-bold text-center mb-2">Upgrade your plan</h1>+ <p class="text-center text-muted-foreground mb-8 max-w-lg mx-auto text-pretty">+ Choose the plan that best fits your needs. You can change your plan at any time, no strings attached.+ </p>++ <div class="mb-10 max-w-72 mx-auto">+ <Tabs value={getBillingInterval()} onChange={setBillingInterval}>+ <TabsList>+ <TabsTrigger value="monthly">+ Monthly+ </TabsTrigger>+ <TabsTrigger value="yearly">+ <div class="flex items-baseline gap-3">+ Yearly+ <span class="text-muted-foreground text-xs">20% off</span>+ </div>+ </TabsTrigger>+ <TabsIndicator />+ </TabsList>+ </Tabs>+ </div>++ <div class="grid grid-cols-1 gap-6 lg:grid-cols-3">+ {plansDetails.map(plan => (+ <Card class="p-6">+ <div>+ <div class="flex justify-between items-center">+ <h2 class="text-xl font-bold">{plan.name}</h2>+ {plan.tags.map(tag => (+ <Badge variant="secondary">+ {tag}+ </Badge>+ ))}+ </div>++ <div class="flex items-baseline gap-2 mt-2 mb-8">+ <div class="text-4xl font-bold">+ {`\$${plan.prices[getBillingInterval()]}`}+ </div>+ <div class="text-muted-foreground text-sm">/ month</div>+ </div>+ </div>+ <div class=" flex flex-col gap-2">+ {plan.features.map(feature => (+ <div class="flex items-center gap-2">+ <div class="i-tabler-check size-4 "></div>+ <div>{feature}</div>+ </div>+ ))}++ {plan.drawbacks && plan.drawbacks.map(drawback => (+ <div class="flex items-center gap-2 text-muted-foreground">+ <div class="i-tabler-x size-4 "></div>+ <div>{drawback}</div>+ </div>+ ))}++ </div>+ <div class="mt-8">+ {user.planId === plan.id+ ? (+ <Button variant="outline" class="w-full" disabled>+ Current plan+ </Button>+ )+ : (+ <PlanButton class="w-full" onClick={() => onPlanChoose({ planId: plan.id })}>+ Choose plan+ </PlanButton>+ )}+ </div>+ </Card>+ ))}+ </div>++ <div class="text-center mt-16">+ <h2 class="text-xl font-bold">Do you need a custom plan?</h2>+ <p class="max-w-lg mx-auto text-muted-foreground text-pretty mt-2">+ We can create a custom plan that fits your needs. Contact us to get started.+ </p>+ <Button variant="outline" class="mt-4">+ Contact us+ </Button>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/payments/payments.models.ts b/apps/app-client/src/modules/payments/payments.models.tsnew file mode 100644index 00000000..61744fc1--- /dev/null+++ b/apps/app-client/src/modules/payments/payments.models.ts@@ -0,0 +1,3 @@+export function getIsRenderingQuotaReached({ maxRenderingsPerMonth, renderingsCount }: { maxRenderingsPerMonth: number; renderingsCount: number }) {+ return renderingsCount >= maxRenderingsPerMonth;+}diff --git a/apps/app-client/src/modules/payments/payments.services.ts b/apps/app-client/src/modules/payments/payments.services.tsnew file mode 100644index 00000000..90b54ae4--- /dev/null+++ b/apps/app-client/src/modules/payments/payments.services.ts@@ -0,0 +1,89 @@+import type { Invoice } from './payments.types';+import { map } from 'lodash-es';+import { apiClient } from '../shared/http/http-client';++export async function getCheckoutUrl({ planId, billingInterval }: { planId: string; billingInterval: string }) {+ const { checkoutUrl } = await apiClient<{ checkoutUrl: string }>({+ method: 'POST',+ path: `/api/payments/checkout-session`,+ body: {+ billingInterval,+ planId,+ },+ });++ return { checkoutUrl };+}++export async function getCheckoutSessionStatus({ sessionId }: { sessionId: string }) {+ const { isPaid, status } = await apiClient<{+ isPaid: boolean;+ status: string;+ }>({+ method: 'GET',+ path: `/api/payments/checkout-session/${sessionId}`,+ });++ return { isPaid, status };+}++export async function fetchUserSubscription() {+ const { subscription, planId } = await apiClient<{+ planId: string;+ subscription?: {+ nextBillingDate: string;+ };+ }>({+ method: 'GET',+ path: '/api/payments/subscription',+ });++ return {+ planId,+ subscription: subscription+ ? {+ nextBillingDate: new Date(subscription.nextBillingDate),+ }+ : undefined,+ };+}++export async function cancelSubscription() {+ await apiClient({+ method: 'DELETE',+ path: '/api/payments/subscription',+ });+}++export async function fetchInvoices() {+ const { invoices } = await apiClient<{ invoices: Invoice[] }>({+ method: 'GET',+ path: '/api/payments/invoices',+ });++ return {+ invoices: map(invoices, invoice => ({+ ...invoice,+ createdAt: new Date(invoice.createdAt),+ })),+ };+}++export async function fetchSubscriptionQuota({ userId }: { userId?: string } = {}) {+ const { maxRenderingsPerMonth, renderingsCount } = await apiClient<{ renderingsCount: number; maxRenderingsPerMonth: number }>({+ method: 'GET',+ path: '/api/subscription/quotas',+ impersonatedUserId: userId,+ });++ return { maxRenderingsPerMonth, renderingsCount };+}++export async function getCustomerPortalUrl() {+ const { portalUrl } = await apiClient<{ portalUrl: string }>({+ method: 'GET',+ path: '/api/payments/customer-portal',+ });++ return { portalUrl };+}diff --git a/apps/app-client/src/modules/payments/payments.types.ts b/apps/app-client/src/modules/payments/payments.types.tsnew file mode 100644index 00000000..0d13a2ce--- /dev/null+++ b/apps/app-client/src/modules/payments/payments.types.ts@@ -0,0 +1,7 @@+export type Invoice = {+ id: string;+ amountDue: number;+ createdAt: Date;+ pdfUrl: string;+ status: string;+};diff --git a/apps/app-client/src/modules/shared/confirm.tsx b/apps/app-client/src/modules/shared/confirm.tsxnew file mode 100644index 00000000..26c33883--- /dev/null+++ b/apps/app-client/src/modules/shared/confirm.tsx@@ -0,0 +1,92 @@+import type { JSX, ParentComponent } from 'solid-js';+import { createContext, createSignal, useContext } from 'solid-js';+import { Button } from '../ui/components/button';+import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '../ui/components/dialog';++type ConfirmModalConfig = {+ title: JSX.Element | string;+ message?: JSX.Element | string;+ confirmButton?: {+ text?: string;+ variant?: 'default' | 'destructive';+ };+ cancelButton?: {+ text?: string;+ variant?: 'default' | 'secondary';+ };+};++const ConfirmModalContext = createContext<{ confirm: (config: ConfirmModalConfig) => Promise<boolean> }>(undefined);++export function useConfirmModal() {+ const context = useContext(ConfirmModalContext);++ if (!context) {+ throw new Error('useConfirmModal must be used within a ConfirmModalProvider');+ }++ return context;+}++export const ConfirmModalProvider: ParentComponent = (props) => {+ const [getIsOpen, setIsOpen] = createSignal(false);+ const [getConfig, setConfig] = createSignal<ConfirmModalConfig | undefined>();+ const [getResolve, setResolve] = createSignal<((isConfirmed: boolean) => void) | undefined>();++ const confirm = ({ title, message, confirmButton, cancelButton }: ConfirmModalConfig) => {+ setConfig({+ title,+ message,+ confirmButton: {+ text: confirmButton?.text,+ variant: confirmButton?.variant ?? 'default',+ },+ cancelButton: {+ text: cancelButton?.text ?? 'Cancel',+ variant: cancelButton?.variant ?? 'secondary',+ },+ });+ setIsOpen(true);++ return new Promise<boolean>((resolve) => {+ setResolve(() => resolve);+ });+ };++ function onOpenChange(isOpen: boolean) {+ if (!isOpen) {+ getResolve()?.(false);+ }++ setIsOpen(isOpen);+ }++ function handleConfirm({ isConfirmed }: { isConfirmed: boolean }) {+ getResolve()?.(isConfirmed);+ setIsOpen(false);+ }++ return (+ <ConfirmModalContext.Provider value={{ confirm }}>+ <Dialog open={getIsOpen()} onOpenChange={onOpenChange}>+ <DialogContent class="sm:max-w-[425px]">+ <DialogHeader>+ <DialogTitle>{getConfig()?.title ?? 'Confirm ?'}</DialogTitle>+ {getConfig()?.message && <DialogDescription>{getConfig()?.message}</DialogDescription>}+ </DialogHeader>++ <DialogFooter>+ <Button onClick={() => handleConfirm({ isConfirmed: false })} variant={getConfig()?.cancelButton?.variant ?? 'secondary'}>+ {getConfig()?.cancelButton?.text ?? 'Cancel'}+ </Button>+ <Button onClick={() => handleConfirm({ isConfirmed: true })} variant={getConfig()?.confirmButton?.variant ?? 'default'}>+ {getConfig()?.confirmButton?.text ?? 'Confirm'}+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>++ {props.children}+ </ConfirmModalContext.Provider>+ );+};diff --git a/apps/app-client/src/modules/shared/currency.test.ts b/apps/app-client/src/modules/shared/currency.test.tsnew file mode 100644index 00000000..0da0a107--- /dev/null+++ b/apps/app-client/src/modules/shared/currency.test.ts@@ -0,0 +1,18 @@+import { describe, expect, test } from 'vitest';+import { formatAmountInCents } from './currency';++describe('currency', () => {+ describe('formatAmountInCents', () => {+ test('formats amount in cents to human readable format with currency symbol, by default USD', () => {+ expect(formatAmountInCents({ amountInCents: 1000 })).toBe('$10.00');+ expect(formatAmountInCents({ amountInCents: 100000 })).toBe('$1,000.00');+ expect(formatAmountInCents({ amountInCents: 1234.5 })).toBe('$12.35');+ });++ test('the currency can be changed', () => {+ expect(formatAmountInCents({ amountInCents: 1000, currency: 'EUR' })).toBe('€10.00');+ expect(formatAmountInCents({ amountInCents: 1000, currency: 'JPY' })).toBe('¥10.00');+ expect(formatAmountInCents({ amountInCents: 1000, currency: 'GBP' })).toBe('£10.00');+ });+ });+});diff --git a/apps/app-client/src/modules/shared/currency.ts b/apps/app-client/src/modules/shared/currency.tsnew file mode 100644index 00000000..55ed6d19--- /dev/null+++ b/apps/app-client/src/modules/shared/currency.ts@@ -0,0 +1,8 @@+export function formatAmountInCents({ amountInCents, currency = 'USD' }: { amountInCents: number; currency?: string }): string {+ return new Intl.NumberFormat('en-US', {+ style: 'currency',+ currency,+ minimumFractionDigits: 2,+ currencyDisplay: 'symbol',+ }).format(amountInCents / 100);+}diff --git a/apps/app-client/src/modules/shared/date/time-ago.test.ts b/apps/app-client/src/modules/shared/date/time-ago.test.tsnew file mode 100644index 00000000..ec965e31--- /dev/null+++ b/apps/app-client/src/modules/shared/date/time-ago.test.ts@@ -0,0 +1,26 @@+import { describe, expect, test } from 'vitest';+import { timeAgo } from './time-ago';++describe('time-ago', () => {+ describe('timeAgo', () => {+ test('formats the relative time', () => {+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T00:00:00Z') })).toBe('just now');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T00:00:06Z') })).toBe('a few seconds ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T00:01:00Z') })).toBe('a minute ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T00:02:00Z') })).toBe('2 minutes ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T01:00:00Z') })).toBe('an hour ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-01T02:00:00Z') })).toBe('2 hours ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-02T00:00:00Z') })).toBe('a day ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-01-03T00:00:00Z') })).toBe('2 days ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-02-01T00:00:00Z') })).toBe('a month ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2021-03-02T00:00:00Z') })).toBe('2 months ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2022-01-01T00:00:00Z') })).toBe('a year ago');+ expect(timeAgo({ date: new Date('2021-01-01T00:00:00Z'), now: new Date('2023-01-01T00:00:00Z') })).toBe('2 years ago');+ });++ test('the date can be a parsable string', () => {+ expect(timeAgo({ date: '2021-01-01T00:00:00Z', now: new Date('2021-01-01T00:00:00Z') })).toBe('just now');+ expect(timeAgo({ date: '2021-01-01T00:00:00Z', now: new Date('2021-03-02T00:00:00Z') })).toBe('2 months ago');+ });+ });+});diff --git a/apps/app-client/src/modules/shared/date/time-ago.ts b/apps/app-client/src/modules/shared/date/time-ago.tsnew file mode 100644index 00000000..7a9a3072--- /dev/null+++ b/apps/app-client/src/modules/shared/date/time-ago.ts@@ -0,0 +1,63 @@+export { timeAgo };++function timeAgo({ date: maybeRawDate, now = new Date() }: { date: Date | string; now?: Date }): string {+ const date = typeof maybeRawDate === 'string' ? new Date(maybeRawDate) : maybeRawDate;++ const diffMs = now.getTime() - date.getTime();+ const diffSeconds = Math.floor(diffMs / 1000);+ const diffMinutes = Math.floor(diffSeconds / 60);+ const diffHours = Math.floor(diffMinutes / 60);+ const diffDays = Math.floor(diffHours / 24);+ const diffMonths = Math.floor(diffDays / 30);+ const diffYears = Math.floor(diffMonths / 12);++ if (diffSeconds < 5) {+ return 'just now';+ }++ if (diffSeconds < 10) {+ return 'a few seconds ago';+ }++ if (diffSeconds < 60) {+ return `${diffSeconds} seconds ago`;+ }++ if (diffMinutes === 1) {+ return 'a minute ago';+ }++ if (diffMinutes < 60) {+ return `${diffMinutes} minutes ago`;+ }++ if (diffHours === 1) {+ return 'an hour ago';+ }++ if (diffHours < 24) {+ return `${diffHours} hours ago`;+ }++ if (diffDays === 1) {+ return 'a day ago';+ }++ if (diffDays < 30) {+ return `${diffDays} days ago`;+ }++ if (diffMonths === 1) {+ return 'a month ago';+ }++ if (diffMonths < 12) {+ return `${diffMonths} months ago`;+ }++ if (diffYears === 1) {+ return 'a year ago';+ }++ return `${diffYears} years ago`;+}diff --git a/apps/app-client/src/modules/shared/form/form.ts b/apps/app-client/src/modules/shared/form/form.tsnew file mode 100644index 00000000..402972a4--- /dev/null+++ b/apps/app-client/src/modules/shared/form/form.ts@@ -0,0 +1,146 @@+import type { z } from 'zod';+import { flatten, isEmpty, isEqual, map, mapValues } from 'lodash-es';+import { createSignal } from 'solid-js';+import { createHook } from '../hooks/hooks';++export type FormRule = {+ isValid: (value: string) => boolean;+ message: string;+};++export type FormField = {+ initialValue?: string;+ schema: z.ZodTypeAny;+};++export function createForm<Keys>({ fields }: { fields: Record<keyof Keys, FormField> }) {+ const [getForm, setForm] = createSignal<Record<keyof Keys, string>>(mapValues(fields, field => field.initialValue ?? ''));+ const [getFieldsErrors, setFieldsErrors] = createSignal<Record<keyof Keys, string[]>>(mapValues(fields, () => []));+ const [getIsSubmitting, setIsSubmitting] = createSignal(false);++ const setField = (key: keyof Keys, value: string) => {+ setForm(form => ({ ...form, [key]: value }));+ setFieldsErrors(fieldErrors => ({ ...fieldErrors, [key]: [] }));+ };++ const getField = (key: keyof Keys) => {+ return getForm()[key];+ };++ const validateField = (key: keyof Keys) => {+ const value = getForm()[key];+ const schema = fields[key].schema;+ const result = schema.safeParse(value);++ if (!result.success) {+ return {+ isValid: false,+ errors: result.error.issues.map(issue => issue.message),+ };+ }++ return {+ isValid: true,+ errors: [],+ };+ };++ const triggerFieldValidation = (key: keyof Keys) => {+ const { isValid, errors } = validateField(key);+ if (!isValid) {+ setFieldsErrors(fieldErrors => ({ ...fieldErrors, [key]: errors }));+ return false;+ }++ return true;+ };++ const triggerFieldsValidation = () => {+ return map(fields, (_, key) => triggerFieldValidation(key as keyof Keys));+ };++ const getFieldErrors = (key: keyof Keys) => {+ return getFieldsErrors()[key];+ };++ const getFieldError = (key: keyof Keys) => {+ return getFieldErrors(key)[0];+ };++ const submitHook = createHook<Record<keyof Keys, string>>();++ const submit = async (event?: Event) => {+ event?.preventDefault();+ const form = getForm();++ triggerFieldsValidation();+ const isValid = isEmpty(flatten(Object.values(getFieldsErrors())));++ if (!isValid) {+ return;+ }++ setIsSubmitting(true);+ await submitHook.trigger(form);+ setIsSubmitting(false);+ };++ const getInputBindings = (key: keyof Keys) => {+ return {+ value: getField(key),+ onInput: (event: InputEvent) => {+ const value = (event.target as HTMLInputElement).value;+ setField(key, value);+ },+ onBlur: () => {+ triggerFieldValidation(key);+ },+ };+ };++ const getFieldStatus = (key: keyof Keys) => {+ const errors = getFieldErrors(key);++ if (isEmpty(errors)) {+ return 'valid';+ }++ return 'invalid';+ };++ const setFieldError = (key: keyof Keys, errors: string) => {+ setFieldsErrors(fieldErrors => ({ ...fieldErrors, [key]: [errors] }));+ };++ const getIsFormDirty = () => {+ return !isEqual(+ getForm(),+ mapValues(fields, field => field.initialValue ?? ''),+ );+ };++ const getFormHasErrors = () => {+ return !isEmpty(flatten(Object.values(getFieldsErrors())));+ };++ return {+ getForm,+ setForm,+ getField,+ setField,+ getFieldsErrors,+ getFieldError,+ validateField,+ triggerFieldValidation,+ triggerFieldsValidation,+ getFieldErrors,+ submit,+ onSubmit: submitHook.on,+ getIsSubmitting,+ getInputBindings,+ getFieldStatus,+ setFieldError,+ getIsFormDirty,+ getFormHasErrors,+ };+}diff --git a/apps/app-client/src/modules/shared/hooks/hooks.ts b/apps/app-client/src/modules/shared/hooks/hooks.tsnew file mode 100644index 00000000..fe856264--- /dev/null+++ b/apps/app-client/src/modules/shared/hooks/hooks.ts@@ -0,0 +1,25 @@+export { createHook, createWaitForHook };++function createHook<T = any>() {+ let callbacks: ((args: T) => void)[] = [];++ return {+ on: (callback: (args: T) => void | Promise<void>) => callbacks.push(callback),+ trigger: (args: T) => Promise.all(callbacks.map(callback => callback(args))),+ removeHandler: (callback: (args: T) => void) => {+ callbacks = callbacks.filter(cb => cb !== callback);+ },+ };+}++function createWaitForHook(): { waitFor: () => Promise<void>; trigger: () => void } {+ let resolves: (() => void)[] = [];++ return {+ waitFor: () => new Promise(resolve => resolves.push(resolve)),+ trigger: () => {+ resolves.forEach(resolve => resolve());+ resolves = [];+ },+ };+}diff --git a/apps/app-client/src/modules/shared/http/http-client.models.test.ts b/apps/app-client/src/modules/shared/http/http-client.models.test.tsnew file mode 100644index 00000000..acba4b89--- /dev/null+++ b/apps/app-client/src/modules/shared/http/http-client.models.test.ts@@ -0,0 +1,30 @@+import { describe, expect, test } from 'vitest';+import { buildAuthHeader, buildImpersonationHeader } from './http-client.models';++describe('http-client models', () => {+ describe('buildAuthHeader', () => {+ test('given a auth token the autorization header is a standard bearer token', () => {+ expect(buildAuthHeader({ accessToken: 'foo' })).to.eql({ Authorization: 'Bearer foo' });+ });++ test('if no auth token is provided, no headers are built', () => {+ expect(buildAuthHeader()).to.eql({});+ expect(buildAuthHeader({})).to.eql({});+ expect(buildAuthHeader({ accessToken: undefined })).to.eql({});+ expect(buildAuthHeader({ accessToken: null })).to.eql({});+ });+ });++ describe('buildImpersonationHeader', () => {+ test('the impersonation user id is added as a x-user-id header', () => {+ expect(buildImpersonationHeader({ impersonatedUserId: 'foo' })).to.eql({ 'x-user-id': 'foo' });+ });++ test('if no impersonation user id is provided, no headers are built', () => {+ expect(buildImpersonationHeader()).to.eql({});+ expect(buildImpersonationHeader({})).to.eql({});+ expect(buildImpersonationHeader({ impersonatedUserId: undefined })).to.eql({});+ expect(buildImpersonationHeader({ impersonatedUserId: null })).to.eql({});+ });+ });+});diff --git a/apps/app-client/src/modules/shared/http/http-client.models.ts b/apps/app-client/src/modules/shared/http/http-client.models.tsnew file mode 100644index 00000000..5a91b36a--- /dev/null+++ b/apps/app-client/src/modules/shared/http/http-client.models.ts@@ -0,0 +1,39 @@+export { buildAuthHeader, buildImpersonationHeader, getBody, isFetchResponseJson };++function isFetchResponseJson({ response }: { response: Response }): boolean {+ return Boolean(response.headers.get('content-type')?.includes('application/json'));+}++function getBody({ response }: { response: Response }): Promise<unknown> {+ try {+ return isFetchResponseJson({ response }) ? response.json() : response.text();+ } catch (_error) {+ return Promise.resolve({});+ }+}++function buildAuthHeader({ accessToken }: { accessToken?: string | null | undefined } = {}): Record<string, string> {+ if (!accessToken) {+ return {};+ }++ return {+ Authorization: `Bearer ${accessToken}`,+ };+}++function buildImpersonationHeader({ impersonatedUserId }: { impersonatedUserId?: string | null | undefined } = {}): Record<string, string> {+ if (!impersonatedUserId) {+ return {};+ }++ return {+ 'x-user-id': impersonatedUserId,+ };+}++export function getFormData(pojo: Record<string, unknown>): FormData {+ const formData = new FormData();+ Object.keys(pojo).forEach(key => formData.append(key, pojo[key] as string));+ return formData;+}diff --git a/apps/app-client/src/modules/shared/http/http-client.ts b/apps/app-client/src/modules/shared/http/http-client.tsnew file mode 100644index 00000000..d9099e35--- /dev/null+++ b/apps/app-client/src/modules/shared/http/http-client.ts@@ -0,0 +1,94 @@+import { authStore } from '@/modules/auth/auth.store';+import { config } from '@/modules/config/config';+import { buildUrl } from '@corentinth/chisels';+import { mapValues } from 'lodash-es';+import { buildAuthHeader, buildImpersonationHeader, getBody, getFormData } from './http-client.models';++export { apiClient };++async function apiClient<T>({+ path,+ method,+ body,+ formData,+ queryParams,+ impersonatedUserId,+}: {+ path: string;+ method: string;+ body?: unknown;+ formData?: Record<string, unknown>;+ queryParams?: Record<string, string | number>;+ impersonatedUserId?: string;+}): Promise<T> {+ const url = buildUrl({+ path,+ baseUrl: config.baseApiUrl,+ queryParams: queryParams ? mapValues(queryParams, String) : undefined,+ });++ const accessToken = authStore.getAccessToken();++ const fetchOptions = {+ method,+ headers: {+ ...(body ? { 'Content-Type': 'application/json' } : {}),+ ...buildAuthHeader({ accessToken }),+ ...buildImpersonationHeader({ impersonatedUserId }),+ },+ body: body ? JSON.stringify(body) : formData ? getFormData(formData) : undefined,+ };++ const response = await fetch(url, fetchOptions);++ if (!response.ok) {+ if (response.status === 401) {+ return refreshTokensAndRetry<T>({ originalOptions: fetchOptions, url });+ }++ const error = new Error(response.statusText);+ Object.assign(error, {+ status: response.status,+ body: await getBody({ response }),+ });++ throw error;+ }++ if (response.status === 204) {+ return {} as T;+ }++ return response.json();+}++async function refreshTokensAndRetry<T>({ originalOptions, url }: { originalOptions: RequestInit; url: string }): Promise<T> {+ try {+ if (authStore.getIsRefreshTokenInProgress()) {+ await authStore.waitForRefreshTokenToBeRefreshed();+ } else {+ await authStore.refreshToken();+ }++ const accessToken = authStore.getAccessToken();++ const response = await fetch(url, {+ ...originalOptions,+ headers: {+ ...originalOptions.headers,+ ...buildAuthHeader({ accessToken }),+ },+ });++ if (response.status === 204) {+ return {} as T;+ }++ return response.json();+ } catch (err) {+ await authStore.clearAccessToken();+ window.location.href = '/login';+ console.error('Refresh token expired or invalid', err);+ throw err;+ }+}diff --git a/apps/app-client/src/modules/shared/http/http-errors.ts b/apps/app-client/src/modules/shared/http/http-errors.tsnew file mode 100644index 00000000..a73835d7--- /dev/null+++ b/apps/app-client/src/modules/shared/http/http-errors.ts@@ -0,0 +1,15 @@+import { get } from 'lodash-es';++export { isHttpErrorWithCode, isHttpErrorWithStatusCode, isRateLimitError };++function isHttpErrorWithCode({ error, code }: { error: unknown; code: string }) {+ return get(error, 'body.error.code') === code;+}++function isHttpErrorWithStatusCode({ error, statusCode }: { error: unknown; statusCode: number }) {+ return get(error, 'status') === statusCode;+}++function isRateLimitError({ error }: { error: unknown }) {+ return isHttpErrorWithStatusCode({ error, statusCode: 429 });+}diff --git a/apps/app-client/src/modules/shared/query/query-client.ts b/apps/app-client/src/modules/shared/query/query-client.tsnew file mode 100644index 00000000..4bac81b3--- /dev/null+++ b/apps/app-client/src/modules/shared/query/query-client.ts@@ -0,0 +1,7 @@+import { QueryClient } from '@tanstack/solid-query';++export const queryClient = new QueryClient();++export function clearQueryCache() {+ queryClient.clear();+}diff --git a/apps/app-client/src/modules/shared/signals/async-state.ts b/apps/app-client/src/modules/shared/signals/async-state.tsnew file mode 100644index 00000000..b6bf0f17--- /dev/null+++ b/apps/app-client/src/modules/shared/signals/async-state.ts@@ -0,0 +1,63 @@+import { castError } from '@corentinth/chisels';+import { identity } from 'lodash-es';+import { createSignal } from 'solid-js';+import { createHook } from '../hooks/hooks';++export { useAsyncState };++function useAsyncState<Args, Return, ReturnFormatted = Return>(+ getter: (args: Args) => Promise<Return>,+ { initialData, formatValue = identity, immediate = false }: { initialData?: ReturnFormatted; formatValue?: (value: Return) => ReturnFormatted; immediate?: boolean } = {},+) {+ const [getIsLoading, setIsLoading] = createSignal(false);+ const [getError, setError] = createSignal<Error | undefined>(undefined);+ const [getData, setData] = createSignal<ReturnFormatted | undefined>(initialData);+ const [getStatus, setStatus] = createSignal<'idle' | 'loading' | 'success' | 'error'>('idle');++ const successHook = createHook<{ data: Return; args: Args }>();+ const errorHook = createHook<{ error: Error; args: Args }>();+ const finishHook = createHook<{ data: ReturnFormatted | undefined; error: Error | undefined; args: Args }>();++ const execute = async (args: Args) => {+ setIsLoading(true);+ setStatus('loading');++ try {+ const data = await getter(args);++ // eslint-disable-next-line ts/no-unsafe-function-type+ setData(formatValue(data) as Exclude<ReturnFormatted, Function>);+ setError(undefined);+ setStatus('success');+ successHook.trigger({ data, args });+ return data;+ } catch (err) {+ const error = castError(err);++ console.error(error);++ setData(undefined);+ setError(error);+ setStatus('error');+ errorHook.trigger({ error, args });+ } finally {+ setIsLoading(false);+ finishHook.trigger({ data: getData(), error: getError(), args });+ }+ };++ if (immediate) {+ execute({} as Args);+ }++ return {+ getIsLoading,+ getError,+ getData,+ getStatus,+ execute,+ onSuccess: successHook.on,+ onError: errorHook.on,+ onFinish: finishHook.on,+ };+}diff --git a/apps/app-client/src/modules/shared/style/cn.ts b/apps/app-client/src/modules/shared/style/cn.tsnew file mode 100644index 00000000..46e69d1f--- /dev/null+++ b/apps/app-client/src/modules/shared/style/cn.ts@@ -0,0 +1,5 @@+import type { ClassValue } from 'clsx';+import clsx from 'clsx';+import { twMerge } from 'tailwind-merge';++export const cn = (...classLists: ClassValue[]) => twMerge(clsx(classLists));diff --git a/apps/app-client/src/modules/shared/syntax-highlight/code-group.tsx b/apps/app-client/src/modules/shared/syntax-highlight/code-group.tsxnew file mode 100644index 00000000..993eb3c0--- /dev/null+++ b/apps/app-client/src/modules/shared/syntax-highlight/code-group.tsx@@ -0,0 +1,47 @@+import type { BuiltinLanguage } from 'shiki';+import type { Component, JSX } from 'solid-js';++import { Card, CardContent, CardHeader } from '@/modules/ui/components/card';+import { ToggleGroup, ToggleGroupItem } from '@/modules/ui/components/toggle-group';+import { keys, map } from 'lodash-es';+import { createSignal, splitProps } from 'solid-js';+import { cn } from '../style/cn';+import { CopyButton } from '../utils/copy';+import { SyntaxHighlight } from './syntax-highlight';++export type CodeGroupItem = {+ language: BuiltinLanguage;+ label: string;+ icon?: string;+ code: string;+};++export type CodeGroupItems = Record<string, CodeGroupItem>;++export const CodeGroup: Component<{ items: CodeGroupItems } & JSX.HTMLAttributes<HTMLDivElement>> = (props) => {+ const [getSelectedKey, setSelectedKey] = createSignal(keys(props.items)[0]);++ const getCurrentItem = () => props.items[getSelectedKey()];++ const [local, rest] = splitProps(props, ['class', 'items']);++ return (+ <Card class={cn('w-full overflow-hidden', local.class)} {...rest}>+ <CardHeader class="py-2 px-2 flex items-center justify-between flex-row light:bg-white">+ <div class="overflow-x-auto">+ <ToggleGroup value={getSelectedKey()} onChange={setSelectedKey} class="justify-start">+ {map(local.items, (group, index) => (+ <ToggleGroupItem class="px-3 py-1.5 leading-tight h-auto" value={index}>+ {group.label}+ </ToggleGroupItem>+ ))}+ </ToggleGroup>+ </div>+ <CopyButton text={getCurrentItem().code} class="!mt-0" size="sm" variant="secondary" />+ </CardHeader>+ <CardContent class="p-0 ">+ <SyntaxHighlight code={getCurrentItem().code} language={getCurrentItem().language} class="rounded-none" />+ </CardContent>+ </Card>+ );+};diff --git a/apps/app-client/src/modules/shared/syntax-highlight/syntax-highlight.tsx b/apps/app-client/src/modules/shared/syntax-highlight/syntax-highlight.tsxnew file mode 100644index 00000000..9a712977--- /dev/null+++ b/apps/app-client/src/modules/shared/syntax-highlight/syntax-highlight.tsx@@ -0,0 +1,24 @@+import type { Component, JSX } from 'solid-js';+import { codeToHtml } from 'shiki';+import { createEffect, createSignal, splitProps } from 'solid-js';+import { cn } from '../style/cn';+import { theme } from './theme';++export const SyntaxHighlight: Component<{ code: string; language: string } & JSX.HTMLAttributes<HTMLDivElement>> = (props) => {+ const [local, rest] = splitProps(props, ['code', 'language', 'class']);+ const [html, setHtml] = createSignal<string | undefined>();++ createEffect(async () => {+ const codeHtml = await codeToHtml(local.code, {+ lang: local.language,+ theme,+ });+ setHtml(codeHtml);+ });++ return (+ <div class={cn('rounded-lg px-8 py-6 bg-#111 overflow-auto text-muted-foreground', local.class)} {...rest}>+ {html() ? <div innerHTML={html()} /> : <pre>{local.code}</pre>}+ </div>+ );+};diff --git a/apps/app-client/src/modules/shared/syntax-highlight/theme.ts b/apps/app-client/src/modules/shared/syntax-highlight/theme.tsnew file mode 100644index 00000000..45ffd672--- /dev/null+++ b/apps/app-client/src/modules/shared/syntax-highlight/theme.ts@@ -0,0 +1,562 @@+import type { ThemeRegistration } from 'shiki';++export const theme: ThemeRegistration = {+ name: 'getcallback-dark',+ bg: '#00000000',+ colors: {+ 'activityBar.activeBorder': '#4d9375',+ 'activityBar.background': '#121212',+ 'activityBar.border': '#191919',+ 'activityBar.foreground': '#dbd7caee',+ 'activityBar.inactiveForeground': '#dedcd550',+ 'activityBarBadge.background': '#bfbaaa',+ 'activityBarBadge.foreground': '#121212',+ 'badge.background': '#dedcd590',+ 'badge.foreground': '#121212',+ 'breadcrumb.activeSelectionForeground': '#eeeeee18',+ 'breadcrumb.background': '#181818',+ 'breadcrumb.focusForeground': '#dbd7caee',+ 'breadcrumb.foreground': '#959da5',+ 'breadcrumbPicker.background': '#121212',+ 'button.background': '#4d9375',+ 'button.foreground': '#121212',+ 'button.hoverBackground': '#4d9375',+ 'checkbox.background': '#181818',+ 'checkbox.border': '#2f363d',+ 'debugToolBar.background': '#121212',+ 'descriptionForeground': '#dedcd590',+ 'diffEditor.insertedTextBackground': '#4d937550',+ 'diffEditor.removedTextBackground': '#ab595950',+ 'dropdown.background': '#121212',+ 'dropdown.border': '#191919',+ 'dropdown.foreground': '#dbd7caee',+ 'dropdown.listBackground': '#181818',+ 'editor.background': '#121212',+ 'editor.findMatchBackground': '#e6cc7722',+ 'editor.findMatchHighlightBackground': '#e6cc7744',+ 'editor.focusedStackFrameHighlightBackground': '#b808',+ 'editor.foldBackground': '#eeeeee10',+ 'editor.foreground': '#dbd7caee',+ 'editor.inactiveSelectionBackground': '#eeeeee10',+ 'editor.lineHighlightBackground': '#181818',+ 'editor.selectionBackground': '#eeeeee18',+ 'editor.selectionHighlightBackground': '#eeeeee10',+ 'editor.stackFrameHighlightBackground': '#a707',+ 'editor.wordHighlightBackground': '#1c6b4805',+ 'editor.wordHighlightStrongBackground': '#1c6b4810',+ 'editorBracketHighlight.foreground1': '#5eaab5',+ 'editorBracketHighlight.foreground2': '#4d9375',+ 'editorBracketHighlight.foreground3': '#d4976c',+ 'editorBracketHighlight.foreground4': '#d9739f',+ 'editorBracketHighlight.foreground5': '#e6cc77',+ 'editorBracketHighlight.foreground6': '#6394bf',+ 'editorBracketMatch.background': '#4d937520',+ 'editorError.foreground': '#cb7676',+ 'editorGroup.border': '#191919',+ 'editorGroupHeader.tabsBackground': '#121212',+ 'editorGroupHeader.tabsBorder': '#191919',+ 'editorGutter.addedBackground': '#4d9375',+ 'editorGutter.commentRangeForeground': '#dedcd550',+ 'editorGutter.deletedBackground': '#cb7676',+ 'editorGutter.foldingControlForeground': '#dedcd590',+ 'editorGutter.modifiedBackground': '#6394bf',+ 'editorHint.foreground': '#4d9375',+ 'editorIndentGuide.activeBackground': '#ffffff30',+ 'editorIndentGuide.background': '#ffffff15',+ 'editorInfo.foreground': '#6394bf',+ 'editorInlayHint.background': '#00000000',+ 'editorInlayHint.foreground': '#666666',+ 'editorLineNumber.activeForeground': '#bfbaaa',+ 'editorLineNumber.foreground': '#dedcd550',+ 'editorOverviewRuler.border': '#111',+ 'editorStickyScroll.background': '#181818',+ 'editorStickyScrollHover.background': '#181818',+ 'editorWarning.foreground': '#d4976c',+ 'editorWhitespace.foreground': '#ffffff15',+ 'editorWidget.background': '#121212',+ 'errorForeground': '#cb7676',+ 'focusBorder': '#00000000',+ 'foreground': '#dbd7caee',+ 'gitDecoration.addedResourceForeground': '#4d9375',+ 'gitDecoration.conflictingResourceForeground': '#d4976c',+ 'gitDecoration.deletedResourceForeground': '#cb7676',+ 'gitDecoration.ignoredResourceForeground': '#dedcd550',+ 'gitDecoration.modifiedResourceForeground': '#6394bf',+ 'gitDecoration.submoduleResourceForeground': '#dedcd590',+ 'gitDecoration.untrackedResourceForeground': '#5eaab5',+ 'input.background': '#181818',+ 'input.border': '#191919',+ 'input.foreground': '#dbd7caee',+ 'input.placeholderForeground': '#dedcd590',+ 'inputOption.activeBackground': '#dedcd550',+ 'list.activeSelectionBackground': '#181818',+ 'list.activeSelectionForeground': '#dbd7caee',+ 'list.focusBackground': '#181818',+ 'list.highlightForeground': '#4d9375',+ 'list.hoverBackground': '#181818',+ 'list.hoverForeground': '#dbd7caee',+ 'list.inactiveFocusBackground': '#121212',+ 'list.inactiveSelectionBackground': '#181818',+ 'list.inactiveSelectionForeground': '#dbd7caee',+ 'menu.separatorBackground': '#191919',+ 'notificationCenterHeader.background': '#121212',+ 'notificationCenterHeader.foreground': '#959da5',+ 'notifications.background': '#121212',+ 'notifications.border': '#191919',+ 'notifications.foreground': '#dbd7caee',+ 'notificationsErrorIcon.foreground': '#cb7676',+ 'notificationsInfoIcon.foreground': '#6394bf',+ 'notificationsWarningIcon.foreground': '#d4976c',+ 'panel.background': '#121212',+ 'panel.border': '#191919',+ 'panelInput.border': '#2f363d',+ 'panelTitle.activeBorder': '#4d9375',+ 'panelTitle.activeForeground': '#dbd7caee',+ 'panelTitle.inactiveForeground': '#959da5',+ 'peekViewEditor.background': '#121212',+ 'peekViewEditor.matchHighlightBackground': '#ffd33d33',+ 'peekViewResult.background': '#121212',+ 'peekViewResult.matchHighlightBackground': '#ffd33d33',+ 'pickerGroup.border': '#191919',+ 'pickerGroup.foreground': '#dbd7caee',+ 'problemsErrorIcon.foreground': '#cb7676',+ 'problemsInfoIcon.foreground': '#6394bf',+ 'problemsWarningIcon.foreground': '#d4976c',+ 'progressBar.background': '#4d9375',+ 'quickInput.background': '#121212',+ 'quickInput.foreground': '#dbd7caee',+ 'quickInputList.focusBackground': '#181818',+ 'scrollbar.shadow': '#0000',+ 'scrollbarSlider.activeBackground': '#dedcd550',+ 'scrollbarSlider.background': '#dedcd510',+ 'scrollbarSlider.hoverBackground': '#dedcd550',+ 'settings.headerForeground': '#dbd7caee',+ 'settings.modifiedItemIndicator': '#4d9375',+ 'sideBar.background': '#121212',+ 'sideBar.border': '#191919',+ 'sideBar.foreground': '#bfbaaa',+ 'sideBarSectionHeader.background': '#121212',+ 'sideBarSectionHeader.border': '#191919',+ 'sideBarSectionHeader.foreground': '#dbd7caee',+ 'sideBarTitle.foreground': '#dbd7caee',+ 'statusBar.background': '#121212',+ 'statusBar.border': '#191919',+ 'statusBar.debuggingBackground': '#181818',+ 'statusBar.debuggingForeground': '#bfbaaa',+ 'statusBar.foreground': '#bfbaaa',+ 'statusBar.noFolderBackground': '#121212',+ 'statusBarItem.prominentBackground': '#181818',+ 'tab.activeBackground': '#121212',+ 'tab.activeBorder': '#191919',+ 'tab.activeBorderTop': '#dedcd590',+ 'tab.activeForeground': '#dbd7caee',+ 'tab.border': '#191919',+ 'tab.hoverBackground': '#181818',+ 'tab.inactiveBackground': '#121212',+ 'tab.inactiveForeground': '#959da5',+ 'tab.unfocusedActiveBorder': '#191919',+ 'tab.unfocusedActiveBorderTop': '#191919',+ 'tab.unfocusedHoverBackground': '#121212',+ 'terminal.ansiBlack': '#393a34',+ 'terminal.ansiBlue': '#6394bf',+ 'terminal.ansiBrightBlack': '#777777',+ 'terminal.ansiBrightBlue': '#6394bf',+ 'terminal.ansiBrightCyan': '#5eaab5',+ 'terminal.ansiBrightGreen': '#4d9375',+ 'terminal.ansiBrightMagenta': '#d9739f',+ 'terminal.ansiBrightRed': '#cb7676',+ 'terminal.ansiBrightWhite': '#ffffff',+ 'terminal.ansiBrightYellow': '#e6cc77',+ 'terminal.ansiCyan': '#5eaab5',+ 'terminal.ansiGreen': '#4d9375',+ 'terminal.ansiMagenta': '#d9739f',+ 'terminal.ansiRed': '#cb7676',+ 'terminal.ansiWhite': '#dbd7ca',+ 'terminal.ansiYellow': '#e6cc77',+ 'terminal.foreground': '#dbd7caee',+ 'terminal.selectionBackground': '#eeeeee18',+ 'textBlockQuote.background': '#121212',+ 'textBlockQuote.border': '#191919',+ 'textCodeBlock.background': '#121212',+ 'textLink.activeForeground': '#4d9375',+ 'textLink.foreground': '#4d9375',+ 'textPreformat.foreground': '#d1d5da',+ 'textSeparator.foreground': '#586069',+ 'titleBar.activeBackground': '#121212',+ 'titleBar.activeForeground': '#bfbaaa',+ 'titleBar.border': '#181818',+ 'titleBar.inactiveBackground': '#121212',+ 'titleBar.inactiveForeground': '#959da5',+ 'tree.indentGuidesStroke': '#2f363d',+ 'welcomePage.buttonBackground': '#2f363d',+ 'welcomePage.buttonHoverBackground': '#444d56',+ },+ tokenColors: [+ {+ scope: ['comment', 'punctuation.definition.comment', 'string.comment'],+ settings: {+ foreground: '#758575dd',+ },+ },+ {+ scope: [+ 'delimiter.bracket',+ 'delimiter',+ 'invalid.illegal.character-not-allowed-here.html',+ 'keyword.operator.rest',+ 'keyword.operator.spread',+ 'keyword.operator.type.annotation',+ 'keyword.operator.relational',+ 'keyword.operator.assignment',+ 'keyword.operator.type',+ 'meta.brace',+ 'meta.tag.block.any.html',+ 'meta.tag.inline.any.html',+ 'meta.tag.structure.input.void.html',+ 'meta.type.annotation',+ 'meta.embedded.block.github-actions-expression',+ 'storage.type.function.arrow',+ 'meta.objectliteral.ts',+ 'punctuation',+ ],+ settings: {+ foreground: '#666666',+ },+ },+ {+ scope: ['constant', 'entity.name.constant', 'variable.language', 'meta.definition.variable'],+ settings: {+ foreground: '#c99076',+ },+ },+ {+ scope: ['entity', 'entity.name'],+ settings: {+ foreground: '#80a665',+ },+ },+ {+ scope: 'variable.parameter.function',+ settings: {+ foreground: '#dbd7caee',+ },+ },+ {+ scope: ['entity.name.tag', 'tag.html'],+ settings: {+ foreground: '#4d9375',+ },+ },+ {+ scope: 'entity.name.function',+ settings: {+ foreground: '#80a665',+ },+ },+ {+ scope: ['keyword', 'storage.type.class.jsdoc'],+ settings: {+ foreground: '#4d9375',+ },+ },+ {+ scope: ['storage', 'storage.type', 'support.type.builtin', 'constant.language.undefined', 'constant.language.null'],+ settings: {+ foreground: '#cb7676',+ },+ },+ {+ scope: ['text.html.derivative', 'storage.modifier.package', 'storage.modifier.import', 'storage.type.java'],+ settings: {+ foreground: '#dbd7caee',+ },+ },+ {+ scope: ['string', 'string punctuation.section.embedded source', 'attribute.value'],+ settings: {+ foreground: '#c98a7d',+ },+ },+ {+ scope: ['punctuation.definition.string', 'punctuation.support.type.property-name'],+ settings: {+ foreground: '#c98a7d99',+ },+ },+ {+ scope: 'support',+ settings: {+ foreground: '#b8a965',+ },+ },+ {+ scope: ['property', 'meta.property-name', 'meta.object-literal.key', 'entity.name.tag.yaml', 'attribute.name'],+ settings: {+ foreground: '#b8a965',+ },+ },+ {+ scope: ['entity.other.attribute-name', 'invalid.deprecated.entity.other.attribute-name.html'],+ settings: {+ foreground: '#bd976a',+ },+ },+ {+ scope: ['variable', 'identifier'],+ settings: {+ foreground: '#bd976a',+ },+ },+ {+ scope: ['support.type.primitive', 'entity.name.type'],+ settings: {+ foreground: '#5DA994',+ },+ },+ {+ scope: 'namespace',+ settings: {+ foreground: '#db889a',+ },+ },+ {+ scope: ['keyword.operator', 'keyword.operator.assignment.compound', 'meta.var.expr.ts'],+ settings: {+ foreground: '#cb7676',+ },+ },+ {+ scope: 'invalid.broken',+ settings: {+ fontStyle: 'italic',+ foreground: '#fdaeb7',+ },+ },+ {+ scope: 'invalid.deprecated',+ settings: {+ fontStyle: 'italic',+ foreground: '#fdaeb7',+ },+ },+ {+ scope: 'invalid.illegal',+ settings: {+ fontStyle: 'italic',+ foreground: '#fdaeb7',+ },+ },+ {+ scope: 'invalid.unimplemented',+ settings: {+ fontStyle: 'italic',+ foreground: '#fdaeb7',+ },+ },+ {+ scope: 'carriage-return',+ settings: {+ background: '#f97583',+ content: '^M',+ fontStyle: 'italic underline',+ foreground: '#24292e',+ },+ },+ {+ scope: 'message.error',+ settings: {+ foreground: '#fdaeb7',+ },+ },+ {+ scope: 'string variable',+ settings: {+ foreground: '#c98a7d',+ },+ },+ {+ scope: ['source.regexp', 'string.regexp'],+ settings: {+ foreground: '#c4704f',+ },+ },+ {+ scope: ['string.regexp.character-class', 'string.regexp constant.character.escape', 'string.regexp source.ruby.embedded', 'string.regexp string.regexp.arbitrary-repitition'],+ settings: {+ foreground: '#c98a7d',+ },+ },+ {+ scope: 'string.regexp constant.character.escape',+ settings: {+ foreground: '#e6cc77',+ },+ },+ {+ scope: ['support.constant'],+ settings: {+ foreground: '#c99076',+ },+ },+ {+ scope: ['keyword.operator.quantifier.regexp', 'constant.numeric', 'number'],+ settings: {+ foreground: '#4C9A91',+ },+ },+ {+ scope: ['keyword.other.unit'],+ settings: {+ foreground: '#cb7676',+ },+ },+ {+ scope: ['constant.language.boolean', 'constant.language'],+ settings: {+ foreground: '#4d9375',+ },+ },+ {+ scope: 'meta.module-reference',+ settings: {+ foreground: '#4d9375',+ },+ },+ {+ scope: 'punctuation.definition.list.begin.markdown',+ settings: {+ foreground: '#d4976c',+ },+ },+ {+ scope: ['markup.heading', 'markup.heading entity.name'],+ settings: {+ fontStyle: 'bold',+ foreground: '#4d9375',+ },+ },+ {+ scope: 'markup.quote',+ settings: {+ foreground: '#5d99a9',+ },+ },+ {+ scope: 'markup.italic',+ settings: {+ fontStyle: 'italic',+ foreground: '#dbd7caee',+ },+ },+ {+ scope: 'markup.bold',+ settings: {+ fontStyle: 'bold',+ foreground: '#dbd7caee',+ },+ },+ {+ scope: 'markup.raw',+ settings: {+ foreground: '#4d9375',+ },+ },+ {+ scope: ['markup.deleted', 'meta.diff.header.from-file', 'punctuation.definition.deleted'],+ settings: {+ background: '#86181d',+ foreground: '#fdaeb7',+ },+ },+ {+ scope: ['markup.inserted', 'meta.diff.header.to-file', 'punctuation.definition.inserted'],+ settings: {+ background: '#144620',+ foreground: '#85e89d',+ },+ },+ {+ scope: ['markup.changed', 'punctuation.definition.changed'],+ settings: {+ background: '#c24e00',+ foreground: '#ffab70',+ },+ },+ {+ scope: ['markup.ignored', 'markup.untracked'],+ settings: {+ background: '#79b8ff',+ foreground: '#2f363d',+ },+ },+ {+ scope: 'meta.diff.range',+ settings: {+ fontStyle: 'bold',+ foreground: '#b392f0',+ },+ },+ {+ scope: 'meta.diff.header',+ settings: {+ foreground: '#79b8ff',+ },+ },+ {+ scope: 'meta.separator',+ settings: {+ fontStyle: 'bold',+ foreground: '#79b8ff',+ },+ },+ {+ scope: 'meta.output',+ settings: {+ foreground: '#79b8ff',+ },+ },+ {+ scope: ['brackethighlighter.tag', 'brackethighlighter.curly', 'brackethighlighter.round', 'brackethighlighter.square', 'brackethighlighter.angle', 'brackethighlighter.quote'],+ settings: {+ foreground: '#d1d5da',+ },+ },+ {+ scope: 'brackethighlighter.unmatched',+ settings: {+ foreground: '#fdaeb7',+ },+ },+ {+ scope: ['constant.other.reference.link', 'string.other.link', 'punctuation.definition.string.begin.markdown', 'punctuation.definition.string.end.markdown'],+ settings: {+ foreground: '#c98a7d',+ },+ },+ {+ scope: ['markup.underline.link.markdown', 'markup.underline.link.image.markdown'],+ settings: {+ fontStyle: 'underline',+ foreground: '#dedcd590',+ },+ },+ {+ scope: ['type.identifier', 'constant.other.character-class.regexp'],+ settings: {+ foreground: '#6872ab',+ },+ },+ {+ scope: ['entity.other.attribute-name.html.vue'],+ settings: {+ foreground: '#80a665',+ },+ },+ {+ scope: ['invalid.illegal.unrecognized-tag.html'],+ settings: {+ fontStyle: 'normal',+ },+ },+ ],+} as unknown as ThemeRegistration;diff --git a/apps/app-client/src/modules/shared/utils/copy.tsx b/apps/app-client/src/modules/shared/utils/copy.tsxnew file mode 100644index 00000000..3e916669--- /dev/null+++ b/apps/app-client/src/modules/shared/utils/copy.tsx@@ -0,0 +1,30 @@+import type { ComponentProps, ParentComponent } from 'solid-js';+import { Button } from '@/modules/ui/components/button';+import { createSignal } from 'solid-js';++export function useCopy() {+ const [getIsJustCopied, setIsJustCopied] = createSignal(false);++ const copy = ({ text }: { text: string }) => {+ navigator.clipboard.writeText(text).then(() => {+ setIsJustCopied(true);+ setTimeout(() => setIsJustCopied(false), 2000);+ });+ };++ return { copy, getIsJustCopied };+}++export const CopyButton: ParentComponent<{ text: string; label?: string; copiedLabel?: string } & ComponentProps<typeof Button>> = (props) => {+ const { copy, getIsJustCopied } = useCopy();++ return (+ <Button+ onClick={() => copy({ text: props.text })}+ {...props}+ >+ <div classList={{ 'i-tabler-copy': !getIsJustCopied(), 'i-tabler-check': getIsJustCopied() }} class="mr-2 text-lg" />+ {(getIsJustCopied() ? props.copiedLabel ?? 'Copied!' : props.children ?? props.label ?? 'Copy')}+ </Button>+ );+};diff --git a/apps/app-client/src/modules/shared/utils/urls.ts b/apps/app-client/src/modules/shared/utils/urls.tsnew file mode 100644index 00000000..00b66820--- /dev/null+++ b/apps/app-client/src/modules/shared/utils/urls.ts@@ -0,0 +1,6 @@+import { config } from '@/modules/config/config';+import { buildUrl } from '@corentinth/chisels';++export function createVitrineUrl({ path, baseUrl = config.vitrineBaseUrl }: { path: string; baseUrl?: string }): string {+ return buildUrl({ path, baseUrl });+}diff --git a/apps/app-client/src/modules/theme/theme.store.ts b/apps/app-client/src/modules/theme/theme.store.tsnew file mode 100644index 00000000..08baae97--- /dev/null+++ b/apps/app-client/src/modules/theme/theme.store.ts@@ -0,0 +1,11 @@+import type { ConfigColorMode } from '@kobalte/core/color-mode';+import { useColorMode } from '@kobalte/core/color-mode';++export function useThemeStore() {+ const { setColorMode, colorMode: getColorMode } = useColorMode();++ return {+ setColorMode: ({ mode }: { mode: ConfigColorMode }) => setColorMode(mode),+ getColorMode,+ };+}diff --git a/apps/app-client/src/modules/ui/components/alert.tsx b/apps/app-client/src/modules/ui/components/alert.tsxnew file mode 100644index 00000000..72f28ea1--- /dev/null+++ b/apps/app-client/src/modules/ui/components/alert.tsx@@ -0,0 +1,63 @@+import type { AlertRootProps } from '@kobalte/core/alert';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { VariantProps } from 'class-variance-authority';+import type { ComponentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Alert as AlertPrimitive } from '@kobalte/core/alert';+import { cva } from 'class-variance-authority';+import { splitProps } from 'solid-js';++export const alertVariants = cva(+ 'relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:(absolute left-4 top-4 text-foreground)',+ {+ variants: {+ variant: {+ default: 'bg-background text-foreground',+ destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',+ },+ },+ defaultVariants: {+ variant: 'default',+ },+ },+);++type alertProps<T extends ValidComponent = 'div'> = AlertRootProps<T> &+ VariantProps<typeof alertVariants> & {+ class?: string;+ };++export function Alert<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, alertProps<T>>) {+ const [local, rest] = splitProps(props as alertProps, ['class', 'variant']);++ return (+ <AlertPrimitive+ class={cn(+ alertVariants({+ variant: props.variant,+ }),+ local.class,+ )}+ {...rest}+ />+ );+}++export function AlertTitle(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn('font-medium leading-5 tracking-tight', local.class)}+ {...rest}+ />+ );+}++export function AlertDescription(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div class={cn('text-sm [&_p]:leading-relaxed', local.class)} {...rest} />+ );+}diff --git a/apps/app-client/src/modules/ui/components/badge.tsx b/apps/app-client/src/modules/ui/components/badge.tsxnew file mode 100644index 00000000..3da569eb--- /dev/null+++ b/apps/app-client/src/modules/ui/components/badge.tsx@@ -0,0 +1,37 @@+import type { VariantProps } from 'class-variance-authority';+import { cn } from '@/modules/shared/style/cn';+import { cva } from 'class-variance-authority';+import { type ComponentProps, splitProps } from 'solid-js';++export const badgeVariants = cva(+ 'inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-shadow focus-visible:(outline-none ring-1.5 ring-ring)',+ {+ variants: {+ variant: {+ default: 'bg-primary text-primary-foreground shadow hover:bg-primary/80',+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',+ destructive: 'bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',+ outline: 'border text-foreground',+ },+ },+ defaultVariants: {+ variant: 'default',+ },+ },+);++export function Badge(props: ComponentProps<'div'> & VariantProps<typeof badgeVariants>) {+ const [local, rest] = splitProps(props, ['class', 'variant']);++ return (+ <div+ class={cn(+ badgeVariants({+ variant: local.variant,+ }),+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/button.tsx b/apps/app-client/src/modules/ui/components/button.tsxnew file mode 100644index 00000000..806622ba--- /dev/null+++ b/apps/app-client/src/modules/ui/components/button.tsx@@ -0,0 +1,67 @@+import type { ButtonRootProps } from '@kobalte/core/button';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { VariantProps } from 'class-variance-authority';+import type { JSX, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Button as ButtonPrimitive } from '@kobalte/core/button';+import { cva } from 'class-variance-authority';+import { splitProps } from 'solid-js';++export const buttonVariants = cva(+ 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-shadow focus-visible:(outline-none ring-1.5 ring-ring) disabled:(pointer-events-none opacity-50) bg-inherit',+ {+ variants: {+ variant: {+ default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',+ destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',+ outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',+ secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',+ ghost: 'hover:(bg-accent/50 text-accent-foreground)',+ link: 'text-primary underline-offset-4 hover:underline',+ },+ size: {+ default: 'h-9 px-4 py-2',+ sm: 'h-8 px-3 text-xs',+ lg: 'h-10 px-8',+ icon: 'h-9 w-9',+ },+ },+ defaultVariants: {+ variant: 'default',+ size: 'default',+ },+ },+);++type buttonProps<T extends ValidComponent = 'button'> = ButtonRootProps<T> &+ VariantProps<typeof buttonVariants> & {+ class?: string;+ isLoading?: boolean;+ children?: JSX.Element;+ };++export function Button<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, buttonProps<T>>) {+ const [local, rest] = splitProps(props as buttonProps, [+ 'class',+ 'variant',+ 'size',+ 'isLoading',+ 'children',+ ]);++ return (+ <ButtonPrimitive+ class={cn(+ buttonVariants({+ size: local.size,+ variant: local.variant,+ }),+ local.class,+ )}+ {...rest}+ >+ {local.isLoading && <div class="i-tabler-loader-2 animate-spin mr-2" />}+ {local.children}+ </ButtonPrimitive>+ );+}diff --git a/apps/app-client/src/modules/ui/components/card.tsx b/apps/app-client/src/modules/ui/components/card.tsxnew file mode 100644index 00000000..bb95ee2e--- /dev/null+++ b/apps/app-client/src/modules/ui/components/card.tsx@@ -0,0 +1,60 @@+import type { ComponentProps, ParentComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { splitProps } from 'solid-js';++export function Card(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'rounded-xl border bg-card text-card-foreground',+ local.class,+ )}+ {...rest}+ />+ );+}++export function CardHeader(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div class={cn('flex flex-col space-y-1.5 p-6', local.class)} {...rest} />+ );+}++export const CardTitle: ParentComponent<ComponentProps<'h1'>> = (props) => {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <h1+ class={cn('font-semibold leading-none tracking-tight', local.class)}+ {...rest}+ />+ );+};++export const CardDescription: ParentComponent<ComponentProps<'h3'>> = (+ props,+) => {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <h3 class={cn('text-sm text-muted-foreground', local.class)} {...rest} />+ );+};++export function CardContent(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return <div class={cn('p-6 pt-0', local.class)} {...rest} />;+}++export function CardFooter(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div class={cn('flex items-center p-6 pt-0', local.class)} {...rest} />+ );+}diff --git a/apps/app-client/src/modules/ui/components/dialog.tsx b/apps/app-client/src/modules/ui/components/dialog.tsxnew file mode 100644index 00000000..6bc8814e--- /dev/null+++ b/apps/app-client/src/modules/ui/components/dialog.tsx@@ -0,0 +1,122 @@+import type {+ DialogContentProps,+ DialogDescriptionProps,+ DialogTitleProps,+} from '@kobalte/core/dialog';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { ComponentProps, ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Dialog as DialogPrimitive } from '@kobalte/core/dialog';+import { splitProps } from 'solid-js';++export const Dialog = DialogPrimitive;+export const DialogTrigger = DialogPrimitive.Trigger;++type dialogContentProps<T extends ValidComponent = 'div'> = ParentProps<+ DialogContentProps<T> & {+ class?: string;+ }+>;++export function DialogContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dialogContentProps<T>>) {+ const [local, rest] = splitProps(props as dialogContentProps, [+ 'class',+ 'children',+ ]);++ return (+ <DialogPrimitive.Portal>+ <DialogPrimitive.Overlay+ class={cn(+ 'fixed inset-0 z-50 bg-background/80 data-[expanded]:(animate-in fade-in-0) data-[closed]:(animate-out fade-out-0)',+ )}+ {...rest}+ />+ <DialogPrimitive.Content+ class={cn(+ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[expanded]:(animate-in fade-in-0 zoom-in-95 slide-in-from-left-1/2 slide-in-from-top-48% duration-200) data-[closed]:(animate-out fade-out-0 zoom-out-95 slide-out-to-left-1/2 slide-out-to-top-48% duration-200) md:w-full sm:rounded-lg',+ local.class,+ )}+ {...rest}+ >+ {local.children}+ <DialogPrimitive.CloseButton class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:(outline-none ring-1.5 ring-ring ring-offset-2) disabled:pointer-events-none bg-inherit transition-property-[opacity,box-shadow]">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class="h-4 w-4"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M18 6L6 18M6 6l12 12"+ />+ <title>Close</title>+ </svg>+ </DialogPrimitive.CloseButton>+ </DialogPrimitive.Content>+ </DialogPrimitive.Portal>+ );+}++type dialogTitleProps<T extends ValidComponent = 'h2'> = DialogTitleProps<T> & {+ class?: string;+};++export function DialogTitle<T extends ValidComponent = 'h2'>(props: PolymorphicProps<T, dialogTitleProps<T>>) {+ const [local, rest] = splitProps(props as dialogTitleProps, ['class']);++ return (+ <DialogPrimitive.Title+ class={cn('text-lg font-semibold text-foreground', local.class)}+ {...rest}+ />+ );+}++type dialogDescriptionProps<T extends ValidComponent = 'p'> =+ DialogDescriptionProps<T> & {+ class?: string;+ };++export function DialogDescription<T extends ValidComponent = 'p'>(props: PolymorphicProps<T, dialogDescriptionProps<T>>) {+ const [local, rest] = splitProps(props as dialogDescriptionProps, ['class']);++ return (+ <DialogPrimitive.Description+ class={cn('text-sm text-muted-foreground', local.class)}+ {...rest}+ />+ );+}++export function DialogHeader(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'flex flex-col space-y-2 text-center sm:text-left',+ local.class,+ )}+ {...rest}+ />+ );+}++export function DialogFooter(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'flex flex-col-reverse sm:(flex-row justify-end space-x-2)',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/dropdown-menu.tsx b/apps/app-client/src/modules/ui/components/dropdown-menu.tsxnew file mode 100644index 00000000..bbbd8750--- /dev/null+++ b/apps/app-client/src/modules/ui/components/dropdown-menu.tsx@@ -0,0 +1,286 @@+import type {+ DropdownMenuCheckboxItemProps,+ DropdownMenuContentProps,+ DropdownMenuGroupLabelProps,+ DropdownMenuItemLabelProps,+ DropdownMenuItemProps,+ DropdownMenuRadioItemProps,+ DropdownMenuRootProps,+ DropdownMenuSeparatorProps,+ DropdownMenuSubTriggerProps,+} from '@kobalte/core/dropdown-menu';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { ComponentProps, ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { DropdownMenu as DropdownMenuPrimitive } from '@kobalte/core/dropdown-menu';+import { mergeProps, splitProps } from 'solid-js';++export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;+export const DropdownMenuGroup = DropdownMenuPrimitive.Group;+export const DropdownMenuSub = DropdownMenuPrimitive.Sub;+export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;++export function DropdownMenu(props: DropdownMenuRootProps) {+ const merge = mergeProps<DropdownMenuRootProps[]>({ gutter: 4 }, props);++ return <DropdownMenuPrimitive {...merge} />;+}++type dropdownMenuContentProps<T extends ValidComponent = 'div'> =+ DropdownMenuContentProps<T> & {+ class?: string;+ };++export function DropdownMenuContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuContentProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuContentProps, [+ 'class',+ ]);++ return (+ <DropdownMenuPrimitive.Portal>+ <DropdownMenuPrimitive.Content+ class={cn(+ 'min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95) focus-visible:(outline-none ring-1.5 ring-ring) transition-shadow',+ local.class,+ )}+ {...rest}+ />+ </DropdownMenuPrimitive.Portal>+ );+}++type dropdownMenuItemProps<T extends ValidComponent = 'div'> =+ DropdownMenuItemProps<T> & {+ class?: string;+ inset?: boolean;+ };++export function DropdownMenuItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuItemProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuItemProps, [+ 'class',+ 'inset',+ ]);++ return (+ <DropdownMenuPrimitive.Item+ class={cn(+ 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',+ local.inset && 'pl-8',+ local.class,+ )}+ {...rest}+ />+ );+}++type dropdownMenuGroupLabelProps<T extends ValidComponent = 'span'> =+ DropdownMenuGroupLabelProps<T> & {+ class?: string;+ };++export function DropdownMenuGroupLabel<T extends ValidComponent = 'span'>(props: PolymorphicProps<T, dropdownMenuGroupLabelProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuGroupLabelProps, [+ 'class',+ ]);++ return (+ <DropdownMenuPrimitive.GroupLabel+ as="div"+ class={cn('px-2 py-1.5 text-sm font-semibold', local.class)}+ {...rest}+ />+ );+}++type dropdownMenuItemLabelProps<T extends ValidComponent = 'div'> =+ DropdownMenuItemLabelProps<T> & {+ class?: string;+ };++export function DropdownMenuItemLabel<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuItemLabelProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuItemLabelProps, [+ 'class',+ ]);++ return (+ <DropdownMenuPrimitive.ItemLabel+ as="div"+ class={cn('px-2 py-1.5 text-sm font-semibold', local.class)}+ {...rest}+ />+ );+}++type dropdownMenuSeparatorProps<T extends ValidComponent = 'hr'> =+ DropdownMenuSeparatorProps<T> & {+ class?: string;+ };++export function DropdownMenuSeparator<T extends ValidComponent = 'hr'>(props: PolymorphicProps<T, dropdownMenuSeparatorProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuSeparatorProps, [+ 'class',+ ]);++ return (+ <DropdownMenuPrimitive.Separator+ class={cn('-mx-1 my-1 h-px bg-muted', local.class)}+ {...rest}+ />+ );+}++export function DropdownMenuShortcut(props: ComponentProps<'span'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <span+ class={cn('ml-auto text-xs tracking-widest opacity-60', local.class)}+ {...rest}+ />+ );+}++type dropdownMenuSubTriggerProps<T extends ValidComponent = 'div'> = ParentProps< DropdownMenuSubTriggerProps<T> & { class?: string }>;++export function DropdownMenuSubTrigger<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuSubTriggerProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuSubTriggerProps, [+ 'class',+ 'children',+ ]);++ return (+ <DropdownMenuPrimitive.SubTrigger+ class={cn(+ 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[expanded]:bg-accent',+ local.class,+ )}+ {...rest}+ >+ {local.children}+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width="1em"+ height="1em"+ viewBox="0 0 24 24"+ class="ml-auto h-4 w-4"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m9 6l6 6l-6 6"+ />+ <title>Arrow</title>+ </svg>+ </DropdownMenuPrimitive.SubTrigger>+ );+}++type dropdownMenuSubContentProps<T extends ValidComponent = 'div'> =+ DropdownMenuSubTriggerProps<T> & {+ class?: string;+ };++export function DropdownMenuSubContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuSubContentProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuSubContentProps, [+ 'class',+ ]);++ return (+ <DropdownMenuPrimitive.Portal>+ <DropdownMenuPrimitive.SubContent+ class={cn(+ 'min-w-8rem z-50 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95)',+ local.class,+ )}+ {...rest}+ />+ </DropdownMenuPrimitive.Portal>+ );+}++type dropdownMenuCheckboxItemProps<T extends ValidComponent = 'div'> = ParentProps< DropdownMenuCheckboxItemProps<T> & { class?: string } >;++export function DropdownMenuCheckboxItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuCheckboxItemProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuCheckboxItemProps, [+ 'class',+ 'children',+ ]);++ return (+ <DropdownMenuPrimitive.CheckboxItem+ class={cn(+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',+ local.class,+ )}+ {...rest}+ >+ <DropdownMenuPrimitive.ItemIndicator class="absolute left-2 inline-flex h-4 w-4 items-center justify-center">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class="h-4 w-4"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m5 12l5 5L20 7"+ />+ <title>Checkbox</title>+ </svg>+ </DropdownMenuPrimitive.ItemIndicator>+ {props.children}+ </DropdownMenuPrimitive.CheckboxItem>+ );+}++type dropdownMenuRadioItemProps<T extends ValidComponent = 'div'> = ParentProps<+ DropdownMenuRadioItemProps<T> & {+ class?: string;+ }+>;++export function DropdownMenuRadioItem<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, dropdownMenuRadioItemProps<T>>) {+ const [local, rest] = splitProps(props as dropdownMenuRadioItemProps, [+ 'class',+ 'children',+ ]);++ return (+ <DropdownMenuPrimitive.RadioItem+ class={cn(+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',+ local.class,+ )}+ {...rest}+ >+ <DropdownMenuPrimitive.ItemIndicator class="absolute left-2 inline-flex h-4 w-4 items-center justify-center">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class="h-2 w-2"+ >+ <g+ fill="none"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ >+ <path d="M0 0h24v24H0z" />+ <path+ fill="currentColor"+ d="M7 3.34a10 10 0 1 1-4.995 8.984L2 12l.005-.324A10 10 0 0 1 7 3.34"+ />+ </g>+ <title>Radio</title>+ </svg>+ </DropdownMenuPrimitive.ItemIndicator>+ {props.children}+ </DropdownMenuPrimitive.RadioItem>+ );+}diff --git a/apps/app-client/src/modules/ui/components/number-field.tsx b/apps/app-client/src/modules/ui/components/number-field.tsxnew file mode 100644index 00000000..3e7596da--- /dev/null+++ b/apps/app-client/src/modules/ui/components/number-field.tsx@@ -0,0 +1,171 @@+import type {+ NumberFieldDecrementTriggerProps,+ NumberFieldDescriptionProps,+ NumberFieldErrorMessageProps,+ NumberFieldIncrementTriggerProps,+ NumberFieldInputProps,+ NumberFieldLabelProps,+ NumberFieldRootProps,+} from '@kobalte/core/number-field';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { ComponentProps, ValidComponent, VoidProps } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { NumberField as NumberFieldPrimitive } from '@kobalte/core/number-field';+import { splitProps } from 'solid-js';+import { textfieldLabel } from './textfield';++export const NumberFieldHiddenInput = NumberFieldPrimitive.HiddenInput;++type numberFieldLabelProps<T extends ValidComponent = 'div'> = NumberFieldLabelProps<T> & { class?: string };++export function NumberFieldLabel<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, numberFieldLabelProps<T>>) {+ const [local, rest] = splitProps(props as numberFieldLabelProps, ['class']);++ return (+ <NumberFieldPrimitive.Label+ class={cn(textfieldLabel({ label: true }), local.class)}+ {...rest}+ />+ );+}++type numberFieldDescriptionProps<T extends ValidComponent = 'div'> = NumberFieldDescriptionProps<T> & { class?: string };++export function NumberFieldDescription<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, numberFieldDescriptionProps<T>>) {+ const [local, rest] = splitProps(props as numberFieldDescriptionProps, ['class']);++ return (+ <NumberFieldPrimitive.Description+ class={cn(+ textfieldLabel({ description: true, label: false }),+ local.class,+ )}+ {...rest}+ />+ );+}++type numberFieldErrorMessageProps<T extends ValidComponent = 'div'> = NumberFieldErrorMessageProps<T> & { class?: string };++export function NumberFieldErrorMessage<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, numberFieldErrorMessageProps<T>>) {+ const [local, rest] = splitProps(props as numberFieldErrorMessageProps, [+ 'class',+ ]);++ return (+ <NumberFieldPrimitive.ErrorMessage+ class={cn(textfieldLabel({ error: true }), local.class)}+ {...rest}+ />+ );+}++type numberFieldProps<T extends ValidComponent = 'div'> =+ NumberFieldRootProps<T> & {+ class?: string;+ };++export function NumberField<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, numberFieldProps<T>>) {+ const [local, rest] = splitProps(props as numberFieldProps, ['class']);++ return (+ <NumberFieldPrimitive class={cn('grid gap-1.5', local.class)} {...rest} />+ );+}++export function NumberFieldGroup(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'relative focus-within:(outline-none ring-1.5 ring-ring) transition-shadow rounded-md',+ local.class,+ )}+ {...rest}+ />+ );+}++type numberFieldInputProps<T extends ValidComponent = 'input'> =+ NumberFieldInputProps<T> & {+ class?: string;+ };++export function NumberFieldInput<T extends ValidComponent = 'input'>(props: PolymorphicProps<T, VoidProps<numberFieldInputProps<T>>>) {+ const [local, rest] = splitProps(props as numberFieldInputProps, ['class']);++ return (+ <NumberFieldPrimitive.Input+ class={cn(+ 'flex h-9 w-full rounded-md border border-input bg-transparent px-10 py-1 text-sm text-center shadow-sm placeholder:text-muted-foreground disabled:(cursor-not-allowed opacity-50) focus-visible:outline-none',+ local.class,+ )}+ {...rest}+ />+ );+}++type numberFieldDecrementTriggerProps<T extends ValidComponent = 'button'> = VoidProps<NumberFieldDecrementTriggerProps<T> & { class?: string }>;++export function NumberFieldDecrementTrigger<T extends ValidComponent = 'button',>(props: PolymorphicProps<T, VoidProps<numberFieldDecrementTriggerProps<T>>>) {+ const [local, rest] = splitProps(props as numberFieldDecrementTriggerProps, ['class']);++ return (+ <NumberFieldPrimitive.DecrementTrigger+ class={cn(+ 'absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:(cursor-not-allowed opacity-20)',+ local.class,+ )}+ {...rest}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="size-4"+ viewBox="0 0 24 24"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M5 12h14"+ />+ <title>Decrease number</title>+ </svg>+ </NumberFieldPrimitive.DecrementTrigger>+ );+}++type numberFieldIncrementTriggerProps<T extends ValidComponent = 'button'> = VoidProps< NumberFieldIncrementTriggerProps<T> & { class?: string }>;++export function NumberFieldIncrementTrigger< T extends ValidComponent = 'button',>(props: PolymorphicProps<T, numberFieldIncrementTriggerProps<T>>) {+ const [local, rest] = splitProps(props as numberFieldIncrementTriggerProps, ['class']);++ return (+ <NumberFieldPrimitive.IncrementTrigger+ class={cn(+ 'absolute top-1/2 -translate-y-1/2 right-0 disabled:(cursor-not-allowed opacity-20) p-3',+ local.class,+ )}+ {...rest}+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="size-4"+ viewBox="0 0 24 24"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M12 5v14m-7-7h14"+ />+ <title>Increase number</title>+ </svg>+ </NumberFieldPrimitive.IncrementTrigger>+ );+}diff --git a/apps/app-client/src/modules/ui/components/popover.tsx b/apps/app-client/src/modules/ui/components/popover.tsxnew file mode 100644index 00000000..9a5e13b4--- /dev/null+++ b/apps/app-client/src/modules/ui/components/popover.tsx@@ -0,0 +1,69 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ PopoverContentProps,+ PopoverRootProps,+} from '@kobalte/core/popover';+import type { ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Popover as PopoverPrimitive } from '@kobalte/core/popover';+import { mergeProps, splitProps } from 'solid-js';++export const PopoverTrigger = PopoverPrimitive.Trigger;+export const PopoverTitle = PopoverPrimitive.Title;+export const PopoverDescription = PopoverPrimitive.Description;++export function Popover(props: PopoverRootProps) {+ const merge = mergeProps<PopoverRootProps[]>(+ {+ gutter: 4,+ flip: false,+ },+ props,+ );++ return <PopoverPrimitive {...merge} />;+}++type popoverContentProps<T extends ValidComponent = 'div'> = ParentProps<+ PopoverContentProps<T> & {+ class?: string;+ }+>;++export function PopoverContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, popoverContentProps<T>>) {+ const [local, rest] = splitProps(props as popoverContentProps, [+ 'class',+ 'children',+ ]);++ return (+ <PopoverPrimitive.Portal>+ <PopoverPrimitive.Content+ class={cn(+ 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95)',+ local.class,+ )}+ {...rest}+ >+ {local.children}+ <PopoverPrimitive.CloseButton class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:(outline-none ring-1.5 ring-ring ring-offset-2) disabled:pointer-events-none bg-inherit transition-property-[opacity,box-shadow]">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class="h-4 w-4"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M18 6L6 18M6 6l12 12"+ />+ <title>Close</title>+ </svg>+ </PopoverPrimitive.CloseButton>+ </PopoverPrimitive.Content>+ </PopoverPrimitive.Portal>+ );+}diff --git a/apps/app-client/src/modules/ui/components/progress.tsx b/apps/app-client/src/modules/ui/components/progress.tsxnew file mode 100644index 00000000..8fd4ae3c--- /dev/null+++ b/apps/app-client/src/modules/ui/components/progress.tsx@@ -0,0 +1,34 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { ProgressRootProps } from '@kobalte/core/progress';+import type { ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Progress as ProgressPrimitive } from '@kobalte/core/progress';+import { splitProps } from 'solid-js';++export const ProgressLabel = ProgressPrimitive.Label;+export const ProgressValueLabel = ProgressPrimitive.ValueLabel;++type progressProps<T extends ValidComponent = 'div'> = ParentProps<+ ProgressRootProps<T> & {+ class?: string;+ }+>;++export function Progress<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, progressProps<T>>) {+ const [local, rest] = splitProps(props as progressProps, [+ 'class',+ 'children',+ ]);++ return (+ <ProgressPrimitive+ class={cn('flex w-full flex-col gap-2', local.class)}+ {...rest}+ >+ {local.children}+ <ProgressPrimitive.Track class="h-2 overflow-hidden rounded-full bg-primary/20">+ <ProgressPrimitive.Fill class="h-full w-[--kb-progress-fill-width] bg-primary transition-all duration-500 ease-linear data-[progress=complete]:bg-primary" />+ </ProgressPrimitive.Track>+ </ProgressPrimitive>+ );+}diff --git a/apps/app-client/src/modules/ui/components/select.tsx b/apps/app-client/src/modules/ui/components/select.tsxnew file mode 100644index 00000000..5256aa01--- /dev/null+++ b/apps/app-client/src/modules/ui/components/select.tsx@@ -0,0 +1,117 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ SelectContentProps,+ SelectItemProps,+ SelectTriggerProps,+} from '@kobalte/core/select';+import type { ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Select as SelectPrimitive } from '@kobalte/core/select';+import { splitProps } from 'solid-js';++export const Select = SelectPrimitive;+export const SelectValue = SelectPrimitive.Value;+export const SelectDescription = SelectPrimitive.Description;+export const SelectErrorMessage = SelectPrimitive.ErrorMessage;+export const SelectItemDescription = SelectPrimitive.ItemDescription;+export const SelectHiddenSelect = SelectPrimitive.HiddenSelect;+export const SelectSection = SelectPrimitive.Section;++type selectTriggerProps<T extends ValidComponent = 'button'> = ParentProps<SelectTriggerProps<T> & { class?: string }>;++export function SelectTrigger<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, selectTriggerProps<T>>) {+ const [local, rest] = splitProps(props as selectTriggerProps, [+ 'class',+ 'children',+ ]);++ return (+ <SelectPrimitive.Trigger+ class={cn(+ 'flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus-visible:(ring-1.5 ring-ring) disabled:(cursor-not-allowed opacity-50) transition-shadow',+ local.class,+ )}+ {...rest}+ >+ {local.children}+ <SelectPrimitive.Icon+ as="svg"+ xmlns="http://www.w3.org/2000/svg"+ width="1em"+ height="1em"+ viewBox="0 0 24 24"+ class="size-4 opacity-50 flex items-center justify-center"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m8 9l4-4l4 4m0 6l-4 4l-4-4"+ />+ </SelectPrimitive.Icon>+ </SelectPrimitive.Trigger>+ );+}++type selectContentProps<T extends ValidComponent = 'div'> =+ SelectContentProps<T> & {+ class?: string;+ };++export function SelectContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, selectContentProps<T>>) {+ const [local, rest] = splitProps(props as selectContentProps, ['class']);++ return (+ <SelectPrimitive.Portal>+ <SelectPrimitive.Content+ class={cn(+ 'relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95)',+ local.class,+ )}+ {...rest}+ >+ <SelectPrimitive.Listbox class="p-1 focus-visible:outline-none" />+ </SelectPrimitive.Content>+ </SelectPrimitive.Portal>+ );+}++type selectItemProps<T extends ValidComponent = 'li'> = ParentProps<SelectItemProps<T> & { class?: string }>;++export function SelectItem<T extends ValidComponent = 'li'>(props: PolymorphicProps<T, selectItemProps<T>>) {+ const [local, rest] = splitProps(props as selectItemProps, [+ 'class',+ 'children',+ ]);++ return (+ <SelectPrimitive.Item+ class={cn(+ 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:(bg-accent text-accent-foreground) data-[disabled]:(pointer-events-none opacity-50)',+ local.class,+ )}+ {...rest}+ >+ <SelectPrimitive.ItemIndicator class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ class="h-4 w-4"+ viewBox="0 0 24 24"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m5 12l5 5L20 7"+ />+ <title>Checked</title>+ </svg>+ </SelectPrimitive.ItemIndicator>+ <SelectPrimitive.ItemLabel>{local.children}</SelectPrimitive.ItemLabel>+ </SelectPrimitive.Item>+ );+}diff --git a/apps/app-client/src/modules/ui/components/separator.tsx b/apps/app-client/src/modules/ui/components/separator.tsxnew file mode 100644index 00000000..27490828--- /dev/null+++ b/apps/app-client/src/modules/ui/components/separator.tsx@@ -0,0 +1,24 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { SeparatorRootProps } from '@kobalte/core/separator';+import type { ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Separator as SeparatorPrimitive } from '@kobalte/core/separator';+import { splitProps } from 'solid-js';++type separatorProps<T extends ValidComponent = 'hr'> = SeparatorRootProps<T> & {+ class?: string;+};++export function Separator<T extends ValidComponent = 'hr'>(props: PolymorphicProps<T, separatorProps<T>>) {+ const [local, rest] = splitProps(props as separatorProps, ['class']);++ return (+ <SeparatorPrimitive+ class={cn(+ 'shrink-0 bg-border data-[orientation=horizontal]:h-[1px] data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-[1px]',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/sheet.tsx b/apps/app-client/src/modules/ui/components/sheet.tsxnew file mode 100644index 00000000..bd64a36b--- /dev/null+++ b/apps/app-client/src/modules/ui/components/sheet.tsx@@ -0,0 +1,141 @@+import type {+ DialogContentProps,+ DialogDescriptionProps,+ DialogTitleProps,+} from '@kobalte/core/dialog';+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { VariantProps } from 'class-variance-authority';+import type { ComponentProps, ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Dialog as DialogPrimitive } from '@kobalte/core/dialog';+import { cva } from 'class-variance-authority';+import { mergeProps, splitProps } from 'solid-js';++export const Sheet = DialogPrimitive;+export const SheetTrigger = DialogPrimitive.Trigger;++export const sheetVariants = cva(+ 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out duration-200 data-[expanded]:(animate-in duration-200) data-[closed]:(animate-out duration-200)',+ {+ variants: {+ side: {+ top: 'inset-x-0 top-0 border-b data-[closed]:slide-out-to-top data-[expanded]:slide-in-from-top',+ bottom: 'inset-x-0 bottom-0 border-t data-[closed]:slide-out-to-bottom data-[expanded]:slide-in-from-bottom',+ left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[closed]:slide-out-to-left data-[expanded]:slide-in-from-left sm:max-w-sm',+ right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[closed]:slide-out-to-right data-[expanded]:slide-in-from-right sm:max-w-sm',+ },+ },+ defaultVariants: {+ side: 'right',+ },+ },+);++type sheetContentProps<T extends ValidComponent = 'div'> = ParentProps<+ DialogContentProps<T> &+ VariantProps<typeof sheetVariants> & {+ class?: string;+ }+>;++export function SheetContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, sheetContentProps<T>>) {+ const merge = mergeProps<sheetContentProps<T>[]>({ side: 'right' }, props);+ const [local, rest] = splitProps(merge as sheetContentProps, [+ 'class',+ 'children',+ 'side',+ ]);++ return (+ <DialogPrimitive.Portal>+ <DialogPrimitive.Overlay+ class={cn(+ 'fixed inset-0 z-50 bg-background/80 data-[expanded]:(animate-in fade-in-0) data-[closed]:(animate-out fade-out-0)',+ )}+ {...rest}+ />+ <DialogPrimitive.Content+ class={sheetVariants({ side: local.side, class: local.class })}+ {...rest}+ >+ {local.children}+ <DialogPrimitive.CloseButton class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:(outline-none ring-1.5 ring-ring ring-offset-2) disabled:pointer-events-none bg-inherit transition-property-[opacity,box-shadow]">+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ class="h-4 w-4"+ >+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M18 6L6 18M6 6l12 12"+ />+ <title>Close</title>+ </svg>+ </DialogPrimitive.CloseButton>+ </DialogPrimitive.Content>+ </DialogPrimitive.Portal>+ );+}++type sheetTitleProps<T extends ValidComponent = 'h2'> = DialogTitleProps<T> & {+ class?: string;+};++export function SheetTitle<T extends ValidComponent = 'h2'>(props: PolymorphicProps<T, sheetTitleProps<T>>) {+ const [local, rest] = splitProps(props as sheetTitleProps, ['class']);++ return (+ <DialogPrimitive.Title+ class={cn('text-lg font-semibold text-foreground', local.class)}+ {...rest}+ />+ );+}++type sheetDescriptionProps<T extends ValidComponent = 'p'> =+ DialogDescriptionProps<T> & {+ class?: string;+ };++export function SheetDescription<T extends ValidComponent = 'p'>(props: PolymorphicProps<T, sheetDescriptionProps<T>>) {+ const [local, rest] = splitProps(props as sheetDescriptionProps, ['class']);++ return (+ <DialogPrimitive.Description+ class={cn('text-sm text-muted-foreground', local.class)}+ {...rest}+ />+ );+}++export function SheetHeader(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'flex flex-col space-y-2 text-center sm:text-left',+ local.class,+ )}+ {...rest}+ />+ );+}++export function SheetFooter(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn(+ 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/skeleton.tsx b/apps/app-client/src/modules/ui/components/skeleton.tsxnew file mode 100644index 00000000..ce795efc--- /dev/null+++ b/apps/app-client/src/modules/ui/components/skeleton.tsx@@ -0,0 +1,13 @@+import { cn } from '@/modules/shared/style/cn';+import { type ComponentProps, splitProps } from 'solid-js';++export function Skeleton(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div+ class={cn('animate-pulse rounded-md bg-primary/10', local.class)}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/sonner.tsx b/apps/app-client/src/modules/ui/components/sonner.tsxnew file mode 100644index 00000000..8ed57c5d--- /dev/null+++ b/apps/app-client/src/modules/ui/components/sonner.tsx@@ -0,0 +1,20 @@+import { Toaster as Sonner } from 'solid-sonner';++export { toast } from 'solid-sonner';++export function Toaster(props: Parameters<typeof Sonner>[0]) {+ return (+ <Sonner+ class="toaster group"+ toastOptions={{+ classes: {+ toast: 'group toast group-[.toaster]:(bg-background text-foreground border border-border shadow-lg)',+ description: 'group-[.toast]:text-muted-foreground',+ actionButton: 'group-[.toast]:(bg-primary text-primary-foreground)',+ cancelButton: 'group-[.toast]:(bg-muted text-muted-foreground)',+ },+ }}+ {...props}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/switch.tsx b/apps/app-client/src/modules/ui/components/switch.tsxnew file mode 100644index 00000000..0e98722b--- /dev/null+++ b/apps/app-client/src/modules/ui/components/switch.tsx@@ -0,0 +1,54 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ SwitchControlProps,+ SwitchThumbProps,+} from '@kobalte/core/switch';+import type { ParentProps, ValidComponent, VoidProps } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Switch as SwitchPrimitive } from '@kobalte/core/switch';+import { splitProps } from 'solid-js';++export const SwitchLabel = SwitchPrimitive.Label;+export const Switch = SwitchPrimitive;+export const SwitchErrorMessage = SwitchPrimitive.ErrorMessage;+export const SwitchDescription = SwitchPrimitive.Description;++type switchControlProps<T extends ValidComponent = 'input'> = ParentProps<SwitchControlProps<T> & { class?: string }>;++export function SwitchControl<T extends ValidComponent = 'input'>(props: PolymorphicProps<T, switchControlProps<T>>) {+ const [local, rest] = splitProps(props as switchControlProps, [+ 'class',+ 'children',+ ]);++ return (+ <>+ <SwitchPrimitive.Input class="[&:focus-visible+div]:(outline-none ring-1.5 ring-ring ring-offset-2 ring-offset-background)" />+ <SwitchPrimitive.Control+ class={cn(+ 'inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input shadow-sm transition-shadow data-[disabled]:(cursor-not-allowed opacity-50) data-[checked]:bg-primary transition-property-[box-shadow,color,background-color]',+ local.class,+ )}+ {...rest}+ >+ {local.children}+ </SwitchPrimitive.Control>+ </>+ );+}++type switchThumbProps<T extends ValidComponent = 'div'> = VoidProps<SwitchThumbProps<T> & { class?: string }>;++export function SwitchThumb<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, switchThumbProps<T>>) {+ const [local, rest] = splitProps(props as switchThumbProps, ['class']);++ return (+ <SwitchPrimitive.Thumb+ class={cn(+ 'pointer-events-none block h-4 w-4 translate-x-0 rounded-full bg-background shadow-lg transition-transform data-[checked]:translate-x-4',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/table.tsx b/apps/app-client/src/modules/ui/components/table.tsxnew file mode 100644index 00000000..10ab6fb7--- /dev/null+++ b/apps/app-client/src/modules/ui/components/table.tsx@@ -0,0 +1,93 @@+import { cn } from '@/modules/shared/style/cn';+import { type ComponentProps, splitProps } from 'solid-js';++export function Table(props: ComponentProps<'table'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <div class="w-full overflow-auto">+ <table+ class={cn('w-full caption-bottom text-sm text-nowrap', local.class)}+ {...rest}+ />+ </div>+ );+}++export function TableHeader(props: ComponentProps<'thead'>) {+ const [local, rest] = splitProps(props, ['class']);++ return <thead class={cn('[&_tr]:border-b', local.class)} {...rest} />;+}++export function TableBody(props: ComponentProps<'tbody'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <tbody class={cn('[&_tr:last-child]:border-0', local.class)} {...rest} />+ );+}++export function TableFooter(props: ComponentProps<'tfoot'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <tbody+ class={cn('bg-primary font-medium text-primary-foreground', local.class)}+ {...rest}+ />+ );+}++export function TableRow(props: ComponentProps<'tr'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <tr+ class={cn(+ 'border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted',+ local.class,+ )}+ {...rest}+ />+ );+}++export function TableHead(props: ComponentProps<'th'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <th+ class={cn(+ 'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',+ local.class,+ )}+ {...rest}+ />+ );+}++export function TableCell(props: ComponentProps<'td'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <td+ class={cn(+ 'p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',+ local.class,+ )}+ {...rest}+ />+ );+}++export function TableCaption(props: ComponentProps<'caption'>) {+ const [local, rest] = splitProps(props, ['class']);++ return (+ <caption+ class={cn('mt-4 text-sm text-muted-foreground', local.class)}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/tabs.tsx b/apps/app-client/src/modules/ui/components/tabs.tsxnew file mode 100644index 00000000..eff8f344--- /dev/null+++ b/apps/app-client/src/modules/ui/components/tabs.tsx@@ -0,0 +1,121 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ TabsContentProps,+ TabsIndicatorProps,+ TabsListProps,+ TabsRootProps,+ TabsTriggerProps,+} from '@kobalte/core/tabs';+import type { VariantProps } from 'class-variance-authority';+import type { ValidComponent, VoidProps } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { Tabs as TabsPrimitive } from '@kobalte/core/tabs';+import { cva } from 'class-variance-authority';+import { splitProps } from 'solid-js';++type tabsProps<T extends ValidComponent = 'div'> = TabsRootProps<T> & {+ class?: string;+};++export function Tabs<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, tabsProps<T>>) {+ const [local, rest] = splitProps(props as tabsProps, ['class']);++ return (+ <TabsPrimitive+ class={cn('w-full data-[orientation=vertical]:flex', local.class)}+ {...rest}+ />+ );+}++type tabsListProps<T extends ValidComponent = 'div'> = TabsListProps<T> & {+ class?: string;+};++export function TabsList<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, tabsListProps<T>>) {+ const [local, rest] = splitProps(props as tabsListProps, ['class']);++ return (+ <TabsPrimitive.List+ class={cn(+ 'relative flex rounded-lg bg-muted p-1 text-muted-foreground data-[orientation=vertical]:(flex-col items-stretch) data-[orientation=horizontal]:items-center w-full',+ local.class,+ )}+ {...rest}+ />+ );+}++type tabsContentProps<T extends ValidComponent = 'div'> =+ TabsContentProps<T> & {+ class?: string;+ };++export function TabsContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, tabsContentProps<T>>) {+ const [local, rest] = splitProps(props as tabsContentProps, ['class']);++ return (+ <TabsPrimitive.Content+ class={cn(+ 'data-[orientation=vertical]:ml-2 data-[orientation=horizontal]:mt-2 transition-shadow duration-200 focus-visible:(ring-offset-background outline-none ring-1.5 ring-ring ring-offset-2)',+ local.class,+ )}+ {...rest}+ />+ );+}++type tabsTriggerProps<T extends ValidComponent = 'button'> =+ TabsTriggerProps<T> & {+ class?: string;+ };++export function TabsTrigger<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, tabsTriggerProps<T>>) {+ const [local, rest] = splitProps(props as tabsTriggerProps, ['class']);++ return (+ <TabsPrimitive.Trigger+ class={cn(+ 'w-full relative z-10 inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-colors disabled:(pointer-events-none opacity-50) data-[selected]:text-foreground peer h-7 outline-none',+ local.class,+ )}+ {...rest}+ />+ );+}++const tabsIndicatorVariants = cva(+ 'absolute transition-all duration-200 outline-none',+ {+ variants: {+ variant: {+ block: 'data-[orientation=horizontal]:(bottom-1 left-0 h-[calc(100%-0.5rem)]) data-[orientation=vertical]:(right-1 top-0 w-[calc(100%-0.5rem)]) bg-background shadow rounded-md peer-focus-visible:(ring-1.5 ring-ring ring-offset-2 ring-offset-background outline-none)',+ underline: 'data-[orientation=horizontal]:(-bottom-[1px] left-0 h-2px) data-[orientation=vertical]:(-right-[1px] top-0 w-2px) bg-primary',+ },+ },+ defaultVariants: {+ variant: 'block',+ },+ },+);++type tabsIndicatorProps<T extends ValidComponent = 'div'> = VoidProps<+ TabsIndicatorProps<T> &+ VariantProps<typeof tabsIndicatorVariants> & {+ class?: string;+ }+>;++export function TabsIndicator<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, tabsIndicatorProps<T>>) {+ const [local, rest] = splitProps(props as tabsIndicatorProps, [+ 'class',+ 'variant',+ ]);++ return (+ <TabsPrimitive.Indicator+ class={cn(tabsIndicatorVariants({ variant: local.variant }), local.class)}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/textarea.tsx b/apps/app-client/src/modules/ui/components/textarea.tsxnew file mode 100644index 00000000..a4d955a7--- /dev/null+++ b/apps/app-client/src/modules/ui/components/textarea.tsx@@ -0,0 +1,26 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { TextFieldTextAreaProps } from '@kobalte/core/text-field';+import type { ValidComponent, VoidProps } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { TextArea as TextFieldPrimitive } from '@kobalte/core/text-field';+import { splitProps } from 'solid-js';++type textAreaProps<T extends ValidComponent = 'textarea'> = VoidProps<+ TextFieldTextAreaProps<T> & {+ class?: string;+ }+>;++export function TextArea<T extends ValidComponent = 'textarea'>(props: PolymorphicProps<T, textAreaProps<T>>) {+ const [local, rest] = splitProps(props as textAreaProps, ['class']);++ return (+ <TextFieldPrimitive+ class={cn(+ 'flex min-h-[60px] w-full rounded-md border border-input bg-inherit px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:(outline-none ring-1.5 ring-ring) disabled:(cursor-not-allowed opacity-50) transition-shadow',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/textfield.tsx b/apps/app-client/src/modules/ui/components/textfield.tsxnew file mode 100644index 00000000..71ad61f9--- /dev/null+++ b/apps/app-client/src/modules/ui/components/textfield.tsx@@ -0,0 +1,116 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ TextFieldDescriptionProps,+ TextFieldErrorMessageProps,+ TextFieldInputProps,+ TextFieldLabelProps,+ TextFieldRootProps,+} from '@kobalte/core/text-field';+import type { ValidComponent, VoidProps } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { TextField as TextFieldPrimitive } from '@kobalte/core/text-field';+import { cva } from 'class-variance-authority';+import { splitProps } from 'solid-js';++type textFieldProps<T extends ValidComponent = 'div'> =+ TextFieldRootProps<T> & {+ class?: string;+ };++export function TextFieldRoot<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldProps<T>>) {+ const [local, rest] = splitProps(props as textFieldProps, ['class']);++ return <TextFieldPrimitive class={cn('space-y-1', local.class)} {...rest} />;+}++export const textfieldLabel = cva(+ 'text-sm data-[disabled]:(cursor-not-allowed opacity-70) font-medium',+ {+ variants: {+ label: {+ true: 'data-[invalid]:text-destructive',+ },+ error: {+ true: 'text-destructive text-xs',+ },+ description: {+ true: 'font-normal text-muted-foreground',+ },+ },+ defaultVariants: {+ label: true,+ },+ },+);++type textFieldLabelProps<T extends ValidComponent = 'label'> =+ TextFieldLabelProps<T> & {+ class?: string;+ };++export function TextFieldLabel<T extends ValidComponent = 'label'>(props: PolymorphicProps<T, textFieldLabelProps<T>>) {+ const [local, rest] = splitProps(props as textFieldLabelProps, ['class']);++ return (+ <TextFieldPrimitive.Label+ class={cn(textfieldLabel(), local.class)}+ {...rest}+ />+ );+}++type textFieldErrorMessageProps<T extends ValidComponent = 'div'> =+ TextFieldErrorMessageProps<T> & {+ class?: string;+ };++export function TextFieldErrorMessage<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldErrorMessageProps<T>>) {+ const [local, rest] = splitProps(props as textFieldErrorMessageProps, [+ 'class',+ ]);++ return (+ <TextFieldPrimitive.ErrorMessage+ class={cn(textfieldLabel({ error: true }), local.class)}+ {...rest}+ />+ );+}++type textFieldDescriptionProps<T extends ValidComponent = 'div'> =+ TextFieldDescriptionProps<T> & {+ class?: string;+ };++export function TextFieldDescription<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, textFieldDescriptionProps<T>>) {+ const [local, rest] = splitProps(props as textFieldDescriptionProps, [+ 'class',+ ]);++ return (+ <TextFieldPrimitive.Description+ class={cn(textfieldLabel({ description: true }), local.class)}+ {...rest}+ />+ );+}++type textFieldInputProps<T extends ValidComponent = 'input'> = VoidProps<+ TextFieldInputProps<T> & {+ class?: string;+ }+>;++export function TextField<T extends ValidComponent = 'input'>(props: PolymorphicProps<T, textFieldInputProps<T>>) {+ const [local, rest] = splitProps(props as textFieldInputProps, ['class']);++ return (+ <TextFieldPrimitive.Input+ class={cn(+ 'flex h-9 w-full rounded-md border border-input bg-inherit px-3 py-1 text-sm shadow-sm file:(border-0 bg-transparent text-sm font-medium) placeholder:text-muted-foreground focus-visible:(outline-none ring-1.5 ring-ring) disabled:(cursor-not-allowed opacity-50) transition-shadow',+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/toggle-group.tsx b/apps/app-client/src/modules/ui/components/toggle-group.tsxnew file mode 100644index 00000000..6d7c8772--- /dev/null+++ b/apps/app-client/src/modules/ui/components/toggle-group.tsx@@ -0,0 +1,80 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ ToggleGroupItemProps,+ ToggleGroupRootProps,+} from '@kobalte/core/toggle-group';+import type { VariantProps } from 'class-variance-authority';+import type { Accessor, ParentProps, ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { ToggleGroup as ToggleGroupPrimitive } from '@kobalte/core/toggle-group';+import { createContext, createMemo, splitProps, useContext } from 'solid-js';+import { toggleVariants } from './toggle';++const ToggleGroupContext = createContext<Accessor<VariantProps<typeof toggleVariants>>>();++function useToggleGroup() {+ const context = useContext(ToggleGroupContext);++ if (!context) {+ throw new Error(+ '`useToggleGroup`: must be used within a `ToggleGroup` component',+ );+ }++ return context;+}++type toggleGroupProps<T extends ValidComponent = 'div'> = ParentProps<+ ToggleGroupRootProps<T> &+ VariantProps<typeof toggleVariants> & {+ class?: string;+ }+>;++export function ToggleGroup<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, toggleGroupProps<T>>) {+ const [local, rest] = splitProps(props as toggleGroupProps, [+ 'class',+ 'children',+ 'size',+ 'variant',+ ]);++ const value = createMemo<VariantProps<typeof toggleVariants>>(() => ({+ size: local.size,+ variant: local.variant,+ }));++ return (+ <ToggleGroupPrimitive+ class={cn('flex items-center justify-center gap-1', local.class)}+ {...rest}+ >+ <ToggleGroupContext.Provider value={value}>+ {local.children}+ </ToggleGroupContext.Provider>+ </ToggleGroupPrimitive>+ );+}++type toggleGroupItemProps<T extends ValidComponent = 'button'> =+ ToggleGroupItemProps<T> & {+ class?: string;+ };++export function ToggleGroupItem<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, toggleGroupItemProps<T>>) {+ const [local, rest] = splitProps(props as toggleGroupItemProps, ['class']);+ const context = useToggleGroup();++ return (+ <ToggleGroupPrimitive.Item+ class={cn(+ toggleVariants({+ variant: context().variant,+ size: context().size,+ }),+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/toggle.tsx b/apps/app-client/src/modules/ui/components/toggle.tsxnew file mode 100644index 00000000..ee2ce881--- /dev/null+++ b/apps/app-client/src/modules/ui/components/toggle.tsx@@ -0,0 +1,53 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type { ToggleButtonRootProps } from '@kobalte/core/toggle-button';+import type { VariantProps } from 'class-variance-authority';+import type { ValidComponent } from 'solid-js';+import { cn } from '@/modules/shared/style/cn';+import { ToggleButton as ToggleButtonPrimitive } from '@kobalte/core/toggle-button';+import { cva } from 'class-variance-authority';+import { splitProps } from 'solid-js';++export const toggleVariants = cva(+ 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors transition-property-[box-shadow,color,background-color] hover:(bg-muted text-muted-foreground) focus-visible:(outline-none ring-1.5 ring-ring) disabled:(pointer-events-none opacity-50) data-[pressed]:(bg-accent text-accent-foreground) transition-shadow',+ {+ variants: {+ variant: {+ default: 'bg-transparent',+ outline: 'border border-input bg-transparent shadow-sm hover:(bg-accent text-accent-foreground)',+ },+ size: {+ default: 'h-9 px-3',+ sm: 'h-8 px-2',+ lg: 'h-10 px-3',+ },+ },+ defaultVariants: {+ variant: 'default',+ size: 'default',+ },+ },+);++type toggleButtonProps<T extends ValidComponent = 'button'> =+ ToggleButtonRootProps<T> &+ VariantProps<typeof toggleVariants> & {+ class?: string;+ };++export function ToggleButton<T extends ValidComponent = 'button'>(props: PolymorphicProps<T, toggleButtonProps<T>>) {+ const [local, rest] = splitProps(props as toggleButtonProps, [+ 'class',+ 'variant',+ 'size',+ ]);++ return (+ <ToggleButtonPrimitive+ class={cn(+ toggleVariants({ variant: local.variant, size: local.size }),+ local.class,+ )}+ {...rest}+ />+ );+}diff --git a/apps/app-client/src/modules/ui/components/tooltip.tsx b/apps/app-client/src/modules/ui/components/tooltip.tsxnew file mode 100644index 00000000..c76e10cd--- /dev/null+++ b/apps/app-client/src/modules/ui/components/tooltip.tsx@@ -0,0 +1,43 @@+import type { PolymorphicProps } from '@kobalte/core/polymorphic';+import type {+ TooltipContentProps,+ TooltipRootProps,+} from '@kobalte/core/tooltip';+import { cn } from '@/modules/shared/style/cn';+import { Tooltip as TooltipPrimitive } from '@kobalte/core/tooltip';+import { mergeProps, splitProps, type ValidComponent } from 'solid-js';++export const TooltipTrigger = TooltipPrimitive.Trigger;++export function Tooltip(props: TooltipRootProps) {+ const merge = mergeProps<TooltipRootProps[]>(+ {+ gutter: 4,+ flip: false,+ },+ props,+ );++ return <TooltipPrimitive {...merge} />;+}++type tooltipContentProps<T extends ValidComponent = 'div'> =+ TooltipContentProps<T> & {+ class?: string;+ };++export function TooltipContent<T extends ValidComponent = 'div'>(props: PolymorphicProps<T, tooltipContentProps<T>>) {+ const [local, rest] = splitProps(props as tooltipContentProps, ['class']);++ return (+ <TooltipPrimitive.Portal>+ <TooltipPrimitive.Content+ class={cn(+ 'z-50 overflow-hidden rounded-md bg-card px-3 py-1.5 text-xs text-card-foreground data-[expanded]:(animate-in fade-in-0 zoom-in-95) data-[closed]:(animate-out fade-out-0 zoom-out-95)',+ local.class,+ )}+ {...rest}+ />+ </TooltipPrimitive.Portal>+ );+}diff --git a/apps/app-client/src/modules/ui/layouts/admin.layout.tsx b/apps/app-client/src/modules/ui/layouts/admin.layout.tsxnew file mode 100644index 00000000..0f1d42bf--- /dev/null+++ b/apps/app-client/src/modules/ui/layouts/admin.layout.tsx@@ -0,0 +1,165 @@+import { authStore } from '@/modules/auth/auth.store';++import { cn } from '@/modules/shared/style/cn';+import { useThemeStore } from '@/modules/theme/theme.store';++import { Button } from '@/modules/ui/components/button';+import { A, useNavigate } from '@solidjs/router';+import { type Component, type ParentComponent, Show, Suspense } from 'solid-js';+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../components/dropdown-menu';+import { Sheet, SheetContent, SheetTrigger } from '../components/sheet';++type MenuItem = {+ label: string;+ icon: string;+ href?: string;+ onClick?: () => void;+};++const MenuItemButton: Component<MenuItem> = (props) => {+ return (+ <>+ <Show when={props.onClick}>+ <Button class="block" onClick={props.onClick} variant="ghost">+ <div class="flex items-center gap-2">+ <div class={cn(props.icon, 'size-5 text-muted-foreground')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>++ <Show when={!props.onClick}>+ <Button class="block" as={A} href={props.href!} variant="ghost" activeClass="bg-accent/50! text-accent-foreground!">+ <div class="flex items-center gap-2">+ <div class={cn(props.icon, 'size-5 text-muted-foreground')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>+ </>+ );+};++const SideNav: Component = () => {+ const navigate = useNavigate();++ const getMainMenuItems = () => [+ {+ label: 'Users',+ icon: 'i-tabler-users',+ href: '/admin/users',+ },+ ];++ const getFooterMenuItems = () => [+ {+ label: 'Settings',+ icon: 'i-tabler-settings',+ href: '/settings',+ },+ {+ label: 'Logout',+ icon: 'i-tabler-logout',+ onClick: () => {+ authStore.logout();+ navigate('/login');+ },+ },+ ];++ return (+ <div class="h-full flex flex-col pb-6">+ <div class="h-60px flex items-center">+ <Button href="/admin" class="text-lg font-bold hover:no-underline gap-1" variant="link" as={A}>+ Papra+ <span class="font-normal text-base text-muted-foreground">+ Admin+ </span>+ </Button>+ </div>++ <nav class="flex flex-col gap-0.5 mt-4 text-muted-foreground">+ {getMainMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>++ <div class="flex-1"></div>++ <nav class="flex flex-col gap-0.5 text-muted-foreground">+ {getFooterMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>+ </div>+ );+};++const ThemeSwitcher: Component = () => {+ const themeStore = useThemeStore();++ return (+ <>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'light' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-sun text-lg"></div>+ Light Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'dark' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-moon text-lg"></div>+ Dark Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'system' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-device-laptop text-lg"></div>+ System Mode+ </DropdownMenuItem>+ </>+ );+};++export const AdminLayout: ParentComponent = (props) => {+ const themeStore = useThemeStore();++ return (+ <div class="flex flex-row h-screen min-h-0">+ <div class="w-64 border-r border-r-border px-2 flex-shrink-0 hidden md:block">+ <SideNav />+ </div>+ <div class="flex-1 min-h-0 flex flex-col">+ <div class="h-60px border-b flex items-center justify-between px-6">+ <div>+ <Sheet>+ <SheetTrigger>+ <Button variant="ghost" size="icon" class="md:hidden">+ <div class="i-tabler-menu-2 size-6"></div>+ </Button>+ </SheetTrigger>+ <SheetContent side="left">+ <SideNav />+ </SheetContent>+ </Sheet>+ </div>++ <div class="flex items-center gap-2">++ <DropdownMenu>+ <DropdownMenuTrigger as={Button} class="text-base" variant="outline" aria-label="Theme switcher">+ <div classList={{ 'i-tabler-moon': themeStore.getColorMode() === 'dark', 'i-tabler-sun': themeStore.getColorMode() === 'light' }}></div>+ <div class="ml-2 i-tabler-chevron-down text-muted-foreground text-sm"></div>+ </DropdownMenuTrigger>+ <DropdownMenuContent class="w-42">+ <ThemeSwitcher />+ </DropdownMenuContent>+ </DropdownMenu>++ <Button as={A} href="/renderings">+ <div class="i-tabler-home size-4 mr-1"></div>+ App+ </Button>++ </div>+ </div>+ <div class="flex-1 overflow-auto max-w-screen">+ <Suspense>+ {props.children}+ </Suspense>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/ui/layouts/app.layout.tsx b/apps/app-client/src/modules/ui/layouts/app.layout.tsxnew file mode 100644index 00000000..eb0e6def--- /dev/null+++ b/apps/app-client/src/modules/ui/layouts/app.layout.tsx@@ -0,0 +1,169 @@+import { authStore } from '@/modules/auth/auth.store';++import { cn } from '@/modules/shared/style/cn';+import { useThemeStore } from '@/modules/theme/theme.store';+import { Button } from '@/modules/ui/components/button';+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';+import { A, useNavigate } from '@solidjs/router';+import { type Component, type ParentComponent, Show, Suspense } from 'solid-js';+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../components/dropdown-menu';+import { Sheet, SheetContent, SheetTrigger } from '../components/sheet';++type MenuItem = {+ label: string;+ icon: string;+ href?: string;+ onClick?: () => void;+};++const MenuItemButton: Component<MenuItem> = (props) => {+ return (+ <>+ <Show when={props.onClick}>+ <Button class="block" onClick={props.onClick} variant="ghost">+ <div class="flex items-center gap-2">+ <div class={cn(props.icon, 'size-5 text-muted-foreground')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>++ <Show when={!props.onClick}>+ <Button class="block" as={A} href={props.href!} variant="ghost" activeClass="bg-accent/50! text-accent-foreground!">+ <div class="flex items-center gap-2">+ <div class={cn(props.icon, 'size-5 text-muted-foreground')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>+ </>+ );+};++const SideNav: Component = () => {+ const navigate = useNavigate();++ const getMainMenuItems = () => [+ {+ label: 'Renderings',+ icon: 'i-tabler-file-text',+ href: '/renderings',+ },+ {+ label: 'API Keys',+ icon: 'i-tabler-key',+ href: '/api-keys',+ },+ ];++ const getFooterMenuItems = () => [+ {+ label: 'Settings',+ icon: 'i-tabler-settings',+ href: '/settings',+ },+ {+ label: 'Logout',+ icon: 'i-tabler-logout',+ onClick: () => {+ authStore.logout();+ navigate('/login');+ },+ },+ ];++ return (+ <div class="h-full flex flex-col pb-6">+ <div class="h-60px flex items-center">+ <Button href="/" class="text-lg font-bold hover:no-underline" variant="link" as={A}>+ Papra+ </Button>+ </div>++ <nav class="flex flex-col gap-0.5 mt-4 text-muted-foreground">+ {getMainMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>++ <div class="flex-1"></div>++ <nav class="flex flex-col gap-0.5 text-muted-foreground">+ {getFooterMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>+ </div>+ );+};++const ThemeSwitcher: Component = () => {+ const themeStore = useThemeStore();++ return (+ <>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'light' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-sun text-lg"></div>+ Light Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'dark' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-moon text-lg"></div>+ Dark Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'system' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-device-laptop text-lg"></div>+ System Mode+ </DropdownMenuItem>+ </>+ );+};++export const AppLayout: ParentComponent = (props) => {+ const { user } = useCurrentUser();+ const themeStore = useThemeStore();++ return (+ <div class="flex flex-row h-screen min-h-0">+ <div class="w-64 border-r border-r-border px-2 flex-shrink-0 hidden md:block">+ <SideNav />+ </div>+ <div class="flex-1 min-h-0 flex flex-col">+ <div class="h-60px border-b flex items-center justify-between px-6">+ <div class="flex items-center gap-2">+ <Sheet>+ <SheetTrigger>+ <Button variant="ghost" size="icon" class="md:hidden">+ <div class="i-tabler-menu-2 size-6"></div>+ </Button>+ </SheetTrigger>+ <SheetContent side="left">+ <SideNav />+ </SheetContent>+ </Sheet>+ </div>++ <div class="flex items-center gap-2">+ <DropdownMenu>+ <DropdownMenuTrigger as={Button} class="text-base hidden sm:flex" variant="outline" aria-label="Theme switcher">+ <div classList={{ 'i-tabler-moon': themeStore.getColorMode() === 'dark', 'i-tabler-sun': themeStore.getColorMode() === 'light' }}></div>+ <div class="ml-2 i-tabler-chevron-down text-muted-foreground text-sm"></div>+ </DropdownMenuTrigger>+ <DropdownMenuContent class="w-42">+ <ThemeSwitcher />+ </DropdownMenuContent>+ </DropdownMenu>++ {user.roles.includes('admin') && (+ <Button as={A} href="/admin">+ <div class="i-tabler-settings size-4 mr-2"></div>+ Admin+ </Button>+ )}++ </div>+ </div>+ <div class="flex-1 overflow-auto max-w-screen">+ <Suspense>+ {props.children}+ </Suspense>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/ui/layouts/organization.layout.tsx b/apps/app-client/src/modules/ui/layouts/organization.layout.tsxnew file mode 100644index 00000000..8e277e70--- /dev/null+++ b/apps/app-client/src/modules/ui/layouts/organization.layout.tsx@@ -0,0 +1,287 @@+import type { Organization } from '@/modules/organizations/organizations.types';++import { authStore } from '@/modules/auth/auth.store';+import { uploadDocument } from '@/modules/documents/documents.services';+import { fetchOrganizations } from '@/modules/organizations/organizations.services';+import { queryClient } from '@/modules/shared/query/query-client';+import { cn } from '@/modules/shared/style/cn';+import { useThemeStore } from '@/modules/theme/theme.store';+import { Button } from '@/modules/ui/components/button';+import { useCurrentUser } from '@/modules/users/composables/useCurrentUser';++import { A, useNavigate, useParams } from '@solidjs/router';+import { createQuery } from '@tanstack/solid-query';+import { type Component, createEffect, onMount, type ParentComponent, Show, Suspense } from 'solid-js';+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../components/dropdown-menu';+import {+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from '../components/select';+import { Separator } from '../components/separator';+import { Sheet, SheetContent, SheetTrigger } from '../components/sheet';++type MenuItem = {+ label: string;+ icon: string;+ href?: string;+ onClick?: () => void;+};++const MenuItemButton: Component<MenuItem> = (props) => {+ return (+ <>+ <Show when={props.onClick}>+ <Button class="block" onClick={props.onClick} variant="ghost">+ <div class="flex items-center gap-2 dark:text-muted-foreground">+ <div class={cn(props.icon, 'size-5')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>++ <Show when={!props.onClick}>+ <Button class="block dark:text-muted-foreground" as={A} href={props.href!} variant="ghost" activeClass="bg-accent/50! text-accent-foreground! ">+ <div class="flex items-center gap-2">+ <div class={cn(props.icon, 'size-5')}></div>+ <div>{props.label}</div>+ </div>+ </Button>+ </Show>+ </>+ );+};++const SideNav: Component = () => {+ const navigate = useNavigate();+ const params = useParams();++ const getMainMenuItems = () => [+ {+ label: 'Documents',+ icon: 'i-tabler-file-text',+ href: `/organizations/${params.organizationId}`,+ },+ {+ label: 'Deleted documents',+ icon: 'i-tabler-trash',+ href: `/organizations/${params.organizationId}/deleted`,+ },+ {+ label: 'Settings',+ icon: 'i-tabler-settings',+ href: `/organizations/${params.organizationId}/settings`,+ },++ ];++ const getFooterMenuItems = () => [+ {+ label: 'Settings',+ icon: 'i-tabler-settings',+ href: '/settings',+ },+ {+ label: 'Logout',+ icon: 'i-tabler-logout',+ onClick: () => {+ authStore.logout();+ navigate('/login');+ },+ },+ ];++ const query = createQuery(() => ({+ queryKey: ['organizations'],+ queryFn: fetchOrganizations,+ }));++ return (+ <div class="flex h-full">+ <div class="w-65px border-r bg-card pt-4">+ <Button variant="link" as={A} href="/" class="text-lg font-bold hover:no-underline flex items-center text-foreground mb-4">+ <div class="i-tabler-file-text size-8"></div>+ </Button>++ <Button variant="link" as={A} href="/organizations" class="text-lg font-bold hover:no-underline flex items-center text-foreground dark:text-muted-foreground">+ <div class="i-tabler-building-community size-5"></div>+ </Button>++ <Button variant="link" as={A} href="/docs" class="text-lg font-bold hover:no-underline flex items-center text-foreground dark:text-muted-foreground mt-1">+ <div class="i-tabler-book-2 size-5"></div>+ </Button>++ </div>+ <div class="h-full flex flex-col pb-6 flex-1">++ <div class="px-6 pt-4">+ <Select+ options={[...query.data?.organizations ?? [], { id: 'create' }]}+ optionValue="id"+ optionTextValue="name"+ value={query.data?.organizations.find(organization => organization.id === params.organizationId)}+ onChange={value => value && (+ value.id === 'create'+ ? navigate('/organizations/create')+ : navigate(`/organizations/${value.id}`)+ )}++ itemComponent={props => props.item.rawValue.id === 'create'+ ? (+ <SelectItem class="cursor-pointer" item={props.item}>+ <div class="flex items-center gap-2 text-muted-foreground">+ <div class="i-tabler-plus size-4"></div>+ <div>Create new organization</div>+ </div>+ </SelectItem>+ )+ : (+ <SelectItem class="cursor-pointer" item={props.item}>{props.item.rawValue.name}</SelectItem>+ )}+ >+ <SelectTrigger>+ <SelectValue<Organization>>+ {state => state.selectedOption().name}+ </SelectValue>+ </SelectTrigger>+ <SelectContent />+ </Select>++ </div>++ <nav class="flex flex-col gap-0.5 mt-4 px-4">+ {getMainMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>++ <div class="flex-1"></div>++ <nav class="flex flex-col gap-0.5 px-4">+ {getFooterMenuItems().map(menuItem => <MenuItemButton {...menuItem} />)}+ </nav>+ </div>+ </div>+ );+};++const ThemeSwitcher: Component = () => {+ const themeStore = useThemeStore();++ return (+ <>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'light' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-sun text-lg"></div>+ Light Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'dark' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-moon text-lg"></div>+ Dark Mode+ </DropdownMenuItem>+ <DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'system' })} class="flex items-center gap-2 cursor-pointer">+ <div class="i-tabler-device-laptop text-lg"></div>+ System Mode+ </DropdownMenuItem>+ </>+ );+};++export const OrganizationLayout: ParentComponent = (props) => {+ const { user } = useCurrentUser();+ const themeStore = useThemeStore();+ const params = useParams();+ const navigate = useNavigate();++ const query = createQuery(() => ({+ queryKey: ['organizations'],+ queryFn: fetchOrganizations,+ }));++ createEffect(() => {+ if (query.data?.organizations && query.data.organizations.length === 0) {+ navigate('/organizations/create');+ }+ });++ const promptImport = () => {+ const input = document.createElement('input');+ input.type = 'file';+ input.accept = '.pdf';+ input.multiple = true;+ input.onchange = async () => {+ if (!input.files) {+ return;+ }++ for (const file of Array.from(input.files)) {+ await uploadDocument({ file, organizationId: params.organizationId });+ }++ queryClient.invalidateQueries({+ queryKey: ['organizations', params.organizationId, 'documents'],+ refetchType: 'all',+ });+ };+ input.click();+ };++ return (+ <div class="flex flex-row h-screen min-h-0">+ <div class="w-320px border-r border-r-border flex-shrink-0 hidden md:block bg-card">+ <SideNav />+ </div>+ <div class="flex-1 min-h-0 flex flex-col">+ <div class="flex justify-between px-6 pt-4">++ <div class="flex items-center">+ <Sheet>+ <SheetTrigger>+ <Button variant="ghost" size="icon" class="md:hidden mr-2">+ <div class="i-tabler-menu-2 size-6"></div>+ </Button>+ </SheetTrigger>+ <SheetContent side="left" class="bg-card p-0!">+ <SideNav />+ </SheetContent>+ </Sheet>++ <Button variant="outline" class="sm:min-w-64 justify-start">+ <div class="i-tabler-search size-4 mr-2"></div>+ Search...+ </Button>+ </div>++ <div class="flex items-center gap-2">+ <Button onClick={promptImport}>+ <div class="i-tabler-upload size-4 mr-2"></div>+ Import a document+ </Button>++ <DropdownMenu>+ <DropdownMenuTrigger as={Button} class="text-base hidden sm:flex" variant="outline" aria-label="Theme switcher">+ <div classList={{ 'i-tabler-moon': themeStore.getColorMode() === 'dark', 'i-tabler-sun': themeStore.getColorMode() === 'light' }}></div>+ <div class="ml-2 i-tabler-chevron-down text-muted-foreground text-sm"></div>+ </DropdownMenuTrigger>+ <DropdownMenuContent class="w-42">+ <ThemeSwitcher />+ </DropdownMenuContent>+ </DropdownMenu>++ {user.roles.includes('admin') && (+ <Button as={A} href="/admin">+ <div class="i-tabler-settings size-4 mr-2"></div>+ Admin+ </Button>+ )}++ </div>+ </div>+ <div class="flex-1 overflow-auto max-w-screen">+ <Suspense>+ {props.children}+ </Suspense>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/app-client/src/modules/ui/layouts/settings.layout.tsx b/apps/app-client/src/modules/ui/layouts/settings.layout.tsxnew file mode 100644index 00000000..b6395fd8--- /dev/null+++ b/apps/app-client/src/modules/ui/layouts/settings.layout.tsx@@ -0,0 +1,34 @@+import type { ParentComponent } from 'solid-js';+import { A } from '@solidjs/router';+import { Button } from '../components/button';++export const SettingsLayout: ParentComponent = (props) => {+ const navigation = [+ {+ name: 'Account',+ href: '/settings/account',+ },+ {+ name: 'Billing & Plan',+ href: '/settings/billing',+ },+ ];++ return (+ <div class="p-6 max-w-5xl mx-auto mt-4 pb-32">+ <div class="flex justify-between items-center mb-2">+ <h1 class="text-2xl font-bold">Settings</h1>+ </div>++ <div class="flex gap-6 mb-6 border-b">+ {navigation.map(item => (+ <Button as={A} href={item.href} variant="ghost" class="px-0 border-b border-transparent text-muted-foreground rounded-b-none !bg-transparent" activeClass="!text-foreground !border-foreground">+ {item.name}+ </Button>+ ))}+ </div>++ {props.children}+ </div>+ );+};diff --git a/apps/app-client/src/modules/users/composables/useCurrentUser.tsx b/apps/app-client/src/modules/users/composables/useCurrentUser.tsxnew file mode 100644index 00000000..285e2ab3--- /dev/null+++ b/apps/app-client/src/modules/users/composables/useCurrentUser.tsx@@ -0,0 +1,58 @@+import type { Organization } from '@/modules/organizations/organizations.types';+import type { ParentComponent } from 'solid-js';+import type { UserMe } from '../users.types';+import { fetchOrganizations } from '@/modules/organizations/organizations.services';+import { makePersisted } from '@solid-primitives/storage';+import { createQueries, createQuery } from '@tanstack/solid-query';+import { createContext, createSignal, Show, useContext } from 'solid-js';+import { fetchCurrentUser } from '../users.services';++const currentUserContext = createContext<{+ user: UserMe;+ refreshCurrentUser: () => Promise<void>;++ getLatestOrganizationId: () => string | null;+ setLatestOrganizationId: (organizationId: string) => void;+}>();++export function useCurrentUser() {+ const context = useContext(currentUserContext);++ if (!context) {+ throw new Error('useCurrentUser must be used within a CurrentUserProvider');+ }++ return context;+}++export const CurrentUserProvider: ParentComponent = (props) => {+ const [getLatestOrganizationId, setLatestOrganizationId] = makePersisted(createSignal<string | null>(null), { name: 'papra_current_organization_id', storage: localStorage });++ const queries = createQueries(() => ({+ queries: [+ {+ queryKey: ['users', 'me'],+ queryFn: fetchCurrentUser,+ },++ ],+ }));++ return (+ <Show when={queries[0].data}>+ <currentUserContext.Provider+ value={{+ user: queries[0].data!.user,+ refreshCurrentUser: async () => {+ queries[0].refetch();+ },++ getLatestOrganizationId,+ setLatestOrganizationId,+ }}+ >+ {props.children}+ </currentUserContext.Provider>+ </Show>+ );+};diff --git a/apps/app-client/src/modules/users/pages/settings.account.page.tsx b/apps/app-client/src/modules/users/pages/settings.account.page.tsxnew file mode 100644index 00000000..477e1882--- /dev/null+++ b/apps/app-client/src/modules/users/pages/settings.account.page.tsx@@ -0,0 +1,78 @@+import { authStore } from '@/modules/auth/auth.store';+import { Button } from '@/modules/ui/components/button';+import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/modules/ui/components/card';+import { TextField, TextFieldLabel, TextFieldRoot } from '@/modules/ui/components/textfield';+import { A } from '@solidjs/router';+import { useCurrentUser } from '../composables/useCurrentUser';++export function SettingsAccountPage() {+ const { user } = useCurrentUser();+ return (+ <div class="mt-8">+ <Card>+ <CardHeader class="border-b">+ <CardTitle>+ Account Email+ </CardTitle>+ </CardHeader>++ <CardContent class="p-6">++ <TextFieldRoot class="text-muted-foreground">+ <TextFieldLabel>Your email</TextFieldLabel>+ <TextField value={user.email} readOnly />+ </TextFieldRoot>+ </CardContent>++ <CardFooter class="border-t p-6">+ <p class="text-muted-foreground">+ Your email is used to log in and send you notifications. It cannot be changed.+ </p>+ </CardFooter>++ </Card>++ <Card class="mt-4">+ <CardHeader class="border-b">+ <CardTitle>+ Onboarding+ </CardTitle>+ </CardHeader>++ <CardContent class="p-6">+ <p class="text-muted-foreground">+ See the onboarding page to get started with setting up your api key.+ </p>+ </CardContent>++ <CardFooter class="border-t p-6">+ <Button as={A} href="/onboarding">+ Go to the onboarding+ </Button>+ </CardFooter>++ </Card>++ <Card class="mt-4 border-destructive">+ <CardHeader class="border-b">+ <CardTitle>+ Logout+ </CardTitle>+ </CardHeader>++ <CardContent class="p-6">+ <p class="text-muted-foreground">+ You can logout from your account here. You will be redirected to the login page.+ </p>+ </CardContent>++ <CardFooter class="border-t p-6">+ <Button onClick={() => authStore.logout()} variant="destructive">+ Logout+ </Button>+ </CardFooter>++ </Card>+ </div>+ );+}diff --git a/apps/app-client/src/modules/users/pages/settings.billing.tsx b/apps/app-client/src/modules/users/pages/settings.billing.tsxnew file mode 100644index 00000000..0ce19f3c--- /dev/null+++ b/apps/app-client/src/modules/users/pages/settings.billing.tsx@@ -0,0 +1,262 @@+import type { Invoice } from '@/modules/payments/payments.types';+import type { Component } from 'solid-js';+import { cancelSubscription, fetchInvoices, fetchSubscriptionQuota, fetchUserSubscription, getCustomerPortalUrl } from '@/modules/payments/payments.services';+import { useConfirmModal } from '@/modules/shared/confirm';+import { formatAmountInCents } from '@/modules/shared/currency';+import { clearQueryCache } from '@/modules/shared/query/query-client';+import { Badge } from '@/modules/ui/components/badge';+import { Button } from '@/modules/ui/components/button';+import { Card, CardContent, CardFooter } from '@/modules/ui/components/card';+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/modules/ui/components/dropdown-menu';+import { Progress } from '@/modules/ui/components/progress';+import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from '@/modules/ui/components/table';+import { Tooltip, TooltipContent, TooltipTrigger } from '@/modules/ui/components/tooltip';+import { safely } from '@corentinth/chisels';+import { A } from '@solidjs/router';+import { createQueries } from '@tanstack/solid-query';+import { capitalize } from 'lodash-es';+import { For, Show, Suspense } from 'solid-js';+import { toast } from 'solid-sonner';+import { useCurrentUser } from '../composables/useCurrentUser';++const InvoiceList: Component<{ invoices?: Invoice[] }> = (props) => {+ return (++ <div class="mt-8 border rounded-lg">+ <Table>+ <TableCaption class="sr-only">+ Invoices+ </TableCaption>++ <TableHeader>+ <TableRow>+ <TableHead>+ Invoice Date+ </TableHead>+ <TableHead>+ Amount Due+ </TableHead>+ <TableHead>+ Status+ </TableHead>+ <TableHead class="text-right">+ Actions+ </TableHead>++ </TableRow>++ </TableHeader>++ <TableBody>+ <For each={props.invoices ?? []}>+ {invoice => (+ <TableRow>+ <TableCell>+ <span title={invoice.createdAt.toLocaleString()}>+ {invoice.createdAt.toLocaleDateString()}+ </span>+ </TableCell>+ <TableCell>+ {formatAmountInCents({ amountInCents: invoice.amountDue })}+ </TableCell>+ <TableCell>+ <Badge variant="secondary">++ {capitalize(invoice.status)}+ </Badge>+ </TableCell>+ <TableCell class="text-right">+ <Tooltip>+ <TooltipTrigger>+ <Button href={invoice.pdfUrl} as="a" target="_blank" rel="noopener noreferrer" download size="icon" variant="ghost">+ <div class="i-tabler-download size-4"></div>+ </Button>+ </TooltipTrigger>+ <TooltipContent>+ Download invoice PDF+ </TooltipContent>+ </Tooltip>+ </TableCell>+ </TableRow>+ )}++ </For>++ </TableBody>+ </Table>+ </div>++ );+};++export function SettingsBillingPage() {+ const { confirm } = useConfirmModal();+ const { refreshCurrentUser } = useCurrentUser();++ const query = createQueries(() => ({+ queries: [+ {+ queryKey: ['subscription'],+ queryFn: fetchUserSubscription,+ },+ {+ queryKey: ['invoices'],+ queryFn: fetchInvoices,+ },+ {+ queryKey: ['subscriptionQuota'],+ queryFn: () => fetchSubscriptionQuota(),+ },+ ],+ }));++ const getPlanId = () => query[0].data?.planId;+ const getSubscription = () => query[0].data?.subscription;+ const getInvoices = () => query[1].data?.invoices ?? [];+ const getSubscriptionQuota = () => query[2].data;++ async function downgradeToFreePlan() {+ const isConfirmed = await confirm({+ title: 'Downgrade to free plan',+ message: 'Are you sure you want to downgrade to the free plan? You will lose access to some features.',+ confirmButton: {+ text: 'Yes, downgrade to free plan',+ variant: 'destructive',+ },+ cancelButton: {+ text: 'Cancel',+ },+ });++ if (!isConfirmed) {+ return;+ }++ const [, cancelationError] = await safely(cancelSubscription());++ clearQueryCache();+ await refreshCurrentUser();++ if (cancelationError) {+ console.error(cancelationError);+ toast.error('An error occurred while canceling your subscription');+ return;+ }++ toast.success('Your subscription has been canceled');++ await query[0].refetch();+ }++ const getUsagePercentage = () => {+ const { maxRenderingsPerMonth = 1, renderingsCount = 0 } = getSubscriptionQuota() ?? {};+ return 100 * renderingsCount / maxRenderingsPerMonth;+ };++ async function openCustomerPortal() {+ try {+ const { portalUrl } = await getCustomerPortalUrl();+ window.open(portalUrl, '_blank');+ } catch (error) {+ console.error(error);+ toast.error('An error occurred while opening the customer portal');+ }+ }++ return (+ <div class="mt-8">+ <Suspense+ fallback={+ <div class="i-tabler-loader-2 animate-spin text-4xl mx-auto" />+ }+ >++ <Card>+ <CardContent class="p-6">+ <div class="flex items-center justify-between">+ <div>+ <div class="text-muted-foreground">+ Current Plan+ </div>+ <div class="text-xl font-bold">+ { getPlanId()?.toUpperCase()}+ </div>+ </div>++ { getPlanId() === 'free'+ ? (+ <Button href="/upgrade-plan" as={A}>+ Upgrade Plan+ <div class="i-tabler-arrow-right size-4 ml-2" />+ </Button>+ )+ : (+ <DropdownMenu>+ <DropdownMenuTrigger>+ <Button variant="outline">+ Manage Plan+ <div class="i-tabler-chevron-down size-4 ml-2" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuItem class="cursor-pointer" onClick={openCustomerPortal}>+ <div class="i-tabler-credit-card size-4 mr-2"></div>+ Manage payment method+ </DropdownMenuItem>++ <DropdownMenuItem class="cursor-pointer" onClick={downgradeToFreePlan}>+ <div class="i-tabler-trash size-4 mr-2"></div>+ Downgrade to Free Plan+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ )}+ </div>+ </CardContent>++ { getSubscription() && (+ <CardFooter class="border-t p-6">+ <span class="text-muted-foreground mr-2">+ Next billing date:+ </span>+ <span title={getSubscription()?.nextBillingDate.toLocaleString()}>+ { getSubscription()?.nextBillingDate.toLocaleDateString()}+ </span>+ </CardFooter>+ )}++ </Card>++ <div class="mt-4 grid grid-cols-1 gap-6 md:grid-cols-2">++ <Card>+ <CardContent class="p-6">+ <div class="text-muted-foreground mb-1">+ Renderings this month+ </div>+ <div class="flex items-baseline gap-2 mb-3">+ <div class="text-xl font-bold">+ { getSubscriptionQuota()?.renderingsCount}+ {' '}+ /+ {' '}+ { getSubscriptionQuota()?.maxRenderingsPerMonth}+ {' '}+ <span class="text-muted-foreground text-sm font-normal">+ renderings+ </span>+ </div>+ </div>+ <Progress value={getUsagePercentage()} />+ </CardContent>+ </Card>++ </div>++ <Show when={getInvoices().length > 0}>+ <InvoiceList invoices={getInvoices()} />+ </Show>+ </Suspense>+ </div>+ );+}diff --git a/apps/app-client/src/modules/users/users.services.ts b/apps/app-client/src/modules/users/users.services.tsnew file mode 100644index 00000000..cbe41ffb--- /dev/null+++ b/apps/app-client/src/modules/users/users.services.ts@@ -0,0 +1,11 @@+import type { UserMe } from './users.types';+import { apiClient } from '../shared/http/http-client';++export async function fetchCurrentUser() {+ const { user } = await apiClient<{ user: UserMe }>({+ path: '/api/users/me',+ method: 'GET',+ });++ return { user };+}diff --git a/apps/app-client/src/modules/users/users.types.ts b/apps/app-client/src/modules/users/users.types.tsnew file mode 100644index 00000000..8eaec67a--- /dev/null+++ b/apps/app-client/src/modules/users/users.types.ts@@ -0,0 +1,19 @@+export type UserMe = {+ id: string;+ email: string;+ planId: string;+ roles: string[];+};++export type User = {+ id: string;+ email: string;+ createdAt: Date;+ updatedAt: Date;+ provider: string;+ maxApiKeys: number;+ apiKeysCount: number;+ isEmailVerified: boolean;+ customerId: string | null;+ planId: string;+};diff --git a/apps/app-client/src/routes.tsx b/apps/app-client/src/routes.tsxnew file mode 100644index 00000000..486e1951--- /dev/null+++ b/apps/app-client/src/routes.tsx@@ -0,0 +1,145 @@+import { A, Navigate, type RouteDefinition, useParams } from '@solidjs/router';+import { createProtectedPage } from './modules/auth/middleware/protected-page.middleware';+import { ConfirmPage } from './modules/auth/pages/confirm.page';+import { GenericAuthPage } from './modules/auth/pages/generic-auth.page';+import { MagicLinkSentPage } from './modules/auth/pages/magic-link-sent.page';+import { PendingMagicLinkPage } from './modules/auth/pages/verify-magic-link.page';+import { DocumentsPage } from './modules/documents/pages/documents.page';+import { CreateOrganizationPage } from './modules/organizations/pages/create-organization.page';+import { OrganizationsPage } from './modules/organizations/pages/organizations.page';+import { CheckoutCancelPage } from './modules/payments/pages/checkout-cancel.page';+import { CheckoutSuccessPage } from './modules/payments/pages/checkout-success.page';+import { Button } from './modules/ui/components/button';+import { OrganizationLayout } from './modules/ui/layouts/organization.layout';+import { SettingsLayout } from './modules/ui/layouts/settings.layout';+import { CurrentUserProvider, useCurrentUser } from './modules/users/composables/useCurrentUser';+import { SettingsAccountPage } from './modules/users/pages/settings.account.page';+import { SettingsBillingPage } from './modules/users/pages/settings.billing';++export const routes: RouteDefinition[] = [+ {+ path: '/',+ component: CurrentUserProvider,+ children: [+ {+ path: '/',+ component: () => {+ const { getLatestOrganizationId } = useCurrentUser();++ return (+ <>+ {getLatestOrganizationId()+ ? <Navigate href={`/organizations/${getLatestOrganizationId()}`} />+ : <Navigate href="/organizations/create" />}+ </>++ );+ },+ },+ {+ path: '/organizations',+ children: [+ {+ path: '/',+ component: OrganizationsPage,+ },+ {+ path: '/:organizationId',+ component: (props) => {+ const params = useParams();+ const { setLatestOrganizationId } = useCurrentUser();++ setLatestOrganizationId(params.organizationId);++ return <OrganizationLayout {...props} />;+ },+ matchFilters: {+ organizationId: /^org_[a-zA-Z0-9]+$/,+ },+ children: [+ {+ path: '/',+ component: DocumentsPage,+ },+ ],+ },+ {+ path: '/create',+ component: CreateOrganizationPage,+ },+ // {+ // path: '/settings',+ // component: SettingsLayout,+ // children: [+ // {+ // path: '/',+ // component: () => <Navigate href="/settings/account" />,+ // },+ // {+ // path: '/account',+ // component: createProtectedPage({ authType: 'private', component: SettingsAccountPage }),+ // },+ // {+ // path: '/billing',+ // component: createProtectedPage({ authType: 'private', component: SettingsBillingPage }),+ // },+ // ],+ // },+ ],+ },++ {+ path: '/checkout-success',+ component: createProtectedPage({ authType: 'private', component: CheckoutSuccessPage }),+ },+ {+ path: '/checkout-cancel',+ component: createProtectedPage({ authType: 'private', component: CheckoutCancelPage }),+ },+ ],+ },+ {+ path: '/login',+ component: createProtectedPage({ authType: 'public-only', component: () => <GenericAuthPage type="login" /> }),+ },+ {+ path: '/register',+ component: createProtectedPage({ authType: 'public-only', component: () => <GenericAuthPage type="register" /> }),+ },+ {+ path: '/magic-link',+ component: createProtectedPage({ authType: 'public-only', component: MagicLinkSentPage }),+ },+ {+ path: '/magic-link/:token',+ component: createProtectedPage({ authType: 'public-only', component: PendingMagicLinkPage }),+ },+ {+ path: '/confirm',+ component: createProtectedPage({ authType: 'public-only', component: ConfirmPage }),+ },+ {+ path: '*404',+ component: () => (+ <div class="h-screen flex flex-col items-center justify-center p-6">++ <div class="flex items-center flex-row sm:gap-24">+ <div class="max-w-350px">+ <h1 class="text-xl mr-4 py-2">404 - Not Found</h1>+ <p class="text-muted-foreground">+ Sorry, the page you are looking for does seem to exist. Please check the URL and try again.+ </p>+ <Button as={A} href="/" class="mt-4" variant="default">+ <div class="i-tabler-arrow-left mr-2"></div>+ Go back to home+ </Button>+ </div>++ <div class="hidden sm:block light:text-muted-foreground">+ <div class="i-tabler-file-shredder text-200px"></div>+ </div>+ </div>+ </div>+ ),+ },+];diff --git a/apps/app-client/tsconfig.json b/apps/app-client/tsconfig.jsonnew file mode 100644index 00000000..452fad0c--- /dev/null+++ b/apps/app-client/tsconfig.json@@ -0,0 +1,21 @@+{+ "compilerOptions": {+ "target": "ESNext",+ "jsx": "preserve",+ "jsxImportSource": "solid-js",+ "baseUrl": "./",+ "module": "ESNext",+ "moduleResolution": "node",+ "paths": {+ "@/*": ["./src/*"]+ },+ "resolveJsonModule": true,+ "types": ["vite/client"],+ "strict": true,+ "noEmit": true,+ "allowSyntheticDefaultImports": true,+ "esModuleInterop": true,+ "isolatedModules": true,+ "skipLibCheck": true+ }+}diff --git a/apps/app-client/uno.config.ts b/apps/app-client/uno.config.tsnew file mode 100644index 00000000..b914d957--- /dev/null+++ b/apps/app-client/uno.config.ts@@ -0,0 +1,117 @@+import { iconByFileType } from '@/modules/documents/document.models';+import { uniq, values } from 'lodash-es';+import {+ defineConfig,+ presetIcons,+ presetUno,+ presetWebFonts,+ transformerDirectives,+ transformerVariantGroup,+} from 'unocss';+import presetAnimations from 'unocss-preset-animations';++export default defineConfig({+ presets: [+ presetUno({+ dark: {+ dark: '[data-kb-theme="dark"]',+ light: '[data-kb-theme="light"]',+ },+ prefix: '',+ }),+ presetAnimations(),+ presetWebFonts({+ provider: 'bunny',+ fonts: {+ sans: 'Inter:400,500,600,700,800,900',+ },+ }),+ presetIcons({+ collections: {+ custom: {+ language: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 512 512"><path fill="currentColor" d="m478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4ZM334.83 362L368 281.65L401.17 362Zm-66.99-19.08a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9Z" /></svg>',+ },+ },+ }),+ ],+ transformers: [transformerVariantGroup(), transformerDirectives()],+ theme: {+ colors: {+ border: 'hsl(var(--border))',+ input: 'hsl(var(--input))',+ ring: 'hsl(var(--ring))',+ background: 'hsl(var(--background))',+ foreground: 'hsl(var(--foreground))',+ primary: {+ DEFAULT: 'hsl(var(--primary))',+ foreground: 'hsl(var(--primary-foreground))',+ },+ secondary: {+ DEFAULT: 'hsl(var(--secondary))',+ foreground: 'hsl(var(--secondary-foreground))',+ },+ destructive: {+ DEFAULT: 'hsl(var(--destructive))',+ foreground: 'hsl(var(--destructive-foreground))',+ },+ warning: {+ DEFAULT: 'hsl(var(--warning))',+ foreground: 'hsl(var(--warning-foreground))',+ },+ muted: {+ DEFAULT: 'hsl(var(--muted))',+ foreground: 'hsl(var(--muted-foreground))',+ },+ accent: {+ DEFAULT: 'hsl(var(--accent))',+ foreground: 'hsl(var(--accent-foreground))',+ },+ popover: {+ DEFAULT: 'hsl(var(--popover))',+ foreground: 'hsl(var(--popover-foreground))',+ },+ card: {+ DEFAULT: 'hsl(var(--card))',+ foreground: 'hsl(var(--card-foreground))',+ },+ },+ borderRadius: {+ lg: 'var(--radius)',+ md: 'calc(var(--radius) - 2px)',+ sm: 'calc(var(--radius) - 4px)',+ },+ animation: {+ keyframes: {+ 'accordion-down':+ '{ from { height: 0 } to { height: var(--kb-accordion-content-height) } }',+ 'accordion-up':+ '{ from { height: var(--kb-accordion-content-height) } to { height: 0 } }',+ 'collapsible-down':+ '{ from { height: 0 } to { height: var(--kb-collapsible-content-height) } }',+ 'collapsible-up':+ '{ from { height: var(--kb-collapsible-content-height) } to { height: 0 } }',+ 'caret-blink': '{ 0%,70%,100% { opacity: 1 } 20%,50% { opacity: 0 } }',+ },+ timingFns: {+ 'accordion-down': 'ease-out',+ 'accordion-up': 'ease-out',+ 'collapsible-down': 'ease-out',+ 'collapsible-up': 'ease-out',+ 'caret-blink': 'ease-out',+ },+ durations: {+ 'accordion-down': '0.2s',+ 'accordion-up': '0.2s',+ 'collapsible-down': '0.2s',+ 'collapsible-up': '0.2s',+ 'caret-blink': '1.25s',+ },+ counts: {+ 'caret-blink': 'infinite',+ },+ },+ },+ safelist: [+ ...uniq(values(iconByFileType)),+ ],+});diff --git a/apps/app-client/vite.config.ts b/apps/app-client/vite.config.tsnew file mode 100644index 00000000..951d69fc--- /dev/null+++ b/apps/app-client/vite.config.ts@@ -0,0 +1,25 @@+import path from 'node:path';+import unoCssPlugin from 'unocss/vite';+import { defineConfig } from 'vite';+import solidPlugin from 'vite-plugin-solid';++export default defineConfig({+ plugins: [+ unoCssPlugin(),+ solidPlugin(),+ ],+ server: {+ port: 3000,+ },+ build: {+ target: 'esnext',+ },+ resolve: {+ alias: {+ '@': path.resolve(__dirname, './src'),+ },+ },+ // test: {+ // exclude: [...configDefaults.exclude, '**/*.e2e.test.ts'],+ // },+});diff --git a/apps/app-server/drizzle.config.ts b/apps/app-server/drizzle.config.tsindex 08c97c8c..662f0f77 100644--- a/apps/app-server/drizzle.config.ts+++ b/apps/app-server/drizzle.config.ts@@ -6,7 +6,7 @@ export default defineConfig({dialect: 'turso',out: './migrations',dbCredentials: {- url: String(env.DATABASE_URL),+ url: env.DATABASE_URL ?? 'file:./db.sqlite',authToken: env.DATABASE_AUTH_TOKEN,},});diff --git a/apps/app-server/migrations/0000_colossal_talon.sql b/apps/app-server/migrations/0000_colossal_talon.sqlnew file mode 100644index 00000000..44125900--- /dev/null+++ b/apps/app-server/migrations/0000_colossal_talon.sql@@ -0,0 +1,72 @@+CREATE TABLE `auth_tokens` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `token` text,+ `user_id` text NOT NULL,+ `expires_at` integer,+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade+);+--> statement-breakpoint+CREATE INDEX `token_index` ON `auth_tokens` (`token`);--> statement-breakpoint+CREATE INDEX `expires_at_index` ON `auth_tokens` (`expires_at`);--> statement-breakpoint+CREATE INDEX `token_user_id_expires_at_index` ON `auth_tokens` (`token`,`user_id`,`expires_at`);--> statement-breakpoint+CREATE TABLE `documents` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `updated_at` integer NOT NULL,+ `is_deleted` integer DEFAULT false NOT NULL,+ `deleted_at` integer,+ `organization_id` text NOT NULL,+ `created_by` text,+ `deleted_by` text,+ `original_name` text NOT NULL,+ `original_checksum` text NOT NULL,+ `original_size` numeric DEFAULT '0' NOT NULL,+ `name` text NOT NULL,+ `mime_type` text NOT NULL,+ `size` numeric DEFAULT '0' NOT NULL,+ `status` text DEFAULT 'pending' NOT NULL,+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE cascade ON DELETE cascade,+ FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE set null,+ FOREIGN KEY (`deleted_by`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE set null+);+--> statement-breakpoint+CREATE TABLE `organization_users` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `updated_at` integer NOT NULL,+ `user_id` text NOT NULL,+ `organization_id` text NOT NULL,+ `role` text DEFAULT 'member' NOT NULL,+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade,+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE cascade ON DELETE cascade+);+--> statement-breakpoint+CREATE TABLE `organizations` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `updated_at` integer NOT NULL,+ `name` text NOT NULL+);+--> statement-breakpoint+CREATE TABLE `user_roles` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `updated_at` integer NOT NULL,+ `user_id` text NOT NULL,+ `role` text NOT NULL,+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade+);+--> statement-breakpoint+CREATE INDEX `role_index` ON `user_roles` (`role`);--> statement-breakpoint+CREATE UNIQUE INDEX `user_roles_user_id_role_key` ON `user_roles` (`user_id`,`role`);--> statement-breakpoint+CREATE TABLE `users` (+ `id` text PRIMARY KEY NOT NULL,+ `created_at` integer NOT NULL,+ `updated_at` integer NOT NULL,+ `email` text NOT NULL,+ `full_name` text+);+--> statement-breakpoint+CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint+CREATE INDEX `email_index` ON `users` (`email`);\ No newline at end of filediff --git a/apps/app-server/migrations/meta/0000_snapshot.json b/apps/app-server/migrations/meta/0000_snapshot.jsonnew file mode 100644index 00000000..efc1634e--- /dev/null+++ b/apps/app-server/migrations/meta/0000_snapshot.json@@ -0,0 +1,513 @@+{+ "version": "6",+ "dialect": "sqlite",+ "id": "daf25e46-2a4b-462a-8488-04778b929104",+ "prevId": "00000000-0000-0000-0000-000000000000",+ "tables": {+ "auth_tokens": {+ "name": "auth_tokens",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "token": {+ "name": "token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expires_at": {+ "name": "expires_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "token_index": {+ "name": "token_index",+ "columns": [+ "token"+ ],+ "isUnique": false+ },+ "expires_at_index": {+ "name": "expires_at_index",+ "columns": [+ "expires_at"+ ],+ "isUnique": false+ },+ "token_user_id_expires_at_index": {+ "name": "token_user_id_expires_at_index",+ "columns": [+ "token",+ "user_id",+ "expires_at"+ ],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "auth_tokens_user_id_users_id_fk": {+ "name": "auth_tokens_user_id_users_id_fk",+ "tableFrom": "auth_tokens",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "documents": {+ "name": "documents",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "is_deleted": {+ "name": "is_deleted",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "deleted_at": {+ "name": "deleted_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "organization_id": {+ "name": "organization_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "created_by": {+ "name": "created_by",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "deleted_by": {+ "name": "deleted_by",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "original_name": {+ "name": "original_name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "original_checksum": {+ "name": "original_checksum",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "original_size": {+ "name": "original_size",+ "type": "numeric",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'0'"+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "mime_type": {+ "name": "mime_type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "size": {+ "name": "size",+ "type": "numeric",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'0'"+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'pending'"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "documents_organization_id_organizations_id_fk": {+ "name": "documents_organization_id_organizations_id_fk",+ "tableFrom": "documents",+ "tableTo": "organizations",+ "columnsFrom": [+ "organization_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ },+ "documents_created_by_users_id_fk": {+ "name": "documents_created_by_users_id_fk",+ "tableFrom": "documents",+ "tableTo": "users",+ "columnsFrom": [+ "created_by"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "cascade"+ },+ "documents_deleted_by_users_id_fk": {+ "name": "documents_deleted_by_users_id_fk",+ "tableFrom": "documents",+ "tableTo": "users",+ "columnsFrom": [+ "deleted_by"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "cascade"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "organization_users": {+ "name": "organization_users",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "organization_id": {+ "name": "organization_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "role": {+ "name": "role",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'member'"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "organization_users_user_id_users_id_fk": {+ "name": "organization_users_user_id_users_id_fk",+ "tableFrom": "organization_users",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ },+ "organization_users_organization_id_organizations_id_fk": {+ "name": "organization_users_organization_id_organizations_id_fk",+ "tableFrom": "organization_users",+ "tableTo": "organizations",+ "columnsFrom": [+ "organization_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "organizations": {+ "name": "organizations",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "user_roles": {+ "name": "user_roles",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "role": {+ "name": "role",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "role_index": {+ "name": "role_index",+ "columns": [+ "role"+ ],+ "isUnique": false+ },+ "user_roles_user_id_role_key": {+ "name": "user_roles_user_id_role_key",+ "columns": [+ "user_id",+ "role"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "user_roles_user_id_users_id_fk": {+ "name": "user_roles_user_id_users_id_fk",+ "tableFrom": "user_roles",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "users": {+ "name": "users",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "email": {+ "name": "email",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "full_name": {+ "name": "full_name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "users_email_unique": {+ "name": "users_email_unique",+ "columns": [+ "email"+ ],+ "isUnique": true+ },+ "email_index": {+ "name": "email_index",+ "columns": [+ "email"+ ],+ "isUnique": false+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ }+ },+ "views": {},+ "enums": {},+ "_meta": {+ "schemas": {},+ "tables": {},+ "columns": {}+ },+ "internal": {+ "indexes": {}+ }+}\ No newline at end of filediff --git a/apps/app-server/migrations/meta/_journal.json b/apps/app-server/migrations/meta/_journal.jsonnew file mode 100644index 00000000..162f502c--- /dev/null+++ b/apps/app-server/migrations/meta/_journal.json@@ -0,0 +1,13 @@+{+ "version": "7",+ "dialect": "sqlite",+ "entries": [+ {+ "idx": 0,+ "version": "6",+ "when": 1735830695548,+ "tag": "0000_colossal_talon",+ "breakpoints": true+ }+ ]+}\ No newline at end of filediff --git a/apps/app-server/package.json b/apps/app-server/package.jsonindex 1087c7b4..620bebae 100644--- a/apps/app-server/package.json+++ b/apps/app-server/package.json@@ -2,24 +2,32 @@"name": "@papra/app-server","type": "module","version": "1.0.0",-"packageManager": "[email protected]","description": "","author": "","keywords": [],"scripts": {- "dev": "tsx -r dotenv/config --watch src/index.ts",+ "dev": "tsx watch --env-file=.env src/index.ts","lint": "eslint .","lint:fix": "eslint --fix .","test": "vitest run","test:watch": "vitest watch",- "typecheck": "tsc --noEmit"+ "typecheck": "tsc --noEmit",+ "migrate:up": "drizzle-kit migrate",+ "migrate:push": "drizzle-kit push",+ "db:studio": "drizzle-kit studio",+ "clean:db": "rm db.sqlite",+ "clean:storage": "rm -rf local-documents",+ "clean:all": "pnpm clean:db && pnpm clean:storage",+ "dev:reset": "pnpm clean:all && pnpm migrate:push"},"dependencies": {"@corentinth/chisels": "^1.1.0","@hono/node-server": "^1.13.7",+ "@hono/oauth-providers": "^0.6.2","@libsql/client": "^0.14.0","@paralleldrive/cuid2": "^2.2.2",+ "date-fns": "^4.1.0","drizzle-orm": "^0.38.3","figue": "^2.1.0","hono": "^4.6.15",@@ -27,14 +35,13 @@"zod": "^3.24.1"},"devDependencies": {- "@antfu/eslint-config": "^3.12.1",+ "@antfu/eslint-config": "catalog:","@types/lodash-es": "^4.17.12","@types/node": "^22.10.2",- "dotenv": "^16.4.7","drizzle-kit": "^0.30.1",- "eslint": "^9.17.0",+ "eslint": "catalog:","tsx": "^4.19.2",- "typescript": "^5.7.2",- "vitest": "^2.1.8"+ "typescript": "catalog:",+ "vitest": "catalog:"}}diff --git a/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.repository.ts b/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.repository.tsnew file mode 100644index 00000000..bd0010c3--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.repository.ts@@ -0,0 +1,44 @@+import type { Database } from '../../database/database.types';+import { injectArguments } from '@corentinth/chisels';+import { and, eq, gt, lt } from 'drizzle-orm';+import { size } from 'lodash-es';+import { authTokensTable } from './auth-tokens.table';++export type AuthTokensRepository = ReturnType<typeof createAuthTokensRepository>;++export function createAuthTokensRepository({ db }: { db: Database }) {+ return injectArguments(+ {+ saveAuthToken,+ getAuthTokenValidity,+ deleteAuthToken,+ deleteExpiredAuthTokens,+ },+ { db },+ );+}++async function saveAuthToken({ db, userId, token, expiresAt }: { db: Database; userId: string; token: string; expiresAt: Date }) {+ const [authTokenDetails] = await db.insert(authTokensTable).values({ userId, token, expiresAt }).returning();++ return { authTokenDetails };+}++async function getAuthTokenValidity({ db, token, userId, now = new Date() }: { db: Database; token: string; userId: string; now?: Date }) {+ const [authTokenDetails] = await db+ .select()+ .from(authTokensTable)+ .where(and(eq(authTokensTable.token, token), eq(authTokensTable.userId, userId), gt(authTokensTable.expiresAt, now)));++ return { isValid: Boolean(authTokenDetails) };+}++async function deleteAuthToken({ db, token }: { db: Database; token: string }) {+ await db.delete(authTokensTable).where(eq(authTokensTable.token, token));+}++async function deleteExpiredAuthTokens({ db, now = new Date() }: { db: Database; now?: Date }) {+ const deletedRecords = await db.delete(authTokensTable).where(lt(authTokensTable.expiresAt, now)).returning({ id: authTokensTable.id });++ return { deletedCount: size(deletedRecords) };+}diff --git a/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.table.ts b/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.table.tsnew file mode 100644index 00000000..69f75d8f--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth-tokens/auth-tokens.table.ts@@ -0,0 +1,26 @@+import { index, integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';+import { createCreatedAtField, createPrimaryKeyField } from '../../../shared/db/columns.helpers';+import { usersTable } from '../../../users/users.table';++export const authTokensTable = sqliteTable(+ 'auth_tokens',+ {+ ...createPrimaryKeyField({ prefix: 'at' }),+ ...createCreatedAtField(),++ token: text('token'),+ userId: text('user_id')+ .notNull()+ .references(() => usersTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),+ expiresAt: integer('expires_at', { mode: 'timestamp_ms' }),++ },+ table => [+ // To get a token record by its value+ index('token_index').on(table.token),+ // To easily remove expired tokens+ index('expires_at_index').on(table.expiresAt),+ // To rotate tokens+ index('token_user_id_expires_at_index').on(table.token, table.userId, table.expiresAt),+ ],+);diff --git a/apps/app-server/src/modules/app/auth/auth.errors.ts b/apps/app-server/src/modules/app/auth/auth.errors.tsnew file mode 100644index 00000000..098bb17e--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.errors.ts@@ -0,0 +1,13 @@+import { createErrorFactory } from '../../shared/errors/errors';++export const createUnauthorizedError = createErrorFactory({+ message: 'Unauthorized',+ code: 'auth.unauthorized',+ statusCode: 401,+});++export const createForbiddenError = createErrorFactory({+ message: 'Forbidden',+ code: 'auth.forbidden',+ statusCode: 403,+});diff --git a/apps/app-server/src/modules/app/auth/auth.models.test.ts b/apps/app-server/src/modules/app/auth/auth.models.test.tsnew file mode 100644index 00000000..70f190da--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.models.test.ts@@ -0,0 +1,13 @@+import { describe, expect, test } from 'vitest';+import { createAccessTokenRedirectionUrl } from './auth.models';++describe('auth models', () => {+ describe('createAccessTokenRedirectionUrl', () => {+ test('set the access token as a hash fragment in the redirection url', () => {+ const redirectionBaseUrl = 'https://example.com/confirm';+ const accessToken = 'foo';++ expect(createAccessTokenRedirectionUrl({ redirectionBaseUrl, accessToken })).to.eql('https://example.com/confirm#accessToken=foo');+ });+ });+});diff --git a/apps/app-server/src/modules/app/auth/auth.models.ts b/apps/app-server/src/modules/app/auth/auth.models.tsnew file mode 100644index 00000000..d231aa3b--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.models.ts@@ -0,0 +1,31 @@+import type { Context } from '../server.types';+import { buildUrl } from '@corentinth/chisels';+import { createError } from '../../shared/errors/errors';++export { createAccessTokenRedirectionUrl, getAuthUserId };++function getAuthUserId({ context }: { context: Context }) {+ const userId = context.get('userId');+ const authUserId = context.get('authUserId');++ if (!userId || !authUserId) {+ throw createError({+ message: 'User ID or Auth User ID not found in context',+ code: 'users.id_not_found',+ statusCode: 500,+ isInternal: true,+ });+ }++ return {+ userId,+ authUserId,+ };+}++function createAccessTokenRedirectionUrl({ redirectionBaseUrl, accessToken }: { redirectionBaseUrl: string; accessToken: string }) {+ return buildUrl({+ baseUrl: redirectionBaseUrl,+ hash: `accessToken=${accessToken}`,+ });+}diff --git a/apps/app-server/src/modules/app/auth/auth.routes.ts b/apps/app-server/src/modules/app/auth/auth.routes.tsnew file mode 100644index 00000000..211f8c4c--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.routes.ts@@ -0,0 +1,58 @@+import type { ServerInstance } from '../server.types';++import { getConfig } from '../../config/config.models';+import { createRolesRepository } from '../../roles/roles.repository';+import { createCookieRepository } from '../cookies/cookies.repository';+import { getDb } from '../database/database.models';+import { createAuthTokensRepository } from './auth-tokens/auth-tokens.repository';+import { renewAuthTokens } from './auth.usecases';+import { registerGithubProviderOauthRoute, registerGoogleProviderOauthRoute } from './oauth-providers/oauth-providers.routes';+import { createRefreshTokenCookieRepository } from './refresh-tokens/refresh-token.cookie.repository';++export function registerAuthPublicRoutes({ app }: { app: ServerInstance }) {+ registerRefreshTokenRoute({ app });+ registerGithubProviderOauthRoute({ app });+ registerGoogleProviderOauthRoute({ app });+}++export function registerAuthPrivateRoutes({ app }: { app: ServerInstance }) {+ registerLogoutRoute({ app });+}++function registerLogoutRoute({ app }: { app: ServerInstance }) {+ app.post('/api/auth/logout', async (context) => {+ const { config } = getConfig({ context });+ const { db } = getDb({ context });+ const refreshTokenCookieRepository = createRefreshTokenCookieRepository({ config, cookiesRepository: createCookieRepository({ context }) });+ const authTokenRepository = createAuthTokensRepository({ db });++ const { refreshToken } = await refreshTokenCookieRepository.getRefreshTokenFromCookie();++ if (refreshToken) {+ await authTokenRepository.deleteAuthToken({ token: refreshToken });+ await refreshTokenCookieRepository.deleteRefreshTokenCookie();+ }++ return context.body(null, 204);+ });+}++function registerRefreshTokenRoute({ app }: { app: ServerInstance }) {+ app.post('/api/auth/refresh', async (context) => {+ const { db } = getDb({ context });+ const { config } = getConfig({ context });++ const authTokensRepository = createAuthTokensRepository({ db });+ const refreshTokenCookieRepository = createRefreshTokenCookieRepository({ config, cookiesRepository: createCookieRepository({ context }) });+ const rolesRepository = createRolesRepository({ db });++ const { accessToken } = await renewAuthTokens({+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ config,+ });++ return context.json({ accessToken });+ });+}diff --git a/apps/app-server/src/modules/app/auth/auth.services.ts b/apps/app-server/src/modules/app/auth/auth.services.tsnew file mode 100644index 00000000..8aa29f62--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.services.ts@@ -0,0 +1,79 @@+import { addDays } from 'date-fns';+import { sign, verify } from 'hono/jwt';+import { isString } from 'lodash-es';+import { createUnauthorizedError } from './auth.errors';++export async function generateUserJwt({+ userId,+ jwtSecret,+ roles = [],+ now = new Date(),+}: {+ userId: string;+ jwtSecret: string;+ roles?: string[];+ now?: Date;+}) {+ const token = await sign({+ sub: userId,+ // TODO: extract token expiration delay to config+ exp: Math.floor(now.getTime() / 1000) + 60 * 10,+ roles,+ }, jwtSecret);++ return { token };+}++export async function verifyJwt({ token, jwtSecret }: { token: string; jwtSecret: string }) {+ const jwtPayload = await verify(token, jwtSecret);++ if (!jwtPayload) {+ throw createUnauthorizedError();+ }++ return jwtPayload;+}++export async function verifyUserJwt({ token, jwtSecret }: { token: string; jwtSecret: string }) {+ const jwtPayload = await verify(token, jwtSecret);++ if (!jwtPayload) {+ throw createUnauthorizedError();+ }++ const userId = jwtPayload.sub;++ if (!userId || !isString(userId)) {+ throw createUnauthorizedError();+ }++ return { userId };+}++export async function verifyUserRefreshToken({ refreshToken, jwtRefreshSecret }: { refreshToken: string; jwtRefreshSecret: string }) {+ const jwtPayload = await verify(refreshToken, jwtRefreshSecret);++ if (!jwtPayload) {+ throw createUnauthorizedError();+ }++ const userId = jwtPayload.sub;++ if (!userId || !isString(userId)) {+ throw createUnauthorizedError();+ }++ return { userId };+}++export async function generateUserRefreshToken({ userId, jwtSecret, now = new Date(), expiresAt = addDays(now, 14) }: { userId: string; jwtSecret: string; now?: Date; expiresAt?: Date }) {+ const refreshToken = await sign(+ {+ sub: userId,+ exp: Math.floor(expiresAt.getTime() / 1000),+ },+ jwtSecret,+ );++ return { refreshToken };+}diff --git a/apps/app-server/src/modules/app/auth/auth.usecases.ts b/apps/app-server/src/modules/app/auth/auth.usecases.tsnew file mode 100644index 00000000..3f8a58dc--- /dev/null+++ b/apps/app-server/src/modules/app/auth/auth.usecases.ts@@ -0,0 +1,113 @@+import type { Config } from '../../config/config.types';+import type { RolesRepository } from '../../roles/roles.repository';+import type { UsersRepository } from '../../users/users.repository';+import type { DbInsertableUser } from '../../users/users.types';+import type { AuthTokensRepository } from './auth-tokens/auth-tokens.repository';+import type { RefreshTokenCookieRepository } from './refresh-tokens/refresh-token.cookie.repository';+import { addDays } from 'date-fns';+import { createUser } from '../../users/users.usecases';+import { createUnauthorizedError } from './auth.errors';+import { generateUserJwt, generateUserRefreshToken, verifyUserRefreshToken } from './auth.services';+import { REFRESH_TOKEN_DURATION_IN_DAYS } from './refresh-tokens/refresh-token.constants';++export async function getOrCreateUserFromProvider({+ usersRepository,+ providerUser,+}: {+ usersRepository: UsersRepository;+ providerUser: DbInsertableUser;+}) {+ const { email } = providerUser;++ const { user: existingUser } = await usersRepository.getUserByEmail({ email });++ if (existingUser) {+ return {+ user: existingUser,+ };+ }++ const { user: newUser } = await createUser({+ user: providerUser,+ usersRepository,+ });++ return {+ user: newUser,+ };+}++export async function createAuthTokens({+ userId,+ config,+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ now = new Date(),+}: {+ userId: string;+ config: Config;+ authTokensRepository: AuthTokensRepository;+ refreshTokenCookieRepository: RefreshTokenCookieRepository;+ rolesRepository: RolesRepository;+ now?: Date;+}) {+ const { jwtSecret, jwtRefreshSecret } = config.auth;++ const { roles } = await rolesRepository.getUserRoles({ userId });++ const { token: accessToken } = await generateUserJwt({ userId, jwtSecret, roles });+ const { refreshToken } = await generateUserRefreshToken({ userId, jwtSecret: jwtRefreshSecret });++ // TODO: create a refreshTokenRepository as a wrapper around the authTokensRepository+ // Save the refresh token in the database+ await authTokensRepository.saveAuthToken({ userId, token: refreshToken, expiresAt: addDays(now, REFRESH_TOKEN_DURATION_IN_DAYS) });++ // Store the refresh token in a cookie+ await refreshTokenCookieRepository.saveRefreshTokenInCookie({ refreshToken });++ return { accessToken };+}++export async function renewAuthTokens({+ config,+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ now = new Date(),+}: {+ config: Config;+ authTokensRepository: AuthTokensRepository;+ refreshTokenCookieRepository: RefreshTokenCookieRepository;+ rolesRepository: RolesRepository;+ now?: Date;+}) {+ const { jwtRefreshSecret } = config.auth;++ // Get the refresh token from the cookies+ const { refreshToken } = await refreshTokenCookieRepository.getRefreshTokenFromCookieOrThrow();++ // Verify the refresh token is a valid JWT token+ const { userId } = await verifyUserRefreshToken({ refreshToken, jwtRefreshSecret });++ // Verify the refresh token is in the DB and not expired+ const { isValid } = await authTokensRepository.getAuthTokenValidity({ token: refreshToken, userId });++ // Delete the refresh token from the database to prevent replay attacks+ await authTokensRepository.deleteAuthToken({ token: refreshToken });++ if (!isValid) {+ throw createUnauthorizedError();+ }++ const { accessToken } = await createAuthTokens({+ userId,+ config,+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ now,+ });++ return { accessToken };+}diff --git a/apps/app-server/src/modules/app/auth/e2e/logout.e2e.test.ts b/apps/app-server/src/modules/app/auth/e2e/logout.e2e.test.tsnew file mode 100644index 00000000..26f23563--- /dev/null+++ b/apps/app-server/src/modules/app/auth/e2e/logout.e2e.test.ts@@ -0,0 +1,92 @@+import { describe, expect, test } from 'vitest';+import { overrideConfig } from '../../../config/config.test-utils';+import { usersTable } from '../../../users/users.table';+import { createInMemoryDatabase } from '../../database/database.test-utils';+import { createServer } from '../../server';+import { generateUserJwt } from '../auth.services';++describe('auth routes e2e', () => {+ describe('logout', () => {+ test('when login out, if no refresh token is present in cookies, the logout should succeed, nothing happens', async () => {+ const jwtSecret = 'jwt-secret';+ const { db } = await createInMemoryDatabase();+ const { app } = createServer({ db, config: overrideConfig({ auth: { jwtSecret } }) });++ await db+ .insert(usersTable)+ .values({+ email: '[email protected]',+ id: 'user-1',+ })+ .returning()+ .execute();++ const { token } = await generateUserJwt({ userId: 'user-1', jwtSecret });++ const response = await app.request('/api/auth/logout', {+ method: 'POST',+ headers: {+ Authorization: `Bearer ${token}`,+ },+ });++ expect(response.status).to.eql(204);+ });++ // test('if a refresh token is present in request cookies and in db, it should be deleted from the cookies and db', async () => {+ // const { request, db, createAuthHeaderForUser } = await setupTestApp({ config: { auth: { jwtRefreshSecret: 'jwt-refresh-token-secret' } } });++ // const [user] = await db+ // .insert(usersTable)+ // .values({+ // email: '[email protected]',+ // id: 'cbu-1',+ // })+ // .returning()+ // .execute();++ // await db.insert(authTokensTable).values({+ // token: 'refresh-token-value',+ // userId: 'cbu-1',+ // expiresAt: new Date('3000-01-01'),+ // }).execute();++ // const initialTokens = await db.select().from(authTokensTable).execute();++ // expect(+ // _.map(initialTokens, ({ token, userId }) => ({ token, userId })),+ // ).to.eql([+ // { token: 'refresh-token-value', userId: 'cbu-1' },+ // ]);++ // const response = await request({+ // url: '/api/auth/logout',+ // method: 'POST',+ // headers: {+ // ...await createAuthHeaderForUser({ userId: user.id }),+ // Cookie: 'refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjYnVfMDFqMmh5YXF6MTQzanl5eGhtN2I4YnBlc2siLCJleHAiOjE3MjQzNTU2OTd9.GRjXLWdQAIa05OnlMLvNlODl0TNJUnPggO4BUJ_FMxQ',+ // },+ // });++ // expect(response.status).to.eql(204);++ // const authTokens = await db.select().from(authTokensTable).execute();++ // expect(_.size(authTokens)).to.eql(0, 'The refresh token should have been deleted from the db');+ // });++ test('if the user is not logged in, the logout rejects with 401', async () => {+ const { db } = await createInMemoryDatabase();+ const { app } = createServer({ db });++ const response = await app.request('/api/auth/logout', {+ method: 'POST',+ });++ expect(response.status).to.eql(401);+ expect(await response.json()).to.eql({+ error: { code: 'auth.unauthorized', message: 'Unauthorized' },+ });+ });+ });+});diff --git a/apps/app-server/src/modules/app/auth/middlewares/auth.middleware.ts b/apps/app-server/src/modules/app/auth/middlewares/auth.middleware.tsnew file mode 100644index 00000000..a34ecaaf--- /dev/null+++ b/apps/app-server/src/modules/app/auth/middlewares/auth.middleware.ts@@ -0,0 +1,43 @@+import type { ServerInstanceGenerics } from '../../server.types';+import { createMiddleware } from 'hono/factory';+import { getConfig } from '../../../config/config.models';+import { getAuthorizationHeader } from '../../../shared/headers/headers.models';+import { createCookieRepository } from '../../cookies/cookies.repository';+import { createUnauthorizedError } from '../auth.errors';+import { verifyJwt } from '../auth.services';+import { createRefreshTokenCookieRepository } from '../refresh-tokens/refresh-token.cookie.repository';++export const jwtValidationMiddleware = createMiddleware<ServerInstanceGenerics>(async (context, next) => {+ const { authorizationHeader } = getAuthorizationHeader({ context });+ const { config } = getConfig({ context });++ const { deleteRefreshTokenCookie } = createRefreshTokenCookieRepository({ config, cookiesRepository: createCookieRepository({ context }) });++ if (!authorizationHeader) {+ throw createUnauthorizedError();+ }++ const tokenParts = authorizationHeader.trim().split(' ');++ if (tokenParts.length !== 2) {+ throw createUnauthorizedError();+ }++ const token = tokenParts[1];++ const {+ auth: { jwtSecret },+ } = config;++ try {+ const jwtPayload = await verifyJwt({ token, jwtSecret });++ context.set('jwtPayload', jwtPayload);++ await next();+ } catch (_ignored) {+ await deleteRefreshTokenCookie();++ throw createUnauthorizedError();+ }+});diff --git a/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.test.ts b/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.test.tsnew file mode 100644index 00000000..8a6d41d2--- /dev/null+++ b/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.test.ts@@ -0,0 +1,152 @@+import type { Context } from '../../server.types';+import { describe, expect, test } from 'vitest';+import { impersonationMiddleware } from './impersonation.middleware';++function createContext({ jwtPayload, xUserId }: { jwtPayload: Record<string, unknown>; xUserId?: string }) {+ let isNextCalled = false;+ const contextDatas: Record<string, unknown> = {};++ const context = {+ get: (key: string) => {+ if (key === 'jwtPayload') {+ return jwtPayload;+ }++ throw new Error(`Unknown key: ${key}`);+ },+ set: (key: string, value: any) => {+ contextDatas[key] = value;+ },+ req: {+ header: (name: string) => {+ if (name === 'x-user-id') {+ return xUserId;+ }++ throw new Error(`Unknown header: ${name}`);+ },+ },+ } as Context;++ const next = async () => {+ isNextCalled = true;+ };++ return {+ context,+ getIsNextCalled: () => isNextCalled,+ getContextDatas: () => contextDatas,+ next,+ };+}++describe('impersonation middleware', () => {+ describe('impersonationMiddleware', () => {+ test('for the standard user, the userId is extracted from the sub field of the jwtPayload', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ getContextDatas,+ } = createContext({ jwtPayload: { sub: '123' }, xUserId: undefined });++ await impersonationMiddleware(context, next);++ expect(getIsNextCalled()).to.eql(true);+ expect(getContextDatas()).to.eql({ authUserId: '123', userId: '123' });+ });++ test('when the userId in the jwtPayload is not a string, an error should be thrown', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ } = createContext({+ jwtPayload: {+ sub: 123 as any,+ },+ xUserId: undefined,+ });++ await expect(impersonationMiddleware(context, next)).rejects.toThrowError('Forbidden');++ expect(getIsNextCalled()).to.eql(false);+ });++ test('when the x-user-id header is present and the user has the admin role, the userId is extracted from the x-user-id header and the authUserId is the one of the admin', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ getContextDatas,+ } = createContext({+ jwtPayload: {+ sub: '123',+ roles: ['admin'],+ },+ xUserId: '456',+ });++ await impersonationMiddleware(context, next);++ expect(getIsNextCalled()).to.eql(true);+ expect(getContextDatas()).to.eql({ authUserId: '123', userId: '456' });+ });++ test('when the x-user-id header is present and the user does not have the admin role, an error should be thrown', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ } = createContext({+ jwtPayload: {+ sub: '123',+ roles: [],+ },+ xUserId: '456',+ });++ await expect(impersonationMiddleware(context, next)).rejects.toThrowError('Forbidden');++ expect(getIsNextCalled()).to.eql(false);+ });++ test('when the x-user-id header is not a string, an error should be thrown', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ } = createContext({+ jwtPayload: {+ sub: '123',+ roles: ['admin'],+ },+ xUserId: 456 as any,+ });++ await expect(impersonationMiddleware(context, next)).rejects.toThrowError('Forbidden');++ expect(getIsNextCalled()).to.eql(false);+ });++ test('when the x-user-id header is not present, the userId should be the same as the authUserId', async () => {+ const {+ context,+ getIsNextCalled,+ next,+ getContextDatas,+ } = createContext({+ jwtPayload: {+ sub: '123',+ roles: ['admin'],+ },+ xUserId: undefined,+ });++ await impersonationMiddleware(context, next);++ expect(getIsNextCalled()).to.eql(true);+ expect(getContextDatas()).to.eql({ authUserId: '123', userId: '123' });+ });+ });+});diff --git a/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.ts b/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.tsnew file mode 100644index 00000000..e30e0c31--- /dev/null+++ b/apps/app-server/src/modules/app/auth/middlewares/impersonation.middleware.ts@@ -0,0 +1,38 @@+import type { ServerInstanceGenerics } from '../../server.types';+import { createMiddleware } from 'hono/factory';+import { get, isString } from 'lodash-es';+import { ADMIN_ROLE } from '../../../roles/roles.constants';+import { areSomeRolesInJwtPayload } from '../../../roles/roles.models';+import { getImpersonatedUserIdFromHeader } from '../../../shared/headers/headers.models';+import { addLogContext } from '../../../shared/logger/logger';+import { createForbiddenError } from '../auth.errors';++export const impersonationMiddleware = createMiddleware<ServerInstanceGenerics>(async (context, next) => {+ const jwtPayload = context.get('jwtPayload');+ const authUserId = get(jwtPayload, 'sub') as string;++ if (!isString(authUserId)) {+ throw createForbiddenError();+ }++ const { impersonatedUserId } = getImpersonatedUserIdFromHeader({ context });++ if (impersonatedUserId && !isString(impersonatedUserId)) {+ throw createForbiddenError();+ }++ const isAdmin = areSomeRolesInJwtPayload({ roles: [ADMIN_ROLE], jwtPayload });++ if (impersonatedUserId && !isAdmin) {+ throw createForbiddenError();+ }++ const userId = impersonatedUserId ?? authUserId;++ context.set('authUserId', authUserId);+ context.set('userId', userId);++ addLogContext({ userId, authUserId });++ await next();+});diff --git a/apps/app-server/src/modules/app/auth/oauth-providers/oauth-providers.routes.ts b/apps/app-server/src/modules/app/auth/oauth-providers/oauth-providers.routes.tsnew file mode 100644index 00000000..a9abf508--- /dev/null+++ b/apps/app-server/src/modules/app/auth/oauth-providers/oauth-providers.routes.ts@@ -0,0 +1,124 @@+import type { ServerInstance } from '../../server.types';+import { githubAuth } from '@hono/oauth-providers/github';+import { googleAuth } from '@hono/oauth-providers/google';+import { getConfig } from '../../../config/config.models';+import { createRolesRepository } from '../../../roles/roles.repository';+import { createUsersRepository } from '../../../users/users.repository';+import { createCookieRepository } from '../../cookies/cookies.repository';+import { getDb } from '../../database/database.models';+import { createAuthTokensRepository } from '../auth-tokens/auth-tokens.repository';+import { createUnauthorizedError } from '../auth.errors';+import { createAccessTokenRedirectionUrl } from '../auth.models';+import { createAuthTokens, getOrCreateUserFromProvider } from '../auth.usecases';+import { createRefreshTokenCookieRepository } from '../refresh-tokens/refresh-token.cookie.repository';++export function registerGithubProviderOauthRoute({ app }: { app: ServerInstance }) {+ app.get(+ '/api/auth/github',+ (context, next) => {+ const { config } = getConfig({ context });+ const { clientId, clientSecret } = config.auth.providers.github;++ const oauthMiddleware = githubAuth({+ oauthApp: true,+ scope: ['read:user', 'user:email'],+ client_id: clientId,+ client_secret: clientSecret,+ });++ return oauthMiddleware(context, next);+ },+ async (context) => {+ const githubUser = context.get('user-github');+ const { db } = getDb({ context });+ const { config } = getConfig({ context });++ const authTokensRepository = createAuthTokensRepository({ db });+ const refreshTokenCookieRepository = createRefreshTokenCookieRepository({ config, cookiesRepository: createCookieRepository({ context }) });+ const rolesRepository = createRolesRepository({ db });++ if (!githubUser || !githubUser.email) {+ throw createUnauthorizedError();+ }++ const usersRepository = createUsersRepository({ db });++ const { user } = await getOrCreateUserFromProvider({+ usersRepository,+ providerUser: {+ email: githubUser.email,+ fullName: githubUser.name,+ },+ });++ const userId = user.id;++ const { accessToken } = await createAuthTokens({+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ userId,+ config,+ });++ const redirectUrl = createAccessTokenRedirectionUrl({ accessToken, redirectionBaseUrl: config.client.oauthRedirectUrl });++ return context.redirect(redirectUrl);+ },+ );+}++export function registerGoogleProviderOauthRoute({ app }: { app: ServerInstance }) {+ app.get(+ '/api/auth/google',+ (context, next) => {+ const { config } = getConfig({ context });+ const { clientId, clientSecret } = config.auth.providers.google;++ const oauthMiddleware = googleAuth({+ scope: ['email', 'profile'],+ client_id: clientId,+ client_secret: clientSecret,+ });++ return oauthMiddleware(context, next);+ },+ async (context) => {+ const googleUser = context.get('user-google');+ const { db } = getDb({ context });+ const { config } = getConfig({ context });++ const authTokensRepository = createAuthTokensRepository({ db });+ const refreshTokenCookieRepository = createRefreshTokenCookieRepository({ config, cookiesRepository: createCookieRepository({ context }) });+ const rolesRepository = createRolesRepository({ db });++ if (!googleUser || !googleUser.email) {+ throw createUnauthorizedError();+ }++ const usersRepository = createUsersRepository({ db });++ const { user } = await getOrCreateUserFromProvider({+ usersRepository,+ providerUser: {+ email: googleUser.email,+ fullName: googleUser.name,+ },+ });++ const userId = user.id;++ const { accessToken } = await createAuthTokens({+ authTokensRepository,+ refreshTokenCookieRepository,+ rolesRepository,+ userId,+ config,+ });++ const redirectUrl = createAccessTokenRedirectionUrl({ accessToken, redirectionBaseUrl: config.client.oauthRedirectUrl });++ return context.redirect(redirectUrl);+ },+ );+}diff --git a/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.constants.ts b/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.constants.tsnew file mode 100644index 00000000..4319d35e--- /dev/null+++ b/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.constants.ts@@ -0,0 +1,3 @@+export const REFRESH_TOKEN_DURATION_IN_DAYS = 14;+export const REFRESH_TOKEN_COOKIE_NAME = 'refreshToken';+export const REFRESH_TOKEN_COOKIE_DURATION_IN_DAYS = REFRESH_TOKEN_DURATION_IN_DAYS;diff --git a/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.cookie.repository.ts b/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.cookie.repository.tsnew file mode 100644index 00000000..999eca1d--- /dev/null+++ b/apps/app-server/src/modules/app/auth/refresh-tokens/refresh-token.cookie.repository.ts@@ -0,0 +1,74 @@+import type { Config } from '../../../config/config.types';+import type { CookieRepository } from '../../cookies/cookies.repository';+import { injectArguments } from '@corentinth/chisels';+import { addDays } from 'date-fns';+import { createUnauthorizedError } from '../auth.errors';+import { REFRESH_TOKEN_COOKIE_DURATION_IN_DAYS, REFRESH_TOKEN_COOKIE_NAME } from './refresh-token.constants';++export type RefreshTokenCookieRepository = ReturnType<typeof createRefreshTokenCookieRepository>;++export function createRefreshTokenCookieRepository({ cookiesRepository, config }: { cookiesRepository: CookieRepository; config: Config }) {+ return injectArguments(+ {+ saveRefreshTokenInCookie,+ getRefreshTokenFromCookie,+ getRefreshTokenFromCookieOrThrow,+ deleteRefreshTokenCookie,+ },+ { cookiesRepository, config },+ );+}++async function saveRefreshTokenInCookie({+ cookiesRepository,+ config,+ refreshToken,+ now = new Date(),+ expiresAt = addDays(now, REFRESH_TOKEN_COOKIE_DURATION_IN_DAYS),+}: {+ refreshToken: string;+ cookiesRepository: CookieRepository;+ config: Config;+ now?: Date;+ expiresAt?: Date;+}) {+ await cookiesRepository.setSignedCookie({+ cookieName: REFRESH_TOKEN_COOKIE_NAME,+ value: refreshToken,+ secret: config.auth.refreshTokenCookieSecret,+ options: {+ expires: expiresAt,+ httpOnly: true,+ secure: true,+ },+ });+}++async function getRefreshTokenFromCookieOrThrow({ cookiesRepository, config }: { cookiesRepository: CookieRepository; config: Config }) {+ const { refreshToken } = await getRefreshTokenFromCookie({ cookiesRepository, config });++ if (!refreshToken) {+ throw createUnauthorizedError();+ }++ return { refreshToken };+}++async function getRefreshTokenFromCookie({ cookiesRepository, config }: { cookiesRepository: CookieRepository; config: Config }) {+ const refreshToken = await cookiesRepository.getSignedCookie({+ cookieName: REFRESH_TOKEN_COOKIE_NAME,+ secret: config.auth.refreshTokenCookieSecret,+ });++ return { refreshToken };+}++async function deleteRefreshTokenCookie({ cookiesRepository }: { cookiesRepository: CookieRepository }) {+ await cookiesRepository.deleteCookie({+ cookieName: REFRESH_TOKEN_COOKIE_NAME,+ options: {+ httpOnly: true,+ secure: true,+ },+ });+}diff --git a/apps/app-server/src/modules/app/cookies/cookies.repository.ts b/apps/app-server/src/modules/app/cookies/cookies.repository.tsnew file mode 100644index 00000000..a227cfcc--- /dev/null+++ b/apps/app-server/src/modules/app/cookies/cookies.repository.ts@@ -0,0 +1,29 @@+import type { CookieOptions } from 'hono/utils/cookie';+import type { Context } from '../server.types';+import { injectArguments } from '@corentinth/chisels';+import { deleteCookie as deleteCookieImpl, getSignedCookie as getSignedCookieImpl, setSignedCookie as setSignedCookieImpl } from 'hono/cookie';++export type CookieRepository = ReturnType<typeof createCookieRepository>;++export function createCookieRepository({ context }: { context: Context }) {+ return injectArguments(+ {+ setSignedCookie,+ getSignedCookie,+ deleteCookie,+ },+ { context },+ );+}++async function setSignedCookie({ context, cookieName, value, secret, options }: { context: Context; cookieName: string; value: string; secret: string; options: CookieOptions }) {+ await setSignedCookieImpl(context, cookieName, value, secret, options);+}++async function getSignedCookie({ context, cookieName, secret }: { context: Context; cookieName: string; secret: string }) {+ return getSignedCookieImpl(context, secret, cookieName);+}++async function deleteCookie({ context, cookieName, options }: { context: Context; cookieName: string; options?: CookieOptions }) {+ return deleteCookieImpl(context, cookieName, options);+}diff --git a/apps/app-server/src/modules/app/database/database.test-utils.ts b/apps/app-server/src/modules/app/database/database.test-utils.tsindex dde24810..378ffb1e 100644--- a/apps/app-server/src/modules/app/database/database.test-utils.ts+++ b/apps/app-server/src/modules/app/database/database.test-utils.ts@@ -1,9 +1,6 @@import type { Database } from './database.types';import { migrate } from 'drizzle-orm/libsql/migrator';-import { apiKeysTable } from '../../api-keys/api-keys.db';-import { communicationsTable } from '../../communications/communications.db';-import { renderingsTable } from '../../renderings/renderings.db';-import { usersTable } from '../../users/users.db';+import { usersTable } from '../../users/users.table';import { setupDatabase } from './database';export { createInMemoryDatabase, seedDatabase };@@ -23,20 +20,11 @@ async function createInMemoryDatabase(seedOptions: Omit<Parameters<typeof seedDaasync function seedDatabase({db,users,- renderings,- apiKeys,- communications,}: {db: Database;users?: typeof usersTable.$inferInsert[];- renderings?: typeof renderingsTable.$inferInsert[];- apiKeys?: typeof apiKeysTable.$inferInsert[];- communications?: typeof communicationsTable.$inferInsert[];}) {await Promise.all([users && db.insert(usersTable).values(users).execute(),- renderings && db.insert(renderingsTable).values(renderings).execute(),- apiKeys && db.insert(apiKeysTable).values(apiKeys).execute(),- communications && db.insert(communicationsTable).values(communications).execute(),]);}diff --git a/apps/app-server/src/modules/app/routes.ts b/apps/app-server/src/modules/app/routes.tsdeleted file mode 100644index 32cdffbb..00000000--- a/apps/app-server/src/modules/app/routes.ts+++ /dev/null@@ -1,14 +0,0 @@-import type { ServerInstance } from './server.types';--export function registerRoutes({ app }: { app: ServerInstance }) {- registerPublicRoutes({ app });- registerPrivateRoutes({ app });-}--function registerPublicRoutes({ app }: { app: ServerInstance }) {- app.get('/api/ping', context => context.json({ status: 'ok' }));-}--function registerPrivateRoutes({ app: _ }: { app: ServerInstance }) {--}diff --git a/apps/app-server/src/modules/app/server.routes.ts b/apps/app-server/src/modules/app/server.routes.tsnew file mode 100644index 00000000..2625e79b--- /dev/null+++ b/apps/app-server/src/modules/app/server.routes.ts@@ -0,0 +1,28 @@+import type { ServerInstance } from './server.types';+import { registerDocumentsPrivateRoutes } from '../documents/documents.routes';+import { registerOrganizationsPrivateRoutes } from '../organizations/organizations.routes';+import { registerUsersPrivateRoutes } from '../users/users.routes';+import { registerAuthPrivateRoutes, registerAuthPublicRoutes } from './auth/auth.routes';+import { jwtValidationMiddleware } from './auth/middlewares/auth.middleware';+import { impersonationMiddleware } from './auth/middlewares/impersonation.middleware';++export function registerRoutes({ app }: { app: ServerInstance }) {+ registerPublicRoutes({ app });+ registerPrivateRoutes({ app });+}++function registerPublicRoutes({ app }: { app: ServerInstance }) {+ app.get('/api/ping', context => context.json({ status: 'ok' }));++ registerAuthPublicRoutes({ app });+}++function registerPrivateRoutes({ app }: { app: ServerInstance }) {+ app.use(jwtValidationMiddleware);+ app.use(impersonationMiddleware);++ registerAuthPrivateRoutes({ app });+ registerUsersPrivateRoutes({ app });+ registerOrganizationsPrivateRoutes({ app });+ registerDocumentsPrivateRoutes({ app });+}diff --git a/apps/app-server/src/modules/app/server.ts b/apps/app-server/src/modules/app/server.tsindex b7c102de..ed158d6f 100644--- a/apps/app-server/src/modules/app/server.ts+++ b/apps/app-server/src/modules/app/server.ts@@ -9,9 +9,10 @@ import { corsMiddleware } from './middlewares/cors.middleware';import { registerErrorMiddleware } from './middlewares/errors.middleware';import { loggerMiddleware } from './middlewares/logger.middleware';import { timeoutMiddleware } from './middlewares/timeout.middleware';-import { registerRoutes } from './routes';+import { registerRoutes } from './server.routes';+import { parseConfig } from '../config/config';-export function createServer({ config, db }: { config: Config; db: Database }) {+export function createServer({ config = parseConfig().config, db }: { config?: Config; db: Database }) {const app = new Hono<ServerInstanceGenerics>({ strict: true });app.use(loggerMiddleware);diff --git a/apps/app-server/src/modules/config/config.test-utils.ts b/apps/app-server/src/modules/config/config.test-utils.tsnew file mode 100644index 00000000..9693a055--- /dev/null+++ b/apps/app-server/src/modules/config/config.test-utils.ts@@ -0,0 +1,12 @@+import type { DeepPartial } from '@corentinth/chisels';+import type { Config } from './config.types';+import { merge } from 'lodash-es';+import { parseConfig } from './config';++export { overrideConfig };++function overrideConfig(config: DeepPartial<Config>) {+ const { config: defaultConfig } = parseConfig();++ return merge({}, defaultConfig, config);+}diff --git a/apps/app-server/src/modules/config/config.ts b/apps/app-server/src/modules/config/config.tsindex 4d1a2498..0d2c7f09 100644--- a/apps/app-server/src/modules/config/config.ts+++ b/apps/app-server/src/modules/config/config.ts@@ -4,6 +4,7 @@ import { safelySync } from '@corentinth/chisels';import { defineConfig } from 'figue';import { z } from 'zod';import { createLogger } from '../shared/logger/logger';+import { documentStorageConfig } from './fragments/document-storage.config';export const configDefinition = {env: {@@ -31,7 +32,7 @@ export const configDefinition = {z.string(),z.array(z.string()),]).transform(value => (typeof value === 'string' ? value.split(',') : value)),- default: [],+ default: ['http://localhost:3000'],env: 'SERVER_CORS_ORIGINS',},},@@ -96,7 +97,14 @@ export const configDefinition = {env: 'CLIENT_OAUTH_REDIRECT_URL',},},+ documentsStorage: documentStorageConfig,auth: {+ isRegistrationEnabled: {+ doc: 'Whether registration is enabled',+ schema: z.boolean(),+ default: true,+ env: 'AUTH_IS_REGISTRATION_ENABLED',+ },jwtSecret: {doc: 'The secret to use for JWT',schema: z.string(),diff --git a/apps/app-server/src/modules/config/fragments/document-storage.config.ts b/apps/app-server/src/modules/config/fragments/document-storage.config.tsnew file mode 100644index 00000000..182fd680--- /dev/null+++ b/apps/app-server/src/modules/config/fragments/document-storage.config.ts@@ -0,0 +1,28 @@+import type { ConfigDefinition } from 'figue';+import { z } from 'zod';+import { FS_STORAGE_DRIVER_NAME } from '../../documents/storage/drivers/fs/fs.storage-driver';++export const documentStorageConfig = {+ maxUploadSize: {+ doc: 'The maximum size in bytes for an uploaded file',+ schema: z.coerce.number().int().positive(),+ default: 10 * 1024 * 1024, // 10MB+ env: 'DOCUMENT_STORAGE_MAX_UPLOAD_SIZE',+ },+ driver: {+ doc: 'The driver to use for document storage',+ schema: z.enum([FS_STORAGE_DRIVER_NAME]),+ default: FS_STORAGE_DRIVER_NAME,+ env: 'DOCUMENT_STORAGE_DRIVER',+ },+ drivers: {+ filesystem: {+ root: {+ doc: 'The root directory to store documents in',+ schema: z.string(),+ default: './local-documents',+ env: 'DOCUMENT_STORAGE_FILESYSTEM_ROOT',+ },+ },+ },+} as const satisfies ConfigDefinition;diff --git a/apps/app-server/src/modules/documents/documents.repository.ts b/apps/app-server/src/modules/documents/documents.repository.tsnew file mode 100644index 00000000..392e1c3f--- /dev/null+++ b/apps/app-server/src/modules/documents/documents.repository.ts@@ -0,0 +1,44 @@+import type { Database } from '../app/database/database.types';+import type { DbInsertableDocument } from './documents.types';+import { injectArguments } from '@corentinth/chisels';+import { desc, eq } from 'drizzle-orm';+import { withPagination } from '../shared/db/pagination';+import { documentsTable } from './documents.table';++export type DocumentsRepository = ReturnType<typeof createDocumentsRepository>;++export function createDocumentsRepository({ db }: { db: Database }) {+ return injectArguments(+ {+ saveOrganizationDocument,+ getOrganizationDocuments,+ },+ { db },+ );+}++async function saveOrganizationDocument({ db, ...documentToInsert }: { db: Database } & DbInsertableDocument) {+ const [document] = await db.insert(documentsTable).values(documentToInsert).returning();++ return { document };+}++async function getOrganizationDocuments({ organizationId, pageIndex, pageSize, db }: { organizationId: string; pageIndex: number; pageSize: number; db: Database }) {+ const query = db+ .select()+ .from(documentsTable)+ .where(eq(documentsTable.organizationId, organizationId));++ const documents = await withPagination(+ query.$dynamic(),+ {+ orderByColumn: desc(documentsTable.createdAt),+ pageIndex,+ pageSize,+ },+ );++ return {+ documents,+ };+}diff --git a/apps/app-server/src/modules/documents/documents.routes.ts b/apps/app-server/src/modules/documents/documents.routes.tsnew file mode 100644index 00000000..d70d8446--- /dev/null+++ b/apps/app-server/src/modules/documents/documents.routes.ts@@ -0,0 +1,129 @@+import type { ServerInstance } from '../app/server.types';+import { bodyLimit } from 'hono/body-limit';+import { validator } from 'hono/validator';+import { z } from 'zod';+import { getAuthUserId } from '../app/auth/auth.models';+import { getDb } from '../app/database/database.models';+import { getConfig } from '../config/config.models';+import { organizationIdRegex } from '../organizations/organizations.constants';+import { createOrganizationsRepository } from '../organizations/organizations.repository';+import { createError } from '../shared/errors/errors';+import { validateFormData, validateParams, validateQuery } from '../shared/validation/validation';+import { createDocumentsRepository } from './documents.repository';+import { createDocument } from './documents.usecases';+import { createDocumentStorageService } from './storage/documents.storage.services';++export function registerDocumentsPrivateRoutes({ app }: { app: ServerInstance }) {+ setupCreateDocumentRoute({ app });+ setupGetDocumentsRoute({ app });+}++function setupCreateDocumentRoute({ app }: { app: ServerInstance }) {+ app.post(+ '/api/organizations/:organizationId/documents',+ (context, next) => {+ const { config } = getConfig({ context });+ const { maxUploadSize } = config.documentsStorage;++ const middleware = bodyLimit({+ maxSize: maxUploadSize,+ onError: () => {+ throw createError({+ message: `The file is too big, the maximum size is ${maxUploadSize} bytes.`,+ code: 'document.file_too_big',+ statusCode: 413,+ });+ },+ });++ return middleware(context, next);+ },++ validateFormData(z.object({+ file: z.instanceof(File),+ })),+ validateParams(z.object({+ organizationId: z.string().regex(organizationIdRegex),+ })),+ async (context) => {+ const { userId } = getAuthUserId({ context });+ const { db } = getDb({ context });+ const { config } = getConfig({ context });++ const { file } = context.req.valid('form');+ const { organizationId } = context.req.valid('param');++ if (!file) {+ throw createError({+ message: 'No file provided, please upload a file using the "file" key.',+ code: 'document.no_file',+ statusCode: 400,+ });+ }++ if (!(file instanceof File)) {+ throw createError({+ message: 'The file provided is not a file object.',+ code: 'document.invalid_file',+ statusCode: 400,+ });+ }++ const documentsRepository = createDocumentsRepository({ db });+ const documentsStorageService = await createDocumentStorageService({ config });++ const { document } = await createDocument({+ file,+ userId,+ organizationId,+ documentsRepository,+ documentsStorageService,+ });++ return context.json({+ document,+ });+ },+ );+}++function setupGetDocumentsRoute({ app }: { app: ServerInstance }) {+ app.get(+ '/api/organizations/:organizationId/documents',+ validateParams(z.object({+ organizationId: z.string().regex(organizationIdRegex),+ })),+ validateQuery(+ z.object({+ pageIndex: z.coerce.number().min(0).int().optional().default(0),+ pageSize: z.coerce.number().min(1).max(100).int().optional().default(100),+ }),+ ),+ async (context) => {+ const { userId } = getAuthUserId({ context });+ const { db } = getDb({ context });++ const { organizationId } = context.req.valid('param');+ const { pageIndex, pageSize } = context.req.valid('query');++ const documentsRepository = createDocumentsRepository({ db });+ const organizationsRepository = createOrganizationsRepository({ db });++ const { isInOrganization } = await organizationsRepository.isUserInOrganization({ userId, organizationId });++ if (!isInOrganization) {+ throw createError({+ message: 'You are not part of this organization.',+ code: 'user.not_in_organization',+ statusCode: 403,+ });+ }++ const { documents } = await documentsRepository.getOrganizationDocuments({ organizationId, pageIndex, pageSize });++ return context.json({+ documents,+ });+ },+ );+}diff --git a/apps/app-server/src/modules/documents/documents.table.ts b/apps/app-server/src/modules/documents/documents.table.tsindex 72dace18..a8d6dfa6 100644--- a/apps/app-server/src/modules/documents/documents.table.ts+++ b/apps/app-server/src/modules/documents/documents.table.ts@@ -1,22 +1,25 @@-import { numeric, sqliteTable, text } from 'drizzle-orm/sqlite-core';-import { organizationTable } from '../organizations/organizations.table';+import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';+import { organizationsTable } from '../organizations/organizations.table';import { createPrimaryKeyField, createSoftDeleteColumns, createTimestampColumns } from '../shared/db/columns.helpers';import { usersTable } from '../users/users.table';export const documentsTable = sqliteTable('documents', {- ...createPrimaryKeyField({ prefix: 'usr' }),+ ...createPrimaryKeyField({ prefix: 'doc' }),...createTimestampColumns(),...createSoftDeleteColumns(),- organizationId: text('organization_id').notNull().references(() => organizationTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),+ organizationId: text('organization_id').notNull().references(() => organizationsTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),createdBy: text('created_by').references(() => usersTable.id, { onDelete: 'set null', onUpdate: 'cascade' }),deletedBy: text('deleted_by').references(() => usersTable.id, { onDelete: 'set null', onUpdate: 'cascade' }),originalName: text('original_name').notNull(),- originalChecksum: text('original_checksum').notNull(),- originalSize: numeric('original_size').notNull().default('0'),+ // originalChecksum: text('original_checksum').notNull(),+ originalSize: integer('original_size').notNull().default(0),+ storageKey: text('storage_key').notNull(),+name: text('name').notNull(),- mimeType: text('mime_type').notNull(),- size: numeric('size').notNull().default('0'),+ // mimeType: text('mime_type').notNull(),+ size: integer('size').notNull().default(0),status: text('status').notNull().default('pending'),+ mimeType: text('mime_type').notNull(),});diff --git a/apps/app-server/src/modules/documents/documents.types.ts b/apps/app-server/src/modules/documents/documents.types.tsnew file mode 100644index 00000000..5134c726--- /dev/null+++ b/apps/app-server/src/modules/documents/documents.types.ts@@ -0,0 +1,4 @@+import type { Expand } from '@corentinth/chisels';+import type { documentsTable } from './documents.table';++export type DbInsertableDocument = Expand<typeof documentsTable.$inferInsert>;diff --git a/apps/app-server/src/modules/documents/documents.usecases.ts b/apps/app-server/src/modules/documents/documents.usecases.tsnew file mode 100644index 00000000..e402c3b9--- /dev/null+++ b/apps/app-server/src/modules/documents/documents.usecases.ts@@ -0,0 +1,39 @@+import type { DocumentsRepository } from './documents.repository';+import type { DocumentStorageService } from './storage/documents.storage.services';++export async function createDocument({+ file,+ userId,+ organizationId,+ documentsRepository,+ documentsStorageService,+}: {+ file: File;+ userId: string;+ organizationId: string;+ documentsRepository: DocumentsRepository;+ documentsStorageService: DocumentStorageService;+}) {+ const {+ name: fileName,+ size,+ type: mimeType,+ } = file;++ const { storageKey } = await documentsStorageService.saveFile({+ fileStream: file.stream(),+ fileName,+ });++ const { document } = await documentsRepository.saveOrganizationDocument({+ name: fileName,+ organizationId,+ originalName: fileName,+ createdBy: userId,+ size,+ storageKey,+ mimeType,+ });++ return { document };+}diff --git a/apps/app-server/src/modules/documents/storage/documents.storage.services.ts b/apps/app-server/src/modules/documents/storage/documents.storage.services.tsnew file mode 100644index 00000000..985af678--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/documents.storage.services.ts@@ -0,0 +1,38 @@+import type { Config } from '../../config/config.types';+import type { StorageDriver } from './drivers/drivers.models';+import { injectArguments } from '@corentinth/chisels';+import { createError } from '../../shared/errors/errors';+import { FS_STORAGE_DRIVER_NAME, fsStorageDriverFactory } from './drivers/fs/fs.storage-driver';++const storageDriverFactories = {+ [FS_STORAGE_DRIVER_NAME]: fsStorageDriverFactory,+};++export type DocumentStorageService = Awaited<ReturnType<typeof createDocumentStorageService>>++export async function createDocumentStorageService({ config }: { config: Config }) {+ const storageDriverName = config.documentsStorage.driver;++ const storageDriverFactory = storageDriverFactories[storageDriverName];++ if (!storageDriverFactory) {+ throw createError({+ message: `Unknown storage driver: ${storageDriverName}`,+ code: 'storage_driver.unknown_driver',+ isInternal: true,+ statusCode: 500,+ });+ }++ const storageDriver = await storageDriverFactory({ config });++ return injectArguments({+ saveFile,+ }, {+ storageDriver,+ });+}++async function saveFile({ storageDriver, fileStream, fileName }: { storageDriver: StorageDriver; fileStream: ReadableStream; fileName: string }) {+ return storageDriver.saveFile({ fileStream, fileName });+}diff --git a/apps/app-server/src/modules/documents/storage/drivers/drivers.models.ts b/apps/app-server/src/modules/documents/storage/drivers/drivers.models.tsnew file mode 100644index 00000000..d4c0f462--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/drivers/drivers.models.ts@@ -0,0 +1,13 @@+import type { Readable } from 'node:stream';+import type { Config } from '../../../config/config.types';++export type StorageDriver = {+ name: string;+ saveFile: (args: { fileStream: ReadableStream; fileName: string }) => Promise<{ storageKey: string }>;+};++export type StorageDriverFactory = (args: { config: Config }) => Promise<StorageDriver>;++export function defineStorageDriver(factory: StorageDriverFactory) {+ return factory;+}diff --git a/apps/app-server/src/modules/documents/storage/drivers/fs/fixtures/text-file.txt b/apps/app-server/src/modules/documents/storage/drivers/fs/fixtures/text-file.txtnew file mode 100644index 00000000..08e00ed2--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/drivers/fs/fixtures/text-file.txt@@ -0,0 +1 @@+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\ No newline at end of filediff --git a/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.errors.ts b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.errors.tsnew file mode 100644index 00000000..070cc982--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.errors.ts@@ -0,0 +1,7 @@+import { createErrorFactory } from '../../../../shared/errors/errors';++export const createFileAlreadyExistsError = createErrorFactory({+ message: 'The file already exists.',+ code: 'document.file_already_exists',+ statusCode: 409,+});diff --git a/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.test.ts b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.test.tsnew file mode 100644index 00000000..e4d09bde--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.test.ts@@ -0,0 +1,77 @@+import type { Config } from '../../../../config/config.types';+import fs from 'node:fs';+import os, { tmpdir } from 'node:os';+import path, { join } from 'node:path';+import stream from 'node:stream';+import { afterEach, beforeEach, describe, expect, test } from 'vitest';+import { fsStorageDriverFactory } from './fs.storage-driver';+import { createFileAlreadyExistsError } from './fs.storage-driver.errors';++describe('storage driver', () => {+ describe('fsStorageDriver', async () => {+ let tmpDirectory: string;++ beforeEach(async () => {+ tmpDirectory = await fs.promises.mkdtemp(join(tmpdir(), 'tests-'));+ });++ afterEach(async () => {+ await fs.promises.rm(tmpDirectory, { recursive: true });+ });++ describe('saveFile', () => {+ test('persists the file to the filesystem', async () => {+ const config = {+ documentsStorage: {+ drivers: {+ filesystem: {+ root: tmpDirectory,+ },+ },+ },+ } as Config;++ const fsStorageDriver = await fsStorageDriverFactory({ config });+ const fileStream = fs.createReadStream(path.join(__dirname, 'fixtures', 'text-file.txt'));++ const { storageKey } = await fsStorageDriver.saveFile({+ fileStream: stream.Readable.toWeb(fileStream),+ fileName: 'text-file.txt',+ });++ expect(storageKey).to.eql(`${tmpDirectory}/text-file.txt`);++ const fileExists = await fs.promises.access(storageKey, fs.constants.F_OK).then(() => true).catch(() => false);++ expect(fileExists).to.eql(true);+ });++ test('an error is raised if the file already exists', async () => {+ const config = {+ documentsStorage: {+ drivers: {+ filesystem: {+ root: tmpDirectory,+ },+ },+ },+ } as Config;++ const fsStorageDriver = await fsStorageDriverFactory({ config });+ const fileStream = fs.createReadStream(path.join(__dirname, 'fixtures', 'text-file.txt'));++ await fsStorageDriver.saveFile({+ fileStream: stream.Readable.toWeb(fileStream),+ fileName: 'text-file.txt',+ });++ await expect(+ fsStorageDriver.saveFile({+ fileStream: stream.Readable.toWeb(fileStream),+ fileName: 'text-file.txt',+ }),+ ).rejects.toThrow(createFileAlreadyExistsError());+ });+ });+ });+});diff --git a/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.ts b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.tsnew file mode 100644index 00000000..fbdda512--- /dev/null+++ b/apps/app-server/src/modules/documents/storage/drivers/fs/fs.storage-driver.ts@@ -0,0 +1,53 @@+import fs from 'node:fs';+import path, { dirname } from 'node:path';+import stream from 'node:stream';+import { defineStorageDriver } from '../drivers.models';+import { createFileAlreadyExistsError } from './fs.storage-driver.errors';++function ensureDirectoryExists({ path }: { path: string }) {+ return fs.promises.mkdir(+ dirname(path),+ { recursive: true },+ );+}++function checkFileExists({ path }: { path: string }) {+ return fs.promises.access(path, fs.constants.F_OK).then(() => true).catch(() => false);+}++export const FS_STORAGE_DRIVER_NAME = 'filesystem' as const;++export const fsStorageDriverFactory = defineStorageDriver(async ({ config }) => {+ const { root } = config.documentsStorage.drivers.filesystem;++ await ensureDirectoryExists({ path: root });++ return {+ name: FS_STORAGE_DRIVER_NAME,+ saveFile: async ({ fileStream, fileName }) => {+ // Save file to disk+ const storageKey = `${root}/${fileName}`;++ const fileExists = await checkFileExists({ path: storageKey });++ if (fileExists) {+ throw createFileAlreadyExistsError();+ }++ await ensureDirectoryExists({ path: storageKey });++ const writeStream = fs.createWriteStream(storageKey);+ stream.Readable.fromWeb(fileStream).pipe(writeStream);++ return new Promise((resolve, reject) => {+ writeStream.on('finish', () => {+ resolve({ storageKey });+ });++ writeStream.on('error', (error) => {+ reject(error);+ });+ });+ },+ };+});diff --git a/apps/app-server/src/modules/organizations/organizations.constants.ts b/apps/app-server/src/modules/organizations/organizations.constants.tsnew file mode 100644index 00000000..b8bfca54--- /dev/null+++ b/apps/app-server/src/modules/organizations/organizations.constants.ts@@ -0,0 +1,5 @@+export const organizationIdRegex = /^org_[a-z0-9]{24}$/;++export const ORGANIZATION_ROLE_MEMBER = 'member';+export const ORGANIZATION_ROLE_OWNER = 'owner';+export const ORGANIZATION_ROLE_ADMIN = 'admin';diff --git a/apps/app-server/src/modules/organizations/organizations.repository.ts b/apps/app-server/src/modules/organizations/organizations.repository.tsnew file mode 100644index 00000000..404f8995--- /dev/null+++ b/apps/app-server/src/modules/organizations/organizations.repository.ts@@ -0,0 +1,57 @@+import type { Database } from '../app/database/database.types';+import type { DbInsertableOrganization } from './organizations.types';+import { injectArguments } from '@corentinth/chisels';+import { and, eq, getTableColumns } from 'drizzle-orm';+import { organizationsTable, organizationUsersTable } from './organizations.table';++export type OrganizationsRepository = ReturnType<typeof createOrganizationsRepository>;++export function createOrganizationsRepository({ db }: { db: Database }) {+ return injectArguments(+ {+ saveOrganization,+ getUserOrganizations,+ addUserToOrganization,+ isUserInOrganization,+ },+ { db },+ );+}++async function saveOrganization({ organization: organizationToInsert, db }: { organization: DbInsertableOrganization; db: Database }) {+ const [organization] = await db.insert(organizationsTable).values(organizationToInsert).returning();++ return { organization };+}++async function getUserOrganizations({ userId, db }: { userId: string; db: Database }) {+ const organizations = await db+ .select({+ organization: getTableColumns(organizationsTable),+ })+ .from(organizationsTable)+ .leftJoin(organizationUsersTable, eq(organizationsTable.id, organizationUsersTable.organizationId))+ .where(eq(organizationUsersTable.userId, userId));++ return {+ organizations: organizations.map(({ organization }) => organization),+ };+}++async function addUserToOrganization({ userId, organizationId, role, db }: { userId: string; organizationId: string; role: string; db: Database }) {+ await db.insert(organizationUsersTable).values({ userId, organizationId, role });+}++async function isUserInOrganization({ userId, organizationId, db }: { userId: string; organizationId: string; db: Database }) {+ const organizationUser = await db+ .select()+ .from(organizationUsersTable)+ .where(and(+ eq(organizationUsersTable.userId, userId),+ eq(organizationUsersTable.organizationId, organizationId),+ ));++ return {+ isInOrganization: organizationUser.length > 0,+ };+}diff --git a/apps/app-server/src/modules/organizations/organizations.routes.ts b/apps/app-server/src/modules/organizations/organizations.routes.tsnew file mode 100644index 00000000..86b00101--- /dev/null+++ b/apps/app-server/src/modules/organizations/organizations.routes.ts@@ -0,0 +1,49 @@+import type { ServerInstance } from '../app/server.types';+import { z } from 'zod';+import { getAuthUserId } from '../app/auth/auth.models';+import { getDb } from '../app/database/database.models';+import { validateJsonBody } from '../shared/validation/validation';+import { createOrganizationsRepository } from './organizations.repository';+import { createOrganization } from './organizations.usecases';++export async function registerOrganizationsPrivateRoutes({ app }: { app: ServerInstance }) {+ setupGetOrganizationsRoute({ app });+ setupCreateOrganizationRoute({ app });+}++function setupGetOrganizationsRoute({ app }: { app: ServerInstance }) {+ app.get('/api/organizations', async (context) => {+ const { userId } = getAuthUserId({ context });+ const { db } = getDb({ context });++ const organizationsRepository = createOrganizationsRepository({ db });++ const { organizations } = await organizationsRepository.getUserOrganizations({ userId });++ return context.json({+ organizations,+ });+ });+}++function setupCreateOrganizationRoute({ app }: { app: ServerInstance }) {+ app.post(+ '/api/organizations',+ validateJsonBody(z.object({+ name: z.string().min(3).max(50),+ })),+ async (context) => {+ const { userId } = getAuthUserId({ context });+ const { db } = getDb({ context });+ const { name } = context.req.valid('json');++ const organizationsRepository = createOrganizationsRepository({ db });++ const { organization } = await createOrganization({ userId, name, organizationsRepository });++ return context.json({+ organization,+ });+ },+ );+}diff --git a/apps/app-server/src/modules/organizations/organizations.table.ts b/apps/app-server/src/modules/organizations/organizations.table.tsindex bc81b2a0..df5898cf 100644--- a/apps/app-server/src/modules/organizations/organizations.table.ts+++ b/apps/app-server/src/modules/organizations/organizations.table.ts@@ -1,15 +1,16 @@import { sqliteTable, text } from 'drizzle-orm/sqlite-core';import { createPrimaryKeyField, createTimestampColumns } from '../shared/db/columns.helpers';import { usersTable } from '../users/users.table';+import { ORGANIZATION_ROLE_MEMBER } from './organizations.constants';-export const organizationTable = sqliteTable('organizations', {+export const organizationsTable = sqliteTable('organizations', {...createPrimaryKeyField({ prefix: 'org' }),...createTimestampColumns(),name: text('name').notNull(),});-export const organizationUserTable = sqliteTable('organization_users', {+export const organizationUsersTable = sqliteTable('organization_users', {...createPrimaryKeyField({ prefix: 'org_usr' }),...createTimestampColumns(),@@ -19,9 +20,9 @@ export const organizationUserTable = sqliteTable('organization_users', {organizationId: text('organization_id').notNull()- .references(() => organizationTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),+ .references(() => organizationsTable.id, { onDelete: 'cascade', onUpdate: 'cascade' }),- roleId: text('role_id')+ role: text('role').notNull()- .default('member'),+ .default(ORGANIZATION_ROLE_MEMBER),});diff --git a/apps/app-server/src/modules/organizations/organizations.types.ts b/apps/app-server/src/modules/organizations/organizations.types.tsnew file mode 100644index 00000000..ede24c33--- /dev/null+++ b/apps/app-server/src/modules/organizations/organizations.types.ts@@ -0,0 +1,4 @@+import type { Expand } from '@corentinth/chisels';+import type { organizationsTable } from './organizations.table';++export type DbInsertableOrganization = Expand<typeof organizationsTable.$inferInsert>;diff --git a/apps/app-server/src/modules/organizations/organizations.usecases.ts b/apps/app-server/src/modules/organizations/organizations.usecases.tsnew file mode 100644index 00000000..c17a3cc2--- /dev/null+++ b/apps/app-server/src/modules/organizations/organizations.usecases.ts@@ -0,0 +1,10 @@+import type { OrganizationsRepository } from './organizations.repository';+import { ORGANIZATION_ROLE_OWNER } from './organizations.constants';++export async function createOrganization({ name, userId, organizationsRepository }: { name: string; userId: string; organizationsRepository: OrganizationsRepository }) {+ const { organization } = await organizationsRepository.saveOrganization({ organization: { name } });++ await organizationsRepository.addUserToOrganization({ userId, organizationId: organization.id, role: ORGANIZATION_ROLE_OWNER });++ return { organization };+}diff --git a/apps/app-server/src/modules/roles/middlewares/roles.middleware.ts b/apps/app-server/src/modules/roles/middlewares/roles.middleware.tsnew file mode 100644index 00000000..a0faf819--- /dev/null+++ b/apps/app-server/src/modules/roles/middlewares/roles.middleware.ts@@ -0,0 +1,24 @@+import type { ServerInstanceGenerics } from '../../app/server.types';+import type { Role } from '../roles.types';+import { createMiddleware } from 'hono/factory';+import { createForbiddenError } from '../../app/auth/auth.errors';+import { areSomeRolesInJwtPayload } from '../roles.models';++export function createRoleGuardMiddleware({ allowedRoles }: { allowedRoles: Role[] }) {+ return createMiddleware<ServerInstanceGenerics>(async (context, next) => {+ const jwtPayload = context.get('jwtPayload');++ const hasRole = areSomeRolesInJwtPayload({+ roles: allowedRoles,+ jwtPayload,+ });++ if (!hasRole) {+ throw createForbiddenError();+ }++ await next();+ });+}++export const adminGuardMiddleware = createRoleGuardMiddleware({ allowedRoles: ['admin'] });diff --git a/apps/app-server/src/modules/roles/roles.constants.ts b/apps/app-server/src/modules/roles/roles.constants.tsnew file mode 100644index 00000000..d60cc67b--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.constants.ts@@ -0,0 +1,3 @@+export const ADMIN_ROLE = 'admin';++export const ROLES = [ADMIN_ROLE] as const;diff --git a/apps/app-server/src/modules/roles/roles.models.test.ts b/apps/app-server/src/modules/roles/roles.models.test.tsnew file mode 100644index 00000000..8d3a2f59--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.models.test.ts@@ -0,0 +1,55 @@+import { describe, expect, test } from 'vitest';+import { areSomeRolesInJwtPayload } from './roles.models';++describe('roles models', () => {+ describe('areSomeRolesInJwtPayload', () => {+ test('check if at least one roles in the jwtPayload match at least one of the expected roles', () => {+ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {+ roles: ['admin', 'user'],+ },+ })).to.eql(true);++ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {+ roles: [],+ },+ })).to.eql(false);+ });++ test('when the roles field in the jwtPayload is not a string array, it should return false', () => {+ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {+ roles: 'admin',+ },+ })).to.eql(false);++ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {+ roles: undefined,+ },+ })).to.eql(false);++ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {+ roles: ['admin', 123],+ },+ })).to.eql(false);++ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: {},+ })).to.eql(false);++ expect(areSomeRolesInJwtPayload({+ roles: ['admin'],+ jwtPayload: undefined,+ })).to.eql(false);+ });+ });+});diff --git a/apps/app-server/src/modules/roles/roles.models.ts b/apps/app-server/src/modules/roles/roles.models.tsnew file mode 100644index 00000000..a25ebd4a--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.models.ts@@ -0,0 +1,15 @@+import { get, isArray, isString } from 'lodash-es';++export function areSomeRolesInJwtPayload({ roles, jwtPayload }: { roles: string[]; jwtPayload?: Record<string, unknown> }) {+ const rolesInJwt = get(jwtPayload, 'roles');++ if (!rolesInJwt) {+ return false;+ }++ if (!isArray(rolesInJwt) || !rolesInJwt.every(isString)) {+ return false;+ }++ return rolesInJwt.some(role => roles.includes(role));+}diff --git a/apps/app-server/src/modules/roles/roles.repository.ts b/apps/app-server/src/modules/roles/roles.repository.tsnew file mode 100644index 00000000..10cae514--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.repository.ts@@ -0,0 +1,24 @@+import type { Database } from '../app/database/database.types';+import { injectArguments } from '@corentinth/chisels';+import { eq } from 'drizzle-orm';+import { map } from 'lodash-es';+import { userRolesTable } from './roles.table';++export type RolesRepository = ReturnType<typeof createRolesRepository>;++export function createRolesRepository({ db }: { db: Database }) {+ return injectArguments(+ {+ getUserRoles,+ },+ { db },+ );+}++async function getUserRoles({ userId, db }: { userId: string; db: Database }) {+ const roles = await db.select().from(userRolesTable).where(eq(userRolesTable.userId, userId));++ return {+ roles: map(roles, 'role'),+ };+}diff --git a/apps/app-server/src/modules/roles/roles.table.ts b/apps/app-server/src/modules/roles/roles.table.tsnew file mode 100644index 00000000..fdd9a478--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.table.ts@@ -0,0 +1,28 @@+import type { Role } from './roles.types';+import { index, sqliteTable, text, unique } from 'drizzle-orm/sqlite-core';+import { createPrimaryKeyField, createTimestampColumns } from '../shared/db/columns.helpers';+import { usersTable } from '../users/users.table';++export const userRolesTable = sqliteTable(+ 'user_roles',+ {+ ...createPrimaryKeyField({ prefix: 'rol' }),+ ...createTimestampColumns(),++ userId: text('user_id')+ .notNull()+ .references(+ () => usersTable.id,+ { onDelete: 'cascade', onUpdate: 'cascade' },+ ),++ role: text('role').notNull().$type<Role>(),+ },+ table => [+ // To enforce unique roles per user+ unique('user_roles_user_id_role_key').on(table.userId, table.role),++ // To get all user for a role+ index('role_index').on(table.role),+ ],+);diff --git a/apps/app-server/src/modules/roles/roles.types.ts b/apps/app-server/src/modules/roles/roles.types.tsnew file mode 100644index 00000000..6d69f3a9--- /dev/null+++ b/apps/app-server/src/modules/roles/roles.types.ts@@ -0,0 +1,3 @@+import type { ROLES } from './roles.constants';++export type Role = typeof ROLES[number];diff --git a/apps/app-server/src/modules/shared/db/constraints.models.test.ts b/apps/app-server/src/modules/shared/db/constraints.models.test.tsnew file mode 100644index 00000000..2af47c5b--- /dev/null+++ b/apps/app-server/src/modules/shared/db/constraints.models.test.ts@@ -0,0 +1,16 @@+import { describe, expect, test } from 'vitest';+import { isUniqueConstraintError } from './constraints.models';++describe('constraints models', () => {+ describe('isUniqueConstraintError', () => {+ test('in case of an insertion of a record with a unique constraint violation, an error with code SQLITE_CONSTRAINT_UNIQUE is raised by the db driver', () => {+ expect(isUniqueConstraintError({ error: { code: 'SQLITE_CONSTRAINT_UNIQUE' } })).to.eql(true);+ expect(isUniqueConstraintError({ error: Object.assign(new Error('error'), { code: 'SQLITE_CONSTRAINT_UNIQUE' }) })).to.eql(true);++ expect(isUniqueConstraintError({ error: { code: 'other' } })).to.eql(false);+ expect(isUniqueConstraintError({ error: {} })).to.eql(false);+ expect(isUniqueConstraintError({ error: null })).to.eql(false);+ expect(isUniqueConstraintError({ error: new Set([Symbol('bob')]) })).to.eql(false);+ });+ });+});diff --git a/apps/app-server/src/modules/shared/db/constraints.models.ts b/apps/app-server/src/modules/shared/db/constraints.models.tsnew file mode 100644index 00000000..ac4ce17f--- /dev/null+++ b/apps/app-server/src/modules/shared/db/constraints.models.ts@@ -0,0 +1,7 @@+import { get } from 'lodash-es';++export { isUniqueConstraintError };++function isUniqueConstraintError({ error }: { error: unknown }): boolean {+ return get(error, 'code') === 'SQLITE_CONSTRAINT_UNIQUE';+}diff --git a/apps/app-server/src/modules/shared/db/pagination.ts b/apps/app-server/src/modules/shared/db/pagination.tsnew file mode 100644index 00000000..268caa90--- /dev/null+++ b/apps/app-server/src/modules/shared/db/pagination.ts@@ -0,0 +1,17 @@+import type { SQL } from 'drizzle-orm';+import type { SQLiteColumn, SQLiteSelect } from 'drizzle-orm/sqlite-core';++export function withPagination<T extends SQLiteSelect>(query: T, {+ orderByColumn,+ pageIndex,+ pageSize,+}: {+ orderByColumn: SQLiteColumn | SQL;+ pageIndex: number;+ pageSize: number;+}) {+ return query+ .orderBy(orderByColumn)+ .limit(pageSize)+ .offset(pageIndex * pageSize);+}diff --git a/apps/app-server/src/modules/shared/validation/validation.test.ts b/apps/app-server/src/modules/shared/validation/validation.test.tsnew file mode 100644index 00000000..8c7bb31c--- /dev/null+++ b/apps/app-server/src/modules/shared/validation/validation.test.ts@@ -0,0 +1,146 @@+import { Hono } from 'hono';+import { describe, expect, test } from 'vitest';+import { z } from 'zod';+import { validateJsonBody, validateParams, validateQuery } from './validation';++function makeJsonBodyPayload(payload: Record<string, unknown>) {+ return {+ body: JSON.stringify(payload),+ headers: new Headers({ 'Content-Type': 'application/json' }),+ };+}++describe('validation', () => {+ describe('validateJsonBody', () => {+ describe('validateJsonBody creates a validation middleware that check the request json body against a schema', async () => {+ test('an invalid payload should trigger a 400 error', async () => {+ const app = new Hono().post('/', validateJsonBody(z.object({ name: z.string({ required_error: 'The name is required' }) })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/', { method: 'POST', ...makeJsonBodyPayload({ }) });+ const responseBody = await response.json();++ expect(response.status).toBe(400);+ expect(responseBody).toEqual({+ error: {+ message: 'Invalid request body',+ code: 'server.invalid_request.body',+ details: [{+ path: 'name',+ message: 'The name is required',+ }],+ },+ });+ });++ test('a valid request should pass through', async () => {+ const app = new Hono().post('/', validateJsonBody(z.object({ name: z.string() })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/', { method: 'POST', ...makeJsonBodyPayload({ name: 'hono' }) });+ const responseBody = await response.json();++ expect(response.status).toBe(200);+ expect(responseBody).toEqual({ ok: true });+ });++ test('no additional properties should be allowed', async () => {+ const app = new Hono().post('/', validateJsonBody(z.object({ name: z.string() })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/', { method: 'POST', ...makeJsonBodyPayload({ name: 'hono', foo: 'bar' }) });+ const responseBody = await response.json();++ expect(response.status).toBe(400);+ expect(responseBody).toEqual({+ error: {+ message: 'Invalid request body',+ code: 'server.invalid_request.body',+ details: [{+ message: 'Unrecognized key(s) in object: \'foo\'',+ }],+ },+ });+ });+ });+ });++ describe('validateQuery', () => {+ describe('validateQuery creates a validation middleware that check the request query parameters against a schema', async () => {+ test('an invalid query should trigger a 400 error', async () => {+ const app = new Hono().get('/', validateQuery(z.object({ name: z.string({ required_error: 'The name is required' }) })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/');+ const responseBody = await response.json();++ expect(response.status).toBe(400);+ expect(responseBody).toEqual({+ error: {+ message: 'Invalid query parameters',+ code: 'server.invalid_request.query',+ details: [{+ path: 'name',+ message: 'The name is required',+ }],+ },+ });+ });++ test('a valid query should pass through', async () => {+ const app = new Hono().get('/', validateQuery(z.object({ name: z.string() })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/?name=hono');+ const responseBody = await response.json();++ expect(response.status).toBe(200);+ expect(responseBody).toEqual({ ok: true });+ });+ });+ });++ describe('validateParams', () => {+ describe('validateParams creates a validation middleware that check the request url parameters against a schema', async () => {+ test('an invalid params should trigger a 400 error', async () => {+ const app = new Hono().get('/:name', validateParams(z.object({ name: z.string().startsWith('foo-') })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/test');+ const responseBody = await response.json();++ expect(response.status).toBe(400);+ expect(responseBody).toEqual({+ error: {+ message: 'Invalid URL parameters',+ code: 'server.invalid_request.params',+ details: [+ {+ path: 'name',+ message: 'Invalid input: must start with "foo-"',+ },+ ],+ },+ });+ });++ test('a valid params should pass through', async () => {+ const app = new Hono().get('/:name', validateParams(z.object({ name: z.string().startsWith('foo-') })), (context) => {+ return context.json({ ok: true });+ });++ const response = await app.request('/foo-bar');+ const responseBody = await response.json();++ expect(response.status).toBe(200);+ expect(responseBody).toEqual({ ok: true });+ });+ });+ });+});diff --git a/apps/app-server/src/modules/shared/validation/validation.ts b/apps/app-server/src/modules/shared/validation/validation.tsnew file mode 100644index 00000000..fcb298c2--- /dev/null+++ b/apps/app-server/src/modules/shared/validation/validation.ts@@ -0,0 +1,46 @@+import type { ValidationTargets } from 'hono';+import type z from 'zod';+import { validator } from 'hono/validator';++function formatValidationError({ error }: { error: z.ZodError }) {+ const details = (error.errors ?? []).map((e) => {+ return {+ ...(e.path.length === 0 ? {} : { path: e.path.join('.') }),+ message: e.message,+ };+ });++ return details;+}++function buildValidator<Target extends keyof ValidationTargets>({ target, error }: { target: Target; error: { message: string; code: string } }) {+ return <Schema extends z.ZodTypeAny>(schema: Schema) => {+ return validator(target, (value, context) => {+ // @ts-expect-error try to enforce strict mode+ const refinedSchema = schema.strict?.() ?? schema;++ const result = refinedSchema.safeParse(value);++ if (result.success) {+ return result.data as z.infer<Schema>;+ }++ const details = formatValidationError({ error: result.error });++ return context.json(+ {+ error: {+ ...error,+ details,+ },+ },+ 400,+ );+ });+ };+}++export const validateJsonBody = buildValidator({ target: 'json', error: { message: 'Invalid request body', code: 'server.invalid_request.body' } });+export const validateQuery = buildValidator({ target: 'query', error: { message: 'Invalid query parameters', code: 'server.invalid_request.query' } });+export const validateParams = buildValidator({ target: 'param', error: { message: 'Invalid URL parameters', code: 'server.invalid_request.params' } });+export const validateFormData = buildValidator({ target: 'form', error: { message: 'Invalid form data', code: 'server.invalid_request.form_data' } });diff --git a/apps/app-server/src/modules/users/users.errors.ts b/apps/app-server/src/modules/users/users.errors.tsnew file mode 100644index 00000000..b2322d6a--- /dev/null+++ b/apps/app-server/src/modules/users/users.errors.ts@@ -0,0 +1,25 @@+import { createErrorFactory } from '../shared/errors/errors';++export const createUsersNotFoundError = createErrorFactory({+ message: 'User not found',+ code: 'users.not_found',+ statusCode: 404,+});++export const createUserAlreadyExistsError = createErrorFactory({+ message: 'User already exists',+ code: 'users.create_user_already_exists',+ statusCode: 400,+});++export const createCustomerIdNotFoundError = createErrorFactory({+ message: 'Customer ID not found',+ code: 'users.customer_id_not_found',+ statusCode: 404,+});++export const createUserAccountCreationDisabledError = createErrorFactory({+ message: 'User account creation is disabled',+ code: 'users.create_account_disabled',+ statusCode: 403,+});diff --git a/apps/app-server/src/modules/users/users.repository.test.ts b/apps/app-server/src/modules/users/users.repository.test.tsnew file mode 100644index 00000000..b80f093c--- /dev/null+++ b/apps/app-server/src/modules/users/users.repository.test.ts@@ -0,0 +1,23 @@+import { describe, expect, test } from 'vitest';+import { createInMemoryDatabase } from '../app/database/database.test-utils';+import { createUserAlreadyExistsError } from './users.errors';+import { createUsersRepository } from './users.repository';++describe('users repository', () => {+ describe('createUser', () => {+ test('when a user already exists with the same email, an error is thrown', async () => {+ const { db } = await createInMemoryDatabase();+ const { createUser } = createUsersRepository({ db });++ const email = '[email protected]';+ await createUser({ user: { email } });++ try {+ await createUser({ user: { email } });+ expect.fail('An error should have been thrown');+ } catch (error) {+ expect(error).to.deep.equal(createUserAlreadyExistsError());+ }+ });+ });+});diff --git a/apps/app-server/src/modules/users/users.repository.ts b/apps/app-server/src/modules/users/users.repository.tsnew file mode 100644index 00000000..7c5990f3--- /dev/null+++ b/apps/app-server/src/modules/users/users.repository.ts@@ -0,0 +1,67 @@+import type { Database } from '../app/database/database.types';+import type { DbInsertableUser } from './users.types';+import { injectArguments } from '@corentinth/chisels';+import { desc, eq } from 'drizzle-orm';+import { isUniqueConstraintError } from '../shared/db/constraints.models';+import { createUserAlreadyExistsError, createUsersNotFoundError } from './users.errors';+import { usersTable } from './users.table';++export { createUsersRepository };++export type UsersRepository = ReturnType<typeof createUsersRepository>;++function createUsersRepository({ db }: { db: Database }) {+ return injectArguments(+ {+ createUser,+ getUserByEmail,+ getUserById,+ getUserByIdOrThrow,+ },+ { db },+ );+}++async function createUser({ user: userToCreate, db }: { user: DbInsertableUser; db: Database }) {+ try {+ const [user] = await db.insert(usersTable).values(userToCreate).returning();++ return { user };+ } catch (error) {+ if (isUniqueConstraintError({ error })) {+ throw createUserAlreadyExistsError();+ }++ throw error;+ }+}++async function getUserByEmail({ email, db }: { email: string; db: Database }) {+ const [user] = await db.select().from(usersTable).where(eq(usersTable.email, email));++ if (!user) {+ return { user: undefined };+ }++ return { user };+}++async function getUserById({ userId, db }: { userId: string; db: Database }) {+ const [user] = await db.select().from(usersTable).where(eq(usersTable.id, userId));++ if (!user) {+ return { user: undefined };+ }++ return { user };+}++async function getUserByIdOrThrow({ userId, db, errorFactory = createUsersNotFoundError }: { userId: string; db: Database; errorFactory?: () => Error }) {+ const { user } = await getUserById({ userId, db });++ if (!user) {+ throw errorFactory();+ }++ return { user };+}diff --git a/apps/app-server/src/modules/users/users.routes.ts b/apps/app-server/src/modules/users/users.routes.tsnew file mode 100644index 00000000..a3e8ba75--- /dev/null+++ b/apps/app-server/src/modules/users/users.routes.ts@@ -0,0 +1,44 @@+import type { ServerInstance } from '../app/server.types';+import { pick } from 'lodash-es';+import { getAuthUserId } from '../app/auth/auth.models';+import { getDb } from '../app/database/database.models';+import { createRolesRepository } from '../roles/roles.repository';+import { createUsersRepository } from './users.repository';++export async function registerUsersPrivateRoutes({ app }: { app: ServerInstance }) {+ setupGetCurrentUserRoute({ app });+}++function setupGetCurrentUserRoute({ app }: { app: ServerInstance }) {+ app.get('/api/users/me', async (context) => {+ const { userId } = getAuthUserId({ context });+ const { db } = getDb({ context });++ const usersRepository = createUsersRepository({ db });+ const rolesRepository = createRolesRepository({ db });++ const [+ { user },+ { roles },+ ] = await Promise.all([+ usersRepository.getUserByIdOrThrow({ userId }),+ rolesRepository.getUserRoles({ userId }),+ ]);++ return context.json({+ user: {+ roles,+ ...pick(+ user,+ [+ 'id',+ 'email',+ 'createdAt',+ 'updatedAt',+ 'planId',+ ],+ ),+ },+ });+ });+}diff --git a/apps/app-server/src/modules/users/users.table.ts b/apps/app-server/src/modules/users/users.table.tsindex 5058164c..9fc3bdec 100644--- a/apps/app-server/src/modules/users/users.table.ts+++ b/apps/app-server/src/modules/users/users.table.ts@@ -8,7 +8,7 @@ export const usersTable = sqliteTable(...createTimestampColumns(),email: text('email').notNull().unique(),- fullName: text('full_name').notNull(),+ fullName: text('full_name'),},table => [index('email_index').on(table.email),diff --git a/apps/app-server/src/modules/users/users.types.ts b/apps/app-server/src/modules/users/users.types.tsnew file mode 100644index 00000000..ac2f51a3--- /dev/null+++ b/apps/app-server/src/modules/users/users.types.ts@@ -0,0 +1,8 @@+import type { Expand } from '@corentinth/chisels';+import type { createUsersRepository } from './users.repository';+import type { usersTable } from './users.table';+++export type User = Expand<typeof usersTable.$inferSelect>;++export type DbInsertableUser = Expand<typeof usersTable.$inferInsert>;diff --git a/apps/app-server/src/modules/users/users.usecases.ts b/apps/app-server/src/modules/users/users.usecases.tsnew file mode 100644index 00000000..dfb1b7b6--- /dev/null+++ b/apps/app-server/src/modules/users/users.usecases.ts@@ -0,0 +1,24 @@+import type { Config } from '../config/config.types';+import type { UsersRepository } from './users.repository';+import type { DbInsertableUser } from './users.types';+import { createUserAccountCreationDisabledError } from './users.errors';++export async function createUser({+ user: userPartials,+ usersRepository,+ config,+}: {+ user: DbInsertableUser;+ usersRepository: UsersRepository;+ config: Config;+}) {+ const { isRegistrationEnabled } = config.auth;++ if (!isRegistrationEnabled) {+ throw createUserAccountCreationDisabledError();+ }++ const { user } = await usersRepository.createUser({ user: userPartials });++ return { user };+}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex ddb56891..841cb020 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -4,10 +4,134 @@ settings:autoInstallPeers: trueexcludeLinksFromLockfile: false+catalogs:+ default:+ '@antfu/eslint-config':+ specifier: ^3.6.2+ version: 3.12.1+ '@types/node':+ specifier: ^22.5.4+ version: 22.10.2+ eslint:+ specifier: ^9.10.0+ version: 9.17.0+ typescript:+ specifier: ^5.6.2+ version: 5.7.2+ vitest:+ specifier: ^2.0.5+ version: 2.1.8+importers:.: {}+ apps/app-client:+ dependencies:+ '@corentinth/chisels':+ specifier: ^1.0.2+ version: 1.1.0+ '@kobalte/core':+ specifier: ^0.13.4+ version: 0.13.7([email protected])+ '@solid-primitives/i18n':+ specifier: ^2.1.1+ version: 2.1.1([email protected])+ '@solid-primitives/storage':+ specifier: ^4.2.1+ version: 4.2.1([email protected])+ '@solidjs/router':+ specifier: ^0.14.3+ version: 0.15.2([email protected])+ '@tanstack/solid-query':+ specifier: ^5.61.5+ version: 5.62.10([email protected])+ '@tanstack/solid-table':+ specifier: ^8.20.5+ version: 8.20.5([email protected])+ '@unocss/reset':+ specifier: ^0.64.0+ version: 0.65.3+ class-variance-authority:+ specifier: ^0.7.0+ version: 0.7.1+ clsx:+ specifier: ^2.1.1+ version: 2.1.1+ date-fns:+ specifier: ^4.1.0+ version: 4.1.0+ jszip:+ specifier: ^3.10.1+ version: 3.10.1+ lodash-es:+ specifier: ^4.17.21+ version: 4.17.21+ shiki:+ specifier: ^1.24.0+ version: 1.26.1+ solid-js:+ specifier: ^1.8.11+ version: 1.9.3+ solid-sonner:+ specifier: ^0.2.8+ version: 0.2.8([email protected])+ tailwind-merge:+ specifier: ^2.6.0+ version: 2.6.0+ ts-pattern:+ specifier: ^5.5.0+ version: 5.6.0+ unocss-preset-animations:+ specifier: ^1.1.0+ version: 1.1.0(@unocss/[email protected])([email protected]([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected])))+ uqr:+ specifier: ^0.1.2+ version: 0.1.2+ zod:+ specifier: ^3.23.8+ version: 3.24.1+ devDependencies:+ '@antfu/eslint-config':+ specifier: 'catalog:'+ version: 3.12.1(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))+ '@iconify-json/tabler':+ specifier: ^1.1.120+ version: 1.2.13+ '@playwright/test':+ specifier: ^1.46.1+ version: 1.49.1+ '@types/lodash-es':+ specifier: ^4.17.12+ version: 4.17.12+ '@types/node':+ specifier: 'catalog:'+ version: 22.10.2+ eslint:+ specifier: 'catalog:'+ version: 9.17.0([email protected])+ jsdom:+ specifier: ^25.0.0+ version: 25.0.1+ tsx:+ specifier: ^4.19.1+ version: 4.19.2+ typescript:+ specifier: 'catalog:'+ version: 5.7.2+ unocss:+ specifier: 0.65.0-beta.2+ version: 0.65.3([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))+ vite:+ specifier: ^5.0.11+ vite-plugin-solid:+ specifier: ^2.8.2+ version: 2.11.0([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ vitest:+ specifier: 'catalog:'+ version: 2.1.8(@types/[email protected])([email protected])+apps/app-server:dependencies:'@corentinth/chisels':@@ -16,12 +140,18 @@ importers:'@hono/node-server':specifier: ^1.13.7version: 1.13.7([email protected])+ '@hono/oauth-providers':+ specifier: ^0.6.2+ version: 0.6.2([email protected])'@libsql/client':specifier: ^0.14.0version: 0.14.0'@paralleldrive/cuid2':specifier: ^2.2.2version: 2.2.2+ date-fns:+ specifier: ^4.1.0+ version: 4.1.0drizzle-orm:specifier: ^0.38.3version: 0.38.3(@libsql/[email protected])@@ -39,35 +169,36 @@ importers:version: 3.24.1devDependencies:'@antfu/eslint-config':- specifier: ^3.12.1- version: 3.12.1(@typescript-eslint/[email protected]([email protected])([email protected]))(@vue/[email protected])([email protected])([email protected])([email protected](@types/[email protected]))+ specifier: 'catalog:'+ version: 3.12.1(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))'@types/lodash-es':specifier: ^4.17.12version: 4.17.12'@types/node':specifier: ^22.10.2- version: 22.10.2- dotenv:- specifier: ^16.4.7- version: 16.4.7+ version: 22.10.5drizzle-kit:specifier: ^0.30.1version: 0.30.1eslint:- specifier: ^9.17.0- version: 9.17.0+ specifier: 'catalog:'+ version: 9.17.0([email protected])tsx:specifier: ^4.19.2version: 4.19.2typescript:- specifier: ^5.7.2+ specifier: 'catalog:'version: 5.7.2vitest:- specifier: ^2.1.8- version: 2.1.8(@types/[email protected])+ specifier: 'catalog:'+ version: 2.1.8(@types/[email protected])([email protected])packages:+ '@ampproject/[email protected]':+ resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}+ engines: {node: '>=6.0.0'}+'@antfu/[email protected]':resolution: {integrity: sha512-6sRgO4u63GK75xeZ2MfCSRT9GcfLti4ZN3Xw+bIu39oo6HY50fBY+rXnWvgwNimzHBOh3yV5xUHfTqcHq1M5AA==}hasBin: true@@ -114,6 +245,9 @@ packages:svelte-eslint-parser:optional: true+ '@antfu/[email protected]':+ resolution: {integrity: sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw==}+'@antfu/[email protected]':resolution: {integrity: sha512-dKnk2xlAyC7rvTkpkHmu+Qy/2Zc3Vm/l8PtNyIOGDBtXPY3kThfU4ORNEp3V7SXw5XSOb+tOJaUYpfquPzL/Tg==}@@ -124,6 +258,40 @@ packages:resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==}engines: {node: '>=6.9.0'}+ '@babel/[email protected]':+ resolution: {integrity: sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==}+ engines: {node: '>=6.9.0'}+ peerDependencies:+ '@babel/core': ^7.0.0++ '@babel/[email protected]':+ resolution: {integrity: sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==}+ engines: {node: '>=6.9.0'}+'@babel/[email protected]':resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==}engines: {node: '>=6.9.0'}@@ -132,11 +300,33 @@ packages:resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==}engines: {node: '>=6.9.0'}+ '@babel/[email protected]':+ resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==}+ engines: {node: '>=6.9.0'}+'@babel/[email protected]':resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==}engines: {node: '>=6.0.0'}hasBin: true+ '@babel/[email protected]':+ resolution: {integrity: sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==}+ engines: {node: '>=6.9.0'}+ peerDependencies:+ '@babel/core': ^7.0.0-0++ '@babel/[email protected]':+ resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==}+ engines: {node: '>=6.9.0'}++ '@babel/[email protected]':+ resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==}+ engines: {node: '>=6.9.0'}+'@babel/[email protected]':resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==}engines: {node: '>=6.9.0'}@@ -150,6 +340,11 @@ packages:'@corentinth/[email protected]':resolution: {integrity: sha512-l4qG6uXLKFWilt1Mnt5btCoCaIGVLiPOk95V6W3BPPJ9LE558tlet2EnU3z1gfSO7kqRTgkqLdcwwlzI9mMRNQ==}+ '@corvu/[email protected]':+ resolution: {integrity: sha512-Ox2kYyxy7NoXdKWdHeDEjZxClwzO4SKM8plAaVwmAJPxHMqA0rLOoAsa+hBDwRLpctf+ZRnAd/ykguuJidnaTA==}+ peerDependencies:+ solid-js: ^1.8+'@drizzle-team/[email protected]':resolution: {integrity: sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==}@@ -183,6 +378,12 @@ packages:cpu: [ppc64]os: [aix]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==}+ engines: {node: '>=18'}+ cpu: [ppc64]+ os: [aix]+'@esbuild/[email protected]':resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}engines: {node: '>=12'}@@ -207,6 +408,12 @@ packages:cpu: [arm64]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}engines: {node: '>=12'}@@ -231,6 +438,12 @@ packages:cpu: [arm]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==}+ engines: {node: '>=18'}+ cpu: [arm]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}engines: {node: '>=12'}@@ -255,6 +468,12 @@ packages:cpu: [x64]os: [android]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [android]+'@esbuild/[email protected]':resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}engines: {node: '>=12'}@@ -279,6 +498,12 @@ packages:cpu: [arm64]os: [darwin]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [darwin]+'@esbuild/[email protected]':resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}engines: {node: '>=12'}@@ -303,6 +528,12 @@ packages:cpu: [x64]os: [darwin]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [darwin]+'@esbuild/[email protected]':resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}engines: {node: '>=12'}@@ -327,6 +558,12 @@ packages:cpu: [arm64]os: [freebsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [freebsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}engines: {node: '>=12'}@@ -351,6 +588,12 @@ packages:cpu: [x64]os: [freebsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [freebsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}engines: {node: '>=12'}@@ -375,6 +618,12 @@ packages:cpu: [arm64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}engines: {node: '>=12'}@@ -399,6 +648,12 @@ packages:cpu: [arm]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==}+ engines: {node: '>=18'}+ cpu: [arm]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}engines: {node: '>=12'}@@ -423,6 +678,12 @@ packages:cpu: [ia32]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==}+ engines: {node: '>=18'}+ cpu: [ia32]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}engines: {node: '>=12'}@@ -447,6 +708,12 @@ packages:cpu: [loong64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==}+ engines: {node: '>=18'}+ cpu: [loong64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}engines: {node: '>=12'}@@ -471,6 +738,12 @@ packages:cpu: [mips64el]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==}+ engines: {node: '>=18'}+ cpu: [mips64el]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}engines: {node: '>=12'}@@ -495,6 +768,12 @@ packages:cpu: [ppc64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==}+ engines: {node: '>=18'}+ cpu: [ppc64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}engines: {node: '>=12'}@@ -519,6 +798,12 @@ packages:cpu: [riscv64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==}+ engines: {node: '>=18'}+ cpu: [riscv64]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}engines: {node: '>=12'}@@ -543,6 +828,12 @@ packages:cpu: [s390x]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==}+ engines: {node: '>=18'}+ cpu: [s390x]+ os: [linux]+'@esbuild/[email protected]':resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}engines: {node: '>=12'}@@ -567,6 +858,18 @@ packages:cpu: [x64]os: [linux]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [linux]++ '@esbuild/[email protected]':+ resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [netbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}engines: {node: '>=12'}@@ -591,12 +894,24 @@ packages:cpu: [x64]os: [netbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [netbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==}engines: {node: '>=18'}cpu: [arm64]os: [openbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [openbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}engines: {node: '>=12'}@@ -621,6 +936,12 @@ packages:cpu: [x64]os: [openbsd]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [openbsd]+'@esbuild/[email protected]':resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}engines: {node: '>=12'}@@ -645,6 +966,12 @@ packages:cpu: [x64]os: [sunos]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [sunos]+'@esbuild/[email protected]':resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}engines: {node: '>=12'}@@ -669,6 +996,12 @@ packages:cpu: [arm64]os: [win32]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==}+ engines: {node: '>=18'}+ cpu: [arm64]+ os: [win32]+'@esbuild/[email protected]':resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}engines: {node: '>=12'}@@ -693,6 +1026,12 @@ packages:cpu: [ia32]os: [win32]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==}+ engines: {node: '>=18'}+ cpu: [ia32]+ os: [win32]+'@esbuild/[email protected]':resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}engines: {node: '>=12'}@@ -717,6 +1056,12 @@ packages:cpu: [x64]os: [win32]+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==}+ engines: {node: '>=18'}+ cpu: [x64]+ os: [win32]+'@eslint-community/[email protected]':resolution: {integrity: sha512-lb/Z/MzbTf7CaVYM9WCFNQZ4L1yi3ev2fsFPF99h31ljhSEyUoyEsKsNWiU+qD1glbYTDJdqgyaLKtyTkkqtuQ==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}@@ -770,12 +1115,27 @@ packages:resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==}engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}+ '@floating-ui/[email protected]':+ resolution: {integrity: sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==}++ '@floating-ui/[email protected]':+ resolution: {integrity: sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==}++ '@floating-ui/[email protected]':+ resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==}+'@hono/[email protected]':resolution: {integrity: sha512-kTfUMsoloVKtRA2fLiGSd9qBddmru9KadNyhJCwgKBxTiNkaAJEwkVN9KV/rS4HtmmNRtUh6P+YpmjRMl0d9vQ==}engines: {node: '>=18.14.1'}peerDependencies:hono: ^4+ '@hono/[email protected]':+ resolution: {integrity: sha512-Uo2Lf+GnaPGebkC4GUQMRD9spIKonav/gWwSapEJhCKQjq1WVxTLIlCykNRhJtcizPCPc6OAV3A9RAYk0kX9XQ==}+ engines: {node: '>=18.4.0'}+ peerDependencies:+ hono: '>=3.*'+'@humanfs/[email protected]':resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}engines: {node: '>=18.18.0'}@@ -796,9 +1156,49 @@ packages:resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==}engines: {node: '>=18.18'}+ '@iconify-json/[email protected]':+ resolution: {integrity: sha512-vXnl0db3Q/v1e+lMEGmdrzJeFVyR//20gbUU2HFOrJP08nbz1EGRa8urNS4zL3oEV6Wjgo11AHJLSs628I6swQ==}++ '@iconify/[email protected]':+ resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}++ '@iconify/[email protected]':+ resolution: {integrity: sha512-0/7J7hk4PqXmxo5PDBDxmnecw5PxklZJfNjIVG9FM0mEfVrvfudS22rYWsqVk6gR3UJ/mSYS90X4R3znXnqfNA==}++ '@internationalized/[email protected]':+ resolution: {integrity: sha512-+z6ti+CcJnRlLHok/emGEsWQhe7kfSmEW+/6qCzvKY67YPh7YOBfvc7+/+NXq+zJlbArg30tYpqLjNgcAYv2YQ==}++ '@internationalized/[email protected]':+ resolution: {integrity: sha512-PtrRcJVy7nw++wn4W2OuePQQfTqDzfusSuY1QTtui4wa7r+rGVtR75pO8CyKvHvzyQYi3Q1uO5sY0AsB4e65Bw==}++ '@jridgewell/[email protected]':+ resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==}+ engines: {node: '>=6.0.0'}++ '@jridgewell/[email protected]':+ resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}+ engines: {node: '>=6.0.0'}++ '@jridgewell/[email protected]':+ resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==}+ engines: {node: '>=6.0.0'}+'@jridgewell/[email protected]':resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}+ '@jridgewell/[email protected]':+ resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}++ '@kobalte/[email protected]':+ resolution: {integrity: sha512-COhjWk1KnCkl3qMJDvdrOsvpTlJ9gMLdemkAn5SWfbPn/lxJYabejnNOk+b/ILGg7apzQycgbuo48qb8ppqsAg==}+ peerDependencies:+ solid-js: ^1.8.15++ '@kobalte/[email protected]':+ resolution: {integrity: sha512-eeU60A3kprIiBDAfv9gUJX1tXGLuZiKMajUfSQURAF2pk4ZoMYiqIzmrMBvzcxP39xnYttgTyQEVLwiTZnrV4w==}+ peerDependencies:+ solid-js: ^1.8.8+'@libsql/[email protected]':resolution: {integrity: sha512-/9HEKfn6fwXB5aTEEoMeFh4CtG0ZzbncBb1e++OCdVpgKZ/xyMsIVYXm0w7Pv4RUel803vE6LwniB3PqD72R0Q==}@@ -876,6 +1276,23 @@ packages:resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}+ '@playwright/[email protected]':+ resolution: {integrity: sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==}+ engines: {node: '>=18'}+ hasBin: true++ '@polka/[email protected]':+ resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==}++ '@rollup/[email protected]':+ resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==}+ engines: {node: '>=14.0.0'}+ peerDependencies:+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0+ peerDependenciesMeta:+ rollup:+ optional: true+'@rollup/[email protected]':resolution: {integrity: sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==}cpu: [arm]@@ -971,12 +1388,143 @@ packages:cpu: [x64]os: [win32]+ '@shikijs/[email protected]':+ resolution: {integrity: sha512-yeo7sG+WZQblKPclUOKRPwkv1PyoHYkJ4gP9DzhFJbTdueKR7wYTI1vfF/bFi1NTgc545yG/DzvVhZgueVOXMA==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-CRhA0b8CaSLxS0E9A4Bzcb3LKBNpykfo9F85ozlNyArxjo2NkijtiwrJZ6eHa+NT5I9Kox2IXVdjUsP4dilsmw==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-F5XuxN1HljLuvfXv7d+mlTkV7XukC1cawdtOo+7pKgPD83CAB1Sf8uHqP3PK0u7njFH0ZhoXE1r+0JzEgAQ+kg==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-oz/TQiIqZejEIZbGtn68hbJijAOTtYH4TMMSWkWYozwqdpKR3EXgILneQy26WItmJjp3xVspHdiUxUCws4gtuw==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-JDxVn+z+wgLCiUhBGx2OQrLCkKZQGzNH3nAxFir4PjUcYiyD8Jdms9izyxIogYmSwmoPTatFTdzyrRKbKlSfPA==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-d4B00TKKAMaHuFYgRf3L0gwtvqpW4hVdVwKcZYbBfAAQXspgkbWqnFfuFl3MDH6gLbsubOcr+prcnsqah3ny7Q==}++ '@shikijs/[email protected]':+ resolution: {integrity: sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==}++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-DAJbl+F0wrFW2xmcV8dKMBhk9QLVLuBSW+TR4JmIfTaObxd13PuL7nqaXnaYKDWOYa6otB00qcCUIGbuIhSUgQ==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-1p9B8hveu+gzFRWfXcRtdzzEdr7gw3c8uLXm+2bU33JHgiI8kYJsWvG128sE6vU1ZtYGPrGq980Jd6hxYupyZQ==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-Tlm2wCKcXEVxqd1speWjPhGvDhuuo/VeWSvNF6r2h77BUOHRKmNwz9uVKKMQmYSaLwiptJTp+fPZY2dOVPWQRQ==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-B1zyFbsiTQvqPr+cuPCXO72sRuczG9Swncqk5P74NCGw1VE8qa/Ry9GlfI1e/VdeQYHjan+XkbE3rO2GW/qKew==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-QUmU62D4/d9YWx/4Dvr/UZasIkIpqNXz7wosA5GLmesRW9XlPa3G5M6uOmTw73SByHNTCw0D6x8bSdtvvLgzvQ==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-jZAKWwvDRHjiydIumDgMj68qviIbowQ1ci7nkEAgzgvanNkhKSQV8iPgR2jMk1uv7S2ZqXYHslVQTgJel/TEyg==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-+jIsWG8/nYvhaCoG2Vg6CJOLgTmPKFbaCrNQKWfChalgUf9WrVxWw0CdJb3yX15n5lUcQ0jBo6qYtuVVmBLpBw==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-KbPhwal6ML9OHeUTZszBbt6PYSMj89d4wVCLxlvDYL4U0+p+xlCEaqz6v9dkCwm/0Lb+Wed7W5T1dQZCP3JUUw==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-GFJE9GC3ojx0aUKqAUZmQPyU8fOVMtnVNrkdk2yS4kd17WqVSpXpoTmo9CnOwA+PG7FTzdIkogvfLQSLs4lrww==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-ZecE4BqY0oBk0YG00nzaAWO5Mjcny8Fc06CdbXadH9T9lzq/9GefqcSe/5AtdXqjvY/DtJ5C6CkcjPZO0o/eqg==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-1XUJeaSlizH9Eam/+IbIpslHEnggJMNZXzfsr06AlbG6tJtQENMu0+94ZIvooxt4Cyw46wPzcnHYbSK7LzoQAA==}+ peerDependencies:+ '@tauri-apps/plugin-store': '*'+ solid-js: ^1.6.12+ solid-start: '*'+ peerDependenciesMeta:+ '@tauri-apps/plugin-store':+ optional: true+ solid-start:+ optional: true++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-00BbAiXV66WwjHuKZc3wr0+GLb9C24mMUmi3JdTpNFgHBbrQGrIHubmZDg36c5/7wH+E0GQtOOanwQS063PO+A==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solid-primitives/[email protected]':+ resolution: {integrity: sha512-CqAwKb2T5Vi72+rhebSsqNZ9o67buYRdEJrIFzRXz3U59QqezuuxPsyzTSVCacwS5Pf109VRsgCJQoxKRoECZQ==}+ peerDependencies:+ solid-js: ^1.6.12++ '@solidjs/[email protected]':+ resolution: {integrity: sha512-UWtliRvOnjfYMONQcTGwtf6BEud5QlF0oHC5L+kcSGYn0jARH5KzC3+3LLZ0al7oQo/5Rc50ssMswPuAuxFvAA==}+ peerDependencies:+ solid-js: ^1.8.6+'@stylistic/[email protected]':resolution: {integrity: sha512-fubZKIHSPuo07FgRTn6S4Nl0uXPRPYVNpyZzIDGfp7Fny6JjNus6kReLD7NI380JXi4HtUTSOZ34LBuNPO1XLQ==}engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}peerDependencies:eslint: '>=8.40.0'+ '@swc/[email protected]':+ resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-lwePd8hNYhyQ4nM/iRQ+Wz2cDtspGeZZHFZmCzHJ7mfKXt+9S301fULiY2IR2byJYY6Z03T427E5PoVfMexHjw==}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-C7zUowaY6Sprsk5tGZ85FS0e6CAPDonPvPXnzpSsQoSLMmDyG98MPq8F+u2uroR1T0jLBidHIn+gd1WOc3Y/2Q==}+ peerDependencies:+ solid-js: ^1.6.0++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-LsB/g/24CjBpccOcok+u+tfyqtU9SIQg5wf7ne54jRdEsy5YQnrpb5ATWZileHBduIG0p/1oE7UOA+DyjtnbDQ==}+ engines: {node: '>=12'}+ peerDependencies:+ solid-js: '>=1.3'++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg==}+ engines: {node: '>=12'}++ '@types/[email protected]':+ resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}++ '@types/[email protected]':+ resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==}++ '@types/[email protected]':+ resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==}++ '@types/[email protected]':+ resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==}+'@types/[email protected]':resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}@@ -986,6 +1534,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}+ '@types/[email protected]':+ resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}+'@types/[email protected]':resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}@@ -1004,6 +1555,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==}+ '@types/[email protected]':+ resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==}+'@types/[email protected]':resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}@@ -1060,21 +1614,104 @@ packages:resolution: {integrity: sha512-mCFtBbFBJDCNCWUl5y6sZSCHXw1DEFEk3c/M3nRK2a4XUB8StGFtmcEMizdjKuBzB6e/smJAAWYug3VrdLMr1w==}engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- '@vitest/[email protected]':- resolution: {integrity: sha512-ztvy2+thiCMmKnywvKGhH3AcKgEMGd4BsFK2QC9/EXqlyjXDp7Pg96PonbLx8bDvNCAjq4hfCw5YuZSAz1EDIg==}+ '@ungap/[email protected]':+ resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-shEKzsYOz1KMO36jzoNzTltzaUkQOe+UHgiRpsGE28ldSymGfOfiJQzG9T4+Q3Ckk0C86UyVP3Uerxx1qoYwAA==}peerDependencies:- '@typescript-eslint/utils': '>= 8.0'- eslint: '>= 8.57.0'- typescript: '>= 5.0.0'- vitest: '*'+ vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0peerDependenciesMeta:- typescript:- optional: true- vitest:+ vite:optional: true- '@vitest/[email protected]':- resolution: {integrity: sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==}+ '@unocss/[email protected]':+ resolution: {integrity: sha512-VIV6/aLJ0mWOJ8/iK7nWVCR6G/hM/6W7EGSO1gpLHWn4Rj+T6NtCmk/U4nao9pTYg/nVBBBCL3ydRguF3DA0ow==}+ engines: {node: '>=14'}+ hasBin: true++ '@unocss/[email protected]':+ resolution: {integrity: sha512-H+UpEPo47DeEsLbjHMby42MJ+lx7vXltFOdpgXFKutLkT034VoXmN1lgrAh9lZ4ow3iuUfEatHyuWffpOQf9gA==}+ engines: {node: '>=14'}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-xYkJ63lIadL6KqvGcaE2fFeLvo6rC1F+e+R9EFn0Aj0ArMRhiltZk8vvLFHP7iYjjdTdqDkAr/7IdrTosTo8Pg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-ZVGCjOZuU8daGxY7MUJQrI7aVKzZi1llRk53QgEUTU1q60X/fi8M2+A9mwEgG9MBVHBdsuvxqZ9Dp79IktSyLw==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-medDlG0FsCvKBBprC5FZxYrWTLV+iNSnc8S84VI4J/iKZQ43X34Edy+Rudy+YsPXQ8qZcuYQ7RDSHsPnP6X+Bg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-WCAycMhigioWn8IV3w3ptsstvRvEW86vHpELOMSXKcbminaOJ7RkfpoCKwfSzL73CBSYwovVCWS/y4LFP85NQQ==}+ engines: {node: '>=14'}+ peerDependencies:+ postcss: ^8.4.21++ '@unocss/[email protected]':+ resolution: {integrity: sha512-0nDKoR8x32ul1Ne7BbJqzAq5D1RM0C7+DTiLxhWonjCcZwCQpas/npTU6wvwQhc5ksuON0xtoQyl4a6zLNA5Vg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-3V4d5M+a2mTGnLjSsXyNL+/+nzjasdsJEJdXarLnj9Ez0KaBCvi32OjyoYrZUSMC5GCSreVNUOVBZKcxfdtitA==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-HG7mRfq0S2VKkw40duumoyIYaMBQGW1Uxb+Kw8HLGvoamnDmOZKb+TOXxys17Z5Z0vloi2CN1qqyJhYC0G6MSg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-IWRQ/CO+KmspIBPq6pNfYQmUzZkMqTa/Cr7fB4R+ZQFIe9OO3Cpj18R5VL3qujVC+dePiAFiP/tVLt6/mCQzuw==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-PYcVU1uYGJRuj8FqHVUaRYS15X/+m58v2uUXW+qoqv9jh3KGabu3yPac1UILHTtdE3Y6PSflf3Hf9M9MqxAgog==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-1O9qVAG/W7t4X9VExuUPGGy+4n8yxfpuQ3NeFgXlEkT1Mi3cokS0Eb0quvttgLGbjQ2waoS4MWbGyMmDGHWnYQ==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-hDuDbZawPc7ebtNoYI5zKpqURjAH5lLKqVRwdQXQiJ2T8IfT246HkL6+pcpdjAkHy3oJDUxGwrD/tYFcu9fcdA==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-esptoeJEN1QZEXwMIU3OXumSi3TEbIXZg1SuuUYqOWXzldxANsfXSMdHtsiXUSMNwNsfmQl4XfBlGNYYK/7eyg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-elwdQJ6tF4IpVUv7euK8MOKXTcQMeImsimaCViqe0yL0onPChgK16qs5xgVbBGrj9B57bmWgoUp0af/J03oNYA==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-jndyth0X11FbvIDForYq90b+N5xsR31FRsmvp7AC7dcW71clemUEDHCwqzSJn8cVFwahgvlwWbEoYHPEgQrtIQ==}+ engines: {node: '>=14'}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-mfPpsqdpig2Jgd9BDL79XP1VpDslndSLVEr/xzV1LQOL4FVLe8IIiO6hqeeUNVuV99wxCa8QAigbI2vbUi5p+Q==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-cndbJUYqOACeFvldCAVd8edD56XcufFCAwbCm4uio1DjwpqJmtoaJHnLlrE2Pytleej1IAhDuoyaJAnSU9hIDA==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-Jn2b9NSzbp+X5YLY1MWJzXY6dMUYhAuE+xjdiwFNACdbSvnjV+WLX1rOFeeNZx0rP2e5sPeDsv7MTF71uZeohg==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-l18P2lyELe6AiRYr9cPbctRn+ITUgncPqhetH46ZoGHKrVR7MSFYHSo0gUJBusBYJisNHTjhaQvNQcDGD3BPWQ==}++ '@unocss/[email protected]':+ resolution: {integrity: sha512-GMJ9Aj3M1L/m5CiHbMpOJ9WEfF+c+13Q6zW22n+iz5CYhqXAwyDrtV2afpFBF3w5PLUHC4aW3C4nNQTUTUuPeA==}+ peerDependencies:+ vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0++ '@vitest/[email protected]':+ resolution: {integrity: sha512-ztvy2+thiCMmKnywvKGhH3AcKgEMGd4BsFK2QC9/EXqlyjXDp7Pg96PonbLx8bDvNCAjq4hfCw5YuZSAz1EDIg==}+ peerDependencies:+ '@typescript-eslint/utils': '>= 8.0'+ eslint: '>= 8.57.0'+ typescript: '>= 5.0.0'+ vitest: '*'+ peerDependenciesMeta:+ typescript:+ optional: true+ vitest:+ optional: true++ '@vitest/[email protected]':+ resolution: {integrity: sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==}'@vitest/[email protected]':resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==}@@ -1114,6 +1751,20 @@ packages:'@vue/[email protected]':resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==}+ '@vue/[email protected]':+ resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==}++ '@vue/[email protected]':+ resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==}++ '@vue/[email protected]':+ resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==}++ '@vue/[email protected]':+ resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==}+ peerDependencies:+ vue: 3.5.13+'@vue/[email protected]':resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==}@@ -1127,6 +1778,10 @@ packages:engines: {node: '>=0.4.0'}hasBin: true+ resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==}+ engines: {node: '>= 14'}+resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}@@ -1138,6 +1793,10 @@ packages:resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}+ engines: {node: '>= 8'}+resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==}engines: {node: '>=14'}@@ -1149,9 +1808,26 @@ packages:resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}engines: {node: '>=12'}+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}++ resolution: {integrity: sha512-6RzmSu21zYPlV2gNwzjGG9FgODtt9hIWnx7L//OIioIEuRcnpDZoY8Tr+I81Cy1SrH4qoDyKpwHHo6uAMAeyPA==}+ peerDependencies:+ '@babel/core': ^7.20.12++ resolution: {integrity: sha512-jvlx5wDp8s+bEF9sGFw/84SInXOA51ttkUEroQziKMbxplXThVKt83qB6bDTa1HuLNatdU9FHpFOiQWs1tLQIg==}+ peerDependencies:+ '@babel/core': ^7.0.0+resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}+ resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}@@ -1177,6 +1853,12 @@ packages:resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}engines: {node: '>=6'}+ resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+ peerDependencies:+ esbuild: '>=0.18'+resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}engines: {node: '>=8'}@@ -1199,6 +1881,12 @@ packages:resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}engines: {node: '>=10'}+ resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}++ resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==}+resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==}@@ -1206,10 +1894,17 @@ packages:resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==}engines: {node: '>= 16'}+ resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}+ engines: {node: '>= 8.10.0'}+resolution: {integrity: sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A==}engines: {node: '>=8'}+ resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}+resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}engines: {node: '>=4'}@@ -1218,6 +1913,10 @@ packages:resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}engines: {node: '>=12'}+ resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}engines: {node: '>=7.0.0'}@@ -1225,6 +1924,16 @@ packages:resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}+ resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}++ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}+ engines: {node: '>= 0.8'}++ resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}+resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==}engines: {node: '>= 12.0.0'}@@ -1235,22 +1944,50 @@ packages:resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}+ resolution: {integrity: sha512-Qil5KwghMzlqd51UXM0b6fyaGHtOC22scxrwrz4A2882LyUMwQjnvaedN1HAeXzphspQ6CpHkzMAWxBTUruDLg==}+ engines: {node: ^14.18.0 || >=16.10.0}++ resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}+resolution: {integrity: sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==}+ resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}+resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}engines: {node: '>= 8'}+ resolution: {integrity: sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==}+ engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}+resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}engines: {node: '>=4'}hasBin: true+ resolution: {integrity: sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}+resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}engines: {node: '>= 12'}+ resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==}+resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}peerDependencies:@@ -1268,6 +2005,9 @@ packages:supports-color:optional: true+ resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}+resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==}@@ -1278,10 +2018,20 @@ packages:resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}+ resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}++ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}+ engines: {node: '>=0.4.0'}+resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==}+resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==}engines: {node: '>=8'}@@ -1293,10 +2043,6 @@ packages:resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}engines: {node: '>=6.0.0'}- resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==}- engines: {node: '>=12'}-resolution: {integrity: sha512-HmA/NeewvHywhJ2ENXD3KvOuM/+K2dGLJfxVfIHsGwaqKICJnS+Ke2L6UcSrSrtMJLJaT0Im1Qv4TFXfaZShyw==}hasBin: true@@ -1393,9 +2139,15 @@ packages:sqlite3:optional: true+ resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}+resolution: {integrity: sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ==}+ resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}+resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}@@ -1438,6 +2190,11 @@ packages:engines: {node: '>=18'}hasBin: true+ resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==}+ engines: {node: '>=18'}+ hasBin: true+resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}engines: {node: '>=6'}@@ -1664,6 +2421,14 @@ packages:resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==}+ resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==}+ peerDependencies:+ picomatch: ^3 || ^4+ peerDependenciesMeta:+ picomatch:+ optional: true+resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}engines: {node: ^12.20 || >= 14.13}@@ -1700,10 +2465,19 @@ packages:resolution: {integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==}+ resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==}+ engines: {node: '>= 6'}+resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}engines: {node: '>=12.20.0'}+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}+ os: [darwin]+resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}@@ -1712,6 +2486,10 @@ packages:resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}+ resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}+ engines: {node: '>=6.9.0'}+resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}engines: {node: 6.* || 8.* || >= 10.*}@@ -1727,6 +2505,10 @@ packages:resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}engines: {node: '>=10.13.0'}+ resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}+ engines: {node: '>=4'}+resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}engines: {node: '>=8'}@@ -1745,6 +2527,10 @@ packages:resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}+ resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}+ engines: {node: '>=10'}+resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}engines: {node: '>=8'}@@ -1753,6 +2539,12 @@ packages:resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA==}++ resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==}+resolution: {integrity: sha512-OiQwvAOAaI2JrABBH69z5rsctHDzFzIKJge0nYXgtzGJ0KftwLWcBXm1upJC23/omNRtnqM0gjRMbtXshPdqhQ==}engines: {node: '>=16.9.0'}@@ -1760,14 +2552,42 @@ packages:resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}+ resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==}++ resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}++ resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}+ engines: {node: '>= 14'}++ resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}+ engines: {node: '>= 14'}++ resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}engines: {node: '>= 4'}+ resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}+resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}engines: {node: '>=6'}+ resolution: {integrity: sha512-YrRaigAec1sC2CdIJjf/hCH1Wp9Ii8Cq5ROw4k5nJ19FVl2FcJUHZ5gGIb1vs8+JNYIyOJpc2fcufS2330bxDw==}+resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}engines: {node: '>=0.8.19'}@@ -1776,9 +2596,16 @@ packages:resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}+resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}+ resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==}engines: {node: '>=6'}@@ -1803,9 +2630,23 @@ packages:resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}engines: {node: '>=0.12.0'}+ resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}++ resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==}+ engines: {node: '>=12.13'}++ resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}+resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}+ resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==}+ hasBin: true+resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==}@@ -1820,6 +2661,15 @@ packages:resolution: {integrity: sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==}engines: {node: '>=12.0.0'}+ resolution: {integrity: sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==}+ engines: {node: '>=18'}+ peerDependencies:+ canvas: ^2.11.2+ peerDependenciesMeta:+ canvas:+ optional: true+resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}hasBin: true@@ -1841,24 +2691,43 @@ packages:resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}+ resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}+ engines: {node: '>=6'}+ hasBin: true+resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}+ resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==}+resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}+ resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}+resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}engines: {node: '>= 0.8.0'}resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==}+ cpu: [x64, arm64, wasm32]os: [darwin, linux, win32]+ resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==}+resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}+ resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==}+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==}engines: {node: '>=14'}@@ -1886,6 +2755,9 @@ packages:resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==}+ resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}+resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}@@ -1919,12 +2791,22 @@ packages:resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==}+ resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==}+resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==}resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==}+ resolution: {integrity: sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==}++ resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==}+ engines: {node: '>=12.13'}+resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}engines: {node: '>= 8'}@@ -2017,6 +2899,14 @@ packages:resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}engines: {node: '>=8.6'}+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}+ engines: {node: '>= 0.6'}++ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}+ engines: {node: '>= 0.6'}+resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}engines: {node: '>=4'}@@ -2031,6 +2921,10 @@ packages:resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==}+ resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==}+ engines: {node: '>=10'}+resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}@@ -2050,6 +2944,9 @@ packages:resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}engines: {node: '>=10.5.0'}+ resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==}+resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}@@ -2060,9 +2957,22 @@ packages:resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}+ resolution: {integrity: sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==}++ resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==}++ resolution: {integrity: sha512-zapyOUOCJxt+xhiNRPPMtfJkHGsZ98HHB9qJEkdT8BGytO/+kpe4m1Ngf0MzbzTmhacn11w9yGeDP6tzDhnCdg==}+resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}engines: {node: '>= 0.8.0'}@@ -2090,6 +3000,9 @@ packages:resolution: {integrity: sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA==}+ resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}+resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}engines: {node: '>=6'}@@ -2106,6 +3019,9 @@ packages:resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==}+resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}engines: {node: '>=8'}@@ -2124,6 +3040,9 @@ packages:resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==}engines: {node: '>= 14.16'}+ resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}+resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}@@ -2138,6 +3057,16 @@ packages:resolution: {integrity: sha512-kS7yWjVFCkIw9hqdJBoMxDdzEngmkr5FXeWZZfQ6GoYacjVnsW6l2CcYW/0ThD0vF4LPJgVYnrg4d0uuhwYQbg==}+ resolution: {integrity: sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==}+ engines: {node: '>=18'}+ hasBin: true++ resolution: {integrity: sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==}+ engines: {node: '>=18'}+ hasBin: true+resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}engines: {node: '>=4'}@@ -2154,9 +3083,15 @@ packages:resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}engines: {node: '>= 0.8.0'}+ resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}+resolution: {integrity: sha512-7nJ6v5lnJsXwGprnGXga4wx6d1POjvi5Qmf1ivTRxTjH4Z/9Czja/UCMLVmB9N93GeWOU93XaFaEt6jbuoagNw==}+ resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==}+resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}engines: {node: '>=6'}@@ -2172,10 +3107,26 @@ packages:resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}++ resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}+ engines: {node: '>=8.10.0'}+resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==}engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}+ resolution: {integrity: sha512-ae7SBCbzVNrIjgSbh7wMznPcQel1DNlDtzensnFxpiNpXt1U2ju/bHugH422r+4LAVS1FpW1YCwilmnNsjum9w==}++ resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==}++ resolution: {integrity: sha512-dN5I359AVGPnwzJm2jN1k0W9LPZ+ePvoOeVMMfqIMFz53sSwXkxaJoxr50ptnsC771lK95BnTrVSZxq0b9yCGw==}+resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==}engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}@@ -2213,9 +3164,22 @@ packages:engines: {node: '>=18.0.0', npm: '>=8.0.0'}hasBin: true+ resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==}+resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}+ resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}++ resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}++ resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}+ engines: {node: '>=v12.22.7'}+resolution: {integrity: sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==}engines: {node: ^14.0.0 || >=16.0.0}@@ -2224,11 +3188,28 @@ packages:resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}hasBin: true+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}+ hasBin: true+resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}engines: {node: '>=10'}hasBin: true+ resolution: {integrity: sha512-qNSy1+nUj7hsCOon7AO4wdAIo9P0jrzAMp18XhiOzA6/uO5TKtP7ScozVJ8T293oRIvi5wyCHSM4TrJo/c/GJA==}+ engines: {node: '>=10'}+ peerDependencies:+ seroval: ^1.0++ resolution: {integrity: sha512-rqEO6FZk8mv7Hyv4UCj3FD3b6Waqft605TLfsCe/BiaylRpyyMC0b+uA5TJKawX3KzMrdi3wsLbCaLplrQmBvQ==}+ engines: {node: '>=10'}++ resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}+resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}engines: {node: '>=8'}@@ -2237,15 +3218,45 @@ packages:resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}engines: {node: '>=8'}+ resolution: {integrity: sha512-Gqg6DSTk3wYqaZ5OaYtzjcdxcBvX5kCy24yvRJEgjT5U+WHlmqCThLuBUx0juyxQBi+6ug53IGeuQS07DWwpcw==}+resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}+ resolution: {integrity: sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==}+ resolution: {integrity: sha512-5ba3taPoZGt9GY3YlsCB24kCg0Lv/rie/HTD4kG6h4daZZz7+yK02xn8Vx8dLYBc9i6Ps5JwAbEiqjmKaLB3Ag==}++ resolution: {integrity: sha512-pWGtXUFWYYUZNbg5YpG5vkQJyOtzn2KXhxYaMx/4I+lylTLYkITOLevaCwMRN+liCVk0pqB6EayLWojNqBFECA==}+ peerDependencies:+ solid-js: ^1.8++ resolution: {integrity: sha512-KplGPX2GHiWJLZ6AXYRql4M127PdYzfwvLJJXMkO+CMb8Np4VxqDAg5S8jLdwlEuBis/ia9DKw2M8dFx5u8Mhw==}+ peerDependencies:+ solid-js: ^1.8++ resolution: {integrity: sha512-F3aPsX6hVw9ttm5LYlth8Q15x6MlI/J3Dn+o3EQyRTtTxidepSTwAYdozt01/YA+7ObcciagGEyXIopGZzQtbA==}+ peerDependencies:+ solid-js: ^1.3++ resolution: {integrity: sha512-EQ2EIznvHHpAmkYh2CTu0AdCgmPJRJWLGFRWygE8j+vMEfvIV2wotHU5qgWzqzVTG1SODGsay2Lwq6ENWx/rPA==}+ peerDependencies:+ solid-js: ^1.6.0+resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}engines: {node: '>=0.10.0'}@@ -2257,6 +3268,9 @@ packages:resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}+resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}@@ -2285,6 +3299,12 @@ packages:resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}engines: {node: '>=8'}+ resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}++ resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==}+resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}engines: {node: '>=8'}@@ -2305,6 +3325,9 @@ packages:resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}+resolution: {integrity: sha512-Vhf+bUa//YSTYKseDiiEuQmhGCoIF3CVBhunm3r/DQnYiGT4JssmnKQc44BIyOZRK2pKjXXAgbhfmbeoC9CJpA==}engines: {node: '>=12.20'}@@ -2313,6 +3336,9 @@ packages:resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==}engines: {node: ^14.18.0 || >=16.0.0}+ resolution: {integrity: sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==}+resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}engines: {node: '>=6'}@@ -2323,6 +3349,10 @@ packages:resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}+ resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==}+ engines: {node: '>=12.0.0'}+resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}engines: {node: ^18.0.0 || >=20.0.0}@@ -2335,6 +3365,13 @@ packages:resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==}engines: {node: '>=14.0.0'}+ resolution: {integrity: sha512-RNnIXDB1FD4T9cpQRErEqw6ZpjLlGdMOitdV+0xtbsnwr4YFka1zpc7D4KD+aAn8oSG5JyFrdasZTE04qDE9Yg==}++ resolution: {integrity: sha512-/W1YVgYVJd9ZDjey5NXadNh0mJXkiUMUue9Zebd0vpdo1sU+H4zFFTaJ1RKD4N6KFoHfcXy6l+Vu7bh+bdWCzA==}+ hasBin: true+resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}engines: {node: '>=8.0'}@@ -2343,12 +3380,30 @@ packages:resolution: {integrity: sha512-khrZo4buq4qVmsGzS5yQjKe/WsFvV8fGfOjDQN0q4iy9FjRfPWRgTFrU8u1R2iu/SfWLhY9WnCi4Jhdrcbtg+g==}engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}+ resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==}+ engines: {node: '>=6'}++ resolution: {integrity: sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==}+ engines: {node: '>=16'}++ resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}+resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==}engines: {node: '>=16'}peerDependencies:typescript: '>=4.2.0'+ resolution: {integrity: sha512-SL8u60X5+LoEy9tmQHWCdPc2hhb2pKI6I1tU5Jue3v8+iRqZdcT3mWPwKKJy1fMfky6uha82c8ByHAE8PMhKHw==}+resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}@@ -2381,12 +3436,18 @@ packages:resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}+ resolution: {integrity: sha512-4C67J0nIF2QwSXty2kW3zZx1pMZ3iXabylvJWWgHybWVUcMf9pxwsngoQt0gC+AVstRywFqrRBp3qOXJayhpOw==}+resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==}resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==}+ resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==}+resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==}@@ -2396,26 +3457,66 @@ packages:resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==}+ resolution: {integrity: sha512-wCcVnu1IvQmzKK9dZpeZbPPuXO5sKmYGe5VaASjH8st6G3wgw4tw7HsVRP0bXHRhO0PXGtC5Kw9IRKh6dPGPtA==}+ peerDependencies:+ '@unocss/preset-wind': '>= 0.56.0 < 1'+ unocss: '>= 0.56.0 < 1'++ resolution: {integrity: sha512-v/nQ7BVIeW9UlEPElOu6xwqp0TTF2dZeIOfzos52b/N0cwWB9dBOjZM5hTn//ePQVzXm/M/n+Lm8E7gRP4TUfg==}+ engines: {node: '>=14'}+ peerDependencies:+ '@unocss/webpack': 0.65.3+ vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0+ peerDependenciesMeta:+ '@unocss/webpack':+ optional: true+ vite:+ optional: true+resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==}hasBin: truepeerDependencies:browserslist: '>= 4.21.0'+ resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==}+resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}+ resolution: {integrity: sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==}+resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}+ resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==}++ resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}+resolution: {integrity: sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==}engines: {node: ^18.0.0 || >=20.0.0}hasBin: true+ resolution: {integrity: sha512-G+NiwDj4EAeUE0wt3Ur9f+Lt9oMUuLd0FIxYuqwJSqRacKQRteCwUFzNy8zMEt88xWokngQhiFjfJMhjc1fDXw==}+ peerDependencies:+ '@testing-library/jest-dom': ^5.16.6 || ^5.17.0 || ^6.*+ solid-js: ^1.7.2+ vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0+ peerDependenciesMeta:+ '@testing-library/jest-dom':+ optional: true+resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==}engines: {node: ^18.0.0 || >=20.0.0}@@ -2447,27 +3548,75 @@ packages:terser:optional: true- resolution: {integrity: sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==}- engines: {node: ^18.0.0 || >=20.0.0}+ resolution: {integrity: sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==}+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}hasBin: truepeerDependencies:- '@edge-runtime/vm': '*'- '@types/node': ^18.0.0 || >=20.0.0- '@vitest/browser': 2.1.8- '@vitest/ui': 2.1.8- happy-dom: '*'- jsdom: '*'+ '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0+ jiti: '>=1.21.0'+ less: '*'+ lightningcss: ^1.21.0+ sass: '*'+ sass-embedded: '*'+ stylus: '*'+ sugarss: '*'+ terser: ^5.16.0+ tsx: ^4.8.1+ yaml: ^2.4.2peerDependenciesMeta:- '@edge-runtime/vm':- optional: true'@types/node':optional: true- '@vitest/browser':+ jiti:optional: true- '@vitest/ui':+ less:optional: true- happy-dom:+ lightningcss:+ optional: true+ sass:+ optional: true+ sass-embedded:+ optional: true+ stylus:+ optional: true+ sugarss:+ optional: true+ terser:+ optional: true+ tsx:+ optional: true+ yaml:+ optional: true++ resolution: {integrity: sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==}+ peerDependencies:+ vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0+ peerDependenciesMeta:+ vite:+ optional: true++ resolution: {integrity: sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==}+ engines: {node: ^18.0.0 || >=20.0.0}+ hasBin: true+ peerDependencies:+ '@edge-runtime/vm': '*'+ '@types/node': ^18.0.0 || >=20.0.0+ '@vitest/browser': 2.1.8+ '@vitest/ui': 2.1.8+ happy-dom: '*'+ jsdom: '*'+ peerDependenciesMeta:+ '@edge-runtime/vm':+ optional: true+ '@types/node':+ optional: true+ '@vitest/browser':+ optional: true+ '@vitest/ui':+ optional: true+ happy-dom:optional: truejsdom:optional: true@@ -2478,10 +3627,43 @@ packages:peerDependencies:eslint: '>=6.0.0'+ resolution: {integrity: sha512-JdgRRUVrN0Y2GosA0M68DEbKlXMqJ7FQgsK8CjQD2vxvNSqAU6PZEpi4cfcTVtfM2GVOMjHo7GKKLbXxOBqDqA==}+ peerDependencies:+ vue: ^3.4.37++ resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==}+ peerDependencies:+ typescript: '*'+ peerDependenciesMeta:+ typescript:+ optional: true++ resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}engines: {node: '>= 8'}+ resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}+ engines: {node: '>=12'}++ resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}engines: {node: '>= 8'}@@ -2516,10 +3698,20 @@ packages:resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}engines: {node: '>=12'}+ resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}+resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}engines: {node: '>=10'}+ resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}+resolution: {integrity: sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==}engines: {node: ^14.17.0 || >=16.0.0}@@ -2549,42 +3741,93 @@ packages:snapshots:- '@antfu/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))(@vue/[email protected])([email protected])([email protected])([email protected](@types/[email protected]))':+ '@ampproject/[email protected]':+ dependencies:+ '@jridgewell/gen-mapping': 0.3.8+ '@jridgewell/trace-mapping': 0.3.25++ '@antfu/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))':+ dependencies:+ '@antfu/install-pkg': 0.5.0+ '@clack/prompts': 0.9.0+ '@eslint-community/eslint-plugin-eslint-comments': 4.4.1([email protected]([email protected]))+ '@eslint/markdown': 6.2.1+ '@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ '@vitest/eslint-plugin': 1.1.22(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))+ eslint: 9.17.0([email protected])+ eslint-config-flat-gitignore: 0.3.0([email protected]([email protected]))+ eslint-flat-config-utils: 0.4.0+ eslint-merge-processors: 0.1.0([email protected]([email protected]))+ eslint-plugin-antfu: 2.7.0([email protected]([email protected]))+ eslint-plugin-command: 0.2.7([email protected]([email protected]))+ eslint-plugin-jsdoc: 50.6.1([email protected]([email protected]))+ eslint-plugin-jsonc: 2.18.2([email protected]([email protected]))+ eslint-plugin-n: 17.15.1([email protected]([email protected]))+ eslint-plugin-no-only-tests: 3.3.0+ eslint-plugin-regexp: 2.7.0([email protected]([email protected]))+ eslint-plugin-toml: 0.12.0([email protected]([email protected]))+ eslint-plugin-unicorn: 56.0.1([email protected]([email protected]))+ eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))([email protected]([email protected]))+ eslint-plugin-vue: 9.32.0([email protected]([email protected]))+ eslint-plugin-yml: 1.16.0([email protected]([email protected]))+ globals: 15.14.0+ jsonc-eslint-parser: 2.4.0+ local-pkg: 0.5.1+ parse-gitignore: 2.0.0+ picocolors: 1.1.1+ toml-eslint-parser: 0.10.0+ vue-eslint-parser: 9.4.3([email protected]([email protected]))+ yaml-eslint-parser: 1.2.3+ yargs: 17.7.2+ transitivePeerDependencies:+ - '@eslint/json'+ - '@typescript-eslint/utils'+ - '@vue/compiler-sfc'+ - supports-color+ - typescript+ - vitest++ '@antfu/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))(@vue/[email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))':dependencies:'@antfu/install-pkg': 0.5.0'@clack/prompts': 0.9.0- '@eslint-community/eslint-plugin-eslint-comments': 4.4.1([email protected])+ '@eslint-community/eslint-plugin-eslint-comments': 4.4.1([email protected]([email protected]))'@eslint/markdown': 6.2.1- '@stylistic/eslint-plugin': 2.12.1([email protected])([email protected])- '@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])- '@typescript-eslint/parser': 8.19.0([email protected])([email protected])- '@vitest/eslint-plugin': 1.1.22(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected]))- eslint: 9.17.0- eslint-config-flat-gitignore: 0.3.0([email protected])+ '@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ '@vitest/eslint-plugin': 1.1.22(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))+ eslint: 9.17.0([email protected])+ eslint-config-flat-gitignore: 0.3.0([email protected]([email protected]))eslint-flat-config-utils: 0.4.0- eslint-merge-processors: 0.1.0([email protected])- eslint-plugin-antfu: 2.7.0([email protected])- eslint-plugin-command: 0.2.7([email protected])- eslint-plugin-import-x: 4.6.1([email protected])([email protected])- eslint-plugin-jsdoc: 50.6.1([email protected])- eslint-plugin-jsonc: 2.18.2([email protected])- eslint-plugin-n: 17.15.1([email protected])+ eslint-merge-processors: 0.1.0([email protected]([email protected]))+ eslint-plugin-antfu: 2.7.0([email protected]([email protected]))+ eslint-plugin-command: 0.2.7([email protected]([email protected]))+ eslint-plugin-jsdoc: 50.6.1([email protected]([email protected]))+ eslint-plugin-jsonc: 2.18.2([email protected]([email protected]))+ eslint-plugin-n: 17.15.1([email protected]([email protected]))eslint-plugin-no-only-tests: 3.3.0- eslint-plugin-perfectionist: 4.4.0([email protected])([email protected])- eslint-plugin-regexp: 2.7.0([email protected])- eslint-plugin-toml: 0.12.0([email protected])- eslint-plugin-unicorn: 56.0.1([email protected])- eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]))([email protected])- eslint-plugin-vue: 9.32.0([email protected])- eslint-plugin-yml: 1.16.0([email protected])- eslint-processor-vue-blocks: 0.1.2(@vue/[email protected])([email protected])+ eslint-plugin-regexp: 2.7.0([email protected]([email protected]))+ eslint-plugin-toml: 0.12.0([email protected]([email protected]))+ eslint-plugin-unicorn: 56.0.1([email protected]([email protected]))+ eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))([email protected]([email protected]))+ eslint-plugin-vue: 9.32.0([email protected]([email protected]))+ eslint-plugin-yml: 1.16.0([email protected]([email protected]))globals: 15.14.0jsonc-eslint-parser: 2.4.0local-pkg: 0.5.1parse-gitignore: 2.0.0picocolors: 1.1.1toml-eslint-parser: 0.10.0- vue-eslint-parser: 9.4.3([email protected])+ vue-eslint-parser: 9.4.3([email protected]([email protected]))yaml-eslint-parser: 1.2.3yargs: 17.7.2transitivePeerDependencies:@@ -2595,6 +3838,11 @@ snapshots:- typescript- vitest+ '@antfu/[email protected]':+ dependencies:+ package-manager-detector: 0.2.8+ tinyexec: 0.3.2+'@antfu/[email protected]':dependencies:package-manager-detector: 0.2.8@@ -2608,14 +3856,104 @@ snapshots:js-tokens: 4.0.0picocolors: 1.1.1+ '@babel/[email protected]': {}++ '@babel/[email protected]':+ dependencies:+ '@ampproject/remapping': 2.3.0+ '@babel/code-frame': 7.26.2+ '@babel/generator': 7.26.3+ '@babel/helper-compilation-targets': 7.25.9+ '@babel/helper-module-transforms': 7.26.0(@babel/[email protected])+ '@babel/helpers': 7.26.0+ '@babel/parser': 7.26.3+ '@babel/template': 7.25.9+ '@babel/traverse': 7.26.4+ '@babel/types': 7.26.3+ convert-source-map: 2.0.0+ debug: 4.4.0+ gensync: 1.0.0-beta.2+ json5: 2.2.3+ semver: 6.3.1+ transitivePeerDependencies:+ - supports-color++ '@babel/[email protected]':+ dependencies:+ '@babel/parser': 7.26.3+ '@babel/types': 7.26.3+ '@jridgewell/gen-mapping': 0.3.8+ '@jridgewell/trace-mapping': 0.3.25+ jsesc: 3.1.0++ '@babel/[email protected]':+ dependencies:+ '@babel/compat-data': 7.26.3+ '@babel/helper-validator-option': 7.25.9+ browserslist: 4.24.3+ lru-cache: 5.1.1+ semver: 6.3.1++ '@babel/[email protected]':+ dependencies:+ '@babel/types': 7.26.3++ '@babel/[email protected]':+ dependencies:+ '@babel/traverse': 7.26.4+ '@babel/types': 7.26.3+ transitivePeerDependencies:+ - supports-color++ '@babel/[email protected](@babel/[email protected])':+ dependencies:+ '@babel/core': 7.26.0+ '@babel/helper-module-imports': 7.25.9+ '@babel/helper-validator-identifier': 7.25.9+ '@babel/traverse': 7.26.4+ transitivePeerDependencies:+ - supports-color++ '@babel/[email protected]': {}+'@babel/[email protected]': {}'@babel/[email protected]': {}+ '@babel/[email protected]': {}++ '@babel/[email protected]':+ dependencies:+ '@babel/template': 7.25.9+ '@babel/types': 7.26.3+'@babel/[email protected]':dependencies:'@babel/types': 7.26.3+ '@babel/[email protected](@babel/[email protected])':+ dependencies:+ '@babel/core': 7.26.0+ '@babel/helper-plugin-utils': 7.25.9++ '@babel/[email protected]':+ dependencies:+ '@babel/code-frame': 7.26.2+ '@babel/parser': 7.26.3+ '@babel/types': 7.26.3++ '@babel/[email protected]':+ dependencies:+ '@babel/code-frame': 7.26.2+ '@babel/generator': 7.26.3+ '@babel/parser': 7.26.3+ '@babel/template': 7.25.9+ '@babel/types': 7.26.3+ debug: 4.4.0+ globals: 11.12.0+ transitivePeerDependencies:+ - supports-color+'@babel/[email protected]':dependencies:'@babel/helper-string-parser': 7.25.9@@ -2636,6 +3974,11 @@ snapshots:dependencies:lodash-es: 4.17.21+ '@corvu/[email protected]([email protected])':+ dependencies:+ '@floating-ui/dom': 1.6.12+ solid-js: 1.9.3+'@drizzle-team/[email protected]': {}'@es-joy/[email protected]':@@ -2663,6 +4006,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2675,6 +4021,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2687,6 +4036,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2699,6 +4051,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2711,6 +4066,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2723,6 +4081,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2735,6 +4096,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2747,6 +4111,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2759,6 +4126,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2771,6 +4141,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2783,6 +4156,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2795,6 +4171,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2807,6 +4186,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2819,6 +4201,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2831,6 +4216,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2843,6 +4231,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2855,6 +4246,12 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true++ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2867,9 +4264,15 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2882,6 +4285,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2894,6 +4300,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2906,6 +4315,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2918,6 +4330,9 @@ snapshots:'@esbuild/[email protected]':optional: true+ '@esbuild/[email protected]':+ optional: true+'@esbuild/[email protected]':optional: true@@ -2930,22 +4345,25 @@ snapshots:'@esbuild/[email protected]':optional: true- '@eslint-community/[email protected]([email protected])':+ '@esbuild/[email protected]':+ optional: true+dependencies:escape-string-regexp: 4.0.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])ignore: 5.3.2- '@eslint-community/[email protected]([email protected])':dependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])eslint-visitor-keys: 3.4.3'@eslint-community/[email protected]': {}- '@eslint/[email protected]([email protected])':optionalDependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])'@eslint/[email protected]':dependencies:@@ -2990,10 +4408,25 @@ snapshots:dependencies:levn: 0.4.1+ '@floating-ui/[email protected]':+ dependencies:+ '@floating-ui/utils': 0.2.8++ '@floating-ui/[email protected]':+ dependencies:+ '@floating-ui/core': 1.6.8+ '@floating-ui/utils': 0.2.8++ '@floating-ui/[email protected]': {}+'@hono/[email protected]([email protected])':dependencies:hono: 4.6.15+ '@hono/[email protected]([email protected])':+ dependencies:+ hono: 4.6.15+'@humanfs/[email protected]': {}'@humanfs/[email protected]':@@ -3007,8 +4440,73 @@ snapshots:'@humanwhocodes/[email protected]': {}+ '@iconify-json/[email protected]':+ dependencies:+ '@iconify/types': 2.0.0++ '@iconify/[email protected]': {}++ '@iconify/[email protected]':+ dependencies:+ '@antfu/install-pkg': 0.4.1+ '@antfu/utils': 0.7.10+ '@iconify/types': 2.0.0+ debug: 4.4.0+ globals: 15.14.0+ kolorist: 1.8.0+ local-pkg: 0.5.1+ mlly: 1.7.3+ transitivePeerDependencies:+ - supports-color++ '@internationalized/[email protected]':+ dependencies:+ '@swc/helpers': 0.5.15++ '@internationalized/[email protected]':+ dependencies:+ '@swc/helpers': 0.5.15++ '@jridgewell/[email protected]':+ dependencies:+ '@jridgewell/set-array': 1.2.1+ '@jridgewell/sourcemap-codec': 1.5.0+ '@jridgewell/trace-mapping': 0.3.25++ '@jridgewell/[email protected]': {}++ '@jridgewell/[email protected]': {}+'@jridgewell/[email protected]': {}+ '@jridgewell/[email protected]':+ dependencies:+ '@jridgewell/resolve-uri': 3.1.2+ '@jridgewell/sourcemap-codec': 1.5.0++ '@kobalte/[email protected]([email protected])':+ dependencies:+ '@floating-ui/dom': 1.6.12+ '@internationalized/date': 3.6.0+ '@internationalized/number': 3.6.0+ '@kobalte/utils': 0.9.1([email protected])+ '@solid-primitives/props': 3.1.11([email protected])+ '@solid-primitives/resize-observer': 2.0.26([email protected])+ solid-js: 1.9.3+ solid-presence: 0.1.8([email protected])+ solid-prevent-scroll: 0.1.10([email protected])++ '@kobalte/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/event-listener': 2.3.3([email protected])+ '@solid-primitives/keyed': 1.2.3([email protected])+ '@solid-primitives/map': 0.4.13([email protected])+ '@solid-primitives/media': 2.2.9([email protected])+ '@solid-primitives/props': 3.1.11([email protected])+ '@solid-primitives/refs': 1.0.8([email protected])+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3+'@libsql/[email protected]':dependencies:'@libsql/core': 0.14.0@@ -3087,6 +4585,20 @@ snapshots:'@pkgr/[email protected]': {}+ '@playwright/[email protected]':+ dependencies:+ playwright: 1.49.1++ '@polka/[email protected]': {}++ '@rollup/[email protected]([email protected])':+ dependencies:+ '@types/estree': 1.0.6+ estree-walker: 2.0.2+ picomatch: 4.0.2+ optionalDependencies:+ rollup: 4.29.1+'@rollup/[email protected]':optional: true@@ -3144,10 +4656,117 @@ snapshots:'@rollup/[email protected]':optional: true+ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/engine-javascript': 1.26.1+ '@shikijs/engine-oniguruma': 1.26.1+ '@shikijs/types': 1.26.1+ '@shikijs/vscode-textmate': 10.0.1+ '@types/hast': 3.0.4+ hast-util-to-html: 9.0.4++ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/types': 1.26.1+ '@shikijs/vscode-textmate': 10.0.1+ oniguruma-to-es: 0.10.0++ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/types': 1.26.1+ '@shikijs/vscode-textmate': 10.0.1++ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/types': 1.26.1++ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/types': 1.26.1++ '@shikijs/[email protected]':+ dependencies:+ '@shikijs/vscode-textmate': 10.0.1+ '@types/hast': 3.0.4++ '@shikijs/[email protected]': {}++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':dependencies:- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])- eslint: 9.17.0+ '@solid-primitives/trigger': 1.1.0([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/event-listener': 2.3.3([email protected])+ '@solid-primitives/rootless': 1.4.5([email protected])+ '@solid-primitives/static-store': 0.0.8([email protected])+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/event-listener': 2.3.3([email protected])+ '@solid-primitives/rootless': 1.4.5([email protected])+ '@solid-primitives/static-store': 0.0.8([email protected])+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ '@solid-primitives/utils': 6.2.3([email protected])+ solid-js: 1.9.3++ '@solid-primitives/[email protected]([email protected])':+ dependencies:+ solid-js: 1.9.3++ '@solidjs/[email protected]([email protected])':+ dependencies:+ solid-js: 1.9.3++ dependencies:+ eslint: 9.17.0([email protected])eslint-visitor-keys: 4.2.0espree: 10.3.0estraverse: 5.3.0@@ -3156,6 +4775,45 @@ snapshots:- supports-color- typescript+ '@swc/[email protected]':+ dependencies:+ tslib: 2.8.1++ '@tanstack/[email protected]': {}++ '@tanstack/[email protected]([email protected])':+ dependencies:+ '@tanstack/query-core': 5.62.9+ solid-js: 1.9.3++ '@tanstack/[email protected]([email protected])':+ dependencies:+ '@tanstack/table-core': 8.20.5+ solid-js: 1.9.3++ '@tanstack/[email protected]': {}++ '@types/[email protected]':+ dependencies:+ '@babel/parser': 7.26.3+ '@babel/types': 7.26.3+ '@types/babel__generator': 7.6.8+ '@types/babel__template': 7.4.4+ '@types/babel__traverse': 7.20.6++ '@types/[email protected]':+ dependencies:+ '@babel/types': 7.26.3++ '@types/[email protected]':+ dependencies:+ '@babel/parser': 7.26.3+ '@babel/types': 7.26.3++ '@types/[email protected]':+ dependencies:+ '@babel/types': 7.26.3+'@types/[email protected]':dependencies:'@types/ms': 0.7.34@@ -3164,6 +4822,10 @@ snapshots:'@types/[email protected]': {}+ '@types/[email protected]':+ dependencies:+ '@types/unist': 3.0.3+'@types/[email protected]': {}'@types/[email protected]':@@ -3182,23 +4844,27 @@ snapshots:dependencies:undici-types: 6.20.0+ '@types/[email protected]':+ dependencies:+ undici-types: 6.20.0+'@types/[email protected]': {}'@types/[email protected]': {}'@types/[email protected]':dependencies:- '@types/node': 22.10.2+ '@types/node': 22.10.5- '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':+ '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])':dependencies:'@eslint-community/regexpp': 4.12.1- '@typescript-eslint/parser': 8.19.0([email protected])([email protected])'@typescript-eslint/scope-manager': 8.19.0- '@typescript-eslint/type-utils': 8.19.0([email protected])([email protected])- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])'@typescript-eslint/visitor-keys': 8.19.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])graphemer: 1.4.0ignore: 5.3.2natural-compare: 1.4.0@@ -3207,14 +4873,14 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@typescript-eslint/scope-manager': 8.19.0'@typescript-eslint/types': 8.19.0'@typescript-eslint/typescript-estree': 8.19.0([email protected])'@typescript-eslint/visitor-keys': 8.19.0debug: 4.4.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])typescript: 5.7.2transitivePeerDependencies:- supports-color@@ -3224,12 +4890,12 @@ snapshots:'@typescript-eslint/types': 8.19.0'@typescript-eslint/visitor-keys': 8.19.0dependencies:'@typescript-eslint/typescript-estree': 8.19.0([email protected])- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])debug: 4.4.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])ts-api-utils: 1.4.3([email protected])typescript: 5.7.2transitivePeerDependencies:@@ -3251,13 +4917,13 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))'@typescript-eslint/scope-manager': 8.19.0'@typescript-eslint/types': 8.19.0'@typescript-eslint/typescript-estree': 8.19.0([email protected])- eslint: 9.17.0+ eslint: 9.17.0([email protected])typescript: 5.7.2transitivePeerDependencies:- supports-color@@ -3267,13 +4933,174 @@ snapshots:'@typescript-eslint/types': 8.19.0eslint-visitor-keys: 4.2.0- '@vitest/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected](@types/[email protected]))':+ '@ungap/[email protected]': {}++ '@unocss/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))':dependencies:- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])- eslint: 9.17.0+ '@unocss/core': 0.65.3+ '@unocss/reset': 0.65.3+ '@unocss/vite': 0.65.3([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))+ optionalDependencies:+ transitivePeerDependencies:+ - rollup+ - supports-color+ - vue++ '@unocss/[email protected]([email protected])':+ dependencies:+ '@ampproject/remapping': 2.3.0+ '@rollup/pluginutils': 5.1.4([email protected])+ '@unocss/config': 0.65.3+ '@unocss/core': 0.65.3+ '@unocss/preset-uno': 0.65.3+ cac: 6.7.14+ chokidar: 3.6.0+ colorette: 2.0.20+ consola: 3.3.3+ magic-string: 0.30.17+ pathe: 1.1.2+ perfect-debounce: 1.0.0+ tinyglobby: 0.2.10+ transitivePeerDependencies:+ - rollup+ - supports-color++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ unconfig: 0.6.0+ transitivePeerDependencies:+ - supports-color++ '@unocss/[email protected]': {}++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/rule-utils': 0.65.3+ gzip-size: 6.0.0+ sirv: 3.0.0+ vue-flow-layout: 0.1.1([email protected]([email protected]))+ transitivePeerDependencies:+ - vue++ '@unocss/[email protected]([email protected])':+ dependencies:+ '@unocss/config': 0.65.3+ '@unocss/core': 0.65.3+ '@unocss/rule-utils': 0.65.3+ css-tree: 3.1.0+ postcss: 8.4.49+ tinyglobby: 0.2.10+ transitivePeerDependencies:+ - supports-color++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@iconify/utils': 2.2.1+ '@unocss/core': 0.65.3+ ofetch: 1.4.1+ transitivePeerDependencies:+ - supports-color++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/extractor-arbitrary-variants': 0.65.3+ '@unocss/rule-utils': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/preset-mini': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/preset-mini': 0.65.3+ '@unocss/preset-wind': 0.65.3+ '@unocss/rule-utils': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ ofetch: 1.4.1++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/preset-mini': 0.65.3+ '@unocss/rule-utils': 0.65.3++ '@unocss/[email protected]': {}++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ magic-string: 0.30.17++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3+ '@unocss/rule-utils': 0.65.3+ css-tree: 3.1.0++ '@unocss/[email protected]':+ dependencies:+ '@unocss/core': 0.65.3++ '@unocss/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))':+ dependencies:+ '@ampproject/remapping': 2.3.0+ '@rollup/pluginutils': 5.1.4([email protected])+ '@unocss/config': 0.65.3+ '@unocss/core': 0.65.3+ '@unocss/inspector': 0.65.3([email protected]([email protected]))+ chokidar: 3.6.0+ magic-string: 0.30.17+ tinyglobby: 0.2.10+ transitivePeerDependencies:+ - rollup+ - supports-color+ - vue++ '@vitest/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))':+ dependencies:+ eslint: 9.17.0([email protected])+ optionalDependencies:+ typescript: 5.7.2+ vitest: 2.1.8(@types/[email protected])([email protected])++ '@vitest/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected]))':+ dependencies:+ eslint: 9.17.0([email protected])optionalDependencies:typescript: 5.7.2- vitest: 2.1.8(@types/[email protected])+ vitest: 2.1.8(@types/[email protected])([email protected])'@vitest/[email protected]':dependencies:@@ -3290,6 +5117,14 @@ snapshots:optionalDependencies:vite: 5.4.11(@types/[email protected])+ dependencies:+ '@vitest/spy': 2.1.8+ estree-walker: 3.0.3+ magic-string: 0.30.17+ optionalDependencies:+ vite: 5.4.11(@types/[email protected])+'@vitest/[email protected]':dependencies:tinyrainbow: 1.2.0@@ -3345,6 +5180,28 @@ snapshots:'@vue/compiler-dom': 3.5.13'@vue/shared': 3.5.13+ '@vue/[email protected]':+ dependencies:+ '@vue/shared': 3.5.13++ '@vue/[email protected]':+ dependencies:+ '@vue/reactivity': 3.5.13+ '@vue/shared': 3.5.13++ '@vue/[email protected]':+ dependencies:+ '@vue/reactivity': 3.5.13+ '@vue/runtime-core': 3.5.13+ '@vue/shared': 3.5.13+ csstype: 3.1.3++ dependencies:+ '@vue/compiler-ssr': 3.5.13+ '@vue/shared': 3.5.13+ vue: 3.5.13([email protected])+'@vue/[email protected]': {}@@ -3353,6 +5210,8 @@ snapshots:+ [email protected]: {}+dependencies:fast-deep-equal: 3.1.3@@ -3366,14 +5225,38 @@ snapshots:dependencies:color-convert: 2.0.1+ dependencies:+ normalize-path: 3.0.0+ picomatch: 2.3.1++ [email protected]: {}++ [email protected](@babel/[email protected]):+ dependencies:+ '@babel/core': 7.26.0+ '@babel/helper-module-imports': 7.18.6+ '@babel/plugin-syntax-jsx': 7.25.9(@babel/[email protected])+ '@babel/types': 7.26.3+ html-entities: 2.3.3+ parse5: 7.2.1+ validate-html-nesting: 1.2.2++ [email protected](@babel/[email protected]):+ dependencies:+ '@babel/core': 7.26.0+ babel-plugin-jsx-dom-expressions: 0.39.3(@babel/[email protected])++ [email protected]: {}+@@ -3400,6 +5283,11 @@ snapshots:+ dependencies:+ esbuild: 0.24.2+ load-tsconfig: 0.2.5+@@ -3421,12 +5309,32 @@ snapshots:ansi-styles: 4.3.0supports-color: 7.2.0+ [email protected]: {}++ [email protected]: {}++ dependencies:+ anymatch: 3.1.3+ braces: 3.0.3+ 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++ dependencies:+ clsx: 2.1.1+dependencies:escape-string-regexp: 1.0.5@@ -3437,32 +5345,66 @@ snapshots:strip-ansi: 6.0.1wrap-ansi: 7.0.0+ [email protected]: {}+dependencies:color-name: 1.1.4+ [email protected]: {}++ dependencies:+ delayed-stream: 1.0.0++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}+dependencies:browserslist: 4.24.3+ [email protected]: {}+dependencies:path-key: 3.1.1shebang-command: 2.0.0which: 2.0.2+ dependencies:+ mdn-data: 2.12.2+ source-map-js: 1.2.1++ dependencies:+ rrweb-cssom: 0.7.1++ [email protected]: {}++ dependencies:+ whatwg-mimetype: 4.0.0+ whatwg-url: 14.1.0++ [email protected]: {}+dependencies:ms: 2.1.3@@ -3471,6 +5413,8 @@ snapshots:dependencies:ms: 2.1.3+ [email protected]: {}+dependencies:character-entities: 2.0.2@@ -3479,8 +5423,14 @@ snapshots:+ [email protected]: {}++ [email protected]: {}++ [email protected]: {}+@@ -3491,8 +5441,6 @@ snapshots:dependencies:esutils: 2.0.3- [email protected]: {}-dependencies:'@drizzle-team/brocli': 0.10.2@@ -3506,8 +5454,12 @@ snapshots:optionalDependencies:'@libsql/client': 0.14.0+ [email protected]: {}++ [email protected]: {}+@@ -3634,6 +5586,34 @@ snapshots:'@esbuild/win32-ia32': 0.23.1'@esbuild/win32-x64': 0.23.1+ optionalDependencies:+ '@esbuild/aix-ppc64': 0.24.2+ '@esbuild/android-arm': 0.24.2+ '@esbuild/android-arm64': 0.24.2+ '@esbuild/android-x64': 0.24.2+ '@esbuild/darwin-arm64': 0.24.2+ '@esbuild/darwin-x64': 0.24.2+ '@esbuild/freebsd-arm64': 0.24.2+ '@esbuild/freebsd-x64': 0.24.2+ '@esbuild/linux-arm': 0.24.2+ '@esbuild/linux-arm64': 0.24.2+ '@esbuild/linux-ia32': 0.24.2+ '@esbuild/linux-loong64': 0.24.2+ '@esbuild/linux-mips64el': 0.24.2+ '@esbuild/linux-ppc64': 0.24.2+ '@esbuild/linux-riscv64': 0.24.2+ '@esbuild/linux-s390x': 0.24.2+ '@esbuild/linux-x64': 0.24.2+ '@esbuild/netbsd-arm64': 0.24.2+ '@esbuild/netbsd-x64': 0.24.2+ '@esbuild/openbsd-arm64': 0.24.2+ '@esbuild/openbsd-x64': 0.24.2+ '@esbuild/sunos-x64': 0.24.2+ '@esbuild/win32-arm64': 0.24.2+ '@esbuild/win32-ia32': 0.24.2+ '@esbuild/win32-x64': 0.24.2+@@ -3642,20 +5622,20 @@ snapshots:dependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])semver: 7.6.3dependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])semver: 7.6.3dependencies:- '@eslint/compat': 1.2.4([email protected])- eslint: 9.17.0+ '@eslint/compat': 1.2.4([email protected]([email protected]))+ eslint: 9.17.0([email protected])find-up-simple: 1.0.0@@ -3670,42 +5650,42 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])esquery: 1.6.0jsonc-eslint-parser: 2.4.0dependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])dependencies:'@antfu/utils': 0.7.10- eslint: 9.17.0+ eslint: 9.17.0([email protected])dependencies:'@es-joy/jsdoccomment': 0.49.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])dependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))'@eslint-community/regexpp': 4.12.1- eslint: 9.17.0- eslint-compat-utils: 0.5.1([email protected])+ eslint: 9.17.0([email protected])+ eslint-compat-utils: 0.5.1([email protected]([email protected]))dependencies:'@types/doctrine': 0.0.9'@typescript-eslint/scope-manager': 8.19.0- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])debug: 4.4.0doctrine: 3.0.0enhanced-resolve: 5.18.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])eslint-import-resolver-node: 0.3.9get-tsconfig: 4.8.1is-glob: 4.0.3@@ -3717,14 +5697,14 @@ snapshots:- supports-color- typescriptdependencies:'@es-joy/jsdoccomment': 0.49.0are-docs-informative: 0.0.2comment-parser: 1.4.1debug: 4.4.0escape-string-regexp: 4.0.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])espree: 10.3.0esquery: 1.6.0parse-imports: 2.2.1@@ -3734,12 +5714,12 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])- eslint: 9.17.0- eslint-compat-utils: 0.6.4([email protected])- eslint-json-compat-utils: 0.2.1([email protected])([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))+ eslint: 9.17.0([email protected])+ eslint-compat-utils: 0.6.4([email protected]([email protected]))espree: 9.6.1graphemer: 1.4.0jsonc-eslint-parser: 2.4.0@@ -3748,12 +5728,12 @@ snapshots:transitivePeerDependencies:- '@eslint/json'dependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))enhanced-resolve: 5.18.0- eslint: 9.17.0- eslint-plugin-es-x: 7.8.0([email protected])+ eslint: 9.17.0([email protected])+ eslint-plugin-es-x: 7.8.0([email protected]([email protected]))get-tsconfig: 4.8.1globals: 15.14.0ignore: 5.3.2@@ -3762,45 +5742,45 @@ snapshots:dependencies:'@typescript-eslint/types': 8.19.0- '@typescript-eslint/utils': 8.19.0([email protected])([email protected])- eslint: 9.17.0+ eslint: 9.17.0([email protected])natural-orderby: 5.0.0transitivePeerDependencies:- supports-color- typescriptdependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))'@eslint-community/regexpp': 4.12.1comment-parser: 1.4.1- eslint: 9.17.0+ eslint: 9.17.0([email protected])jsdoc-type-pratt-parser: 4.1.0refa: 0.12.1regexp-ast-analysis: 0.7.1scslre: 0.3.0dependencies:debug: 4.4.0- eslint: 9.17.0- eslint-compat-utils: 0.6.4([email protected])+ eslint: 9.17.0([email protected])+ eslint-compat-utils: 0.6.4([email protected]([email protected]))lodash: 4.17.21toml-eslint-parser: 0.10.0transitivePeerDependencies:- supports-colordependencies:'@babel/helper-validator-identifier': 7.25.9- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))ci-info: 4.1.0clean-regexp: 1.0.0core-js-compat: 3.39.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])esquery: 1.6.0globals: 15.14.0indent-string: 4.0.0@@ -3813,41 +5793,41 @@ snapshots:semver: 7.6.3strip-indent: 3.0.0- [email protected](@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]))([email protected]):+ [email protected](@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]))([email protected]([email protected])):dependencies:- eslint: 9.17.0+ eslint: 9.17.0([email protected])optionalDependencies:- '@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])+ '@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])dependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])- eslint: 9.17.0+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))+ eslint: 9.17.0([email protected])globals: 13.24.0natural-compare: 1.4.0nth-check: 2.1.1postcss-selector-parser: 6.1.2semver: 7.6.3- vue-eslint-parser: 9.4.3([email protected])+ vue-eslint-parser: 9.4.3([email protected]([email protected]))xml-name-validator: 4.0.0transitivePeerDependencies:- supports-colordependencies:debug: 4.4.0- eslint: 9.17.0- eslint-compat-utils: 0.6.4([email protected])+ eslint: 9.17.0([email protected])+ eslint-compat-utils: 0.6.4([email protected]([email protected]))lodash: 4.17.21natural-compare: 1.4.0yaml-eslint-parser: 1.2.3transitivePeerDependencies:- supports-colordependencies:'@vue/compiler-sfc': 3.5.13- eslint: 9.17.0+ eslint: 9.17.0([email protected])dependencies:@@ -3863,9 +5843,9 @@ snapshots:dependencies:- '@eslint-community/eslint-utils': 4.4.1([email protected])+ '@eslint-community/eslint-utils': 4.4.1([email protected]([email protected]))'@eslint-community/regexpp': 4.12.1'@eslint/config-array': 0.19.1'@eslint/core': 0.9.1@@ -3899,6 +5879,8 @@ snapshots:minimatch: 3.1.2natural-compare: 1.4.0optionator: 0.9.4+ optionalDependencies:+ jiti: 2.4.2transitivePeerDependencies:- supports-color@@ -3952,6 +5934,10 @@ snapshots:dependencies:reusify: 1.0.4+ optionalDependencies:+ picomatch: 4.0.2+dependencies:node-domexception: 1.0.0@@ -3988,15 +5974,26 @@ snapshots:+ dependencies:+ asynckit: 0.4.0+ combined-stream: 1.0.8+ mime-types: 2.1.35+dependencies:fetch-blob: 3.2.0+ optional: true+optional: true+ [email protected]: {}+@@ -4011,6 +6008,8 @@ snapshots:dependencies:is-glob: 4.0.3+ [email protected]: {}+dependencies:type-fest: 0.20.2@@ -4023,29 +6022,96 @@ snapshots:+ dependencies:+ duplexer: 0.1.2+dependencies:function-bind: 1.1.2+ dependencies:+ '@types/hast': 3.0.4+ '@types/unist': 3.0.3+ ccount: 2.0.1+ comma-separated-tokens: 2.0.3+ hast-util-whitespace: 3.0.0+ html-void-elements: 3.0.0+ mdast-util-to-hast: 13.2.0+ property-information: 6.5.0+ space-separated-tokens: 2.0.2+ stringify-entities: 4.0.4+ zwitch: 2.0.4++ dependencies:+ '@types/hast': 3.0.4++ dependencies:+ whatwg-encoding: 3.1.1++ [email protected]: {}++ [email protected]: {}++ dependencies:+ agent-base: 7.1.3+ debug: 4.4.0+ transitivePeerDependencies:+ - supports-color++ dependencies:+ agent-base: 7.1.3+ debug: 4.4.0+ transitivePeerDependencies:+ - supports-color++ dependencies:+ safer-buffer: 2.1.2++ [email protected]: {}+dependencies:parent-module: 1.0.1resolve-from: 4.0.0+ dependencies:+ bundle-require: 5.1.0([email protected])+ debug: 4.4.0+ esbuild: 0.24.2+ jiti: 2.4.2+ pathe: 1.1.2+ tsx: 4.19.2+ transitivePeerDependencies:+ - supports-color++ [email protected]: {}++ dependencies:+ binary-extensions: 2.3.0+dependencies:builtin-modules: 3.3.0@@ -4064,8 +6130,16 @@ snapshots:+ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}+@@ -4076,6 +6150,34 @@ snapshots:+ dependencies:+ cssstyle: 4.1.0+ data-urls: 5.0.0+ decimal.js: 10.4.3+ form-data: 4.0.1+ html-encoding-sniffer: 4.0.0+ http-proxy-agent: 7.0.2+ https-proxy-agent: 7.0.6+ is-potential-custom-element-name: 1.0.1+ nwsapi: 2.2.16+ parse5: 7.2.1+ rrweb-cssom: 0.7.1+ saxes: 6.0.0+ symbol-tree: 3.2.4+ tough-cookie: 5.0.0+ w3c-xmlserializer: 5.0.0+ webidl-conversions: 7.0.0+ whatwg-encoding: 3.1.1+ whatwg-mimetype: 4.0.0+ whatwg-url: 14.1.0+ ws: 8.18.0+ xml-name-validator: 5.0.0+ transitivePeerDependencies:+ - bufferutil+ - supports-color+ - utf-8-validate+@@ -4088,6 +6190,8 @@ snapshots:+ [email protected]: {}+dependencies:acorn: 8.14.0@@ -4095,10 +6199,19 @@ snapshots:espree: 9.6.1semver: 7.6.3+ dependencies:+ lie: 3.3.0+ pako: 1.0.11+ readable-stream: 2.3.8+ setimmediate: 1.0.5+dependencies:json-buffer: 3.0.1+ [email protected]: {}+dependencies:prelude-ls: 1.2.1@@ -4117,8 +6230,14 @@ snapshots:'@libsql/linux-x64-musl': 0.4.7'@libsql/win32-x64-msvc': 0.4.7+ dependencies:+ immediate: 3.0.6++ [email protected]: {}+dependencies:mlly: 1.7.3@@ -4142,6 +6261,10 @@ snapshots:+ dependencies:+ yallist: 3.1.1+dependencies:'@jridgewell/sourcemap-codec': 1.5.0@@ -4234,6 +6357,18 @@ snapshots:'@types/mdast': 4.0.4unist-util-is: 6.0.0+ dependencies:+ '@types/hast': 3.0.4+ '@types/mdast': 4.0.4+ '@ungap/structured-clone': 1.2.1+ devlop: 1.1.0+ micromark-util-sanitize-uri: 2.0.1+ trim-lines: 3.0.1+ unist-util-position: 5.0.0+ unist-util-visit: 5.0.0+ vfile: 6.0.3+dependencies:'@types/mdast': 4.0.4@@ -4250,6 +6385,12 @@ snapshots:dependencies:'@types/mdast': 4.0.4+ [email protected]: {}++ dependencies:+ is-what: 4.1.16+@@ -4448,6 +6589,12 @@ snapshots:braces: 3.0.3picomatch: 2.3.1+ [email protected]: {}++ dependencies:+ mime-db: 1.52.0+@@ -4465,6 +6612,8 @@ snapshots:pkg-types: 1.3.0ufo: 1.5.4+ [email protected]: {}+@@ -4475,6 +6624,8 @@ snapshots:+ [email protected]: {}+dependencies:data-uri-to-buffer: 4.0.1@@ -4490,10 +6641,26 @@ snapshots:semver: 5.7.2validate-npm-package-license: 3.0.4+ [email protected]: {}+dependencies:boolbase: 1.0.0+ [email protected]: {}++ dependencies:+ destr: 2.0.3+ node-fetch-native: 1.6.4+ ufo: 1.5.4++ dependencies:+ emoji-regex-xs: 1.0.0+ regex: 5.1.1+ regex-recursion: 5.1.1+dependencies:deep-is: 0.1.4@@ -4523,6 +6690,8 @@ snapshots:+ [email protected]: {}+dependencies:callsites: 3.1.0@@ -4541,6 +6710,10 @@ snapshots:json-parse-even-better-errors: 2.3.1lines-and-columns: 1.2.4+ dependencies:+ entities: 4.5.0+@@ -4551,6 +6724,8 @@ snapshots:+ [email protected]: {}+@@ -4563,6 +6738,14 @@ snapshots:mlly: 1.7.3pathe: 1.1.2+ [email protected]: {}++ dependencies:+ playwright-core: 1.49.1+ optionalDependencies:+ fsevents: 2.3.2+@@ -4578,8 +6761,12 @@ snapshots:+ [email protected]: {}++ [email protected]: {}+@@ -4597,10 +6784,35 @@ snapshots:parse-json: 5.2.0type-fest: 0.6.0+ dependencies:+ core-util-is: 1.0.3+ inherits: 2.0.4+ isarray: 1.0.0+ process-nextick-args: 2.0.1+ safe-buffer: 5.1.2+ string_decoder: 1.1.1+ util-deprecate: 1.0.2++ dependencies:+ picomatch: 2.3.1+dependencies:'@eslint-community/regexpp': 4.12.1+ dependencies:+ regex: 5.1.1+ regex-utilities: 2.3.0++ [email protected]: {}++ dependencies:+ regex-utilities: 2.3.0+dependencies:'@eslint-community/regexpp': 4.12.1@@ -4651,10 +6863,20 @@ snapshots:'@rollup/rollup-win32-x64-msvc': 4.29.1fsevents: 2.3.3+ [email protected]: {}+dependencies:queue-microtask: 1.2.3+ [email protected]: {}++ [email protected]: {}++ dependencies:+ xmlchars: 2.2.0+dependencies:'@eslint-community/regexpp': 4.12.1@@ -4663,20 +6885,76 @@ snapshots:+ [email protected]: {}++ dependencies:+ seroval: 1.1.1++ [email protected]: {}++ [email protected]: {}+dependencies:shebang-regex: 3.0.0+ dependencies:+ '@shikijs/core': 1.26.1+ '@shikijs/engine-javascript': 1.26.1+ '@shikijs/engine-oniguruma': 1.26.1+ '@shikijs/langs': 1.26.1+ '@shikijs/themes': 1.26.1+ '@shikijs/types': 1.26.1+ '@shikijs/vscode-textmate': 10.0.1+ '@types/hast': 3.0.4++ dependencies:+ '@polka/url': 1.0.0-next.28+ mrmime: 2.0.0+ totalist: 3.0.1++ dependencies:+ csstype: 3.1.3+ seroval: 1.1.1+ seroval-plugins: 1.1.1([email protected])++ dependencies:+ '@corvu/utils': 0.4.2([email protected])+ solid-js: 1.9.3++ dependencies:+ '@corvu/utils': 0.4.2([email protected])+ solid-js: 1.9.3++ dependencies:+ '@babel/generator': 7.26.3+ '@babel/helper-module-imports': 7.25.9+ '@babel/types': 7.26.3+ solid-js: 1.9.3+ transitivePeerDependencies:+ - supports-color++ dependencies:+ solid-js: 1.9.3+@@ -4686,6 +6964,8 @@ snapshots:+ [email protected]: {}+dependencies:spdx-expression-parse: 3.0.1@@ -4717,6 +6997,15 @@ snapshots:is-fullwidth-code-point: 3.0.0strip-ansi: 6.0.1+ dependencies:+ safe-buffer: 5.1.2++ dependencies:+ character-entities-html4: 2.1.0+ character-entities-legacy: 3.0.0+dependencies:ansi-regex: 5.0.1@@ -4733,6 +7022,8 @@ snapshots:+ [email protected]: {}+dependencies:tslib: 2.8.1@@ -4742,18 +7033,31 @@ snapshots:'@pkgr/core': 0.1.1tslib: 2.8.1+ [email protected]: {}++ dependencies:+ fdir: 6.4.2([email protected])+ picomatch: 4.0.2++ [email protected]: {}++ dependencies:+ tldts-core: 6.1.70+dependencies:is-number: 7.0.0@@ -4762,10 +7066,24 @@ snapshots:dependencies:eslint-visitor-keys: 3.4.3+ [email protected]: {}++ dependencies:+ tldts: 6.1.70++ dependencies:+ punycode: 2.3.1++ [email protected]: {}+dependencies:typescript: 5.7.2+ [email protected]: {}+@@ -4789,12 +7107,24 @@ snapshots:+ dependencies:+ '@antfu/utils': 0.7.10+ defu: 6.1.4+ importx: 0.5.1+ transitivePeerDependencies:+ - supports-color+dependencies:'@types/unist': 3.0.3+ dependencies:+ '@types/unist': 3.0.3+dependencies:'@types/unist': 3.0.3@@ -4810,23 +7140,69 @@ snapshots:unist-util-is: 6.0.0unist-util-visit-parents: 6.0.1+ [email protected](@unocss/[email protected])([email protected]([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))):+ dependencies:+ '@unocss/preset-wind': 0.65.3+ unocss: 0.65.3([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))++ [email protected]([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected])):+ dependencies:+ '@unocss/astro': 0.65.3([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))+ '@unocss/cli': 0.65.3([email protected])+ '@unocss/core': 0.65.3+ '@unocss/postcss': 0.65.3([email protected])+ '@unocss/preset-attributify': 0.65.3+ '@unocss/preset-icons': 0.65.3+ '@unocss/preset-mini': 0.65.3+ '@unocss/preset-tagify': 0.65.3+ '@unocss/preset-typography': 0.65.3+ '@unocss/preset-uno': 0.65.3+ '@unocss/preset-web-fonts': 0.65.3+ '@unocss/preset-wind': 0.65.3+ '@unocss/transformer-attributify-jsx': 0.65.3+ '@unocss/transformer-compile-class': 0.65.3+ '@unocss/transformer-directives': 0.65.3+ '@unocss/transformer-variant-group': 0.65.3+ '@unocss/vite': 0.65.3([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))+ optionalDependencies:+ transitivePeerDependencies:+ - postcss+ - rollup+ - supports-color+ - vue+dependencies:browserslist: 4.24.3escalade: 3.2.0picocolors: 1.1.1+ [email protected]: {}+dependencies:punycode: 2.3.1+ [email protected]: {}+dependencies:spdx-correct: 3.2.0spdx-expression-parse: 3.0.1+ dependencies:+ '@types/unist': 3.0.3+ unist-util-stringify-position: 4.0.0++ dependencies:+ '@types/unist': 3.0.3+ vfile-message: 4.0.2+[email protected](@types/[email protected]):dependencies:cac: 6.7.14@@ -4845,6 +7221,37 @@ snapshots:- supports-color- terser+ [email protected](@types/[email protected]):+ dependencies:+ cac: 6.7.14+ debug: 4.4.0+ es-module-lexer: 1.6.0+ pathe: 1.1.2+ vite: 5.4.11(@types/[email protected])+ transitivePeerDependencies:+ - '@types/node'+ - less+ - lightningcss+ - sass+ - sass-embedded+ - stylus+ - sugarss+ - supports-color+ - terser++ [email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])):+ dependencies:+ '@babel/core': 7.26.0+ '@types/babel__core': 7.20.5+ babel-preset-solid: 1.9.3(@babel/[email protected])+ merge-anything: 5.1.7+ solid-js: 1.9.3+ solid-refresh: 0.6.3([email protected])+ vitefu: 1.0.4([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ transitivePeerDependencies:+ - supports-color+[email protected](@types/[email protected]):dependencies:esbuild: 0.21.5@@ -4854,7 +7261,32 @@ snapshots:'@types/node': 22.10.2fsevents: 2.3.3- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):+ dependencies:+ esbuild: 0.21.5+ postcss: 8.4.49+ rollup: 4.29.1+ optionalDependencies:+ '@types/node': 22.10.5+ fsevents: 2.3.3++ [email protected](@types/[email protected])([email protected])([email protected])([email protected]):+ dependencies:+ esbuild: 0.24.2+ postcss: 8.4.49+ rollup: 4.29.1+ optionalDependencies:+ '@types/node': 22.10.2+ fsevents: 2.3.3+ jiti: 2.4.2+ tsx: 4.19.2+ yaml: 2.7.0++ [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])):+ optionalDependencies:+dependencies:'@vitest/expect': 2.1.8'@vitest/mocker': 2.1.8([email protected](@types/[email protected]))@@ -4878,6 +7310,43 @@ snapshots:why-is-node-running: 2.3.0optionalDependencies:'@types/node': 22.10.2+ jsdom: 25.0.1+ transitivePeerDependencies:+ - less+ - lightningcss+ - msw+ - sass+ - sass-embedded+ - stylus+ - sugarss+ - supports-color+ - terser++ dependencies:+ '@vitest/expect': 2.1.8+ '@vitest/mocker': 2.1.8([email protected](@types/[email protected]))+ '@vitest/pretty-format': 2.1.8+ '@vitest/runner': 2.1.8+ '@vitest/snapshot': 2.1.8+ '@vitest/spy': 2.1.8+ '@vitest/utils': 2.1.8+ chai: 5.1.2+ debug: 4.4.0+ expect-type: 1.1.0+ magic-string: 0.30.17+ pathe: 1.1.2+ std-env: 3.8.0+ tinybench: 2.9.0+ tinyexec: 0.3.2+ tinypool: 1.0.2+ tinyrainbow: 1.2.0+ vite: 5.4.11(@types/[email protected])+ vite-node: 2.1.8(@types/[email protected])+ why-is-node-running: 2.3.0+ optionalDependencies:+ '@types/node': 22.10.5+ jsdom: 25.0.1transitivePeerDependencies:- less- lightningcss@@ -4889,10 +7358,10 @@ snapshots:- supports-color- terserdependencies:debug: 4.4.0- eslint: 9.17.0+ eslint: 9.17.0([email protected])eslint-scope: 7.2.2eslint-visitor-keys: 3.4.3espree: 9.6.1@@ -4902,8 +7371,39 @@ snapshots:transitivePeerDependencies:- supports-color+ dependencies:+ vue: 3.5.13([email protected])++ dependencies:+ '@vue/compiler-dom': 3.5.13+ '@vue/compiler-sfc': 3.5.13+ '@vue/runtime-dom': 3.5.13+ '@vue/server-renderer': 3.5.13([email protected]([email protected]))+ '@vue/shared': 3.5.13+ optionalDependencies:+ typescript: 5.7.2++ dependencies:+ xml-name-validator: 5.0.0++ [email protected]: {}++ dependencies:+ iconv-lite: 0.6.3++ [email protected]: {}++ dependencies:+ tr46: 5.0.0+ webidl-conversions: 7.0.0+dependencies:isexe: 2.0.0@@ -4925,8 +7425,14 @@ snapshots:+ [email protected]: {}++ [email protected]: {}++ [email protected]: {}+dependencies:eslint-visitor-keys: 3.4.3diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 4e708bd3..f85c330e 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -1,3 +1,11 @@packages:- 'packages/*'- 'apps/*'++catalog:+ "@antfu/eslint-config": ^3.6.2+ "@types/node": ^22.5.4+ eslint: ^9.10.0+ tsx: ^4.17.0+ typescript: ^5.6.2+ vitest: ^2.0.5\ No newline at end of file