refactor: repartition server-side and client-side code
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { data, type LoaderFunctionArgs, type MetaFunction } from '@remix-run/node';
|
||||
import { Chat } from '~/components/chat/Chat.client';
|
||||
import { Header } from '~/components/header/Header';
|
||||
import { getUser } from '~/lib/.server/auth';
|
||||
import { getUserUsageStats } from '~/lib/.server/chatUsage';
|
||||
import { Chat } from '~/.client/components/chat/Chat.client';
|
||||
import { Header } from '~/.client/components/header/Header';
|
||||
import { getUser } from '~/.server/service/auth';
|
||||
import { getUserUsageStats } from '~/.server/service/chat-usage';
|
||||
|
||||
export const meta: MetaFunction = () => {
|
||||
return [{ title: 'UPage' }, { name: 'description', content: 'Talk with UPage, an AI assistant from Lxware' }];
|
||||
|
||||
@@ -2,7 +2,7 @@ import crypto from 'crypto';
|
||||
import type { _1PanelPaginationResponse, _1PanelResponse, _1PanelWebsite } from '~/types/1panel';
|
||||
import { isBinaryString } from '~/utils/file-utils';
|
||||
import { generateUUID } from '~/utils/uuid';
|
||||
import { request } from '../../lib/fetch';
|
||||
import { request } from '../../.server/utils/fetch';
|
||||
|
||||
export interface _1PanelBaseParams {
|
||||
serverUrl: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { delete1PanelConnectionSettings, save1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { delete1PanelConnectionSettings, save1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { getWebsiteList } from '~/routes/api.1panel.$action/1panel.server';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.1panel.auth');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { get1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/lib/.server/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { get1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { deleteWebsite } from './1panel.server';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { get1PanelConnectionSettings, save1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/lib/.server/deployment';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { get1PanelConnectionSettings, save1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import {
|
||||
createWebsite,
|
||||
getWebsite,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '~/routes/api.1panel.$action/1panel.server';
|
||||
import type { _1PanelWebsite, _1PanelWebsiteInfo } from '~/types/1panel';
|
||||
import { DeploymentPlatformEnum, DeploymentStatusEnum } from '~/types/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
interface DeployRequestBody {
|
||||
websiteId: number;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { handleAuth } from './auth.server';
|
||||
import { deletePage } from './delete.server';
|
||||
import { handleDeploy } from './deploy.server';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { get1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { get1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { getWebsiteList } from '~/routes/api.1panel.$action/1panel.server';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.1panel.stats');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { get1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/lib/.server/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { get1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { toggleAccessWebsite } from './1panel.server';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { get1PanelConnectionSettings, save1PanelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { deleteDeploymentsByPlatformAndId } from '~/lib/.server/deployment';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { get1PanelConnectionSettings, save1PanelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { deleteDeploymentsByPlatformAndId } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { deleteWebsite, getWebsiteList } from '~/routes/api.1panel.$action/1panel.server';
|
||||
import { DeploymentPlatformEnum } from '~/types/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
interface WebsiteListRequestBody {
|
||||
serverUrl?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { data } from '@remix-run/node';
|
||||
import { getAuthError } from '~/lib/.server/auth';
|
||||
import { getAuthError } from '~/.server/service/auth';
|
||||
|
||||
/**
|
||||
* 检查认证错误信息的路由
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { logto } from '~/lib/.server/auth';
|
||||
import { logto } from '~/.server/service/auth';
|
||||
import { checkErrorLoader } from './check-error.server';
|
||||
import { userLoader } from './user.server';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { data, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { getUser } from '~/lib/.server/auth';
|
||||
import { getUser } from '~/.server/service/auth';
|
||||
|
||||
/**
|
||||
* 用户信息API端点
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { deleteChat, getUserChatById } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { deleteChat, getUserChatById } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.delete');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChatById } from '~/lib/.server/chat';
|
||||
import { prisma } from '~/lib/.server/prisma';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChatById } from '~/.server/service/chat';
|
||||
import { prisma } from '~/.server/service/prisma';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.fork');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChats } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChats } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.list');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { handleDeleteAction } from './delete.server';
|
||||
import { handleForkAction } from './fork.server';
|
||||
import { handleListLoader } from './list.server';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChatById, updateChat } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChatById, updateChat } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.update');
|
||||
|
||||
@@ -6,21 +6,21 @@ import {
|
||||
generateId,
|
||||
type UIMessageStreamWriter,
|
||||
} from 'ai';
|
||||
import { upsertChat } from '~/lib/.server/chat';
|
||||
import { ChatUsageStatus, recordUsage, updateUsageStatus } from '~/lib/.server/chatUsage';
|
||||
import { chatStreamText } from '~/lib/.server/llm/chat-stream-text';
|
||||
import { MAX_RESPONSE_SEGMENTS, MAX_TOKENS } from '~/lib/.server/llm/constants';
|
||||
import { createSummary } from '~/lib/.server/llm/create-summary';
|
||||
import { type SelectContextResult, selectContext } from '~/lib/.server/llm/select-context';
|
||||
import { structuredPageSnapshot } from '~/lib/.server/llm/structured-page-snapshot';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { getHistoryChatMessages, saveChatMessages, updateDiscardedMessage } from '~/lib/.server/message';
|
||||
import { getPageByMessageId } from '~/lib/.server/page';
|
||||
import { CONTINUE_PROMPT } from '~/lib/common/prompts/prompts';
|
||||
import { DEFAULT_MODEL, DEFAULT_MODEL_DETAILS, getModel, MINOR_MODEL } from '~/lib/modules/constants';
|
||||
import { chatStreamText } from '~/.server/llm/chat-stream-text';
|
||||
import { MAX_RESPONSE_SEGMENTS, MAX_TOKENS } from '~/.server/llm/constants';
|
||||
import { createSummary } from '~/.server/llm/create-summary';
|
||||
import { type SelectContextResult, selectContext } from '~/.server/llm/select-context';
|
||||
import { structuredPageSnapshot } from '~/.server/llm/structured-page-snapshot';
|
||||
import { DEFAULT_MODEL, DEFAULT_MODEL_DETAILS, getModel, MINOR_MODEL } from '~/.server/modules/constants';
|
||||
import { CONTINUE_PROMPT } from '~/.server/prompts/prompts';
|
||||
import { upsertChat } from '~/.server/service/chat';
|
||||
import { ChatUsageStatus, recordUsage, updateUsageStatus } from '~/.server/service/chat-usage';
|
||||
import { getHistoryChatMessages, saveChatMessages, updateDiscardedMessage } from '~/.server/service/message';
|
||||
import { getPageByMessageId } from '~/.server/service/page';
|
||||
import { approximateUsageFromContent } from '~/.server/utils/token';
|
||||
import type { Page } from '~/types/actions';
|
||||
import type { UPageUIMessage } from '~/types/message';
|
||||
import { approximateUsageFromContent } from '~/utils/token';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.chat');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { generateId } from 'ai';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.mock-chat');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { chatAction } from './chat.server';
|
||||
import { mockChat } from './mock-chat.server';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { getDeploymentStats } from './stats.server';
|
||||
|
||||
export async function loader({ request, params }: LoaderFunctionArgs) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { prisma } from '~/lib/.server/prisma';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { prisma } from '~/.server/service/prisma';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.deployments.stats');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { getUserPlatformDeploymentsWithPagination } from '~/lib/.server/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { getUserPlatformDeploymentsWithPagination } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
|
||||
export async function loader({ request }: LoaderFunctionArgs) {
|
||||
try {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import type { UIMessage } from 'ai';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { streamEnhancer } from '~/lib/.server/llm/stream-enhancer';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { getModel, MINOR_MODEL } from '~/lib/modules/constants';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { streamEnhancer } from '~/.server/llm/stream-enhancer';
|
||||
import { getModel, MINOR_MODEL } from '~/.server/modules/constants';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
export async function action(args: ActionFunctionArgs) {
|
||||
const authResult = await requireAuth(args.request, { isApi: true });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
// Allowed headers to forward to the target server
|
||||
const ALLOW_HEADERS = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { deleteNetlifyConnectionSettings, saveNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { deleteNetlifyConnectionSettings, saveNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.auth');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/lib/.server/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.delete');
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { getNetlifyConnectionSettings, saveNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/lib/.server/deployment';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { getNetlifyConnectionSettings, saveNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { DeploymentPlatformEnum, DeploymentStatusEnum } from '~/types/deployment';
|
||||
import type { NetlifySiteInfo } from '~/types/netlify';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { binaryStringToUint8Array, isBinaryString } from '~/utils/file-utils';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
export type HandleDeployArgs = {
|
||||
request: Request;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { handleNetlifyAuth } from './auth.server';
|
||||
import { deletePage } from './delete.server';
|
||||
import { handleDeploy } from './deploy.server';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.stats');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/lib/.server/deployment';
|
||||
import { request } from '~/lib/fetch';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { request } from '~/.server/utils/fetch';
|
||||
import type { NetlifySite } from '~/types/netlify';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { generateUUID } from '~/utils/uuid';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.deploys');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.sites.cache');
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { deleteDeploymentsByPlatformAndId } from '~/lib/.server/deployment';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { getNetlifyConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { deleteDeploymentsByPlatformAndId } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { DeploymentPlatformEnum } from '~/types/deployment';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.netlify.sites');
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import type { PageCreateParams } from '~/lib/.server/page';
|
||||
import { savePagesAndSections } from '~/lib/.server/projectService';
|
||||
import type { SectionCreateParams } from '~/lib/.server/section';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import type { PageCreateParams } from '~/.server/service/page';
|
||||
import { savePagesAndSections } from '~/.server/service/project-service';
|
||||
import type { SectionCreateParams } from '~/.server/service/section';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.project');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs, LoaderFunction } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
// These are injected by Vite at build time
|
||||
declare const __PKG_NAME: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs, LoaderFunction } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
// Only import child_process if we're not in a Cloudflare environment
|
||||
let execSync: any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { json, type LoaderFunction, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
interface GitInfo {
|
||||
local: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs, LoaderFunction } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
// Only import child_process if we're not in a Cloudflare environment
|
||||
let execSync: any;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs, LoaderFunction } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
// Only import child_process if we're not in a Cloudflare environment
|
||||
let execSync: any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { appInfoAction, appInfoLoader } from './app-info.server';
|
||||
import { diskAction, diskLoader } from './disk.server';
|
||||
import { gitInfoLoader } from './git-info.server';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type ActionFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { storageProvider } from '~/lib/storage/index.server';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { storageProvider } from '~/.server/storage/index.server';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.upload');
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import {
|
||||
deleteUserSetting,
|
||||
deleteUserSettings,
|
||||
getUserSetting,
|
||||
getUserSettings,
|
||||
setUserSetting,
|
||||
} from '~/lib/.server/userSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
} from '~/.server/service/user-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.user.settings');
|
||||
|
||||
@@ -2,8 +2,8 @@ import {
|
||||
deleteVercelConnectionSettings,
|
||||
getVercelConnectionSettings,
|
||||
saveVercelConnectionSettings,
|
||||
} from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
} from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.vercel.auth');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getVercelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/lib/.server/deployment';
|
||||
import { request } from '~/lib/fetch';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getVercelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { deleteDeploymentById, getDeploymentById } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { request } from '~/.server/utils/fetch';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import type { VercelResponseError } from './type';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { getVercelConnectionSettings, saveVercelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/lib/.server/deployment';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { getVercelConnectionSettings, saveVercelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { createOrUpdateDeployment, getLatestDeployment } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { DeploymentPlatformEnum, DeploymentStatusEnum } from '~/types/deployment';
|
||||
import type { VercelProjectInfo } from '~/types/vercel';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { isBinaryString } from '~/utils/file-utils';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.vercel.deploy');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import { handleVercelAuth } from './auth.server';
|
||||
import { deletePage } from './delete.server';
|
||||
import { getVercelDeployByProjectId, handleVercelDeploy } from './deploy.server';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getVercelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getVercelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.vercel.stats');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getVercelConnectionSettings } from '~/lib/.server/connectionSettings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/lib/.server/deployment';
|
||||
import { request } from '~/lib/fetch';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getVercelConnectionSettings } from '~/.server/service/connection-settings';
|
||||
import { getDeploymentById, updateDeploymentStatus } from '~/.server/service/deployment';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { request } from '~/.server/utils/fetch';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
import type { VercelAlias, VercelResponseAliases, VercelResponseError } from './type';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import fs from 'fs';
|
||||
import { getUser } from '~/lib/.server/auth';
|
||||
import { createScopedLogger } from '~/lib/.server/logger';
|
||||
import { storageProvider } from '~/lib/storage/index.server';
|
||||
import { getUser } from '~/.server/service/auth';
|
||||
import { storageProvider } from '~/.server/storage/index.server';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.assets');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { data, type LoaderFunctionArgs, redirect } from '@remix-run/node';
|
||||
import { getUser, requireAuth } from '~/lib/.server/auth';
|
||||
import { getUserChatById } from '~/lib/.server/chat';
|
||||
import { getChatDeployments } from '~/lib/.server/deployment';
|
||||
import { getUser, requireAuth } from '~/.server/service/auth';
|
||||
import { getUserChatById } from '~/.server/service/chat';
|
||||
import { getChatDeployments } from '~/.server/service/deployment';
|
||||
import { default as IndexRoute } from './_index';
|
||||
|
||||
export async function loader(args: LoaderFunctionArgs) {
|
||||
|
||||
Reference in New Issue
Block a user