feat: add challenge and red-blue competitions across API and web

This commit is contained in:
Joey Yakimowich-Payne 2025-10-01 06:49:09 -06:00
commit 8fd3c4bb64
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
77 changed files with 5355 additions and 24 deletions

View file

@ -0,0 +1,27 @@
import { request } from '@/service/base'
export type ConsoleRedBlueChallenge = {
id: string
name: string
description?: string
is_active?: boolean
}
export async function listConsoleRedBlueChallenges() {
const resp = await request<{ data: ConsoleRedBlueChallenge[] }>('/red-blue-challenges', {}, {})
return resp.data
}
export async function createConsoleRedBlueChallenge(payload: {
tenant_id: string
app_id: string
name: string
description?: string
judge_suite: Record<string, any>
}) {
const resp = await request<{ data: { id: string } }>('/red-blue-challenges', {
method: 'POST',
body: JSON.stringify(payload),
}, {})
return resp.data
}