@superinterface/server 1.0.25 → 1.0.27

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.
Files changed (266) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  5. package/.next/fallback-build-manifest.json +2 -2
  6. package/.next/server/app/_not-found.html +1 -1
  7. package/.next/server/app/_not-found.rsc +1 -1
  8. package/.next/server/app/api/api-keys/[apiKeyId]/route.js +1 -1
  9. package/.next/server/app/api/api-keys/[apiKeyId]/route.js.nft.json +1 -1
  10. package/.next/server/app/api/api-keys/route.js +1 -1
  11. package/.next/server/app/api/api-keys/route.js.nft.json +1 -1
  12. package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js +1 -1
  13. package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js.nft.json +1 -1
  14. package/.next/server/app/api/assistants/[assistantId]/functions/route.js +1 -1
  15. package/.next/server/app/api/assistants/[assistantId]/functions/route.js.nft.json +1 -1
  16. package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js +1 -1
  17. package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js.nft.json +1 -1
  18. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +1 -1
  19. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js.nft.json +1 -1
  20. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js +1 -1
  21. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js.nft.json +1 -1
  22. package/.next/server/app/api/assistants/[assistantId]/route.js +1 -1
  23. package/.next/server/app/api/assistants/[assistantId]/route.js.nft.json +1 -1
  24. package/.next/server/app/api/assistants/route.js +1 -1
  25. package/.next/server/app/api/assistants/route.js.nft.json +1 -1
  26. package/.next/server/app/api/files/[fileId]/contents/route.js +1 -1
  27. package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
  28. package/.next/server/app/api/files/route.js +1 -1
  29. package/.next/server/app/api/files/route.js.nft.json +1 -1
  30. package/.next/server/app/api/messages/route.js +1 -1
  31. package/.next/server/app/api/messages/route.js.nft.json +1 -1
  32. package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js +1 -1
  33. package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js.nft.json +1 -1
  34. package/.next/server/app/api/providers/[modelProviderId]/models/route.js +1 -1
  35. package/.next/server/app/api/providers/[modelProviderId]/models/route.js.nft.json +1 -1
  36. package/.next/server/app/api/providers/[modelProviderId]/route.js +1 -1
  37. package/.next/server/app/api/providers/[modelProviderId]/route.js.nft.json +1 -1
  38. package/.next/server/app/api/providers/route.js +1 -1
  39. package/.next/server/app/api/providers/route.js.nft.json +1 -1
  40. package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  41. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  42. package/.next/server/app/api/tasks/callback/route.js +1 -1
  43. package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
  44. package/.next/server/app/api/tasks/route.js +1 -1
  45. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  46. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js +1 -1
  47. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js.nft.json +1 -1
  48. package/.next/server/app/api/workspaces/[workspaceId]/route.js +1 -1
  49. package/.next/server/app/api/workspaces/[workspaceId]/route.js.nft.json +1 -1
  50. package/.next/server/app/api/workspaces/route.js +1 -1
  51. package/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  52. package/.next/server/app/index.html +1 -1
  53. package/.next/server/app/index.rsc +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js +1 -1
  55. package/.next/server/chunks/[root-of-the-server]__0c1bc5ed._.js.map +1 -1
  56. package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js +1 -1
  57. package/.next/server/chunks/[root-of-the-server]__25ee13bc._.js.map +1 -1
  58. package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js +1 -1
  59. package/.next/server/chunks/[root-of-the-server]__2945c9e9._.js.map +1 -1
  60. package/.next/server/chunks/[root-of-the-server]__29635e8e._.js +1 -1
  61. package/.next/server/chunks/[root-of-the-server]__29635e8e._.js.map +1 -1
  62. package/.next/server/chunks/[root-of-the-server]__315f084a._.js +1 -1
  63. package/.next/server/chunks/[root-of-the-server]__315f084a._.js.map +1 -1
  64. package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js +1 -1
  65. package/.next/server/chunks/[root-of-the-server]__40ab45eb._.js.map +1 -1
  66. package/.next/server/chunks/[root-of-the-server]__441cee00._.js +1 -1
  67. package/.next/server/chunks/[root-of-the-server]__441cee00._.js.map +1 -1
  68. package/.next/server/chunks/[root-of-the-server]__464a4377._.js +1 -1
  69. package/.next/server/chunks/[root-of-the-server]__464a4377._.js.map +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__47b17fad._.js +38 -0
  71. package/.next/server/chunks/[root-of-the-server]__47b17fad._.js.map +1 -0
  72. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js +1 -1
  73. package/.next/server/chunks/[root-of-the-server]__4e536bc0._.js.map +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js +1 -1
  75. package/.next/server/chunks/[root-of-the-server]__583a7f1c._.js.map +1 -1
  76. package/.next/server/chunks/[root-of-the-server]__5abf1160._.js +1 -1
  77. package/.next/server/chunks/[root-of-the-server]__5abf1160._.js.map +1 -1
  78. package/.next/server/chunks/[root-of-the-server]__5d09614a._.js +1 -1
  79. package/.next/server/chunks/[root-of-the-server]__5d09614a._.js.map +1 -1
  80. package/.next/server/chunks/[root-of-the-server]__62d958e7._.js +1 -1
  81. package/.next/server/chunks/[root-of-the-server]__62d958e7._.js.map +1 -1
  82. package/.next/server/chunks/[root-of-the-server]__676affb1._.js +1 -1
  83. package/.next/server/chunks/[root-of-the-server]__676affb1._.js.map +1 -1
  84. package/.next/server/chunks/[root-of-the-server]__83461316._.js +1 -1
  85. package/.next/server/chunks/[root-of-the-server]__83461316._.js.map +1 -1
  86. package/.next/server/chunks/[root-of-the-server]__9a611d42._.js +1 -1
  87. package/.next/server/chunks/[root-of-the-server]__9a611d42._.js.map +1 -1
  88. package/.next/server/chunks/[root-of-the-server]__a878c913._.js +1 -1
  89. package/.next/server/chunks/[root-of-the-server]__a878c913._.js.map +1 -1
  90. package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js +1 -1
  91. package/.next/server/chunks/[root-of-the-server]__b10ec83e._.js.map +1 -1
  92. package/.next/server/chunks/[root-of-the-server]__c1629392._.js +1 -1
  93. package/.next/server/chunks/[root-of-the-server]__c1629392._.js.map +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__eb816e13._.js +1 -1
  95. package/.next/server/chunks/[root-of-the-server]__eb816e13._.js.map +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__f6f61507._.js +38 -0
  97. package/.next/server/chunks/[root-of-the-server]__f6f61507._.js.map +1 -0
  98. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js +1 -1
  99. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_cb746cf4.js.map +1 -1
  100. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js +1 -1
  101. package/.next/server/chunks/c4f00_next_dist_esm_build_templates_app-route_f952d9ab.js.map +1 -1
  102. package/.next/server/functions-config-manifest.json +1 -8
  103. package/.next/server/pages/404.html +1 -1
  104. package/.next/server/pages/500.html +1 -1
  105. package/.next/trace +1 -1
  106. package/dist/app/api/api-keys/[apiKeyId]/buildRoute.d.ts +52 -0
  107. package/dist/app/api/api-keys/[apiKeyId]/buildRoute.d.ts.map +1 -0
  108. package/dist/app/api/api-keys/[apiKeyId]/buildRoute.js +121 -0
  109. package/dist/app/api/api-keys/[apiKeyId]/route.d.ts +10 -21
  110. package/dist/app/api/api-keys/[apiKeyId]/route.d.ts.map +1 -1
  111. package/dist/app/api/api-keys/[apiKeyId]/route.js +6 -125
  112. package/dist/app/api/api-keys/buildRoute.d.ts +32 -0
  113. package/dist/app/api/api-keys/buildRoute.d.ts.map +1 -0
  114. package/dist/app/api/api-keys/buildRoute.js +104 -0
  115. package/dist/app/api/api-keys/builders.d.ts +31 -0
  116. package/dist/app/api/api-keys/builders.d.ts.map +1 -0
  117. package/dist/app/api/api-keys/builders.js +109 -0
  118. package/dist/app/api/api-keys/route.d.ts +5 -13
  119. package/dist/app/api/api-keys/route.d.ts.map +1 -1
  120. package/dist/app/api/api-keys/route.js +8 -108
  121. package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts +120 -0
  122. package/dist/app/api/assistants/[assistantId]/buildRoute.d.ts.map +1 -0
  123. package/dist/app/api/assistants/[assistantId]/buildRoute.js +226 -0
  124. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts +167 -0
  125. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.d.ts.map +1 -0
  126. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/buildRoute.js +184 -0
  127. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts +10 -21
  128. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.d.ts.map +1 -1
  129. package/dist/app/api/assistants/[assistantId]/functions/[functionId]/route.js +6 -191
  130. package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts +114 -0
  131. package/dist/app/api/assistants/[assistantId]/functions/buildRoute.d.ts.map +1 -0
  132. package/dist/app/api/assistants/[assistantId]/functions/buildRoute.js +117 -0
  133. package/dist/app/api/assistants/[assistantId]/functions/route.d.ts +7 -15
  134. package/dist/app/api/assistants/[assistantId]/functions/route.d.ts.map +1 -1
  135. package/dist/app/api/assistants/[assistantId]/functions/route.js +5 -122
  136. package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts +40 -0
  137. package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.d.ts.map +1 -0
  138. package/dist/app/api/assistants/[assistantId]/initial-messages/buildRoute.js +85 -0
  139. package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts +7 -15
  140. package/dist/app/api/assistants/[assistantId]/initial-messages/route.d.ts.map +1 -1
  141. package/dist/app/api/assistants/[assistantId]/initial-messages/route.js +5 -90
  142. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts +89 -0
  143. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.d.ts.map +1 -0
  144. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/buildRoute.js +167 -0
  145. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts +10 -21
  146. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.d.ts.map +1 -1
  147. package/dist/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +6 -174
  148. package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts +62 -0
  149. package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.d.ts.map +1 -0
  150. package/dist/app/api/assistants/[assistantId]/mcp-servers/buildRoute.js +115 -0
  151. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts +7 -15
  152. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.d.ts.map +1 -1
  153. package/dist/app/api/assistants/[assistantId]/mcp-servers/route.js +5 -120
  154. package/dist/app/api/assistants/[assistantId]/route.d.ts +11 -22
  155. package/dist/app/api/assistants/[assistantId]/route.d.ts.map +1 -1
  156. package/dist/app/api/assistants/[assistantId]/route.js +6 -233
  157. package/dist/app/api/assistants/buildRoute.d.ts +121 -0
  158. package/dist/app/api/assistants/buildRoute.d.ts.map +1 -0
  159. package/dist/app/api/assistants/buildRoute.js +144 -0
  160. package/dist/app/api/assistants/route.d.ts +7 -13
  161. package/dist/app/api/assistants/route.d.ts.map +1 -1
  162. package/dist/app/api/assistants/route.js +6 -148
  163. package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts +18 -0
  164. package/dist/app/api/files/[fileId]/contents/buildRoute.d.ts.map +1 -0
  165. package/dist/app/api/files/[fileId]/contents/buildRoute.js +81 -0
  166. package/dist/app/api/files/[fileId]/contents/route.d.ts +3 -13
  167. package/dist/app/api/files/[fileId]/contents/route.d.ts.map +1 -1
  168. package/dist/app/api/files/[fileId]/contents/route.js +4 -84
  169. package/dist/app/api/files/buildRoute.d.ts +14 -0
  170. package/dist/app/api/files/buildRoute.d.ts.map +1 -0
  171. package/dist/app/api/files/buildRoute.js +88 -0
  172. package/dist/app/api/files/route.d.ts +4 -10
  173. package/dist/app/api/files/route.d.ts.map +1 -1
  174. package/dist/app/api/files/route.js +4 -91
  175. package/dist/app/api/messages/buildRoute.d.ts +34 -0
  176. package/dist/app/api/messages/buildRoute.d.ts.map +1 -0
  177. package/dist/app/api/messages/buildRoute.js +607 -0
  178. package/dist/app/api/messages/lib/initialMessagesResponse.d.ts.map +1 -1
  179. package/dist/app/api/messages/lib/initialMessagesResponse.js +1 -1
  180. package/dist/app/api/messages/route.d.ts +10 -22
  181. package/dist/app/api/messages/route.d.ts.map +1 -1
  182. package/dist/app/api/messages/route.js +6 -612
  183. package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts +24 -0
  184. package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.d.ts.map +1 -0
  185. package/dist/app/api/providers/[modelProviderId]/assistants/buildRoute.js +43 -0
  186. package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts +4 -9
  187. package/dist/app/api/providers/[modelProviderId]/assistants/route.d.ts.map +1 -1
  188. package/dist/app/api/providers/[modelProviderId]/assistants/route.js +4 -46
  189. package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts +61 -0
  190. package/dist/app/api/providers/[modelProviderId]/buildRoute.d.ts.map +1 -0
  191. package/dist/app/api/providers/[modelProviderId]/buildRoute.js +134 -0
  192. package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts +19 -0
  193. package/dist/app/api/providers/[modelProviderId]/models/buildRoute.d.ts.map +1 -0
  194. package/dist/app/api/providers/[modelProviderId]/models/buildRoute.js +43 -0
  195. package/dist/app/api/providers/[modelProviderId]/models/route.d.ts +4 -9
  196. package/dist/app/api/providers/[modelProviderId]/models/route.d.ts.map +1 -1
  197. package/dist/app/api/providers/[modelProviderId]/models/route.js +4 -46
  198. package/dist/app/api/providers/[modelProviderId]/route.d.ts +10 -21
  199. package/dist/app/api/providers/[modelProviderId]/route.d.ts.map +1 -1
  200. package/dist/app/api/providers/[modelProviderId]/route.js +6 -141
  201. package/dist/app/api/providers/buildRoute.d.ts +38 -0
  202. package/dist/app/api/providers/buildRoute.d.ts.map +1 -0
  203. package/dist/app/api/providers/buildRoute.js +75 -0
  204. package/dist/app/api/providers/route.d.ts +5 -13
  205. package/dist/app/api/providers/route.d.ts.map +1 -1
  206. package/dist/app/api/providers/route.js +5 -80
  207. package/dist/app/api/tasks/[taskId]/buildRoute.d.ts +19 -0
  208. package/dist/app/api/tasks/[taskId]/buildRoute.d.ts.map +1 -0
  209. package/dist/app/api/tasks/[taskId]/buildRoute.js +125 -0
  210. package/dist/app/api/tasks/[taskId]/route.d.ts +7 -57
  211. package/dist/app/api/tasks/[taskId]/route.d.ts.map +1 -1
  212. package/dist/app/api/tasks/[taskId]/route.js +6 -144
  213. package/dist/app/api/tasks/buildRoute.d.ts +36 -0
  214. package/dist/app/api/tasks/buildRoute.d.ts.map +1 -0
  215. package/dist/app/api/tasks/buildRoute.js +85 -0
  216. package/dist/app/api/tasks/callback/buildRoute.d.ts +6 -0
  217. package/dist/app/api/tasks/callback/buildRoute.d.ts.map +1 -0
  218. package/dist/app/api/tasks/callback/buildRoute.js +244 -0
  219. package/dist/app/api/tasks/callback/route.d.ts +2 -1
  220. package/dist/app/api/tasks/callback/route.d.ts.map +1 -1
  221. package/dist/app/api/tasks/callback/route.js +4 -244
  222. package/dist/app/api/tasks/route.d.ts +5 -13
  223. package/dist/app/api/tasks/route.d.ts.map +1 -1
  224. package/dist/app/api/tasks/route.js +5 -90
  225. package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts +10 -0
  226. package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.d.ts.map +1 -0
  227. package/dist/app/api/threads/runs/submit-client-tool-outputs/buildRoute.js +36 -0
  228. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts +2 -7
  229. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.d.ts.map +1 -1
  230. package/dist/app/api/threads/runs/submit-client-tool-outputs/route.js +3 -37
  231. package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts +16 -0
  232. package/dist/app/api/workspaces/[workspaceId]/buildRoute.d.ts.map +1 -0
  233. package/dist/app/api/workspaces/[workspaceId]/buildRoute.js +89 -0
  234. package/dist/app/api/workspaces/[workspaceId]/route.d.ts +5 -31
  235. package/dist/app/api/workspaces/[workspaceId]/route.d.ts.map +1 -1
  236. package/dist/app/api/workspaces/[workspaceId]/route.js +5 -89
  237. package/dist/app/api/workspaces/buildRoute.d.ts +42 -0
  238. package/dist/app/api/workspaces/buildRoute.d.ts.map +1 -0
  239. package/dist/app/api/workspaces/buildRoute.js +78 -0
  240. package/dist/app/api/workspaces/route.d.ts +7 -27
  241. package/dist/app/api/workspaces/route.d.ts.map +1 -1
  242. package/dist/app/api/workspaces/route.js +6 -82
  243. package/dist/lib/functions/functionSchema.d.ts +56 -56
  244. package/dist/lib/functions/handleFunction/getFunction.d.ts +4 -4
  245. package/dist/lib/mcpServers/mcpServerSchema.d.ts +20 -20
  246. package/dist/lib/prisma/index.d.ts +1 -9
  247. package/dist/lib/prisma/index.d.ts.map +1 -1
  248. package/dist/lib/prisma/index.js +10 -78
  249. package/package.json +4 -12
  250. package/.next/server/chunks/[root-of-the-server]__228bff78._.js +0 -38
  251. package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +0 -1
  252. package/.next/server/chunks/[root-of-the-server]__3307123c._.js +0 -38
  253. package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +0 -1
  254. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +0 -38
  255. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +0 -1
  256. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +0 -38
  257. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +0 -1
  258. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +0 -38
  259. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +0 -1
  260. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +0 -38
  261. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +0 -1
  262. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +0 -38
  263. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +0 -1
  264. /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → iaWEclnh6aHcuw0CBnWpA}/_buildManifest.js +0 -0
  265. /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → iaWEclnh6aHcuw0CBnWpA}/_clientMiddlewareManifest.json +0 -0
  266. /package/.next/static/{jt8inwg6nWaLQZ4qpiSJ- → iaWEclnh6aHcuw0CBnWpA}/_ssgManifest.js +0 -0
