mirror of
https://github.com/diced/zipline.git
synced 2025-05-10 18:05:54 +02:00
feat: update mantine, prisma, etc.
This commit is contained in:
parent
8b9303ed80
commit
90aef3dce1
30 changed files with 1645 additions and 1394 deletions
|
@ -5,3 +5,4 @@ node_modules
|
||||||
uploads*
|
uploads*
|
||||||
.env
|
.env
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
generated
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -46,3 +46,4 @@ next-env.d.ts
|
||||||
uploads*/
|
uploads*/
|
||||||
*.crt
|
*.crt
|
||||||
*.key
|
*.key
|
||||||
|
generated
|
|
@ -3,9 +3,7 @@ FROM node:22-alpine3.21 AS base
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
RUN npm install -g corepack
|
RUN corepack enable
|
||||||
RUN corepack enable pnpm
|
|
||||||
RUN corepack prepare pnpm@latest --activate
|
|
||||||
|
|
||||||
RUN apk add --no-cache ffmpeg tzdata
|
RUN apk add --no-cache ffmpeg tzdata
|
||||||
|
|
||||||
|
@ -42,6 +40,7 @@ COPY --from=builder /zipline/.next ./.next
|
||||||
|
|
||||||
COPY --from=builder /zipline/mimes.json ./mimes.json
|
COPY --from=builder /zipline/mimes.json ./mimes.json
|
||||||
COPY --from=builder /zipline/code.json ./code.json
|
COPY --from=builder /zipline/code.json ./code.json
|
||||||
|
COPY --from=builder /zipline/generated ./generated
|
||||||
|
|
||||||
RUN pnpm build:prisma
|
RUN pnpm build:prisma
|
||||||
|
|
||||||
|
|
107
package.json
107
package.json
|
@ -17,98 +17,101 @@
|
||||||
"validate:lint": "eslint --cache --fix .",
|
"validate:lint": "eslint --cache --fix .",
|
||||||
"validate:format": "prettier --write --ignore-path .gitignore .",
|
"validate:format": "prettier --write --ignore-path .gitignore .",
|
||||||
"db:prototype": "prisma db push --skip-generate && prisma generate --no-hints",
|
"db:prototype": "prisma db push --skip-generate && prisma generate --no-hints",
|
||||||
"db:migrate": "prisma migrate dev --create-only"
|
"db:migrate": "prisma migrate dev --create-only",
|
||||||
|
"docker:engine": "colima start --mount $PWD/themes:w --mount $PWD/uploads:w --mount $PWD/public:w",
|
||||||
|
"docker:compose:dev:up": "docker-compose --file docker-compose.dev.yml up --build -d",
|
||||||
|
"docker:compose:dev:down": "docker-compose --file docker-compose.dev.yml down",
|
||||||
|
"docker:compose:dev:logs": "docker-compose --file docker-compose.dev.yml logs -f"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "3.726.1",
|
"@aws-sdk/client-s3": "3.726.1",
|
||||||
"@aws-sdk/lib-storage": "3.726.1",
|
"@aws-sdk/lib-storage": "3.726.1",
|
||||||
"@fastify/cookie": "^11.0.2",
|
"@fastify/cookie": "^11.0.2",
|
||||||
"@fastify/cors": "^10.0.2",
|
"@fastify/cors": "^11.0.1",
|
||||||
"@fastify/multipart": "^9.0.3",
|
"@fastify/multipart": "^9.0.3",
|
||||||
"@fastify/rate-limit": "^10.2.2",
|
"@fastify/rate-limit": "^10.2.2",
|
||||||
"@fastify/sensible": "^6.0.3",
|
"@fastify/sensible": "^6.0.3",
|
||||||
"@fastify/static": "^8.1.1",
|
"@fastify/static": "^8.1.1",
|
||||||
"@github/webauthn-json": "^2.1.1",
|
"@github/webauthn-json": "^2.1.1",
|
||||||
"@mantine/charts": "^7.17.0",
|
"@mantine/charts": "^8.0.0",
|
||||||
"@mantine/code-highlight": "^7.17.0",
|
"@mantine/code-highlight": "^8.0.0",
|
||||||
"@mantine/core": "^7.17.0",
|
"@mantine/core": "^8.0.0",
|
||||||
"@mantine/dates": "^7.17.0",
|
"@mantine/dates": "^8.0.0",
|
||||||
"@mantine/dropzone": "^7.17.0",
|
"@mantine/dropzone": "^8.0.0",
|
||||||
"@mantine/form": "^7.17.0",
|
"@mantine/form": "^8.0.0",
|
||||||
"@mantine/hooks": "^7.17.0",
|
"@mantine/hooks": "^8.0.0",
|
||||||
"@mantine/modals": "^7.17.0",
|
"@mantine/modals": "^8.0.0",
|
||||||
"@mantine/notifications": "^7.17.0",
|
"@mantine/notifications": "^8.0.0",
|
||||||
"@prisma/client": "^6.4.1",
|
"@prisma/client": "^6.7.0",
|
||||||
"@prisma/internals": "^6.4.1",
|
"@prisma/internals": "^6.7.0",
|
||||||
"@prisma/migrate": "^6.4.1",
|
"@prisma/migrate": "^6.7.0",
|
||||||
"@smithy/node-http-handler": "^4.0.4",
|
"@smithy/node-http-handler": "^4.0.4",
|
||||||
"@tabler/icons-react": "^3.30.0",
|
"@tabler/icons-react": "^3.31.0",
|
||||||
"@xoi/gps-metadata-remover": "^1.1.2",
|
"@xoi/gps-metadata-remover": "^1.1.2",
|
||||||
"argon2": "^0.41.1",
|
"argon2": "^0.43.0",
|
||||||
"bytes": "^3.1.2",
|
"bytes": "^3.1.2",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"colorette": "^2.0.20",
|
"colorette": "^2.0.20",
|
||||||
"commander": "^13.1.0",
|
"commander": "^13.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.5.0",
|
||||||
"express": "^4.21.2",
|
|
||||||
"fast-glob": "^3.3.3",
|
"fast-glob": "^3.3.3",
|
||||||
"fastify": "^5.2.1",
|
"fastify": "^5.3.2",
|
||||||
"fastify-plugin": "^5.0.1",
|
"fastify-plugin": "^5.0.1",
|
||||||
"fflate": "^0.8.2",
|
"fflate": "^0.8.2",
|
||||||
"fluent-ffmpeg": "^2.1.3",
|
"fluent-ffmpeg": "^2.1.3",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"iron-session": "^8.0.4",
|
"iron-session": "^8.0.4",
|
||||||
"isomorphic-dompurify": "^2.22.0",
|
"isomorphic-dompurify": "^2.24.0",
|
||||||
"katex": "^0.16.21",
|
"katex": "^0.16.22",
|
||||||
"mantine-datatable": "^7.15.1",
|
"mantine-datatable": "^7.17.1",
|
||||||
"ms": "^2.1.3",
|
"ms": "^2.1.3",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.2",
|
||||||
"next": "^15.2.4",
|
"next": "^15.3.1",
|
||||||
"nuqs": "^2.4.1",
|
"nuqs": "^2.4.3",
|
||||||
"otplib": "^12.0.1",
|
"otplib": "^12.0.1",
|
||||||
"prisma": "^6.4.1",
|
"prisma": "^6.7.0",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
"react": "^19.0.0-rc.1",
|
"react": "^19.1.0",
|
||||||
"react-dom": "^19.0.0-rc.1",
|
"react-dom": "^19.1.0",
|
||||||
"react-markdown": "^10.0.0",
|
"react-markdown": "^10.1.0",
|
||||||
"remark-gfm": "^4.0.1",
|
"remark-gfm": "^4.0.1",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.34.1",
|
||||||
"swr": "^2.3.2",
|
"swr": "^2.3.3",
|
||||||
"zod": "^3.24.2",
|
"zod": "^3.24.4",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^1.2.7",
|
"@eslint/compat": "^1.2.9",
|
||||||
"@eslint/eslintrc": "^3.3.0",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@eslint/js": "^9.21.0",
|
"@eslint/js": "^9.26.0",
|
||||||
"@types/bytes": "^3.1.5",
|
"@types/bytes": "^3.1.5",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.1",
|
||||||
"@types/fluent-ffmpeg": "^2.1.27",
|
"@types/fluent-ffmpeg": "^2.1.27",
|
||||||
"@types/katex": "^0.16.7",
|
"@types/katex": "^0.16.7",
|
||||||
"@types/ms": "^2.1.0",
|
"@types/ms": "^2.1.0",
|
||||||
"@types/multer": "^1.4.12",
|
"@types/multer": "^1.4.12",
|
||||||
"@types/node": "^22.13.5",
|
"@types/node": "^22.15.11",
|
||||||
"@types/qrcode": "^1.5.5",
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/react": "^19.0.10",
|
"@types/react": "^19.1.3",
|
||||||
"@types/react-dom": "^19.0.4",
|
"@types/react-dom": "^19.1.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
||||||
"@typescript-eslint/parser": "^8.24.1",
|
"@typescript-eslint/parser": "^8.32.0",
|
||||||
"eslint": "^9.21.0",
|
"eslint": "^9.26.0",
|
||||||
"eslint-config-next": "^15.1.7",
|
"eslint-config-next": "^15.3.1",
|
||||||
"eslint-config-prettier": "^10.0.1",
|
"eslint-config-prettier": "^10.1.2",
|
||||||
"eslint-plugin-prettier": "^5.2.3",
|
"eslint-plugin-prettier": "^5.4.0",
|
||||||
"eslint-plugin-unused-imports": "^4.1.4",
|
"eslint-plugin-unused-imports": "^4.1.4",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"postcss-preset-mantine": "^1.17.0",
|
"postcss-preset-mantine": "^1.17.0",
|
||||||
"postcss-simple-vars": "^7.0.1",
|
"postcss-simple-vars": "^7.0.1",
|
||||||
"prettier": "^3.5.2",
|
"prettier": "^3.5.3",
|
||||||
"sass": "^1.86.1",
|
"sass": "^1.87.0",
|
||||||
"tsc-alias": "^1.8.10",
|
"tsc-alias": "^1.8.16",
|
||||||
"tsup": "^8.3.6",
|
"tsup": "^8.4.0",
|
||||||
"tsx": "^4.19.3",
|
"tsx": "^4.19.4",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22"
|
"node": ">=22"
|
||||||
|
|
2796
pnpm-lock.yaml
generated
2796
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,6 @@
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
|
output = "../generated/client"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { IncompleteFile } from '@/lib/db/models/incompleteFile';
|
||||||
import { fetchApi } from '@/lib/fetchApi';
|
import { fetchApi } from '@/lib/fetchApi';
|
||||||
import { ActionIcon, Badge, Button, Card, Group, Modal, Paper, Stack, Text, Tooltip } from '@mantine/core';
|
import { ActionIcon, Badge, Button, Card, Group, Modal, Paper, Stack, Text, Tooltip } from '@mantine/core';
|
||||||
import { showNotification } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
import { IncompleteFileStatus } from '@prisma/client';
|
import { IncompleteFileStatus } from '../../../../generated/client';
|
||||||
import { IconFileDots, IconTrashFilled } from '@tabler/icons-react';
|
import { IconFileDots, IconTrashFilled } from '@tabler/icons-react';
|
||||||
import { parseAsBoolean, useQueryState } from 'nuqs';
|
import { parseAsBoolean, useQueryState } from 'nuqs';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
|
|
|
@ -14,21 +14,21 @@ const StorageGraph = dynamic(() => import('./parts/StorageGraph'));
|
||||||
const ViewsGraph = dynamic(() => import('./parts/ViewsGraph'));
|
const ViewsGraph = dynamic(() => import('./parts/ViewsGraph'));
|
||||||
|
|
||||||
export default function DashboardMetrics() {
|
export default function DashboardMetrics() {
|
||||||
const [dateRange, setDateRange] = useState<[Date | null, Date | null]>([
|
const [dateRange, setDateRange] = useState<[string | null, string | null]>([
|
||||||
new Date(Date.now() - 86400000 * 7),
|
new Date(Date.now() - 86400000 * 7).toISOString(),
|
||||||
new Date(),
|
new Date().toISOString(),
|
||||||
]); // default: [7 days ago, now]
|
]);
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [allTime, setAllTime] = useState(false);
|
const [allTime, setAllTime] = useState(false);
|
||||||
|
|
||||||
const { data, isLoading } = useApiStats({
|
const { data, isLoading } = useApiStats({
|
||||||
from: dateRange[0]?.toISOString() ?? undefined,
|
from: allTime || !dateRange[0] ? undefined : new Date(dateRange[0]).toISOString(),
|
||||||
to: dateRange[1]?.toISOString() ?? undefined,
|
to: allTime || !dateRange[1] ? undefined : new Date(dateRange[1]).toISOString(),
|
||||||
all: allTime,
|
all: allTime,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleDateChange = (value: [Date | null, Date | null]) => {
|
const handleDateChange = (value: [string | null, string | null]) => {
|
||||||
setAllTime(false);
|
setAllTime(false);
|
||||||
setDateRange(value);
|
setDateRange(value);
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,7 @@ export default function DashboardMetrics() {
|
||||||
value={dateRange}
|
value={dateRange}
|
||||||
onChange={handleDateChange}
|
onChange={handleDateChange}
|
||||||
allowSingleDateInRange={false}
|
allowSingleDateInRange={false}
|
||||||
maxDate={new Date(Date.now() + 0)}
|
maxDate={new Date()}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
|
@ -69,25 +69,14 @@ export default function DashboardMetrics() {
|
||||||
</Button>
|
</Button>
|
||||||
{!allTime ? (
|
{!allTime ? (
|
||||||
<Text size='sm' c='dimmed'>
|
<Text size='sm' c='dimmed'>
|
||||||
{data?.length ? (
|
{dateRange[0] ? new Date(dateRange[0]).toLocaleDateString() : '—'}
|
||||||
<>
|
{dateRange[1] ? ` to ${new Date(dateRange[1]).toLocaleDateString()}` : ''}
|
||||||
{new Date(data?.[0]?.createdAt).toLocaleDateString()}
|
|
||||||
{' to '}
|
|
||||||
{new Date(data?.[data.length - 1]?.createdAt).toLocaleDateString()}
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{dateRange[0]?.toLocaleDateString()}{' '}
|
|
||||||
{dateRange[1] ? `to ${dateRange[1]?.toLocaleDateString()}` : ''}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Text>
|
</Text>
|
||||||
) : (
|
) : (
|
||||||
<Text size='sm' c='dimmed'>
|
<Text size='sm' c='dimmed'>
|
||||||
All Time
|
All Time
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{/* <Tooltip label='This may take longer than usual to load.'> */}
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
label={!allTime ? 'This may take longer than usual to load.' : 'You are viewing all time stats.'}
|
label={!allTime ? 'This may take longer than usual to load.' : 'You are viewing all time stats.'}
|
||||||
>
|
>
|
||||||
|
@ -107,22 +96,18 @@ export default function DashboardMetrics() {
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div>
|
<div>
|
||||||
<StatsCardsSkeleton />
|
<StatsCardsSkeleton />
|
||||||
|
|
||||||
<StatsTablesSkeleton />
|
<StatsTablesSkeleton />
|
||||||
</div>
|
</div>
|
||||||
) : data?.length ? (
|
) : data?.length ? (
|
||||||
<div>
|
<div>
|
||||||
<StatsCards data={data!} />
|
<StatsCards data={data} />
|
||||||
|
<StatsTables data={data} />
|
||||||
<StatsTables data={data!} />
|
|
||||||
|
|
||||||
<SimpleGrid mt='md' cols={{ base: 1, md: 2 }}>
|
<SimpleGrid mt='md' cols={{ base: 1, md: 2 }}>
|
||||||
<FilesUrlsCountGraph metrics={data!} />
|
<FilesUrlsCountGraph metrics={data} />
|
||||||
<ViewsGraph metrics={data!} />
|
<ViewsGraph metrics={data} />
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<StorageGraph metrics={data!} />
|
<StorageGraph metrics={data} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { RegistrationResponseJSON } from '@github/webauthn-json/dist/types/brows
|
||||||
import { ActionIcon, Button, Group, Modal, Paper, Stack, Text, TextInput } from '@mantine/core';
|
import { ActionIcon, Button, Group, Modal, Paper, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { modals } from '@mantine/modals';
|
import { modals } from '@mantine/modals';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
import { UserPasskey } from '@prisma/client';
|
import { UserPasskey } from '../../../../../../generated/client';
|
||||||
import { IconKey, IconKeyOff, IconTrashFilled } from '@tabler/icons-react';
|
import { IconKey, IconKeyOff, IconTrashFilled } from '@tabler/icons-react';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { mutate } from 'swr';
|
import { mutate } from 'swr';
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useUserStore } from '@/lib/store/user';
|
||||||
import { darken } from '@/lib/theme/color';
|
import { darken } from '@/lib/theme/color';
|
||||||
import { Button, ButtonProps, Paper, SimpleGrid, Text, Title, useMantineTheme } from '@mantine/core';
|
import { Button, ButtonProps, Paper, SimpleGrid, Text, Title, useMantineTheme } from '@mantine/core';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
import type { OAuthProviderType } from '@prisma/client';
|
import type { OAuthProviderType } from '../../../../../../generated/client';
|
||||||
import {
|
import {
|
||||||
IconBrandDiscordFilled,
|
IconBrandDiscordFilled,
|
||||||
IconBrandGithubFilled,
|
IconBrandGithubFilled,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { log } from '@/lib/logger';
|
import { log } from '@/lib/logger';
|
||||||
import { Prisma, PrismaClient } from '@prisma/client';
|
import { Prisma, PrismaClient } from '../../../generated/client';
|
||||||
import { userViewSchema } from './models/user';
|
import { userViewSchema } from './models/user';
|
||||||
import { metricDataSchema } from './models/metric';
|
import { metricDataSchema } from './models/metric';
|
||||||
import { metadataSchema } from './models/incompleteFile';
|
import { metadataSchema } from './models/incompleteFile';
|
||||||
|
|
6
src/lib/db/migration/index.d.ts
vendored
Normal file
6
src/lib/db/migration/index.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { SchemaContext } from '@prisma/internals';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
declare module '@prisma/migrate/dist/utils/ensureDatabaseExists' {
|
||||||
|
export function ensureDatabaseExists(schemaContext: SchemaContext): Promise<boolean>;
|
||||||
|
}
|
|
@ -1,15 +1,27 @@
|
||||||
import { Migrate } from '@prisma/migrate/dist/Migrate';
|
import { Migrate } from '@prisma/migrate';
|
||||||
import { ensureDatabaseExists } from '@prisma/migrate/dist/utils/ensureDatabaseExists';
|
|
||||||
import { log } from '@/lib/logger';
|
import { log } from '@/lib/logger';
|
||||||
|
import { loadSchemaContext } from '@prisma/internals';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
import { ensureDatabaseExists } from '@prisma/migrate/dist/utils/ensureDatabaseExists';
|
||||||
|
|
||||||
export async function runMigrations() {
|
export async function runMigrations() {
|
||||||
const migrate = new Migrate('./prisma/schema.prisma');
|
const schemaContext = await loadSchemaContext({
|
||||||
|
schemaPathFromArg: './prisma/schema.prisma',
|
||||||
|
});
|
||||||
|
|
||||||
|
const migrate = await Migrate.setup({
|
||||||
|
schemaContext,
|
||||||
|
migrationsDirPath: './prisma/migrations',
|
||||||
|
});
|
||||||
|
|
||||||
const logger = log('migrations');
|
const logger = log('migrations');
|
||||||
logger.debug('running migrations...');
|
logger.debug('running migrations...');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.debug('ensuring database exists...');
|
logger.debug('ensuring database exists...');
|
||||||
const dbCreated = await ensureDatabaseExists('apply', './prisma/schema.prisma');
|
|
||||||
|
const dbCreated = await ensureDatabaseExists(schemaContext.primaryDatasource);
|
||||||
if (dbCreated) {
|
if (dbCreated) {
|
||||||
logger.info('database created');
|
logger.info('database created');
|
||||||
}
|
}
|
||||||
|
|
13
src/lib/db/migration/types.d.ts
vendored
13
src/lib/db/migration/types.d.ts
vendored
|
@ -1,13 +0,0 @@
|
||||||
// types for @prisma/migrate so vscode cant complain
|
|
||||||
|
|
||||||
declare module '@prisma/migrate/dist/Migrate' {
|
|
||||||
export class Migrate {
|
|
||||||
constructor(schemaPath: string);
|
|
||||||
public applyMigrations(): Promise<{ appliedMigrationNames: string[] }>;
|
|
||||||
public stop(): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module '@prisma/migrate/dist/utils/ensureDatabaseExists' {
|
|
||||||
export function ensureDatabaseExists(command: string, schemaPath: string): Promise<boolean>;
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Folder as PrismaFolder } from '@prisma/client';
|
import type { Folder as PrismaFolder } from '../../../../generated/client';
|
||||||
import { File, cleanFiles } from './file';
|
import { File, cleanFiles } from './file';
|
||||||
|
|
||||||
export type Folder = PrismaFolder & {
|
export type Folder = PrismaFolder & {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IncompleteFileStatus } from '@prisma/client';
|
import { IncompleteFileStatus } from '../../../../generated/client';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export type IncompleteFile = {
|
export type IncompleteFile = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Invite as PrismaInvite } from '@prisma/client';
|
import type { Invite as PrismaInvite } from '../../../../generated/client';
|
||||||
import type { User } from './user';
|
import type { User } from './user';
|
||||||
|
|
||||||
export type Invite = PrismaInvite & {
|
export type Invite = PrismaInvite & {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Url as PrismaUrl } from '@prisma/client';
|
import type { Url as PrismaUrl } from '../../../../generated/client';
|
||||||
|
|
||||||
export type Url = PrismaUrl & {
|
export type Url = PrismaUrl & {
|
||||||
similarity?: number;
|
similarity?: number;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { OAuthProvider, UserPasskey, UserQuota } from '@prisma/client';
|
import { OAuthProvider, UserPasskey, UserQuota } from '../../../../generated/client';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export type User = {
|
export type User = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '../../../generated/client';
|
||||||
import { config } from '../config';
|
import { config } from '../config';
|
||||||
import { decryptToken } from '../crypto';
|
import { decryptToken } from '../crypto';
|
||||||
import { prisma } from '../db';
|
import { prisma } from '../db';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { OAuthProviderType } from '@prisma/client';
|
import type { OAuthProviderType } from '../../../generated/client';
|
||||||
import { User } from '../db/models/user';
|
import { User } from '../db/models/user';
|
||||||
|
|
||||||
export function findProvider(
|
export function findProvider(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Role } from '@prisma/client';
|
import type { Role } from '../../generated/client';
|
||||||
|
|
||||||
export function isAdministrator(role?: Role) {
|
export function isAdministrator(role?: Role) {
|
||||||
return role === 'ADMIN' || role === 'SUPERADMIN';
|
return role === 'ADMIN' || role === 'SUPERADMIN';
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { createToken, decrypt } from '@/lib/crypto';
|
||||||
import { prisma } from '@/lib/db';
|
import { prisma } from '@/lib/db';
|
||||||
import Logger, { log } from '@/lib/logger';
|
import Logger, { log } from '@/lib/logger';
|
||||||
import { findProvider } from '@/lib/oauth/providerUtil';
|
import { findProvider } from '@/lib/oauth/providerUtil';
|
||||||
import { OAuthProviderType, User } from '@prisma/client';
|
import { OAuthProviderType, User } from '../../../generated/client';
|
||||||
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { getSession, saveSession } from '../session';
|
import { getSession, saveSession } from '../session';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { log } from '@/lib/logger';
|
import { log } from '@/lib/logger';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { OAuthProvider, OAuthProviderType } from '@prisma/client';
|
import { OAuthProvider, OAuthProviderType } from '../../../../../../generated/client';
|
||||||
import { userMiddleware } from '@/server/middleware/user';
|
import { userMiddleware } from '@/server/middleware/user';
|
||||||
import { prisma } from '@/lib/db';
|
import { prisma } from '@/lib/db';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { datasource } from '@/lib/datasource';
|
||||||
import { prisma } from '@/lib/db';
|
import { prisma } from '@/lib/db';
|
||||||
import { log } from '@/lib/logger';
|
import { log } from '@/lib/logger';
|
||||||
import { userMiddleware } from '@/server/middleware/user';
|
import { userMiddleware } from '@/server/middleware/user';
|
||||||
import { Export } from '@prisma/client';
|
import { Export } from '../../../../../generated/client';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { Zip, ZipPassThrough } from 'fflate';
|
import { Zip, ZipPassThrough } from 'fflate';
|
||||||
import { createWriteStream } from 'fs';
|
import { createWriteStream } from 'fs';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { prisma } from '@/lib/db';
|
||||||
import { File, cleanFiles, fileSelect } from '@/lib/db/models/file';
|
import { File, cleanFiles, fileSelect } from '@/lib/db/models/file';
|
||||||
import { canInteract } from '@/lib/role';
|
import { canInteract } from '@/lib/role';
|
||||||
import { userMiddleware } from '@/server/middleware/user';
|
import { userMiddleware } from '@/server/middleware/user';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '../../../../../../generated/client';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { RegistrationResponseJSON } from '@github/webauthn-json/dist/types/browser-ponyfill';
|
import { RegistrationResponseJSON } from '@github/webauthn-json/dist/types/browser-ponyfill';
|
||||||
import { Prisma } from '@prisma/client';
|
import { Prisma } from '../../../../../../generated/client';
|
||||||
import { config } from '@/lib/config';
|
import { config } from '@/lib/config';
|
||||||
import { prisma } from '@/lib/db';
|
import { prisma } from '@/lib/db';
|
||||||
import { User } from '@/lib/db/models/user';
|
import { User } from '@/lib/db/models/user';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { log } from '@/lib/logger';
|
||||||
import { canInteract } from '@/lib/role';
|
import { canInteract } from '@/lib/role';
|
||||||
import { administratorMiddleware } from '@/server/middleware/administrator';
|
import { administratorMiddleware } from '@/server/middleware/administrator';
|
||||||
import { userMiddleware } from '@/server/middleware/user';
|
import { userMiddleware } from '@/server/middleware/user';
|
||||||
import { UserFilesQuota } from '@prisma/client';
|
import { UserFilesQuota } from '../../../../../generated/client';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { log } from '@/lib/logger';
|
||||||
import { canInteract } from '@/lib/role';
|
import { canInteract } from '@/lib/role';
|
||||||
import { administratorMiddleware } from '@/server/middleware/administrator';
|
import { administratorMiddleware } from '@/server/middleware/administrator';
|
||||||
import { userMiddleware } from '@/server/middleware/user';
|
import { userMiddleware } from '@/server/middleware/user';
|
||||||
import { Role } from '@prisma/client';
|
import { Role } from '../../../../../generated/client';
|
||||||
import fastifyPlugin from 'fastify-plugin';
|
import fastifyPlugin from 'fastify-plugin';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*", "./generated/*"],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/client/mount.js"],
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/client/mount.js"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue