rive_models/core.rs
1use serde::Deserialize;
2
3/// Revolt instance configuration
4#[derive(Deserialize, Debug, Clone)]
5pub struct InstanceConfiguration {
6 /// Revolt API version
7 pub revolt: String,
8
9 /// Features enabled on this Revolt node
10 pub features: InstanceFeatures,
11
12 /// WebSocket URL
13 pub ws: String,
14
15 /// URL pointing to the client serving this node
16 pub app: String,
17
18 /// Web Push VAPID public key
19 pub vapid: String,
20
21 /// Build information
22 pub build: BuildInformation,
23}
24
25/// Features enabled on this Revolt node
26#[derive(Deserialize, Debug, Clone)]
27pub struct InstanceFeatures {
28 /// hCaptcha configuration
29 pub captcha: CaptchaConfiguration,
30
31 /// Whether email verification is enabled
32 pub email: bool,
33
34 /// Whether this instance is invite only
35 pub invite_only: bool,
36
37 /// File server service configuration
38 pub autumn: AutumnConfiguration,
39
40 /// Proxy server configuration
41 pub january: JanuaryConfiguration,
42
43 /// Voice server configuration
44 pub voso: VosoConfiguration,
45}
46
47/// hCaptcha configuration
48#[derive(Deserialize, Debug, Clone)]
49pub struct CaptchaConfiguration {
50 /// Whether captcha is enabled
51 pub enabled: bool,
52
53 /// Client key used for solving captcha
54 pub key: String,
55}
56
57/// File server service configuration
58#[derive(Deserialize, Debug, Clone)]
59pub struct AutumnConfiguration {
60 /// Whether the service is enabled
61 pub enabled: bool,
62
63 /// URL pointing to this service
64 pub url: String,
65}
66
67/// Proxy server configuration
68#[derive(Deserialize, Debug, Clone)]
69pub struct JanuaryConfiguration {
70 /// Whether the service is enabled
71 pub enabled: bool,
72
73 /// URL pointing to this service
74 pub url: String,
75}
76
77/// Voice server configuration
78#[derive(Deserialize, Debug, Clone)]
79pub struct VosoConfiguration {
80 /// Whether the service is enabled
81 pub enabled: bool,
82
83 /// URL pointing to the voice API
84 pub url: String,
85
86 /// URL pointing to the voice WebSocket server
87 pub ws: String,
88}
89
90/// Build information
91#[derive(Deserialize, Debug, Clone)]
92pub struct BuildInformation {
93 /// Commit hash
94 pub commit_sha: String,
95
96 /// Commit timestamp
97 pub commit_timestamp: String,
98
99 /// Git semver
100 pub semver: String,
101
102 /// Git origin URL
103 pub origin_url: String,
104
105 /// Build timestamp
106 pub timestamp: String,
107}