refactor: rename rfs-client to sal-rfs-client and integrate with workspace dependencies
This commit is contained in:
		| @@ -1,18 +1,21 @@ | ||||
| [package] | ||||
| name = "rfs-client" | ||||
| name = "sal-rfs-client" | ||||
| version = "0.1.0" | ||||
| edition = "2021" | ||||
| description = "Client library for RFS (Remote File System) server" | ||||
| license = "MIT" | ||||
| description = "SAL RFS Client - Client library for Remote File System server" | ||||
| repository = "https://git.threefold.info/herocode/sal" | ||||
| license = "Apache-2.0" | ||||
| keywords = ["rfs", "client", "filesystem", "remote"] | ||||
| categories = ["filesystem", "api-bindings"] | ||||
|  | ||||
| [dependencies] | ||||
| openapi = { path = "./openapi" } | ||||
| thiserror = "1.0" | ||||
| url = "2.4" | ||||
| reqwest = { version = "^0.12", features = ["json", "multipart"] } | ||||
| tokio = { version = "1.28", features = ["full"] } | ||||
| serde = { version = "1.0", features = ["derive"] } | ||||
| serde_json = "1.0" | ||||
| log = "0.4" | ||||
| bytes = "1.4" | ||||
| futures = "0.3" | ||||
| thiserror.workspace = true | ||||
| url.workspace = true | ||||
| reqwest = { workspace = true, features = ["json", "multipart"] } | ||||
| tokio = { workspace = true, features = ["full"] } | ||||
| serde = { workspace = true, features = ["derive"] } | ||||
| serde_json.workspace = true | ||||
| log.workspace = true | ||||
| bytes.workspace = true | ||||
| futures.workspace = true | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| use rfs_client::RfsClient; | ||||
| use rfs_client::types::{ClientConfig, Credentials}; | ||||
| use sal_rfs_client::RfsClient; | ||||
| use sal_rfs_client::types::{ClientConfig, Credentials}; | ||||
|  | ||||
| #[tokio::main] | ||||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| use rfs_client::RfsClient; | ||||
| use rfs_client::types::{ClientConfig, Credentials}; | ||||
| use sal_rfs_client::RfsClient; | ||||
| use sal_rfs_client::types::{ClientConfig, Credentials}; | ||||
| use openapi::models::{VerifyBlock, VerifyBlocksRequest}; | ||||
|  | ||||
| #[tokio::main] | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| use rfs_client::RfsClient; | ||||
| use rfs_client::types::{ClientConfig, Credentials, UploadOptions, DownloadOptions}; | ||||
| use sal_rfs_client::RfsClient; | ||||
| use sal_rfs_client::types::{ClientConfig, Credentials, UploadOptions, DownloadOptions}; | ||||
|  | ||||
| #[tokio::main] | ||||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| use rfs_client::RfsClient; | ||||
| use rfs_client::types::{ClientConfig, Credentials, FlistOptions, WaitOptions}; | ||||
| use std::path::Path; | ||||
| use sal_rfs_client::RfsClient; | ||||
| use sal_rfs_client::types::{ClientConfig, Credentials, FlistOptions, WaitOptions}; | ||||
|  | ||||
| #[tokio::main] | ||||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| use rfs_client::RfsClient; | ||||
| use rfs_client::types::{ClientConfig, Credentials, WaitOptions}; | ||||
| use sal_rfs_client::RfsClient; | ||||
| use sal_rfs_client::types::{ClientConfig, Credentials, WaitOptions}; | ||||
| use openapi::models::FlistState; | ||||
|  | ||||
| #[tokio::main] | ||||
|   | ||||
| @@ -1,3 +0,0 @@ | ||||
| [toolchain] | ||||
| channel = "1.82.0" | ||||
|  | ||||
| @@ -12,8 +12,8 @@ use openapi::{ | ||||
|     }, | ||||
|     models::{ | ||||
|         SignInBody, ListBlocksParams, | ||||
|         VerifyBlocksRequest, VerifyBlocksResponse, VerifyBlock, FlistBody, UserBlocksResponse, BlockDownloadsResponse, | ||||
|         BlocksResponse, PreviewResponse, FileInfo, FlistState, ResponseResult, FlistStateResponse, BlockUploadedResponse, FileUploadResponse, | ||||
|         VerifyBlocksRequest, VerifyBlocksResponse, FlistBody, UserBlocksResponse, BlockDownloadsResponse, | ||||
|         BlocksResponse, PreviewResponse, FileInfo, FlistState, FlistStateResponse, | ||||
|     }, | ||||
| }; | ||||
|  | ||||
| @@ -122,12 +122,7 @@ impl RfsClient { | ||||
|             .map_err(map_openapi_error)?; | ||||
|          | ||||
|         // Extract the file hash from the response | ||||
|         match result { | ||||
|             FileUploadResponse { file_hash, .. } => { | ||||
|                 Ok(file_hash.clone()) | ||||
|             }, | ||||
|             _ => Err(RfsError::Other("Unexpected response type from file upload".to_string())), | ||||
|         } | ||||
|         Ok(result.file_hash.clone()) | ||||
|     } | ||||
|  | ||||
|     /// Download a file from the RFS server | ||||
|   | ||||
		Reference in New Issue
	
	Block a user