build fix
This commit is contained in:
parent
5748f8c59a
commit
197b240109
@ -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";
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 }> }) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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 }> }) {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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 }> }) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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
102
update-imports.js
Normal 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();
|
||||
Loading…
Reference in New Issue
Block a user