Consolidate more extension API structs that were duplicated btwn client and server (#9797)

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld 2024-03-25 21:28:18 -07:00 committed by GitHub
parent 5e7fcc02fa
commit b0409ddd68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 47 deletions

View file

@ -1,10 +1,11 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct ExtensionApiManifest {
pub name: String,
pub version: String,
pub version: Arc<str>,
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
@ -12,11 +13,16 @@ pub struct ExtensionApiManifest {
pub wasm_api_version: Option<String>,
}
#[derive(Debug, Serialize, PartialEq)]
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct ExtensionMetadata {
pub id: String,
pub id: Arc<str>,
#[serde(flatten)]
pub manifest: ExtensionApiManifest,
pub published_at: DateTime<Utc>,
pub download_count: u64,
}
#[derive(Serialize, Deserialize)]
pub struct GetExtensionsResponse {
pub data: Vec<ExtensionMetadata>,
}