build fix

This commit is contained in:
alma 2025-05-05 13:04:01 +02:00
parent 5748f8c59a
commit 197b240109
99 changed files with 200 additions and 98 deletions

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { prisma } from "@/lib/prisma";
import { CalendarClient } from "@/components/calendar/calendar-client";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { AnnouncementsPage } from "@/components/announcement/announcements-page";

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { getRedisClient } from '@/lib/redis';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getRedisClient } from '@/lib/redis';
// This route just views Redis email credentials without making any changes

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
import crypto from "crypto";

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
/**

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
import { getCachedCalendarData, cacheCalendarData } from "@/lib/redis";

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { toggleEmailFlag } from '@/lib/services/email-service';
import { invalidateEmailContentCache, invalidateFolderCache } from '@/lib/redis';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { markEmailReadStatus } from '@/lib/services/email-service';
import { invalidateEmailContentCache, invalidateFolderCache } from '@/lib/redis';

View File

@ -8,7 +8,7 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getEmailContent, markEmailReadStatus } from '@/lib/services/email-service';
import { getCachedEmailContent, invalidateEmailContentCache } from '@/lib/redis';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
export async function GET(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getMailboxes } from '@/lib/services/email-service';
import { ImapFlow } from 'imapflow';
import { prisma } from '@/lib/prisma';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
export async function GET(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { saveUserEmailCredentials, testEmailConnection } from '@/lib/services/email-service';
import { invalidateFolderCache } from '@/lib/redis';
import { prisma } from '@/lib/prisma';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getUserEmailCredentials } from '@/lib/services/email-service';
export async function GET() {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getCachedEmailCredentials, getCachedImapSession } from '@/lib/redis';
import { prisma } from '@/lib/prisma';
import { getMailboxes } from '@/lib/services/email-service';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getImapConnection } from '@/lib/services/email-service';
import { invalidateFolderCache } from '@/lib/redis';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getEmails } from '@/lib/services/email-service';
import {
getCachedEmailList,

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { getMailboxes } from '@/lib/services/email-service';
import { ImapFlow } from 'imapflow';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { exchangeCodeForTokens } from '@/lib/services/microsoft-oauth';
import { prisma } from '@/lib/prisma';
import { testEmailConnection, saveUserEmailCredentials } from '@/lib/services/email-service';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getMicrosoftAuthUrl } from '@/lib/services/microsoft-oauth';
// Endpoint to initiate Microsoft OAuth flow

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from 'next/server';
import { getServerSession } from 'next-auth/next';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { forceRecacheUserCredentials } from '@/lib/services/email-service';
export async function GET(request: NextRequest) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getEmails } from '@/lib/services/email-service';
import { invalidateFolderCache } from '@/lib/redis';
import { refreshEmailsInBackground } from '@/lib/services/prefetch-service';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getEmails } from '@/lib/services/email-service';
import {
getCachedEmailList,

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { sendEmail } from '@/lib/services/email-service';
export async function POST(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getMailboxes } from '@/lib/services/email-service';
import { getRedisClient } from '@/lib/redis';
import { getImapConnection } from '@/lib/services/email-service';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getImapConnection } from '@/lib/services/email-service';
import { prisma } from '@/lib/prisma';
import { getRedisClient } from '@/lib/redis';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getImapConnection } from '@/lib/services/email-service';
import { simpleParser } from 'mailparser';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { createUserFolderStructure } from '@/lib/s3';
export async function GET(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// GET /api/debug/leantime-methods
export async function GET(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { NotificationService } from '@/lib/services/notifications/notification-service';
// GET /api/debug/notifications

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { ListBucketsCommand, ListObjectsV2Command } from '@aws-sdk/client-s3';
import { s3Client, S3_CONFIG } from '@/lib/s3';

View File

@ -1,6 +1,6 @@
import { NextResponse, NextRequest } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
export async function GET(req: NextRequest) {
try {

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
export async function DELETE(req: NextRequest, props: { params: Promise<{ id: string }> }) {

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { prisma } from "@/lib/prisma";
export async function POST(req: NextRequest) {

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
export async function GET(req: Request, props: { params: Promise<{ groupId: string }> }) {

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "../../auth/[...nextauth]/route";
import { authOptions } from "../../auth/options";
import { NextResponse } from "next/server";
async function getAdminToken() {

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
async function getAdminToken() {

View File

@ -1,6 +1,6 @@
import { NextRequest } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
interface StatusLabel {

View File

@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { getCachedTasksData, cacheTasksData } from "@/lib/redis";
interface Task {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { deleteMissionAttachment } from '@/lib/mission-uploads';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { GetObjectCommand } from '@aws-sdk/client-s3';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
// Helper function to check authentication

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { deleteMissionLogo } from '@/lib/mission-uploads';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
// Helper function to check authentication

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { PrismaClient } from '@prisma/client';
import { prisma } from '@/lib/prisma';
import {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// This file serves as an adapter to redirect requests from the old NextCloud
// content endpoint to the new MinIO S3 content endpoint

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// This file serves as an adapter to redirect requests from the old NextCloud
// endpoints to the new MinIO S3 endpoints

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// This file serves as an adapter to redirect requests from the old NextCloud
// init endpoint to the new MinIO S3 init endpoint

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// This file serves as an adapter to redirect requests from the old NextCloud
// status endpoint to the new MinIO S3 status endpoint

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { NotificationService } from '@/lib/services/notifications/notification-service';
// POST /api/notifications/{id}/read

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { NotificationService } from '@/lib/services/notifications/notification-service';
// GET /api/notifications/count

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { NotificationService } from '@/lib/services/notifications/notification-service';
// POST /api/notifications/read-all

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { NotificationService } from '@/lib/services/notifications/notification-service';
// GET /api/notifications?page=1&limit=20

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
import { getCachedMessagesData, cacheMessagesData } from "@/lib/redis";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
async function getAdminToken() {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { getObjectContent } from '@/lib/s3';
// Helper function to check authentication

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { listUserObjects, putObject, deleteObject } from '@/lib/s3';
// Helper function to check authentication

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { putObject } from '@/lib/s3';
import { S3_CONFIG } from '@/lib/s3';

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { createUserFolderStructure } from '@/lib/s3';
export async function POST(request: Request) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { ListBucketsCommand, ListObjectsV2Command } from '@aws-sdk/client-s3';
import { createUserFolderStructure } from '@/lib/s3';

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
export async function PUT(req: Request, props: { params: Promise<{ userId: string }> }) {

View File

@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { getKeycloakAdminClient } from "@/lib/keycloak";
// Fix for Next.js "params should be awaited" error

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
// Helper function to get Leantime user ID by email

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { NextResponse } from "next/server";
import { createDolibarrUser, checkDolibarrUserExists, deleteDolibarrUser } from "@/lib/dolibarr-api";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,7 +1,7 @@
import { NextResponse } from 'next/server';
import { ImapFlow } from 'imapflow';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { simpleParser } from 'mailparser';

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ManagementTabs } from "@/components/management/management-tabs";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { GroupsTable } from "@/components/groups/groups-table";

View File

@ -3,7 +3,7 @@ import { Inter } from "next/font/google";
import "./globals.css";
import { headers } from "next/headers";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { Providers } from "@/components/providers";
import { LayoutWrapper } from "@/components/layout/layout-wrapper";
import { warmupRedisCache } from '@/lib/redis';

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
export default async function Page() {

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ObservatoryView } from "@/components/observatory/observatory-view";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { TimeTrackerFrame } from "@/components/timetracker/timetracker-frame";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { UsersTable } from "@/components/users/users-table";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,5 +1,5 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";

View File

@ -1,6 +1,6 @@
import { ImapFlow } from 'imapflow';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
import { prisma } from '@/lib/prisma';
import { getCachedEmailCredentials } from '@/lib/redis';

View File

@ -1,7 +1,7 @@
import { Notification, NotificationCount } from '@/lib/types/notification';
import { NotificationAdapter } from './notification-adapter.interface';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { authOptions } from "@/app/api/auth/options";
// Leantime notification type from their API
interface LeantimeNotification {

102
update-imports.js Normal file
View File

@ -0,0 +1,102 @@
const fs = require('fs');
const path = require('path');
// Function to recursively find all TypeScript files
function findTsFiles(dir, fileList = []) {
const files = fs.readdirSync(dir);
files.forEach(file => {
const filePath = path.join(dir, file);
const stat = fs.statSync(filePath);
if (stat.isDirectory() && !filePath.includes('node_modules') && !filePath.includes('.next')) {
fileList = findTsFiles(filePath, fileList);
} else if (
stat.isFile() &&
(filePath.endsWith('.ts') || filePath.endsWith('.tsx')) &&
!filePath.includes('node_modules') &&
!filePath.includes('.next')
) {
fileList.push(filePath);
}
});
return fileList;
}
// Function to update import statements in a file
function updateImportInFile(filePath) {
try {
let content = fs.readFileSync(filePath, 'utf8');
let updated = false;
// Update absolute imports
if (content.includes('import { authOptions } from "@/app/api/auth/[...nextauth]/route"')) {
content = content.replace(
'import { authOptions } from "@/app/api/auth/[...nextauth]/route"',
'import { authOptions } from "@/app/api/auth/options"'
);
updated = true;
}
// Update relative imports
if (content.includes('import { authOptions } from "../../auth/[...nextauth]/route"')) {
content = content.replace(
'import { authOptions } from "../../auth/[...nextauth]/route"',
'import { authOptions } from "../../auth/options"'
);
updated = true;
}
// Other possible relative paths
const patterns = [
/import\s*{\s*authOptions\s*}\s*from\s*['"](.*)\/auth\/\[\.\.\.\S+\]\/route['"]/g,
/import\s*{\s*authOptions\s*}\s*from\s*['"](.*)\[...\S+\]\/route['"]/g
];
for (const pattern of patterns) {
const matches = content.matchAll(pattern);
for (const match of matches) {
const fullMatch = match[0];
const basePath = match[1];
const replacement = `import { authOptions } from "${basePath}/auth/options"`;
content = content.replace(fullMatch, replacement);
updated = true;
}
}
if (updated) {
fs.writeFileSync(filePath, content, 'utf8');
console.log(`Updated: ${filePath}`);
return true;
}
return false;
} catch (error) {
console.error(`Error updating ${filePath}:`, error);
return false;
}
}
// Main function
function main() {
const rootDir = './app';
const libDir = './lib';
const tsFiles = [
...findTsFiles(rootDir),
...findTsFiles(libDir)
];
let updatedCount = 0;
tsFiles.forEach(file => {
if (updateImportInFile(file)) {
updatedCount++;
}
});
console.log(`\nCompleted! Updated ${updatedCount} files.`);
}
main();