@@ -0,0 +1,85 @@
1
+ import { headers } from 'next/headers';
2
+ import { ApiKeyType } from '@prisma/client';
3
+ import { NextResponse } from 'next/server';
4
+ import { createTaskSchema } from '../../../lib/tasks/schemas';
5
+ import { cacheHeaders } from '../../../lib/cache/cacheHeaders';
6
+ import { serializeTask } from '../../../lib/tasks/serializeTask';
7
+ import { validateSchedule } from '../../../lib/tasks/validateSchedule';
8
+ import { getApiKey } from '../../../lib/apiKeys/getApiKey';
9
+ import { scheduleTask } from '../../../lib/tasks/scheduleTask';
10
+ export const buildGET = ({ prisma }) => async (request) => {
11
+ const headersList = await headers();
12
+ const authorization = headersList.get('authorization');
13
+ if (!authorization) {
14
+ return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
15
+ }
16
+ const privateApiKey = await getApiKey({
17
+ authorization,
18
+ type: ApiKeyType.PRIVATE,
19
+ prisma,
20
+ });
21
+ if (!privateApiKey) {
22
+ return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
23
+ }
24
+ const key = request.nextUrl.searchParams.get('key');
25
+ const tasks = await prisma.task.findMany({
26
+ where: Object.assign(Object.assign({}, (key ? { key } : {})), { thread: { assistant: { workspaceId: privateApiKey.workspaceId } } }),
27
+ orderBy: { createdAt: 'desc' },
28
+ });
29
+ return NextResponse.json({
30
+ tasks: tasks.map((t) => serializeTask({ task: t })),
31
+ }, { headers: cacheHeaders });
32
+ };
33
+ export const buildPOST = ({ prisma }) => async (request) => {
34
+ var _a;
35
+ const headersList = await headers();
36
+ const authorization = headersList.get('authorization');
37
+ if (!authorization) {
38
+ return NextResponse.json({ error: 'No authorization header found' }, { status: 400 });
39
+ }
40
+ const privateApiKey = await getApiKey({
41
+ authorization,
42
+ type: ApiKeyType.PRIVATE,
43
+ prisma,
44
+ });
45
+ if (!privateApiKey) {
46
+ return NextResponse.json({ error: 'Invalid api key' }, { status: 400 });
47
+ }
48
+ const parsed = createTaskSchema.safeParse(await request.json());
49
+ if (!parsed.success) {
50
+ return NextResponse.json({ error: 'Invalid payload' }, { status: 400 });
51
+ }
52
+ const { title, message, schedule, threadId } = parsed.data;
53
+ if (!validateSchedule(schedule)) {
54
+ return NextResponse.json({ error: 'Invalid schedule' }, { status: 400 });
55
+ }
56
+ const thread = await prisma.thread.findFirst({
57
+ where: {
58
+ id: threadId,
59
+ assistant: {
60
+ workspaceId: privateApiKey.workspaceId,
61
+ },
62
+ },
63
+ });
64
+ if (!thread) {
65
+ return NextResponse.json({ error: 'Thread not found' }, { status: 400 });
66
+ }
67
+ const task = await prisma.task.create({
68
+ data: {
69
+ title,
70
+ message,
71
+ schedule,
72
+ thread: {
73
+ connect: { id: thread.id },
74
+ },
75
+ key: (_a = parsed.data.key) !== null && _a !== void 0 ? _a : '',
76
+ },
77
+ });
78
+ await scheduleTask({ task, prisma });
79
+ return NextResponse.json({
80
+ task: serializeTask({ task }),
81
+ }, { headers: cacheHeaders });
82
+ };
83
+ export const buildOPTIONS = () => () => NextResponse.json({}, {
84
+ headers: cacheHeaders,
85
+ });
@@ -0,0 +1,6 @@
1
+ import { type PrismaClient } from '@prisma/client';
2
+ export declare const maxDuration = 800;
3
+ export declare const buildPOST: ({ prisma }: {
4
+ prisma: PrismaClient;
5
+ }) => (request: import("next/server").NextRequest | Request, params?: any) => Promise<Response>;
6
+ //# sourceMappingURL=buildRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildRoute.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/tasks/callback/buildRoute.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAA;AAYvB,eAAO,MAAM,WAAW,MAAM,CAAA;AA+Q9B,eAAO,MAAM,SAAS,GAAI,YAAY;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,8FAO7D,CAAA"}
@@ -0,0 +1,244 @@
1
+ import { NextResponse } from 'next/server';
2
+ import { verifySignatureAppRouter } from '@upstash/qstash/nextjs';
3
+ import { createMessageResponse } from '@superinterface/react/server';
4
+ import { LogRequestMethod, LogRequestRoute, LogLevel, } from '@prisma/client';
5
+ import { assistantClientAdapter } from '../../../../lib/assistants/assistantClientAdapter';
6
+ import { createRunOpts } from '../../../../lib/runs/createRunOpts';
7
+ import { scheduleTask } from '../../../../lib/tasks/scheduleTask';
8
+ import { handleToolCall } from '../../../../lib/toolCalls/handleToolCall';
9
+ import { createLog } from '../../../../lib/logs/createLog';
10
+ import { storageThreadId as getStorageThreadId } from '../../../../lib/threads/storageThreadId';
11
+ import { redis } from '../../../../lib/redis';
12
+ import { isOpenaiAssistantsStorageProvider } from '../../../../lib/storageProviders/isOpenaiAssistantsStorageProvider';
13
+ import { managedOpenaiThreadId } from '../../../../lib/threads/managedOpenaiThreadId';
14
+ import { serializeMetadata } from '../../../../lib/metadata/serializeMetadata';
15
+ export const maxDuration = 800;
16
+ const buildPostHandler = ({ prisma }) => async (request) => {
17
+ var _a, _b;
18
+ const { taskId } = await request.json();
19
+ const task = await prisma.task.findUnique({
20
+ where: { id: taskId },
21
+ include: {
22
+ thread: {
23
+ include: {
24
+ assistant: {
25
+ include: {
26
+ modelProvider: true,
27
+ tools: {
28
+ include: {
29
+ fileSearchTool: true,
30
+ webSearchTool: true,
31
+ imageGenerationTool: true,
32
+ codeInterpreterTool: true,
33
+ computerUseTool: {
34
+ include: {
35
+ mcpServer: {
36
+ include: {
37
+ stdioTransport: true,
38
+ sseTransport: true,
39
+ httpTransport: true,
40
+ },
41
+ },
42
+ },
43
+ },
44
+ },
45
+ },
46
+ functions: {
47
+ include: {
48
+ handler: {
49
+ include: {
50
+ requestHandler: true,
51
+ firecrawlHandler: true,
52
+ replicateHandler: true,
53
+ clientToolHandler: true,
54
+ assistantHandler: true,
55
+ createTaskHandler: true,
56
+ listTasksHandler: true,
57
+ updateTaskHandler: true,
58
+ deleteTaskHandler: true,
59
+ },
60
+ },
61
+ },
62
+ },
63
+ mcpServers: {
64
+ include: {
65
+ computerUseTool: true,
66
+ stdioTransport: true,
67
+ sseTransport: true,
68
+ httpTransport: true,
69
+ },
70
+ },
71
+ },
72
+ },
73
+ },
74
+ },
75
+ },
76
+ });
77
+ if (!task) {
78
+ return NextResponse.json({ error: 'Task not found' }, { status: 400 });
79
+ }
80
+ const assistant = task.thread.assistant;
81
+ const thread = task.thread;
82
+ const assistantClient = assistantClientAdapter({ assistant, prisma });
83
+ let storageThreadId;
84
+ try {
85
+ storageThreadId = getStorageThreadId({
86
+ thread,
87
+ });
88
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
89
+ }
90
+ catch (error) {
91
+ createLog({
92
+ log: {
93
+ requestMethod: LogRequestMethod.POST,
94
+ requestRoute: LogRequestRoute.MESSAGES,
95
+ level: LogLevel.ERROR,
96
+ status: 500,
97
+ message: 'Failed to get storage thread id.',
98
+ workspaceId: assistant.workspaceId,
99
+ assistantId: assistant.id,
100
+ threadId: thread.id,
101
+ },
102
+ prisma,
103
+ });
104
+ return NextResponse.json({ error: 'Failed to get storage thread id.' }, { status: 500 });
105
+ }
106
+ if (!storageThreadId &&
107
+ isOpenaiAssistantsStorageProvider({
108
+ storageProviderType: assistant.storageProviderType,
109
+ })) {
110
+ try {
111
+ storageThreadId = await managedOpenaiThreadId({
112
+ assistant,
113
+ threadId: thread.id,
114
+ prisma,
115
+ });
116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
+ }
118
+ catch (error) {
119
+ createLog({
120
+ log: {
121
+ requestMethod: LogRequestMethod.POST,
122
+ requestRoute: LogRequestRoute.MESSAGES,
123
+ level: LogLevel.ERROR,
124
+ status: 500,
125
+ message: `Failed to get managed openai thread id: ${error.message}`,
126
+ workspaceId: assistant.workspaceId,
127
+ assistantId: assistant.id,
128
+ threadId: thread.id,
129
+ },
130
+ prisma,
131
+ });
132
+ return NextResponse.json({ error: 'Failed to get managed openai thread id.' }, { status: 500 });
133
+ }
134
+ }
135
+ if (!storageThreadId) {
136
+ createLog({
137
+ log: {
138
+ requestMethod: LogRequestMethod.POST,
139
+ requestRoute: LogRequestRoute.MESSAGES,
140
+ level: LogLevel.ERROR,
141
+ status: 500,
142
+ message: 'Invalid thread configuration.',
143
+ workspaceId: assistant.workspaceId,
144
+ assistantId: assistant.id,
145
+ threadId: thread.id,
146
+ },
147
+ prisma,
148
+ });
149
+ return NextResponse.json({ error: 'Invalid thread configuration.' }, { status: 500 });
150
+ }
151
+ try {
152
+ await assistantClient.beta.threads.messages.create(storageThreadId, {
153
+ role: 'user',
154
+ content: task.message,
155
+ metadata: serializeMetadata({
156
+ variables: {
157
+ superinterfaceCreatedByType: 'TASK',
158
+ superinterfaceCreatedById: task.id,
159
+ },
160
+ workspaceId: assistant.workspaceId,
161
+ prisma,
162
+ }),
163
+ });
164
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
165
+ }
166
+ catch (error) {
167
+ console.log({ error });
168
+ createLog({
169
+ log: {
170
+ requestMethod: LogRequestMethod.POST,
171
+ requestRoute: LogRequestRoute.MESSAGES,
172
+ level: LogLevel.ERROR,
173
+ status: 500,
174
+ message: `Failed to create message: ${error.message}`,
175
+ workspaceId: assistant.workspaceId,
176
+ assistantId: assistant.id,
177
+ threadId: thread.id,
178
+ },
179
+ prisma,
180
+ });
181
+ return NextResponse.json({ error: 'Failed to create message' }, { status: 500 });
182
+ }
183
+ let createRunStream;
184
+ try {
185
+ createRunStream = await assistantClient.beta.threads.runs.create(storageThreadId, await createRunOpts({ assistant, thread, prisma }));
186
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
187
+ }
188
+ catch (error) {
189
+ console.log({ error });
190
+ createLog({
191
+ log: {
192
+ requestMethod: LogRequestMethod.POST,
193
+ requestRoute: LogRequestRoute.MESSAGES,
194
+ level: LogLevel.ERROR,
195
+ status: 500,
196
+ message: `Failed to create run stream: ${error.message}`,
197
+ workspaceId: assistant.workspaceId,
198
+ assistantId: assistant.id,
199
+ threadId: thread.id,
200
+ },
201
+ prisma,
202
+ });
203
+ return NextResponse.json({ error: 'Failed to create run stream' }, { status: 500 });
204
+ }
205
+ const messageResponse = createMessageResponse({
206
+ client: assistantClient,
207
+ createRunStream,
208
+ handleToolCall: handleToolCall({ assistant, thread, prisma }),
209
+ });
210
+ const decoder = new TextDecoder();
211
+ const reader = messageResponse.getReader();
212
+ while (true) {
213
+ const { value, done } = await reader.read();
214
+ if (done)
215
+ break;
216
+ if (!value)
217
+ continue;
218
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
+ let event;
220
+ try {
221
+ event = JSON.parse(decoder.decode(value));
222
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
223
+ }
224
+ catch (e) {
225
+ continue;
226
+ }
227
+ if (event.event === 'thread.run.requires_action' &&
228
+ ((_b = (_a = event.data) === null || _a === void 0 ? void 0 : _a.required_action) === null || _b === void 0 ? void 0 : _b.type) === 'submit_client_tool_outputs') {
229
+ const toolCalls = event.data.required_action.submit_client_tool_outputs.tool_calls;
230
+ if (Array.isArray(toolCalls)) {
231
+ await Promise.all(toolCalls.map((toolCall) => redis.set(`submit-client-tool-outputs:output:${toolCall.id}`, 'Client tools cannot be used during tasks', { ex: 60 * 60 * 24 * 7 })));
232
+ }
233
+ }
234
+ }
235
+ await scheduleTask({ task, prisma });
236
+ return NextResponse.json({ ok: true });
237
+ };
238
+ export const buildPOST = ({ prisma }) => {
239
+ const postHandler = buildPostHandler({ prisma });
240
+ return process.env.NODE_ENV === 'test' ||
241
+ !process.env.QSTASH_CURRENT_SIGNING_KEY
242
+ ? postHandler
243
+ : verifySignatureAppRouter(postHandler);
244
+ };
@@ -1,3 +1,4 @@
1
- export declare const maxDuration = 800;
1
+ import { maxDuration } from './buildRoute';
2
+ export { maxDuration };
2
3
  export declare const POST: (request: import("next/server").NextRequest | Request, params?: any) => Promise<Response>;
