chore: update to gitea-client
This commit is contained in:
parent
1f5ad2a216
commit
1a2958a6e3
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -719,9 +719,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64"
|
checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gitea-rs"
|
name = "gitea-client"
|
||||||
version = "1.22.1"
|
version = "1.22.1"
|
||||||
source = "git+https://git.front.kjuulh.io/kjuulh/gitea-rs#6eb4cea5c16d85d32555cea10dc55c045231ca10"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2c0b6c1b9c7d3b54eff20e6741c82c88f5b25b6469807a306f2e0756e17b2e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
@ -743,7 +744,7 @@ dependencies = [
|
|||||||
"dirs 5.0.1",
|
"dirs 5.0.1",
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"futures",
|
"futures",
|
||||||
"gitea-rs",
|
"gitea-client",
|
||||||
"nucleo-matcher",
|
"nucleo-matcher",
|
||||||
"octocrab",
|
"octocrab",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
|
@ -23,7 +23,7 @@ uuid = { version = "1.7.0", features = ["v4"] }
|
|||||||
async-trait = "0.1.82"
|
async-trait = "0.1.82"
|
||||||
toml = "0.8.19"
|
toml = "0.8.19"
|
||||||
|
|
||||||
gitea-rs = { git = "https://git.front.kjuulh.io/kjuulh/gitea-rs", version = "1.22.1" }
|
gitea-client = { version = "1.22.1" }
|
||||||
url = "2.5.2"
|
url = "2.5.2"
|
||||||
octocrab = "0.39.0"
|
octocrab = "0.39.0"
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use gitea_rs::apis::configuration::Configuration;
|
use gitea_client::apis::configuration::Configuration;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{app::App, config::GiteaAccessToken};
|
use crate::{app::App, config::GiteaAccessToken};
|
||||||
@ -68,9 +68,9 @@ impl GiteaProvider {
|
|||||||
&self,
|
&self,
|
||||||
config: &Configuration,
|
config: &Configuration,
|
||||||
page: usize,
|
page: usize,
|
||||||
) -> anyhow::Result<Vec<gitea_rs::models::Repository>> {
|
) -> anyhow::Result<Vec<gitea_client::models::Repository>> {
|
||||||
let repos =
|
let repos =
|
||||||
gitea_rs::apis::user_api::user_current_list_repos(config, Some(page as i32), None)
|
gitea_client::apis::user_api::user_current_list_repos(config, Some(page as i32), None)
|
||||||
.await
|
.await
|
||||||
.context("failed to fetch repos for users")?;
|
.context("failed to fetch repos for users")?;
|
||||||
|
|
||||||
@ -125,9 +125,9 @@ impl GiteaProvider {
|
|||||||
user: &str,
|
user: &str,
|
||||||
config: &Configuration,
|
config: &Configuration,
|
||||||
page: usize,
|
page: usize,
|
||||||
) -> anyhow::Result<Vec<gitea_rs::models::Repository>> {
|
) -> anyhow::Result<Vec<gitea_client::models::Repository>> {
|
||||||
let repos =
|
let repos =
|
||||||
gitea_rs::apis::user_api::user_list_repos(config, user, Some(page as i32), None)
|
gitea_client::apis::user_api::user_list_repos(config, user, Some(page as i32), None)
|
||||||
.await
|
.await
|
||||||
.context("failed to fetch repos for users")?;
|
.context("failed to fetch repos for users")?;
|
||||||
|
|
||||||
@ -184,8 +184,8 @@ impl GiteaProvider {
|
|||||||
organisation: &str,
|
organisation: &str,
|
||||||
config: &Configuration,
|
config: &Configuration,
|
||||||
page: usize,
|
page: usize,
|
||||||
) -> anyhow::Result<Vec<gitea_rs::models::Repository>> {
|
) -> anyhow::Result<Vec<gitea_client::models::Repository>> {
|
||||||
let repos = gitea_rs::apis::organization_api::org_list_repos(
|
let repos = gitea_client::apis::organization_api::org_list_repos(
|
||||||
config,
|
config,
|
||||||
organisation,
|
organisation,
|
||||||
Some(page as i32),
|
Some(page as i32),
|
||||||
@ -202,7 +202,7 @@ impl GiteaProvider {
|
|||||||
api: &str,
|
api: &str,
|
||||||
access_token: Option<&GiteaAccessToken>,
|
access_token: Option<&GiteaAccessToken>,
|
||||||
) -> anyhow::Result<Configuration> {
|
) -> anyhow::Result<Configuration> {
|
||||||
let mut config = gitea_rs::apis::configuration::Configuration::new();
|
let mut config = gitea_client::apis::configuration::Configuration::new();
|
||||||
config.base_path = api.into();
|
config.base_path = api.into();
|
||||||
match access_token {
|
match access_token {
|
||||||
Some(GiteaAccessToken::Env { env }) => {
|
Some(GiteaAccessToken::Env { env }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user