mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
chore: bump package versions + fix linter
This commit is contained in:
@@ -7,19 +7,22 @@ import { fieldsToJsonSchema } from "@/ai/schema"
|
||||
import { transactionFormSchema } from "@/forms/transactions"
|
||||
import { ActionState } from "@/lib/actions"
|
||||
import { getCurrentUser, isAiBalanceExhausted, isSubscriptionExpired } from "@/lib/auth"
|
||||
import config from "@/lib/config"
|
||||
import { getTransactionFileUploadPath, getUserUploadsDirectory, safePathJoin, unsortedFilePath } from "@/lib/files"
|
||||
import {
|
||||
getDirectorySize,
|
||||
getTransactionFileUploadPath,
|
||||
getUserUploadsDirectory,
|
||||
safePathJoin,
|
||||
unsortedFilePath,
|
||||
} from "@/lib/files"
|
||||
import { DEFAULT_PROMPT_ANALYSE_NEW_FILE } from "@/models/defaults"
|
||||
import { createFile, deleteFile, getFileById, updateFile } from "@/models/files"
|
||||
import { createTransaction, updateTransactionFiles, TransactionData } from "@/models/transactions"
|
||||
import { createTransaction, TransactionData, updateTransactionFiles } from "@/models/transactions"
|
||||
import { updateUser } from "@/models/users"
|
||||
import { Category, Field, File, Project, Transaction } from "@/prisma/client"
|
||||
import { mkdir, rename } from "fs/promises"
|
||||
import { randomUUID } from "crypto"
|
||||
import { mkdir, readFile, rename, writeFile } from "fs/promises"
|
||||
import { revalidatePath } from "next/cache"
|
||||
import path from "path"
|
||||
import { randomUUID } from "crypto"
|
||||
import { readFile, writeFile } from "fs/promises"
|
||||
import { getDirectorySize } from "@/lib/files"
|
||||
|
||||
export async function analyzeFileAction(
|
||||
file: File,
|
||||
@@ -31,15 +34,15 @@ export async function analyzeFileAction(
|
||||
const user = await getCurrentUser()
|
||||
|
||||
if (!file || file.userId !== user.id) {
|
||||
return { success: false, error: "File not found or does not belong to the user" }
|
||||
}
|
||||
return { success: false, error: "File not found or does not belong to the user" }
|
||||
}
|
||||
|
||||
if (isAiBalanceExhausted(user)) {
|
||||
return {
|
||||
success: false,
|
||||
error: "You used all of your pre-paid AI scans, please upgrade your account or buy new subscription plan",
|
||||
}
|
||||
if (isAiBalanceExhausted(user)) {
|
||||
return {
|
||||
success: false,
|
||||
error: "You used all of your pre-paid AI scans, please upgrade your account or buy new subscription plan",
|
||||
}
|
||||
}
|
||||
|
||||
if (isSubscriptionExpired(user)) {
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Card, CardDescription, CardTitle } from "@/components/ui/card"
|
||||
import { ColoredText } from "@/components/ui/colored-text"
|
||||
import config from "@/lib/config"
|
||||
import { PROVIDERS } from "@/lib/llm-providers"
|
||||
import { getSelfHostedUser } from "@/models/users"
|
||||
import { ShieldAlert } from "lucide-react"
|
||||
import Image from "next/image"
|
||||
import { redirect } from "next/navigation"
|
||||
import { PROVIDERS } from "@/lib/llm-providers"
|
||||
import SelfHostedSetupFormClient from "./setup-form-client"
|
||||
|
||||
export default async function SelfHostedWelcomePage() {
|
||||
@@ -32,7 +32,6 @@ export default async function SelfHostedWelcomePage() {
|
||||
redirect(config.selfHosted.redirectUrl)
|
||||
}
|
||||
|
||||
// Собираем дефолтные ключи для всех провайдеров
|
||||
const defaultProvider = PROVIDERS[0].key
|
||||
const defaultApiKeys: Record<string, string> = {
|
||||
openai: config.ai.openaiApiKey ?? "",
|
||||
|
||||
Reference in New Issue
Block a user