3
4
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/tasks/callback/route.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,WAAW,MAAM,CAAA;AAgR9B,eAAO,MAAM,IAAI,2FAG0B,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/app/api/tasks/callback/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,WAAW,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,eAAO,MAAM,IAAI,2FAAwB,CAAA"}
@@ -1,244 +1,4 @@
1
- import { NextResponse } from 'next/server';
2
- import { verifySignatureAppRouter } from '@upstash/qstash/nextjs';
3
- import { createMessageResponse } from '@superinterface/react/server';
4
- import { LogRequestMethod, LogRequestRoute, LogLevel, } from '@prisma/client';
5
- import { resolvePrisma } from '../../../../lib/prisma';
6
- import { assistantClientAdapter } from '../../../../lib/assistants/assistantClientAdapter';
7
- import { createRunOpts } from '../../../../lib/runs/createRunOpts';
8
- import { scheduleTask } from '../../../../lib/tasks/scheduleTask';
9
- import { handleToolCall } from '../../../../lib/toolCalls/handleToolCall';
10
- import { createLog } from '../../../../lib/logs/createLog';
11
- import { storageThreadId as getStorageThreadId } from '../../../../lib/threads/storageThreadId';
12
- import { redis } from '../../../../lib/redis';
13
- import { isOpenaiAssistantsStorageProvider } from '../../../../lib/storageProviders/isOpenaiAssistantsStorageProvider';
14
- import { managedOpenaiThreadId } from '../../../../lib/threads/managedOpenaiThreadId';
15
- import { serializeMetadata } from '../../../../lib/metadata/serializeMetadata';
16
- export const maxDuration = 800;
17
- const buildPostHandler = ({ prisma: providedPrisma } = {}) => async (request) => {
18
- var _a, _b;
19
- const prisma = resolvePrisma(providedPrisma);
20
- const { taskId } = await request.json();
21
- const task = await prisma.task.findUnique({
22
- where: { id: taskId },
23
- include: {
24
- thread: {
25
- include: {
26
- assistant: {
27
- include: {
28
- modelProvider: true,
29
- tools: {
30
- include: {
31
- fileSearchTool: true,
32
- webSearchTool: true,
33
- imageGenerationTool: true,
34
- codeInterpreterTool: true,
35
- computerUseTool: {
36
- include: {
37
- mcpServer: {
38
- include: {
39
- stdioTransport: true,
40
- sseTransport: true,
41
- httpTransport: true,
42
- },
43
- },
44
- },
45
- },
46
- },
47
- },
48
- functions: {
49
- include: {
50
- handler: {
51
- include: {
52
- requestHandler: true,
53
- firecrawlHandler: true,
54
- replicateHandler: true,
55
- clientToolHandler: true,
56
- assistantHandler: true,
57
- createTaskHandler: true,
58
- listTasksHandler: true,
59
- updateTaskHandler: true,
60
- deleteTaskHandler: true,
61
- },
62
- },
63
- },
64
- },
65
- mcpServers: {
66
- include: {
67
- computerUseTool: true,
68
- stdioTransport: true,
69
- sseTransport: true,
70
- httpTransport: true,
71
- },
72
- },
73
- },
74
- },
75
- },
76
- },
77
- },
78
- });
79
- if (!task) {
80
- return NextResponse.json({ error: 'Task not found' }, { status: 400 });
81
- }
82
- const assistant = task.thread.assistant;
83
- const thread = task.thread;
84
- const assistantClient = assistantClientAdapter({ assistant, prisma });
85
- let storageThreadId;
86
- try {
87
- storageThreadId = getStorageThreadId({
88
- thread,
89
- });
90
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
91
- }
92
- catch (error) {
93
- createLog({
94
- log: {
95
- requestMethod: LogRequestMethod.POST,
96
- requestRoute: LogRequestRoute.MESSAGES,
97
- level: LogLevel.ERROR,
98
- status: 500,
99
- message: 'Failed to get storage thread id.',
100
- workspaceId: assistant.workspaceId,
101
- assistantId: assistant.id,
102
- threadId: thread.id,
103
- },
104
- prisma,
105
- });
106
- return NextResponse.json({ error: 'Failed to get storage thread id.' }, { status: 500 });
107
- }
108
- if (!storageThreadId &&
109
- isOpenaiAssistantsStorageProvider({
110
- storageProviderType: assistant.storageProviderType,
111
- })) {
112
- try {
113
- storageThreadId = await managedOpenaiThreadId({
114
- assistant,
115
- threadId: thread.id,
116
- prisma,
117
- });
118
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
119
- }
120
- catch (error) {
121
- createLog({
122
- log: {
123
- requestMethod: LogRequestMethod.POST,
124
- requestRoute: LogRequestRoute.MESSAGES,
125
- level: LogLevel.ERROR,
126
- status: 500,
127
- message: `Failed to get managed openai thread id: ${error.message}`,
128
- workspaceId: assistant.workspaceId,
129
- assistantId: assistant.id,
130
- threadId: thread.id,
131
- },
132
- prisma,
133
- });
134
- return NextResponse.json({ error: 'Failed to get managed openai thread id.' }, { status: 500 });
135
- }
136
- }
137
- if (!storageThreadId) {
138
- createLog({
139
- log: {
140
- requestMethod: LogRequestMethod.POST,
141
- requestRoute: LogRequestRoute.MESSAGES,
142
- level: LogLevel.ERROR,
143
- status: 500,
144
- message: 'Invalid thread configuration.',
145
- workspaceId: assistant.workspaceId,
146
- assistantId: assistant.id,
147
- threadId: thread.id,
148
- },
149
- prisma,
150
- });
151
- return NextResponse.json({ error: 'Invalid thread configuration.' }, { status: 500 });
152
- }
153
- try {
154
- await assistantClient.beta.threads.messages.create(storageThreadId, {
155
- role: 'user',
156
- content: task.message,
157
- metadata: serializeMetadata({
158
- variables: {
159
- superinterfaceCreatedByType: 'TASK',
160
- superinterfaceCreatedById: task.id,
161
- },
162
- workspaceId: assistant.workspaceId,
163
- prisma,
164
- }),
165
- });
166
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
167
- }
168
- catch (error) {
169
- console.log({ error });
170
- createLog({
171
- log: {
172
- requestMethod: LogRequestMethod.POST,
173
- requestRoute: LogRequestRoute.MESSAGES,
174
- level: LogLevel.ERROR,
175
- status: 500,
176
- message: `Failed to create message: ${error.message}`,
177
- workspaceId: assistant.workspaceId,
178
- assistantId: assistant.id,
179
- threadId: thread.id,
180
- },
181
- prisma,
182
- });
183
- return NextResponse.json({ error: 'Failed to create message' }, { status: 500 });
184
- }
185
- let createRunStream;
186
- try {
187
- createRunStream = await assistantClient.beta.threads.runs.create(storageThreadId, await createRunOpts({ assistant, thread, prisma }));
188
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
- }
190
- catch (error) {
191
- console.log({ error });
192
- createLog({
193
- log: {
194
- requestMethod: LogRequestMethod.POST,
195
- requestRoute: LogRequestRoute.MESSAGES,
196
- level: LogLevel.ERROR,
197
- status: 500,
198
- message: `Failed to create run stream: ${error.message}`,
199
- workspaceId: assistant.workspaceId,
200
- assistantId: assistant.id,
201
- threadId: thread.id,
202
- },
203
- prisma,
204
- });
205
- return NextResponse.json({ error: 'Failed to create run stream' }, { status: 500 });
206
- }
207
- const messageResponse = createMessageResponse({
208
- client: assistantClient,
209
- createRunStream,
210
- handleToolCall: handleToolCall({ assistant, thread, prisma }),
211
- });
212
- const decoder = new TextDecoder();
213
- const reader = messageResponse.getReader();
214
- while (true) {
215
- const { value, done } = await reader.read();
216
- if (done)
217
- break;
218
- if (!value)
219
- continue;
220
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
221
- let event;
222
- try {
223
- event = JSON.parse(decoder.decode(value));
224
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
225
- }
226
- catch (e) {
227
- continue;
228
- }
229
- if (event.event === 'thread.run.requires_action' &&
230
- ((_b = (_a = event.data) === null || _a === void 0 ? void 0 : _a.required_action) === null || _b === void 0 ? void 0 : _b.type) === 'submit_client_tool_outputs') {
231
- await Promise.all(event.data.required_action.submit_client_tool_outputs.tool_calls.map(
232
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
233
- async (toolCall) => {
234
- await redis.set(`submit-client-tool-outputs:output:${toolCall.id}`, 'Client tools cannot be used during tasks', { ex: 60 * 60 * 24 * 7 });
235
- }));
236
- }
237
- }
238
- await scheduleTask({ task, prisma });
239
- return NextResponse.json({ ok: true });
240
- };
241
- const postHandler = buildPostHandler();
242
- export const POST = process.env.NODE_ENV === 'test' || !process.env.QSTASH_CURRENT_SIGNING_KEY
243
- ? postHandler
244
- : verifySignatureAppRouter(postHandler);
1
+ import { prisma } from '../../../../lib/prisma';
2
+ import { buildPOST, maxDuration } from './buildRoute';
3
+ export { maxDuration };
4
+ export const POST = buildPOST({ prisma });
@@ -1,10 +1,6 @@
1
- import { type PrismaClient } from '@prisma/client';
2
- import { NextResponse, type NextRequest } from 'next/server';
3
- export declare const buildGET: ({ prisma: providedPrisma }?: {
4
- prisma?: PrismaClient;
5
- }) => (request: NextRequest) => Promise<NextResponse<{
1
+ export declare const GET: (request: import("next/server").NextRequest) => Promise<import("next/server").NextResponse<{
6
2
  error: string;
7
- }> | NextResponse<{
3
+ }> | import("next/server").NextResponse<{
8
4
  tasks: {
9
5
  id: string;
10
6
  title: string;
@@ -16,12 +12,9 @@ export declare const buildGET: ({ prisma: providedPrisma }?: {
16
12
  updatedAt: string;
17
13
  }[];
18
14
  }>>;
19
- export declare const GET: ReturnType<typeof buildGET>;
20
- export declare const buildPOST: ({ prisma: providedPrisma }?: {
21
- prisma?: PrismaClient;
22
- }) => (request: NextRequest) => Promise<NextResponse<{
15
+ export declare const POST: (request: import("next/server").NextRequest) => Promise<import("next/server").NextResponse<{
23
16
  error: string;
24
- }> | NextResponse<{
17
+ }> | import("next/server").NextResponse<{
25
18
  task: {
26
19
  id: string;
27
20
  title: string;
@@ -33,6 +26,5 @@ export declare const buildPOST: ({ prisma: providedPrisma }?: {
33
26
  updatedAt: string;
34
27
  };
35
28
  }>>;
36
- export declare const POST: ReturnType<typeof buildPOST>;
37
- export declare const OPTIONS: () => NextResponse<{}>;
29
+ export declare const OPTIONS: () => import("next/server").NextResponse<{}>;
38
30
  //# sourceMappingURL=route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/tasks/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAS5D,eAAO,MAAM,QAAQ,GAClB,6BAA4B;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,MACpD,SAAS,WAAW;;;;;;;;;;;;;GAqC1B,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,MACpD,SAAS,WAAW;;;;;;;;;;;;;GAkE1B,CAAA;AAEH,eAAO,MAAM,IAAI,EACU,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvD,eAAO,MAAM,OAAO,wBAMjB,CAAA"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/app/api/tasks/route.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG;;;;;;;;;;;;;GAAuB,CAAA;AAEvC,eAAO,MAAM,IAAI;;;;;;;;;;;;;GAAwB,CAAA;AAEzC,eAAO,MAAM,OAAO,8CAAiB,CAAA"}