@superinterface/server 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_btwyo7 +1 -1
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/api/files/[fileId]/contents/route.js +3 -3
- package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
- package/.next/server/app/api/files/route.js +3 -3
- package/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/server/app/api/messages/route.js +6 -6
- package/.next/server/app/api/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/callback/route.js +6 -7
- package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js +1 -1
- package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__29635e8e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__29635e8e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__29b43490._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__315f084a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__315f084a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__441cee00._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__441cee00._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__464a4377._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__464a4377._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5abf1160._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5abf1160._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5d09614a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5d09614a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__62d958e7._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__62d958e7._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__72b72b9e._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__83461316._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__83461316._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__9a611d42._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__9a611d42._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__c1629392._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__c1629392._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__dd176cb5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__eb816e13._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__eb816e13._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f845ef25._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__f845ef25._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js.map +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js +1 -1
- package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js.map +1 -1
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js +3 -3
- package/.next/server/chunks/supercorp_superinterface_bebd2c96._.js.map +1 -1
- package/.next/server/functions-config-manifest.json +2 -2
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/trace +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +6 -51
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.js +10 -7
- package/dist/app/api/api-keys/route.d.ts +4 -26
- package/dist/app/api/api-keys/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +6 -168
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +10 -7
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +4 -110
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +4 -36
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +6 -90
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +10 -7
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +4 -58
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +7 -5
- package/dist/app/api/assistants/[assistantId]/route.d.ts +6 -119
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/route.js +10 -7
- package/dist/app/api/assistants/route.d.ts +4 -56
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/app/api/assistants/route.js +7 -5
- package/dist/app/api/files/[fileId]/contents/route.d.ts +2 -6
- package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
- package/dist/app/api/files/[fileId]/contents/route.js +4 -3
- package/dist/app/api/files/route.d.ts +2 -8
- package/dist/app/api/files/route.d.ts.map +1 -1
- package/dist/app/api/files/route.js +4 -3
- package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
- package/dist/app/api/messages/lib/initialMessagesResponse.js +2 -3
- package/dist/app/api/messages/route.d.ts +4 -22
- package/dist/app/api/messages/route.d.ts.map +1 -1
- package/dist/app/api/messages/route.js +7 -5
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +2 -17
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -3
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +2 -12
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -3
- package/dist/app/api/providers/[modelProviderId]/route.d.ts +6 -60
- package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/route.js +10 -7
- package/dist/app/api/providers/route.d.ts +4 -32
- package/dist/app/api/providers/route.d.ts.map +1 -1
- package/dist/app/api/providers/route.js +7 -5
- package/dist/app/api/tasks/[taskId]/route.d.ts +6 -57
- package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
- package/dist/app/api/tasks/[taskId]/route.js +10 -7
- package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
- package/dist/app/api/tasks/callback/route.js +5 -5
- package/dist/app/api/tasks/route.d.ts +4 -30
- package/dist/app/api/tasks/route.d.ts.map +1 -1
- package/dist/app/api/tasks/route.js +7 -5
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -6
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts.map +1 -1
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.js +6 -6
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts +4 -30
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/[workspaceId]/route.js +7 -5
- package/dist/app/api/workspaces/route.d.ts +4 -22
- package/dist/app/api/workspaces/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/route.js +7 -5
- package/dist/lib/functions/handleFunction/handleAssistant.d.ts.map +1 -1
- package/dist/lib/functions/handleFunction/handleAssistant.js +2 -3
- package/dist/lib/mcpServers/getToolCallMcpServer.d.ts.map +1 -1
- package/dist/lib/mcpServers/getToolCallMcpServer.js +5 -6
- package/dist/lib/prisma/index.d.ts +1 -0
- package/dist/lib/prisma/index.d.ts.map +1 -1
- package/dist/lib/prisma/index.js +12 -0
- package/dist/lib/tools/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/tools/index.js +2 -3
- package/package.json +2 -3
- package/.next/server/chunks/[root-of-the-server]__19865527._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19865527._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__27aadac9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__27aadac9._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__3ba06f7c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__51977f30._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__51977f30._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7f9ca1e3._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a135e388._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a135e388._.js.map +0 -1
- package/dist/app/messages/lib/getWorkspaceId.d.ts +0 -6
- package/dist/app/messages/lib/getWorkspaceId.d.ts.map +0 -1
- package/dist/app/messages/lib/getWorkspaceId.js +0 -3
- package/dist/app/messages/lib/initialMessagesResponse.d.ts +0 -26
- package/dist/app/messages/lib/initialMessagesResponse.d.ts.map +0 -1
- package/dist/app/messages/lib/initialMessagesResponse.js +0 -59
- package/dist/app/messages/lib/serializeThread.d.ts +0 -18
- package/dist/app/messages/lib/serializeThread.d.ts.map +0 -1
- package/dist/app/messages/lib/serializeThread.js +0 -8
- package/dist/app/messages/route.d.ts +0 -31
- package/dist/app/messages/route.d.ts.map +0 -1
- package/dist/app/messages/route.js +0 -585
- package/dist/lib/prismaClient.d.ts +0 -5
- package/dist/lib/prismaClient.d.ts.map +0 -1
- package/dist/lib/prismaClient.js +0 -4
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_buildManifest.js +0 -0
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{ImVeJObVDbb-MHLkfrFb1 → X1k4ISA6YteJsnJalPLxm}/_ssgManifest.js +0 -0
|
@@ -2,13 +2,14 @@ import { headers } from 'next/headers';
|
|
|
2
2
|
import { ApiKeyType } from '@prisma/client';
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
4
|
import { cacheHeaders } from '../../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../../lib/prisma';
|
|
6
6
|
import { getApiKey } from '../../../../../../lib/apiKeys/getApiKey';
|
|
7
7
|
import { validate } from 'uuid';
|
|
8
8
|
import { serializeApiFunction } from '../../../../../../lib/functions/serializeApiFunction';
|
|
9
9
|
import { functionSchema } from '../../../../../../lib/functions/functionSchema';
|
|
10
10
|
import { updateFunction } from '../../../../../../lib/functions/updateFunction';
|
|
11
|
-
export const buildGET = ({ prisma
|
|
11
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
12
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
12
13
|
const { assistantId, functionId } = await props.params;
|
|
13
14
|
const headersList = await headers();
|
|
14
15
|
const authorization = headersList.get('authorization');
|
|
@@ -60,8 +61,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
60
61
|
function: serializeApiFunction({ fn }),
|
|
61
62
|
}, { headers: cacheHeaders });
|
|
62
63
|
};
|
|
63
|
-
export const GET = buildGET();
|
|
64
|
-
export const buildPATCH = ({ prisma
|
|
64
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
65
|
+
export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
66
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
65
67
|
const { assistantId, functionId } = await props.params;
|
|
66
68
|
const headersList = await headers();
|
|
67
69
|
const authorization = headersList.get('authorization');
|
|
@@ -126,8 +128,9 @@ export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, p
|
|
|
126
128
|
function: serializeApiFunction({ fn: updatedFunction }),
|
|
127
129
|
}, { headers: cacheHeaders });
|
|
128
130
|
};
|
|
129
|
-
export const PATCH = buildPATCH();
|
|
130
|
-
export const buildDELETE = ({ prisma
|
|
131
|
+
export const PATCH = ((...args) => buildPATCH()(...args));
|
|
132
|
+
export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
133
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
131
134
|
const { assistantId, functionId } = await props.params;
|
|
132
135
|
const headersList = await headers();
|
|
133
136
|
const authorization = headersList.get('authorization');
|
|
@@ -182,7 +185,7 @@ export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request,
|
|
|
182
185
|
mcpServer: serializeApiFunction({ fn: deletedFunction }),
|
|
183
186
|
}, { headers: cacheHeaders });
|
|
184
187
|
};
|
|
185
|
-
export const DELETE = buildDELETE();
|
|
188
|
+
export const DELETE = ((...args) => buildDELETE()(...args));
|
|
186
189
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
187
190
|
headers: cacheHeaders,
|
|
188
191
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import { type PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (_request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -56,61 +56,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
56
56
|
updatedAt: string;
|
|
57
57
|
}[];
|
|
58
58
|
}>>;
|
|
59
|
-
export declare const GET:
|
|
60
|
-
|
|
61
|
-
assistantId: string;
|
|
62
|
-
}>;
|
|
63
|
-
}) => Promise<NextResponse<{
|
|
64
|
-
error: string;
|
|
65
|
-
}> | NextResponse<{
|
|
66
|
-
functions: {
|
|
67
|
-
id: string;
|
|
68
|
-
openapiSpec: PrismaJson.OpenapiSpec;
|
|
69
|
-
handler: {
|
|
70
|
-
deleteTaskHandler?: {
|
|
71
|
-
keyTemplate: string;
|
|
72
|
-
} | undefined;
|
|
73
|
-
updateTaskHandler?: {
|
|
74
|
-
keyTemplate: string;
|
|
75
|
-
} | undefined;
|
|
76
|
-
createTaskHandler?: {
|
|
77
|
-
keyTemplate: string;
|
|
78
|
-
} | undefined;
|
|
79
|
-
listTasksHandler?: {
|
|
80
|
-
keyTemplate: string;
|
|
81
|
-
} | undefined;
|
|
82
|
-
assistantHandler?: {
|
|
83
|
-
assistantId: string;
|
|
84
|
-
} | undefined;
|
|
85
|
-
clientToolHandler?: {
|
|
86
|
-
type: "FUNCTION";
|
|
87
|
-
name: string;
|
|
88
|
-
arguments: PrismaJson.ClientToolHandlerArguments;
|
|
89
|
-
} | undefined;
|
|
90
|
-
replicateHandler?: {
|
|
91
|
-
type: "RUN";
|
|
92
|
-
apiKey: string;
|
|
93
|
-
identifier: string;
|
|
94
|
-
body: PrismaJson.ReplicateHandlerBody;
|
|
95
|
-
} | undefined;
|
|
96
|
-
firecrawlHandler?: {
|
|
97
|
-
type: import("@prisma/client").$Enums.FirecrawlHandlerType;
|
|
98
|
-
apiKey: string;
|
|
99
|
-
body: PrismaJson.FirecrawlHandlerBody;
|
|
100
|
-
} | undefined;
|
|
101
|
-
requestHandler?: {
|
|
102
|
-
url: string;
|
|
103
|
-
method: import("@prisma/client").$Enums.MethodType;
|
|
104
|
-
headers: PrismaJson.RequestHandlerHeaders;
|
|
105
|
-
body: PrismaJson.RequestHandlerBody;
|
|
106
|
-
} | undefined;
|
|
107
|
-
type: import("@prisma/client").$Enums.HandlerType;
|
|
108
|
-
};
|
|
109
|
-
createdAt: string;
|
|
110
|
-
updatedAt: string;
|
|
111
|
-
}[];
|
|
112
|
-
}>>;
|
|
113
|
-
export declare const buildPOST: ({ prisma }?: {
|
|
59
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
60
|
+
export declare const buildPOST: ({ prisma: providedPrisma }?: {
|
|
114
61
|
prisma?: PrismaClient;
|
|
115
62
|
}) => (request: NextRequest, props: {
|
|
116
63
|
params: Promise<{
|
|
@@ -166,59 +113,6 @@ export declare const buildPOST: ({ prisma }?: {
|
|
|
166
113
|
updatedAt: string;
|
|
167
114
|
};
|
|
168
115
|
}>>;
|
|
169
|
-
export declare const POST:
|
|
170
|
-
params: Promise<{
|
|
171
|
-
assistantId: string;
|
|
172
|
-
}>;
|
|
173
|
-
}) => Promise<NextResponse<{
|
|
174
|
-
error: string;
|
|
175
|
-
}> | NextResponse<{
|
|
176
|
-
function: {
|
|
177
|
-
id: string;
|
|
178
|
-
openapiSpec: PrismaJson.OpenapiSpec;
|
|
179
|
-
handler: {
|
|
180
|
-
deleteTaskHandler?: {
|
|
181
|
-
keyTemplate: string;
|
|
182
|
-
} | undefined;
|
|
183
|
-
updateTaskHandler?: {
|
|
184
|
-
keyTemplate: string;
|
|
185
|
-
} | undefined;
|
|
186
|
-
createTaskHandler?: {
|
|
187
|
-
keyTemplate: string;
|
|
188
|
-
} | undefined;
|
|
189
|
-
listTasksHandler?: {
|
|
190
|
-
keyTemplate: string;
|
|
191
|
-
} | undefined;
|
|
192
|
-
assistantHandler?: {
|
|
193
|
-
assistantId: string;
|
|
194
|
-
} | undefined;
|
|
195
|
-
clientToolHandler?: {
|
|
196
|
-
type: "FUNCTION";
|
|
197
|
-
name: string;
|
|
198
|
-
arguments: PrismaJson.ClientToolHandlerArguments;
|
|
199
|
-
} | undefined;
|
|
200
|
-
replicateHandler?: {
|
|
201
|
-
type: "RUN";
|
|
202
|
-
apiKey: string;
|
|
203
|
-
identifier: string;
|
|
204
|
-
body: PrismaJson.ReplicateHandlerBody;
|
|
205
|
-
} | undefined;
|
|
206
|
-
firecrawlHandler?: {
|
|
207
|
-
type: import("@prisma/client").$Enums.FirecrawlHandlerType;
|
|
208
|
-
apiKey: string;
|
|
209
|
-
body: PrismaJson.FirecrawlHandlerBody;
|
|
210
|
-
} | undefined;
|
|
211
|
-
requestHandler?: {
|
|
212
|
-
url: string;
|
|
213
|
-
method: import("@prisma/client").$Enums.MethodType;
|
|
214
|
-
headers: PrismaJson.RequestHandlerHeaders;
|
|
215
|
-
body: PrismaJson.RequestHandlerBody;
|
|
216
|
-
} | undefined;
|
|
217
|
-
type: import("@prisma/client").$Enums.HandlerType;
|
|
218
|
-
};
|
|
219
|
-
createdAt: string;
|
|
220
|
-
updatedAt: string;
|
|
221
|
-
};
|
|
222
|
-
}>>;
|
|
116
|
+
export declare const POST: ReturnType<typeof buildPOST>;
|
|
223
117
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
224
118
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/functions/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9D,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/functions/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEF,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,12 +2,13 @@ import { NextResponse } from 'next/server';
|
|
|
2
2
|
import { ApiKeyType } from '@prisma/client';
|
|
3
3
|
import { headers } from 'next/headers';
|
|
4
4
|
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../lib/prisma';
|
|
6
6
|
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
7
7
|
import { serializeApiFunction } from '../../../../../lib/functions/serializeApiFunction';
|
|
8
8
|
import { functionSchema } from '../../../../../lib/functions/functionSchema';
|
|
9
9
|
import { createFunction } from '../../../../../lib/functions/createFunction';
|
|
10
|
-
export const buildGET = ({ prisma
|
|
10
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
11
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
11
12
|
const { assistantId } = await props.params;
|
|
12
13
|
const headersList = await headers();
|
|
13
14
|
const authorization = headersList.get('authorization');
|
|
@@ -59,8 +60,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
59
60
|
})),
|
|
60
61
|
}, { headers: cacheHeaders });
|
|
61
62
|
};
|
|
62
|
-
export const GET = buildGET();
|
|
63
|
-
export const buildPOST = ({ prisma
|
|
63
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
64
|
+
export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
65
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
64
66
|
const { assistantId } = await props.params;
|
|
65
67
|
const headersList = await headers();
|
|
66
68
|
const authorization = headersList.get('authorization');
|
|
@@ -114,7 +116,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, pr
|
|
|
114
116
|
function: serializeApiFunction({ fn }),
|
|
115
117
|
}, { headers: cacheHeaders });
|
|
116
118
|
};
|
|
117
|
-
export const POST = buildPOST();
|
|
119
|
+
export const POST = ((...args) => buildPOST()(...args));
|
|
118
120
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
119
121
|
headers: cacheHeaders,
|
|
120
122
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import { type PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (_request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -19,24 +19,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
19
19
|
updatedAt: string;
|
|
20
20
|
}[];
|
|
21
21
|
}>>;
|
|
22
|
-
export declare const GET:
|
|
23
|
-
|
|
24
|
-
assistantId: string;
|
|
25
|
-
}>;
|
|
26
|
-
}) => Promise<NextResponse<{
|
|
27
|
-
error: string;
|
|
28
|
-
}> | NextResponse<{
|
|
29
|
-
initialMessages: {
|
|
30
|
-
id: string;
|
|
31
|
-
role: import("@prisma/client").$Enums.MessageRole;
|
|
32
|
-
content: string;
|
|
33
|
-
orderNumber: number;
|
|
34
|
-
assistantId: string | null;
|
|
35
|
-
createdAt: string;
|
|
36
|
-
updatedAt: string;
|
|
37
|
-
}[];
|
|
38
|
-
}>>;
|
|
39
|
-
export declare const buildPUT: ({ prisma }?: {
|
|
22
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
23
|
+
export declare const buildPUT: ({ prisma: providedPrisma }?: {
|
|
40
24
|
prisma?: PrismaClient;
|
|
41
25
|
}) => (request: NextRequest, props: {
|
|
42
26
|
params: Promise<{
|
|
@@ -55,22 +39,6 @@ export declare const buildPUT: ({ prisma }?: {
|
|
|
55
39
|
updatedAt: string;
|
|
56
40
|
}[];
|
|
57
41
|
}>>;
|
|
58
|
-
export declare const PUT:
|
|
59
|
-
params: Promise<{
|
|
60
|
-
assistantId: string;
|
|
61
|
-
}>;
|
|
62
|
-
}) => Promise<NextResponse<{
|
|
63
|
-
error: string;
|
|
64
|
-
}> | NextResponse<{
|
|
65
|
-
initialMessages: {
|
|
66
|
-
id: string;
|
|
67
|
-
role: import("@prisma/client").$Enums.MessageRole;
|
|
68
|
-
content: string;
|
|
69
|
-
orderNumber: number;
|
|
70
|
-
assistantId: string | null;
|
|
71
|
-
createdAt: string;
|
|
72
|
-
updatedAt: string;
|
|
73
|
-
}[];
|
|
74
|
-
}>>;
|
|
42
|
+
export declare const PUT: ReturnType<typeof buildPUT>;
|
|
75
43
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
76
44
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/initial-messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9E,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/initial-messages/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS9E,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAkDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;GAyDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,12 +2,13 @@ import { NextResponse } from 'next/server';
|
|
|
2
2
|
import { ApiKeyType } from '@prisma/client';
|
|
3
3
|
import { headers } from 'next/headers';
|
|
4
4
|
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../lib/prisma';
|
|
6
6
|
import { serializeApiInitialMessage } from '../../../../../lib/initialMessages/serializeApiInitialMessage';
|
|
7
7
|
import { initialMessagesSchema } from '../../../../../lib/initialMessages/schema';
|
|
8
8
|
import { updateInitialMessages } from '../../../../../lib/initialMessages/updateInitialMessages';
|
|
9
9
|
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
10
|
-
export const buildGET = ({ prisma
|
|
10
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
11
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
11
12
|
const { assistantId } = await props.params;
|
|
12
13
|
const headersList = await headers();
|
|
13
14
|
const authorization = headersList.get('authorization');
|
|
@@ -42,8 +43,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
42
43
|
initialMessages: assistant.initialMessages.map((m) => serializeApiInitialMessage({ initialMessage: m })),
|
|
43
44
|
}, { headers: cacheHeaders });
|
|
44
45
|
};
|
|
45
|
-
export const GET = buildGET();
|
|
46
|
-
export const buildPUT = ({ prisma
|
|
46
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
47
|
+
export const buildPUT = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
48
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
47
49
|
const { assistantId } = await props.params;
|
|
48
50
|
const headersList = await headers();
|
|
49
51
|
const authorization = headersList.get('authorization');
|
|
@@ -82,7 +84,7 @@ export const buildPUT = ({ prisma = defaultPrisma } = {}) => async (request, pro
|
|
|
82
84
|
initialMessages: messages.map((m) => serializeApiInitialMessage({ initialMessage: m })),
|
|
83
85
|
}, { headers: cacheHeaders });
|
|
84
86
|
};
|
|
85
|
-
export const PUT = buildPUT();
|
|
87
|
+
export const PUT = ((...args) => buildPUT()(...args));
|
|
86
88
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
87
89
|
headers: cacheHeaders,
|
|
88
90
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PrismaClient } from '@prisma/client';
|
|
2
2
|
import { NextResponse, type NextRequest } from 'next/server';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (_request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -31,36 +31,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
31
31
|
updatedAt: string;
|
|
32
32
|
};
|
|
33
33
|
}>>;
|
|
34
|
-
export declare const GET:
|
|
35
|
-
|
|
36
|
-
assistantId: string;
|
|
37
|
-
mcpServerId: string;
|
|
38
|
-
}>;
|
|
39
|
-
}) => Promise<NextResponse<{
|
|
40
|
-
error: string;
|
|
41
|
-
}> | NextResponse<{
|
|
42
|
-
mcpServer: {
|
|
43
|
-
id: string;
|
|
44
|
-
transportType: import("@prisma/client").$Enums.TransportType;
|
|
45
|
-
sseTransport: {
|
|
46
|
-
id: string;
|
|
47
|
-
url: string;
|
|
48
|
-
headers: PrismaJson.SseTransportHeaders;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
} | null;
|
|
52
|
-
httpTransport: {
|
|
53
|
-
id: string;
|
|
54
|
-
url: string;
|
|
55
|
-
headers: PrismaJson.HttpTransportHeaders;
|
|
56
|
-
createdAt: string;
|
|
57
|
-
updatedAt: string;
|
|
58
|
-
} | null;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
updatedAt: string;
|
|
61
|
-
};
|
|
62
|
-
}>>;
|
|
63
|
-
export declare const buildPATCH: ({ prisma }?: {
|
|
34
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
35
|
+
export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
64
36
|
prisma?: PrismaClient;
|
|
65
37
|
}) => (request: NextRequest, props: {
|
|
66
38
|
params: Promise<{
|
|
@@ -91,36 +63,8 @@ export declare const buildPATCH: ({ prisma }?: {
|
|
|
91
63
|
updatedAt: string;
|
|
92
64
|
};
|
|
93
65
|
}>>;
|
|
94
|
-
export declare const PATCH:
|
|
95
|
-
|
|
96
|
-
assistantId: string;
|
|
97
|
-
mcpServerId: string;
|
|
98
|
-
}>;
|
|
99
|
-
}) => Promise<NextResponse<{
|
|
100
|
-
error: string;
|
|
101
|
-
}> | NextResponse<{
|
|
102
|
-
mcpServer: {
|
|
103
|
-
id: string;
|
|
104
|
-
transportType: import("@prisma/client").$Enums.TransportType;
|
|
105
|
-
sseTransport: {
|
|
106
|
-
id: string;
|
|
107
|
-
url: string;
|
|
108
|
-
headers: PrismaJson.SseTransportHeaders;
|
|
109
|
-
createdAt: string;
|
|
110
|
-
updatedAt: string;
|
|
111
|
-
} | null;
|
|
112
|
-
httpTransport: {
|
|
113
|
-
id: string;
|
|
114
|
-
url: string;
|
|
115
|
-
headers: PrismaJson.HttpTransportHeaders;
|
|
116
|
-
createdAt: string;
|
|
117
|
-
updatedAt: string;
|
|
118
|
-
} | null;
|
|
119
|
-
createdAt: string;
|
|
120
|
-
updatedAt: string;
|
|
121
|
-
};
|
|
122
|
-
}>>;
|
|
123
|
-
export declare const buildDELETE: ({ prisma }?: {
|
|
66
|
+
export declare const PATCH: ReturnType<typeof buildPATCH>;
|
|
67
|
+
export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
124
68
|
prisma?: PrismaClient;
|
|
125
69
|
}) => (_request: NextRequest, props: {
|
|
126
70
|
params: Promise<{
|
|
@@ -151,34 +95,6 @@ export declare const buildDELETE: ({ prisma }?: {
|
|
|
151
95
|
updatedAt: string;
|
|
152
96
|
};
|
|
153
97
|
}>>;
|
|
154
|
-
export declare const DELETE:
|
|
155
|
-
params: Promise<{
|
|
156
|
-
assistantId: string;
|
|
157
|
-
mcpServerId: string;
|
|
158
|
-
}>;
|
|
159
|
-
}) => Promise<NextResponse<{
|
|
160
|
-
error: string;
|
|
161
|
-
}> | NextResponse<{
|
|
162
|
-
mcpServer: {
|
|
163
|
-
id: string;
|
|
164
|
-
transportType: import("@prisma/client").$Enums.TransportType;
|
|
165
|
-
sseTransport: {
|
|
166
|
-
id: string;
|
|
167
|
-
url: string;
|
|
168
|
-
headers: PrismaJson.SseTransportHeaders;
|
|
169
|
-
createdAt: string;
|
|
170
|
-
updatedAt: string;
|
|
171
|
-
} | null;
|
|
172
|
-
httpTransport: {
|
|
173
|
-
id: string;
|
|
174
|
-
url: string;
|
|
175
|
-
headers: PrismaJson.HttpTransportHeaders;
|
|
176
|
-
createdAt: string;
|
|
177
|
-
updatedAt: string;
|
|
178
|
-
} | null;
|
|
179
|
-
createdAt: string;
|
|
180
|
-
updatedAt: string;
|
|
181
|
-
};
|
|
182
|
-
}>>;
|
|
98
|
+
export declare const DELETE: ReturnType<typeof buildDELETE>;
|
|
183
99
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
184
100
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ5D,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ5D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAiEF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,UAAU,GACpB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAwGF,CAAA;AAEH,eAAO,MAAM,KAAK,EACU,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AAEzD,eAAO,MAAM,WAAW,GACrB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC9D;;;;;;;;;;;;;;;;;;;;;;;GAqEF,CAAA;AAEH,eAAO,MAAM,MAAM,EACU,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAE3D,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,12 +2,13 @@ import { headers } from 'next/headers';
|
|
|
2
2
|
import { ApiKeyType, TransportType } from '@prisma/client';
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
4
|
import { cacheHeaders } from '../../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../../lib/prisma';
|
|
6
6
|
import { getApiKey } from '../../../../../../lib/apiKeys/getApiKey';
|
|
7
7
|
import { validate } from 'uuid';
|
|
8
8
|
import { serializeApiMcpServer } from '../../../../../../lib/mcpServers/serializeApiMcpServer';
|
|
9
9
|
import { mcpServerSchema } from '../../../../../../lib/mcpServers/mcpServerSchema';
|
|
10
|
-
export const buildGET = ({ prisma
|
|
10
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
11
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
11
12
|
const { assistantId, mcpServerId } = await props.params;
|
|
12
13
|
const headersList = await headers();
|
|
13
14
|
const authorization = headersList.get('authorization');
|
|
@@ -48,8 +49,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
48
49
|
mcpServer: serializeApiMcpServer({ mcpServer }),
|
|
49
50
|
}, { headers: cacheHeaders });
|
|
50
51
|
};
|
|
51
|
-
export const GET = buildGET();
|
|
52
|
-
export const buildPATCH = ({ prisma
|
|
52
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
53
|
+
export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
54
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
53
55
|
const { assistantId, mcpServerId } = await props.params;
|
|
54
56
|
const headersList = await headers();
|
|
55
57
|
const authorization = headersList.get('authorization');
|
|
@@ -120,8 +122,9 @@ export const buildPATCH = ({ prisma = defaultPrisma } = {}) => async (request, p
|
|
|
120
122
|
mcpServer: serializeApiMcpServer({ mcpServer: updatedMcpServer }),
|
|
121
123
|
}, { headers: cacheHeaders });
|
|
122
124
|
};
|
|
123
|
-
export const PATCH = buildPATCH();
|
|
124
|
-
export const buildDELETE = ({ prisma
|
|
125
|
+
export const PATCH = ((...args) => buildPATCH()(...args));
|
|
126
|
+
export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
127
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
125
128
|
const { assistantId, mcpServerId } = await props.params;
|
|
126
129
|
const headersList = await headers();
|
|
127
130
|
const authorization = headersList.get('authorization');
|
|
@@ -165,7 +168,7 @@ export const buildDELETE = ({ prisma = defaultPrisma } = {}) => async (_request,
|
|
|
165
168
|
mcpServer: serializeApiMcpServer({ mcpServer: deletedMcpServer }),
|
|
166
169
|
}, { headers: cacheHeaders });
|
|
167
170
|
};
|
|
168
|
-
export const DELETE = buildDELETE();
|
|
171
|
+
export const DELETE = ((...args) => buildDELETE()(...args));
|
|
169
172
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
170
173
|
headers: cacheHeaders,
|
|
171
174
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import { type PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare const buildGET: ({ prisma }?: {
|
|
3
|
+
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
4
|
prisma?: PrismaClient;
|
|
5
5
|
}) => (_request: NextRequest, props: {
|
|
6
6
|
params: Promise<{
|
|
@@ -30,35 +30,8 @@ export declare const buildGET: ({ prisma }?: {
|
|
|
30
30
|
updatedAt: string;
|
|
31
31
|
}[];
|
|
32
32
|
}>>;
|
|
33
|
-
export declare const GET:
|
|
34
|
-
|
|
35
|
-
assistantId: string;
|
|
36
|
-
}>;
|
|
37
|
-
}) => Promise<NextResponse<{
|
|
38
|
-
error: string;
|
|
39
|
-
}> | NextResponse<{
|
|
40
|
-
mcpServers: {
|
|
41
|
-
id: string;
|
|
42
|
-
transportType: import("@prisma/client").$Enums.TransportType;
|
|
43
|
-
sseTransport: {
|
|
44
|
-
id: string;
|
|
45
|
-
url: string;
|
|
46
|
-
headers: PrismaJson.SseTransportHeaders;
|
|
47
|
-
createdAt: string;
|
|
48
|
-
updatedAt: string;
|
|
49
|
-
} | null;
|
|
50
|
-
httpTransport: {
|
|
51
|
-
id: string;
|
|
52
|
-
url: string;
|
|
53
|
-
headers: PrismaJson.HttpTransportHeaders;
|
|
54
|
-
createdAt: string;
|
|
55
|
-
updatedAt: string;
|
|
56
|
-
} | null;
|
|
57
|
-
createdAt: string;
|
|
58
|
-
updatedAt: string;
|
|
59
|
-
}[];
|
|
60
|
-
}>>;
|
|
61
|
-
export declare const buildPOST: ({ prisma }?: {
|
|
33
|
+
export declare const GET: ReturnType<typeof buildGET>;
|
|
34
|
+
export declare const buildPOST: ({ prisma: providedPrisma }?: {
|
|
62
35
|
prisma?: PrismaClient;
|
|
63
36
|
}) => (request: NextRequest, props: {
|
|
64
37
|
params: Promise<{
|
|
@@ -88,33 +61,6 @@ export declare const buildPOST: ({ prisma }?: {
|
|
|
88
61
|
updatedAt: string;
|
|
89
62
|
};
|
|
90
63
|
}>>;
|
|
91
|
-
export declare const POST:
|
|
92
|
-
params: Promise<{
|
|
93
|
-
assistantId: string;
|
|
94
|
-
}>;
|
|
95
|
-
}) => Promise<NextResponse<{
|
|
96
|
-
error: string;
|
|
97
|
-
}> | NextResponse<{
|
|
98
|
-
mcpServer: {
|
|
99
|
-
id: string;
|
|
100
|
-
transportType: import("@prisma/client").$Enums.TransportType;
|
|
101
|
-
sseTransport: {
|
|
102
|
-
id: string;
|
|
103
|
-
url: string;
|
|
104
|
-
headers: PrismaJson.SseTransportHeaders;
|
|
105
|
-
createdAt: string;
|
|
106
|
-
updatedAt: string;
|
|
107
|
-
} | null;
|
|
108
|
-
httpTransport: {
|
|
109
|
-
id: string;
|
|
110
|
-
url: string;
|
|
111
|
-
headers: PrismaJson.HttpTransportHeaders;
|
|
112
|
-
createdAt: string;
|
|
113
|
-
updatedAt: string;
|
|
114
|
-
} | null;
|
|
115
|
-
createdAt: string;
|
|
116
|
-
updatedAt: string;
|
|
117
|
-
};
|
|
118
|
-
}>>;
|
|
64
|
+
export declare const POST: ReturnType<typeof buildPOST>;
|
|
119
65
|
export declare const OPTIONS: () => NextResponse<{}>;
|
|
120
66
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7E,eAAO,MAAM,QAAQ,GAClB,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/mcp-servers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7E,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,UAAU,WAAW,EACrB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAyDF,CAAA;AAEH,eAAO,MAAM,GAAG,EACU,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAErD,eAAO,MAAM,SAAS,GACnB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MAEzD,SAAS,WAAW,EACpB,OAAO;IACL,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC;;;;;;;;;;;;;;;;;;;;;;;GAsFF,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
|
|
@@ -2,11 +2,12 @@ import { NextResponse } from 'next/server';
|
|
|
2
2
|
import { ApiKeyType, TransportType } from '@prisma/client';
|
|
3
3
|
import { headers } from 'next/headers';
|
|
4
4
|
import { cacheHeaders } from '../../../../../lib/cache/cacheHeaders';
|
|
5
|
-
import {
|
|
5
|
+
import { resolvePrisma } from '../../../../../lib/prisma';
|
|
6
6
|
import { getApiKey } from '../../../../../lib/apiKeys/getApiKey';
|
|
7
7
|
import { serializeApiMcpServer } from '../../../../../lib/mcpServers/serializeApiMcpServer';
|
|
8
8
|
import { mcpServerSchema } from '../../../../../lib/mcpServers/mcpServerSchema';
|
|
9
|
-
export const buildGET = ({ prisma
|
|
9
|
+
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
10
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
10
11
|
const { assistantId } = await props.params;
|
|
11
12
|
const headersList = await headers();
|
|
12
13
|
const authorization = headersList.get('authorization');
|
|
@@ -48,8 +49,9 @@ export const buildGET = ({ prisma = defaultPrisma } = {}) => async (_request, pr
|
|
|
48
49
|
})),
|
|
49
50
|
}, { headers: cacheHeaders });
|
|
50
51
|
};
|
|
51
|
-
export const GET = buildGET();
|
|
52
|
-
export const buildPOST = ({ prisma
|
|
52
|
+
export const GET = ((...args) => buildGET()(...args));
|
|
53
|
+
export const buildPOST = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
54
|
+
const prisma = resolvePrisma(providedPrisma);
|
|
53
55
|
const { assistantId } = await props.params;
|
|
54
56
|
const headersList = await headers();
|
|
55
57
|
const authorization = headersList.get('authorization');
|
|
@@ -112,7 +114,7 @@ export const buildPOST = ({ prisma = defaultPrisma } = {}) => async (request, pr
|
|
|
112
114
|
mcpServer: serializeApiMcpServer({ mcpServer }),
|
|
113
115
|
}, { headers: cacheHeaders });
|
|
114
116
|
};
|
|
115
|
-
export const POST = buildPOST();
|
|
117
|
+
export const POST = ((...args) => buildPOST()(...args));
|
|
116
118
|
export const OPTIONS = () => NextResponse.json({}, {
|
|
117
119
|
headers: cacheHeaders,
|
|
118
120
|
});
|