@superinterface/server 1.0.25 → 1.0.26
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/api-keys/[apiKeyId]/route.js +1 -1
- package/.next/server/app/api/api-keys/[apiKeyId]/route.js.nft.json +1 -1
- package/.next/server/app/api/api-keys/route.js +1 -1
- package/.next/server/app/api/api-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/functions/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/[assistantId]/route.js +1 -1
- package/.next/server/app/api/assistants/[assistantId]/route.js.nft.json +1 -1
- package/.next/server/app/api/assistants/route.js +1 -1
- package/.next/server/app/api/assistants/route.js.nft.json +1 -1
- package/.next/server/app/api/files/[fileId]/contents/route.js +1 -1
- package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
- package/.next/server/app/api/files/route.js +1 -1
- package/.next/server/app/api/files/route.js.nft.json +1 -1
- package/.next/server/app/api/messages/route.js +1 -1
- package/.next/server/app/api/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/models/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/models/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/route.js +1 -1
- package/.next/server/app/api/providers/[modelProviderId]/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/callback/route.js +1 -1
- package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/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/api/workspaces/[workspaceId]/route.js +1 -1
- package/.next/server/app/api/workspaces/[workspaceId]/route.js.nft.json +1 -1
- package/.next/server/app/api/workspaces/route.js +1 -1
- package/.next/server/app/api/workspaces/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]__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]__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]__40ab45eb._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -1
- 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]__47b17fad._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__47b17fad._.js.map +1 -0
- 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]__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 +1 -1
- package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -1
- 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 +1 -1
- package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -1
- 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]__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]__f6f61507._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__f6f61507._.js.map +1 -0
- 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/functions-config-manifest.json +1 -8
- 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]/buildRoute.d.ts +52 -0
- package/dist/app/api/api-keys/[apiKeyId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/api-keys/[apiKeyId]/buildRoute.js +121 -0
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +10 -21
- package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/[apiKeyId]/route.js +6 -125
- package/dist/app/api/api-keys/buildRoute.d.ts +32 -0
- package/dist/app/api/api-keys/buildRoute.d.ts.map +1 -0
- package/dist/app/api/api-keys/buildRoute.js +104 -0
- package/dist/app/api/api-keys/builders.d.ts +31 -0
- package/dist/app/api/api-keys/builders.d.ts.map +1 -0
- package/dist/app/api/api-keys/builders.js +109 -0
- package/dist/app/api/api-keys/route.d.ts +5 -13
- package/dist/app/api/api-keys/route.d.ts.map +1 -1
- package/dist/app/api/api-keys/route.js +8 -108
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +120 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/buildRoute.js +226 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts +167 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.js +184 -0
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +10 -21
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +6 -191
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts +114 -0
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/functions/buildRoute.js +117 -0
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/functions/route.js +5 -122
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts +40 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.js +85 -0
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +5 -90
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts +89 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.js +167 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +10 -21
- 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 +6 -174
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts +62 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.js +115 -0
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +7 -15
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +5 -120
- package/dist/app/api/assistants/[assistantId]/route.d.ts +11 -22
- package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
- package/dist/app/api/assistants/[assistantId]/route.js +6 -233
- package/dist/app/api/assistants/buildRoute.d.ts +121 -0
- package/dist/app/api/assistants/buildRoute.d.ts.map +1 -0
- package/dist/app/api/assistants/buildRoute.js +144 -0
- package/dist/app/api/assistants/route.d.ts +7 -13
- package/dist/app/api/assistants/route.d.ts.map +1 -1
- package/dist/app/api/assistants/route.js +6 -148
- package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts +18 -0
- package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts.map +1 -0
- package/dist/app/api/files/[fileId]/contents/buildRoute.js +81 -0
- package/dist/app/api/files/[fileId]/contents/route.d.ts +3 -13
- package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
- package/dist/app/api/files/[fileId]/contents/route.js +4 -84
- package/dist/app/api/files/buildRoute.d.ts +14 -0
- package/dist/app/api/files/buildRoute.d.ts.map +1 -0
- package/dist/app/api/files/buildRoute.js +88 -0
- package/dist/app/api/files/route.d.ts +4 -10
- package/dist/app/api/files/route.d.ts.map +1 -1
- package/dist/app/api/files/route.js +4 -91
- package/dist/app/api/messages/buildRoute.d.ts +34 -0
- package/dist/app/api/messages/buildRoute.d.ts.map +1 -0
- package/dist/app/api/messages/buildRoute.js +607 -0
- package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
- package/dist/app/api/messages/lib/initialMessagesResponse.js +1 -1
- package/dist/app/api/messages/route.d.ts +10 -22
- package/dist/app/api/messages/route.d.ts.map +1 -1
- package/dist/app/api/messages/route.js +6 -612
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts +24 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.js +43 -0
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +4 -9
- package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -46
- package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts +61 -0
- package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/buildRoute.js +134 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts +19 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/[modelProviderId]/models/buildRoute.js +43 -0
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +4 -9
- package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -46
- package/dist/app/api/providers/[modelProviderId]/route.d.ts +10 -21
- package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
- package/dist/app/api/providers/[modelProviderId]/route.js +6 -141
- package/dist/app/api/providers/buildRoute.d.ts +38 -0
- package/dist/app/api/providers/buildRoute.d.ts.map +1 -0
- package/dist/app/api/providers/buildRoute.js +75 -0
- package/dist/app/api/providers/route.d.ts +5 -13
- package/dist/app/api/providers/route.d.ts.map +1 -1
- package/dist/app/api/providers/route.js +5 -80
- package/dist/app/api/tasks/[taskId]/buildRoute.d.ts +19 -0
- package/dist/app/api/tasks/[taskId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/[taskId]/buildRoute.js +125 -0
- package/dist/app/api/tasks/[taskId]/route.d.ts +7 -57
- package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
- package/dist/app/api/tasks/[taskId]/route.js +6 -144
- package/dist/app/api/tasks/buildRoute.d.ts +36 -0
- package/dist/app/api/tasks/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/buildRoute.js +85 -0
- package/dist/app/api/tasks/callback/buildRoute.d.ts +6 -0
- package/dist/app/api/tasks/callback/buildRoute.d.ts.map +1 -0
- package/dist/app/api/tasks/callback/buildRoute.js +244 -0
- package/dist/app/api/tasks/callback/route.d.ts +2 -1
- package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
- package/dist/app/api/tasks/callback/route.js +4 -244
- package/dist/app/api/tasks/route.d.ts +5 -13
- package/dist/app/api/tasks/route.d.ts.map +1 -1
- package/dist/app/api/tasks/route.js +5 -90
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts +10 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts.map +1 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.js +36 -0
- package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -7
- 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 +3 -37
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts +16 -0
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts.map +1 -0
- package/dist/app/api/workspaces/[workspaceId]/buildRoute.js +89 -0
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts +5 -31
- package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/[workspaceId]/route.js +5 -89
- package/dist/app/api/workspaces/buildRoute.d.ts +42 -0
- package/dist/app/api/workspaces/buildRoute.d.ts.map +1 -0
- package/dist/app/api/workspaces/buildRoute.js +78 -0
- package/dist/app/api/workspaces/route.d.ts +7 -27
- package/dist/app/api/workspaces/route.d.ts.map +1 -1
- package/dist/app/api/workspaces/route.js +6 -82
- package/dist/lib/functions/functionSchema.d.ts +56 -56
- package/dist/lib/functions/handleFunction/getFunction.d.ts +4 -4
- package/dist/lib/mcpServers/mcpServerSchema.d.ts +20 -20
- package/dist/lib/prisma/index.d.ts +2 -5
- package/dist/lib/prisma/index.d.ts.map +1 -1
- package/dist/lib/prisma/index.js +6 -78
- package/package.json +4 -12
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +0 -38
- package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +0 -1
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_buildManifest.js +0 -0
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → KhKDqyqUf75vkMRrXaWJf}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { headers } from 'next/headers';
|
|
2
|
+
import { ApiKeyType } from '@prisma/client';
|
|
3
|
+
import { NextResponse } from 'next/server';
|
|
4
|
+
import { cacheHeaders } from '../../../../../../lib/cache/cacheHeaders';
|
|
5
|
+
import { getApiKey } from '../../../../../../lib/apiKeys/getApiKey';
|
|
6
|
+
import { validate } from 'uuid';
|
|
7
|
+
import { serializeApiFunction } from '../../../../../../lib/functions/serializeApiFunction';
|
|
8
|
+
import { functionSchema } from '../../../../../../lib/functions/functionSchema';
|
|
9
|
+
import { updateFunction } from '../../../../../../lib/functions/updateFunction';
|
|
10
|
+
const ensureIdsValid = ({ assistantId, functionId, }) => {
|
|
11
|
+
if (!validate(assistantId)) {
|
|
12
|
+
return NextResponse.json({ error: 'Invalid assistant id' }, { status: 400 });
|
|
13
|
+
}
|
|
14
|
+
if (!validate(functionId)) {
|
|
15
|
+
return NextResponse.json({ error: 'Invalid function id' }, { status: 400 });
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
export const buildGET = ({ prisma }) => async (_request, props) => {
|
|
20
|
+
const { assistantId, functionId } = await props.params;
|
|
21
|
+
const headersList = await headers();
|
|
22
|
+
const authorization = headersList.get('authorization');
|
|
23
|
+
if (!authorization) {
|
|
24
|
+
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
25
|
+
}
|
|
26
|
+
const privateApiKey = await getApiKey({
|
|
27
|
+
type: ApiKeyType.PRIVATE,
|
|
28
|
+
authorization,
|
|
29
|
+
prisma,
|
|
30
|
+
});
|
|
31
|
+
if (!privateApiKey) {
|
|
32
|
+
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
33
|
+
}
|
|
34
|
+
const validationError = ensureIdsValid({ assistantId, functionId });
|
|
35
|
+
if (validationError)
|
|
36
|
+
return validationError;
|
|
37
|
+
const fn = await prisma.function.findFirst({
|
|
38
|
+
where: {
|
|
39
|
+
id: functionId,
|
|
40
|
+
assistant: {
|
|
41
|
+
id: assistantId,
|
|
42
|
+
workspaceId: privateApiKey.workspaceId,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
include: {
|
|
46
|
+
handler: {
|
|
47
|
+
include: {
|
|
48
|
+
requestHandler: true,
|
|
49
|
+
firecrawlHandler: true,
|
|
50
|
+
replicateHandler: true,
|
|
51
|
+
clientToolHandler: true,
|
|
52
|
+
assistantHandler: true,
|
|
53
|
+
createTaskHandler: true,
|
|
54
|
+
listTasksHandler: true,
|
|
55
|
+
updateTaskHandler: true,
|
|
56
|
+
deleteTaskHandler: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
if (!fn) {
|
|
62
|
+
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
63
|
+
}
|
|
64
|
+
return NextResponse.json({
|
|
65
|
+
function: serializeApiFunction({ fn }),
|
|
66
|
+
}, { headers: cacheHeaders });
|
|
67
|
+
};
|
|
68
|
+
export const buildPATCH = ({ prisma }) => async (request, props) => {
|
|
69
|
+
const { assistantId, functionId } = await props.params;
|
|
70
|
+
const headersList = await headers();
|
|
71
|
+
const authorization = headersList.get('authorization');
|
|
72
|
+
if (!authorization) {
|
|
73
|
+
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
74
|
+
}
|
|
75
|
+
const privateApiKey = await getApiKey({
|
|
76
|
+
authorization,
|
|
77
|
+
type: ApiKeyType.PRIVATE,
|
|
78
|
+
prisma,
|
|
79
|
+
});
|
|
80
|
+
if (!privateApiKey) {
|
|
81
|
+
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
82
|
+
}
|
|
83
|
+
const validationError = ensureIdsValid({ assistantId, functionId });
|
|
84
|
+
if (validationError)
|
|
85
|
+
return validationError;
|
|
86
|
+
const body = await request.json();
|
|
87
|
+
const parsed = functionSchema.safeParse(body);
|
|
88
|
+
if (!parsed.success) {
|
|
89
|
+
return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
|
|
90
|
+
}
|
|
91
|
+
const fn = await prisma.function.findFirst({
|
|
92
|
+
where: {
|
|
93
|
+
id: functionId,
|
|
94
|
+
assistant: {
|
|
95
|
+
id: assistantId,
|
|
96
|
+
workspaceId: privateApiKey.workspaceId,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
include: {
|
|
100
|
+
assistant: true,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
if (!fn) {
|
|
104
|
+
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
105
|
+
}
|
|
106
|
+
const updatedFunction = await updateFunction({
|
|
107
|
+
fn,
|
|
108
|
+
parsedInput: parsed.data,
|
|
109
|
+
include: {
|
|
110
|
+
handler: {
|
|
111
|
+
include: {
|
|
112
|
+
requestHandler: true,
|
|
113
|
+
firecrawlHandler: true,
|
|
114
|
+
replicateHandler: true,
|
|
115
|
+
clientToolHandler: true,
|
|
116
|
+
assistantHandler: true,
|
|
117
|
+
createTaskHandler: true,
|
|
118
|
+
listTasksHandler: true,
|
|
119
|
+
updateTaskHandler: true,
|
|
120
|
+
deleteTaskHandler: true,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
prisma,
|
|
125
|
+
});
|
|
126
|
+
return NextResponse.json({
|
|
127
|
+
function: serializeApiFunction({ fn: updatedFunction }),
|
|
128
|
+
}, { headers: cacheHeaders });
|
|
129
|
+
};
|
|
130
|
+
export const buildDELETE = ({ prisma }) => async (_request, props) => {
|
|
131
|
+
const { assistantId, functionId } = await props.params;
|
|
132
|
+
const headersList = await headers();
|
|
133
|
+
const authorization = headersList.get('authorization');
|
|
134
|
+
if (!authorization) {
|
|
135
|
+
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
136
|
+
}
|
|
137
|
+
const privateApiKey = await getApiKey({
|
|
138
|
+
authorization,
|
|
139
|
+
type: ApiKeyType.PRIVATE,
|
|
140
|
+
prisma,
|
|
141
|
+
});
|
|
142
|
+
if (!privateApiKey) {
|
|
143
|
+
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
144
|
+
}
|
|
145
|
+
const validationError = ensureIdsValid({ assistantId, functionId });
|
|
146
|
+
if (validationError)
|
|
147
|
+
return validationError;
|
|
148
|
+
const fn = await prisma.function.findFirst({
|
|
149
|
+
where: {
|
|
150
|
+
id: functionId,
|
|
151
|
+
assistant: {
|
|
152
|
+
id: assistantId,
|
|
153
|
+
workspaceId: privateApiKey.workspaceId,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
if (!fn) {
|
|
158
|
+
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
159
|
+
}
|
|
160
|
+
const deletedFunction = await prisma.function.delete({
|
|
161
|
+
where: { id: fn.id },
|
|
162
|
+
include: {
|
|
163
|
+
handler: {
|
|
164
|
+
include: {
|
|
165
|
+
requestHandler: true,
|
|
166
|
+
firecrawlHandler: true,
|
|
167
|
+
replicateHandler: true,
|
|
168
|
+
clientToolHandler: true,
|
|
169
|
+
assistantHandler: true,
|
|
170
|
+
createTaskHandler: true,
|
|
171
|
+
listTasksHandler: true,
|
|
172
|
+
updateTaskHandler: true,
|
|
173
|
+
deleteTaskHandler: true,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
return NextResponse.json({
|
|
179
|
+
mcpServer: serializeApiFunction({ fn: deletedFunction }),
|
|
180
|
+
}, { headers: cacheHeaders });
|
|
181
|
+
};
|
|
182
|
+
export const buildOPTIONS = () => () => NextResponse.json({}, {
|
|
183
|
+
headers: cacheHeaders,
|
|
184
|
+
});
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { NextResponse, type NextRequest } from 'next/server';
|
|
3
|
-
export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
4
|
-
prisma?: PrismaClient;
|
|
5
|
-
}) => (_request: NextRequest, props: {
|
|
1
|
+
export declare const GET: (_request: import("next/server").NextRequest, props: {
|
|
6
2
|
params: Promise<{
|
|
7
3
|
assistantId: string;
|
|
8
4
|
functionId: string;
|
|
9
5
|
}>;
|
|
10
|
-
}) => Promise<NextResponse<{
|
|
6
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
11
7
|
error: string;
|
|
12
|
-
}> | NextResponse<{
|
|
8
|
+
}> | import("next/server").NextResponse<{
|
|
13
9
|
function: {
|
|
14
10
|
id: string;
|
|
15
11
|
openapiSpec: PrismaJson.OpenapiSpec;
|
|
@@ -57,17 +53,14 @@ export declare const buildGET: ({ prisma: providedPrisma }?: {
|
|
|
57
53
|
updatedAt: string;
|
|
58
54
|
};
|
|
59
55
|
}>>;
|
|
60
|
-
export declare const
|
|
61
|
-
export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
62
|
-
prisma?: PrismaClient;
|
|
63
|
-
}) => (request: NextRequest, props: {
|
|
56
|
+
export declare const PATCH: (request: import("next/server").NextRequest, props: {
|
|
64
57
|
params: Promise<{
|
|
65
58
|
assistantId: string;
|
|
66
59
|
functionId: string;
|
|
67
60
|
}>;
|
|
68
|
-
}) => Promise<NextResponse<{
|
|
61
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
69
62
|
error: string;
|
|
70
|
-
}> | NextResponse<{
|
|
63
|
+
}> | import("next/server").NextResponse<{
|
|
71
64
|
function: {
|
|
72
65
|
id: string;
|
|
73
66
|
openapiSpec: PrismaJson.OpenapiSpec;
|
|
@@ -115,17 +108,14 @@ export declare const buildPATCH: ({ prisma: providedPrisma }?: {
|
|
|
115
108
|
updatedAt: string;
|
|
116
109
|
};
|
|
117
110
|
}>>;
|
|
118
|
-
export declare const
|
|
119
|
-
export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
120
|
-
prisma?: PrismaClient;
|
|
121
|
-
}) => (_request: NextRequest, props: {
|
|
111
|
+
export declare const DELETE: (_request: import("next/server").NextRequest, props: {
|
|
122
112
|
params: Promise<{
|
|
123
113
|
assistantId: string;
|
|
124
114
|
functionId: string;
|
|
125
115
|
}>;
|
|
126
|
-
}) => Promise<NextResponse<{
|
|
116
|
+
}) => Promise<import("next/server").NextResponse<{
|
|
127
117
|
error: string;
|
|
128
|
-
}> | NextResponse<{
|
|
118
|
+
}> | import("next/server").NextResponse<{
|
|
129
119
|
mcpServer: {
|
|
130
120
|
id: string;
|
|
131
121
|
openapiSpec: PrismaJson.OpenapiSpec;
|
|
@@ -173,6 +163,5 @@ export declare const buildDELETE: ({ prisma: providedPrisma }?: {
|
|
|
173
163
|
updatedAt: string;
|
|
174
164
|
};
|
|
175
165
|
}>>;
|
|
176
|
-
export declare const
|
|
177
|
-
export declare const OPTIONS: () => NextResponse<{}>;
|
|
166
|
+
export declare const OPTIONS: () => import("next/server").NextResponse<{}>;
|
|
178
167
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/functions/[functionId]/route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/api/assistants/[assistantId]/functions/[functionId]/route.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyB,CAAA;AAE3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,CAAA;AAE7C,eAAO,MAAM,OAAO,8CAAiB,CAAA"}
|
|
@@ -1,191 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { validate } from 'uuid';
|
|
8
|
-
import { serializeApiFunction } from '../../../../../../lib/functions/serializeApiFunction';
|
|
9
|
-
import { functionSchema } from '../../../../../../lib/functions/functionSchema';
|
|
10
|
-
import { updateFunction } from '../../../../../../lib/functions/updateFunction';
|
|
11
|
-
export const buildGET = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
12
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
13
|
-
const { assistantId, functionId } = await props.params;
|
|
14
|
-
const headersList = await headers();
|
|
15
|
-
const authorization = headersList.get('authorization');
|
|
16
|
-
if (!authorization) {
|
|
17
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
18
|
-
}
|
|
19
|
-
const privateApiKey = await getApiKey({
|
|
20
|
-
type: ApiKeyType.PRIVATE,
|
|
21
|
-
authorization,
|
|
22
|
-
prisma,
|
|
23
|
-
});
|
|
24
|
-
if (!privateApiKey) {
|
|
25
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
26
|
-
}
|
|
27
|
-
if (!validate(assistantId)) {
|
|
28
|
-
return NextResponse.json({ error: 'Invalid assistant id' }, { status: 400 });
|
|
29
|
-
}
|
|
30
|
-
if (!validate(functionId)) {
|
|
31
|
-
return NextResponse.json({ error: 'Invalid function id' }, { status: 400 });
|
|
32
|
-
}
|
|
33
|
-
const fn = await prisma.function.findFirst({
|
|
34
|
-
where: {
|
|
35
|
-
id: functionId,
|
|
36
|
-
assistant: {
|
|
37
|
-
id: assistantId,
|
|
38
|
-
workspaceId: privateApiKey.workspaceId,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
include: {
|
|
42
|
-
handler: {
|
|
43
|
-
include: {
|
|
44
|
-
requestHandler: true,
|
|
45
|
-
firecrawlHandler: true,
|
|
46
|
-
replicateHandler: true,
|
|
47
|
-
clientToolHandler: true,
|
|
48
|
-
assistantHandler: true,
|
|
49
|
-
createTaskHandler: true,
|
|
50
|
-
listTasksHandler: true,
|
|
51
|
-
updateTaskHandler: true,
|
|
52
|
-
deleteTaskHandler: true,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
if (!fn) {
|
|
58
|
-
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
59
|
-
}
|
|
60
|
-
return NextResponse.json({
|
|
61
|
-
function: serializeApiFunction({ fn }),
|
|
62
|
-
}, { headers: cacheHeaders });
|
|
63
|
-
};
|
|
64
|
-
export const GET = ((...args) => buildGET()(...args));
|
|
65
|
-
export const buildPATCH = ({ prisma: providedPrisma } = {}) => async (request, props) => {
|
|
66
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
67
|
-
const { assistantId, functionId } = await props.params;
|
|
68
|
-
const headersList = await headers();
|
|
69
|
-
const authorization = headersList.get('authorization');
|
|
70
|
-
if (!authorization) {
|
|
71
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
72
|
-
}
|
|
73
|
-
const privateApiKey = await getApiKey({
|
|
74
|
-
authorization,
|
|
75
|
-
type: ApiKeyType.PRIVATE,
|
|
76
|
-
prisma,
|
|
77
|
-
});
|
|
78
|
-
if (!privateApiKey) {
|
|
79
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
80
|
-
}
|
|
81
|
-
if (!validate(assistantId)) {
|
|
82
|
-
return NextResponse.json({ error: 'Invalid assistant id' }, { status: 400 });
|
|
83
|
-
}
|
|
84
|
-
if (!validate(functionId)) {
|
|
85
|
-
return NextResponse.json({ error: 'Invalid function id' }, { status: 400 });
|
|
86
|
-
}
|
|
87
|
-
const body = await request.json();
|
|
88
|
-
const parsed = functionSchema.safeParse(body);
|
|
89
|
-
if (!parsed.success) {
|
|
90
|
-
return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
|
|
91
|
-
}
|
|
92
|
-
const fn = await prisma.function.findFirst({
|
|
93
|
-
where: {
|
|
94
|
-
id: functionId,
|
|
95
|
-
assistant: {
|
|
96
|
-
id: assistantId,
|
|
97
|
-
workspaceId: privateApiKey.workspaceId,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
include: {
|
|
101
|
-
assistant: true,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
if (!fn) {
|
|
105
|
-
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
106
|
-
}
|
|
107
|
-
const updatedFunction = await updateFunction({
|
|
108
|
-
fn,
|
|
109
|
-
parsedInput: parsed.data,
|
|
110
|
-
include: {
|
|
111
|
-
handler: {
|
|
112
|
-
include: {
|
|
113
|
-
requestHandler: true,
|
|
114
|
-
firecrawlHandler: true,
|
|
115
|
-
replicateHandler: true,
|
|
116
|
-
clientToolHandler: true,
|
|
117
|
-
assistantHandler: true,
|
|
118
|
-
createTaskHandler: true,
|
|
119
|
-
listTasksHandler: true,
|
|
120
|
-
updateTaskHandler: true,
|
|
121
|
-
deleteTaskHandler: true,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
prisma,
|
|
126
|
-
});
|
|
127
|
-
return NextResponse.json({
|
|
128
|
-
function: serializeApiFunction({ fn: updatedFunction }),
|
|
129
|
-
}, { headers: cacheHeaders });
|
|
130
|
-
};
|
|
131
|
-
export const PATCH = ((...args) => buildPATCH()(...args));
|
|
132
|
-
export const buildDELETE = ({ prisma: providedPrisma } = {}) => async (_request, props) => {
|
|
133
|
-
const prisma = resolvePrisma(providedPrisma);
|
|
134
|
-
const { assistantId, functionId } = await props.params;
|
|
135
|
-
const headersList = await headers();
|
|
136
|
-
const authorization = headersList.get('authorization');
|
|
137
|
-
if (!authorization) {
|
|
138
|
-
return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
|
|
139
|
-
}
|
|
140
|
-
const privateApiKey = await getApiKey({
|
|
141
|
-
authorization,
|
|
142
|
-
type: ApiKeyType.PRIVATE,
|
|
143
|
-
prisma,
|
|
144
|
-
});
|
|
145
|
-
if (!privateApiKey) {
|
|
146
|
-
return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
|
|
147
|
-
}
|
|
148
|
-
if (!validate(assistantId)) {
|
|
149
|
-
return NextResponse.json({ error: 'Invalid assistant id' }, { status: 400 });
|
|
150
|
-
}
|
|
151
|
-
if (!validate(functionId)) {
|
|
152
|
-
return NextResponse.json({ error: 'Invalid function id' }, { status: 400 });
|
|
153
|
-
}
|
|
154
|
-
const fn = await prisma.function.findFirst({
|
|
155
|
-
where: {
|
|
156
|
-
id: functionId,
|
|
157
|
-
assistant: {
|
|
158
|
-
id: assistantId,
|
|
159
|
-
workspaceId: privateApiKey.workspaceId,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
if (!fn) {
|
|
164
|
-
return NextResponse.json({ error: 'No function found' }, { status: 400 });
|
|
165
|
-
}
|
|
166
|
-
const deletedFunction = await prisma.function.delete({
|
|
167
|
-
where: { id: fn.id },
|
|
168
|
-
include: {
|
|
169
|
-
handler: {
|
|
170
|
-
include: {
|
|
171
|
-
requestHandler: true,
|
|
172
|
-
firecrawlHandler: true,
|
|
173
|
-
replicateHandler: true,
|
|
174
|
-
clientToolHandler: true,
|
|
175
|
-
assistantHandler: true,
|
|
176
|
-
createTaskHandler: true,
|
|
177
|
-
listTasksHandler: true,
|
|
178
|
-
updateTaskHandler: true,
|
|
179
|
-
deleteTaskHandler: true,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
});
|
|
184
|
-
return NextResponse.json({
|
|
185
|
-
mcpServer: serializeApiFunction({ fn: deletedFunction }),
|
|
186
|
-
}, { headers: cacheHeaders });
|
|
187
|
-
};
|
|
188
|
-
export const DELETE = ((...args) => buildDELETE()(...args));
|
|
189
|
-
export const OPTIONS = () => NextResponse.json({}, {
|
|
190
|
-
headers: cacheHeaders,
|
|
191
|
-
});
|
|
1
|
+
import { prisma } from '../../../../../../lib/prisma';
|
|
2
|
+
import { buildDELETE, buildGET, buildOPTIONS, buildPATCH, } from './buildRoute';
|
|
3
|
+
export const GET = buildGET({ prisma });
|
|
4
|
+
export const PATCH = buildPATCH({ prisma });
|
|
5
|
+
export const DELETE = buildDELETE({ prisma });
|
|
6
|
+
export const OPTIONS = buildOPTIONS();
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { type PrismaClient } from '@prisma/client';
|
|
3
|
+
type RouteProps = {
|
|
4
|
+
params: Promise<{
|
|
5
|
+
assistantId: string;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
export declare const buildGET: ({ prisma }: {
|
|
9
|
+
prisma: PrismaClient;
|
|
10
|
+
}) => (_request: NextRequest, props: RouteProps) => Promise<NextResponse<{
|
|
11
|
+
error: string;
|
|
12
|
+
}> | NextResponse<{
|
|
13
|
+
functions: {
|
|
14
|
+
id: string;
|
|
15
|
+
openapiSpec: PrismaJson.OpenapiSpec;
|
|
16
|
+
handler: {
|
|
17
|
+
deleteTaskHandler?: {
|
|
18
|
+
keyTemplate: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
updateTaskHandler?: {
|
|
21
|
+
keyTemplate: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
createTaskHandler?: {
|
|
24
|
+
keyTemplate: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
listTasksHandler?: {
|
|
27
|
+
keyTemplate: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
assistantHandler?: {
|
|
30
|
+
assistantId: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
clientToolHandler?: {
|
|
33
|
+
type: "FUNCTION";
|
|
34
|
+
name: string;
|
|
35
|
+
arguments: PrismaJson.ClientToolHandlerArguments;
|
|
36
|
+
} | undefined;
|
|
37
|
+
replicateHandler?: {
|
|
38
|
+
type: "RUN";
|
|
39
|
+
apiKey: string;
|
|
40
|
+
identifier: string;
|
|
41
|
+
body: PrismaJson.ReplicateHandlerBody;
|
|
42
|
+
} | undefined;
|
|
43
|
+
firecrawlHandler?: {
|
|
44
|
+
type: import("@prisma/client").$Enums.FirecrawlHandlerType;
|
|
45
|
+
apiKey: string;
|
|
46
|
+
body: PrismaJson.FirecrawlHandlerBody;
|
|
47
|
+
} | undefined;
|
|
48
|
+
requestHandler?: {
|
|
49
|
+
url: string;
|
|
50
|
+
method: import("@prisma/client").$Enums.MethodType;
|
|
51
|
+
headers: PrismaJson.RequestHandlerHeaders;
|
|
52
|
+
body: PrismaJson.RequestHandlerBody;
|
|
53
|
+
} | undefined;
|
|
54
|
+
type: import("@prisma/client").$Enums.HandlerType;
|
|
55
|
+
};
|
|
56
|
+
createdAt: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
}[];
|
|
59
|
+
}>>;
|
|
60
|
+
export declare const buildPOST: ({ prisma }: {
|
|
61
|
+
prisma: PrismaClient;
|
|
62
|
+
}) => (request: NextRequest, props: RouteProps) => Promise<NextResponse<{
|
|
63
|
+
error: string;
|
|
64
|
+
}> | NextResponse<{
|
|
65
|
+
function: {
|
|
66
|
+
id: string;
|
|
67
|
+
openapiSpec: PrismaJson.OpenapiSpec;
|
|
68
|
+
handler: {
|
|
69
|
+
deleteTaskHandler?: {
|
|
70
|
+
keyTemplate: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
updateTaskHandler?: {
|
|
73
|
+
keyTemplate: string;
|
|
74
|
+
} | undefined;
|
|
75
|
+
createTaskHandler?: {
|
|
76
|
+
keyTemplate: string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
listTasksHandler?: {
|
|
79
|
+
keyTemplate: string;
|
|
80
|
+
} | undefined;
|
|
81
|
+
assistantHandler?: {
|
|
82
|
+
assistantId: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
clientToolHandler?: {
|
|
85
|
+
type: "FUNCTION";
|
|
86
|
+
name: string;
|
|
87
|
+
arguments: PrismaJson.ClientToolHandlerArguments;
|
|
88
|
+
} | undefined;
|
|
89
|
+
replicateHandler?: {
|
|
90
|
+
type: "RUN";
|
|
91
|
+
apiKey: string;
|
|
92
|
+
identifier: string;
|
|
93
|
+
body: PrismaJson.ReplicateHandlerBody;
|
|
94
|
+
} | undefined;
|
|
95
|
+
firecrawlHandler?: {
|
|
96
|
+
type: import("@prisma/client").$Enums.FirecrawlHandlerType;
|
|
97
|
+
apiKey: string;
|
|
98
|
+
body: PrismaJson.FirecrawlHandlerBody;
|
|
99
|
+
} | undefined;
|
|
100
|
+
requestHandler?: {
|
|
101
|
+
url: string;
|
|
102
|
+
method: import("@prisma/client").$Enums.MethodType;
|
|
103
|
+
headers: PrismaJson.RequestHandlerHeaders;
|
|
104
|
+
body: PrismaJson.RequestHandlerBody;
|
|
105
|
+
} | undefined;
|
|
106
|
+
type: import("@prisma/client").$Enums.HandlerType;
|
|
107
|
+
};
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
};
|
|
111
|
+
}>>;
|
|
112
|
+
export declare const buildOPTIONS: () => () => NextResponse<{}>;
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=buildRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../../../src/app/api/assistants/[assistantId]/functions/buildRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ9D,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,QAAQ,GAClB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,UAAU,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiE9C,CAAA;AAEH,eAAO,MAAM,SAAS,GACnB,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,MAC9B,SAAS,WAAW,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoE7C,CAAA;AAEH,eAAO,MAAM,YAAY,8BAMtB,CAAA"}
|