-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/fragments-endpoints
- Loading branch information
Showing
53 changed files
with
735 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//! Implementation of the GET /vote/active/plans endpoint | ||
use std::sync::Arc; | ||
|
||
use poem::web::Data; | ||
use poem_extensions::{response, UniResponse::T200}; | ||
use poem_openapi::payload::Json; | ||
|
||
use crate::{ | ||
service::common::{ | ||
objects::vote_plan::VotePlan, | ||
responses::{ | ||
resp_2xx::OK, | ||
resp_5xx::{ServerError, ServiceUnavailable}, | ||
}, | ||
}, | ||
state::State, | ||
}; | ||
|
||
/// All responses | ||
pub(crate) type AllResponses = response! { | ||
200: OK<Json<Vec<VotePlan>>>, | ||
500: ServerError, | ||
503: ServiceUnavailable, | ||
}; | ||
|
||
/// GET /v0/vote/active/plans | ||
/// | ||
/// Get all active vote plans endpoint. | ||
/// | ||
/// ## Responses | ||
/// | ||
/// * 200 with a JSON array with the list of vote plans with their respective data. | ||
/// * 500 Server Error - If anything within this function fails unexpectedly. (Possible | ||
/// but unlikely) | ||
/// * 503 Service Unavailable - Service has not started, do not send other requests. | ||
#[allow(clippy::unused_async)] | ||
pub(crate) async fn endpoint(_state: Data<&Arc<State>>) -> AllResponses { | ||
// otherwise everything seems to be A-OK | ||
T200(OK(Json(Vec::new()))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
catalyst-gateway/bin/src/service/common/objects/vote_plan.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! Define the Vote Plan | ||
use poem_openapi::{types::Example, Object}; | ||
|
||
/// Vote Plan | ||
#[derive(Object)] | ||
#[oai(example = true)] | ||
pub(crate) struct VotePlan { | ||
/// Voting token identifier | ||
#[oai(validator( | ||
max_length = 121, | ||
min_length = 59, | ||
pattern = r"[0-9a-f]{56}\.[0-9a-f]{2,64}" | ||
))] | ||
voting_token: String, | ||
} | ||
|
||
impl Example for VotePlan { | ||
fn example() -> Self { | ||
Self { | ||
voting_token: | ||
"134c2d0a0b5761445d3f2d08492a5c193e3a19194453511426153630.0418401957301613" | ||
.to_string(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import 'package:catalyst_voices/app/app.dart'; | ||
import 'package:catalyst_voices/bootstrap.dart'; | ||
|
||
void main() { | ||
bootstrap(() => const App()); | ||
void main() async { | ||
await bootstrap(() => const App()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import 'package:catalyst_voices/app/app.dart'; | ||
import 'package:catalyst_voices/bootstrap.dart'; | ||
|
||
void main() { | ||
bootstrap(() => const App()); | ||
void main() async { | ||
await bootstrap(() => const App()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import 'package:catalyst_voices/app/app.dart'; | ||
import 'package:catalyst_voices/bootstrap.dart'; | ||
|
||
void main() { | ||
bootstrap(() => const App()); | ||
void main() async { | ||
await bootstrap(() => const App()); | ||
} |
Empty file.
43 changes: 43 additions & 0 deletions
43
catalyst_voices/packages/catalyst_voices_assets/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# VSCode related | ||
.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
pubspec.lock | ||
|
||
# Web related | ||
lib/generated_plugin_registrant.dart | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Test related | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Catalyst Voices Assets | ||
|
||
```sh | ||
dart run build_runner build | ||
``` |
12 changes: 12 additions & 0 deletions
12
catalyst_voices/packages/catalyst_voices_assets/assets/colors/colors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="white">#FFFFFF</color> | ||
<color name="dark_background ">#000000</color> | ||
<color name="purple">#512DA8</color> | ||
<color name="purple_gradient_start">#673AB7</color> | ||
<color name="purple_gradient_stop">#512DA8</color> | ||
<color name="dark_card">#222126</color> | ||
<color name="green">#7CAE7A</color> | ||
<color name="red">#B02E0C</color> | ||
<color name="today">#565656</color> | ||
</resources> |
Binary file added
BIN
+1.74 MB
catalyst_voices/packages/catalyst_voices_assets/assets/fonts/SF-Pro-Rounded-Regular.ttf
Binary file not shown.
Binary file added
BIN
+47 KB
catalyst_voices/packages/catalyst_voices_assets/assets/images/dummy_catalyst_voices.webp
Binary file not shown.
43 changes: 43 additions & 0 deletions
43
catalyst_voices/packages/catalyst_voices_assets/example/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio will place build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release |
30 changes: 30 additions & 0 deletions
30
catalyst_voices/packages/catalyst_voices_assets/example/.metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" | ||
channel: "stable" | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a | ||
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a | ||
- platform: web | ||
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a | ||
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
Oops, something went wrong.