feat: add interactive api docs, rewrite run endpoint with hono and zod validator

This commit is contained in:
BennyKok
2024-01-09 14:00:16 +08:00
parent e921d4c320
commit 7d36f8af88
11 changed files with 756 additions and 190 deletions
+1 -23
View File
@@ -20,29 +20,7 @@ export async function getRunsOutput(run_id: string) {
export async function getRunsData(user: APIKeyUserType, run_id: string) {
const data = await db.query.workflowRunsTable.findFirst({
where: and(
eq(workflowRunsTable.id, run_id)
// inArray(
// workflowRunsTable.workflow_id,
// db
// .select({
// id: workflowTable.id,
// })
// .from(workflowTable)
// .innerJoin(
// workflowRunsTable,
// eq(workflowTable.id, workflowRunsTable.workflow_id)
// )
// .where(
// and(
// eq(workflowTable.id, workflowRunsTable.workflow_id),
// user.org_id
// ? eq(workflowTable.org_id, user.org_id)
// : eq(workflowTable.user_id, user.user_id!)
// )
// )
// )
),
where: and(eq(workflowRunsTable.id, run_id)),
with: {
workflow: {
columns: {