feat: use livekit compatible root schema

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2025-04-26 00:59:01 +02:00
parent e91652cb78
commit 88619b044a
1 changed files with 23 additions and 11 deletions

View File

@ -18,36 +18,48 @@ data class Root(
@Serializable @Serializable
data class Features( data class Features(
val captcha: CAPTCHA, val captcha: CAPTCHAFeature,
val email: Boolean, val email: Boolean,
@SerialName("invite_only") val inviteOnly: Boolean,
@SerialName("invite_only") val autumn: AutumnJanuaryFeature,
val inviteOnly: Boolean, val january: AutumnJanuaryFeature,
val voso: LegacyVoiceFeature? = null,
val autumn: Autumn, val livekit: LiveKitFeature? = null,
val january: Autumn,
val voso: Voso
) )
@Serializable @Serializable
data class Autumn( data class AutumnJanuaryFeature(
val enabled: Boolean, val enabled: Boolean,
val url: String val url: String
) )
@Serializable @Serializable
data class CAPTCHA( data class CAPTCHAFeature(
val enabled: Boolean, val enabled: Boolean,
val key: String val key: String
) )
@Serializable @Serializable
data class Voso( data class LegacyVoiceFeature(
val enabled: Boolean, val enabled: Boolean,
val url: String, val url: String,
val ws: String val ws: String
) )
@Serializable
data class LiveKitFeature(
val enabled: Boolean,
val nodes: List<LiveKitNode>
)
@Serializable
data class LiveKitNode(
val name: String,
val lat: Double,
val lon: Double,
@SerialName("public_url") val publicUrl: String,
)
suspend fun getRootRoute(): Root { suspend fun getRootRoute(): Root {
return RevoltHttp.get("/".api()).body() return RevoltHttp.get("/".api()).body()
} }