switch all FE to camelCase (#2576)

* switch all fe to camelCase

* switch to camelCase on backend

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2024-03-24 12:05:59 -06:00
committed by GitHub
parent b14646ebd9
commit c782bab296
173 changed files with 749 additions and 1901 deletions

View File

@@ -26,7 +26,7 @@ pub struct ActionResultV0 {
} }
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum DockerStatus { pub enum DockerStatus {
Running, Running,
Stopped, Stopped,
@@ -48,7 +48,7 @@ pub fn display_action_result(params: WithIoFormat<ActionParams>, result: ActionR
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ActionParams { pub struct ActionParams {
#[arg(id = "id")] #[arg(id = "id")]

View File

@@ -127,7 +127,7 @@ fn gen_pwd() {
) )
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct CliLoginParams { pub struct CliLoginParams {
password: Option<PasswordType>, password: Option<PasswordType>,
@@ -179,7 +179,7 @@ pub fn check_password_against_db(db: &DatabaseModel, password: &str) -> Result<(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LoginParams { pub struct LoginParams {
password: Option<PasswordType>, password: Option<PasswordType>,
@@ -220,7 +220,7 @@ pub async fn login_impl(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LogoutParams { pub struct LogoutParams {
session: InternedString, session: InternedString,
@@ -236,7 +236,7 @@ pub async fn logout(
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Session { pub struct Session {
pub logged_in: DateTime<Utc>, pub logged_in: DateTime<Utc>,
pub last_active: DateTime<Utc>, pub last_active: DateTime<Utc>,
@@ -245,7 +245,7 @@ pub struct Session {
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SessionList { pub struct SessionList {
current: InternedString, current: InternedString,
sessions: Sessions, sessions: Sessions,
@@ -305,7 +305,7 @@ fn display_sessions(params: WithIoFormat<ListParams>, arg: SessionList) {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ListParams { pub struct ListParams {
#[arg(skip)] #[arg(skip)]
@@ -340,7 +340,7 @@ impl AsLogoutSessionId for KillSessionId {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct KillParams { pub struct KillParams {
ids: Vec<String>, ids: Vec<String>,
@@ -353,12 +353,10 @@ pub async fn kill(ctx: RpcContext, KillParams { ids }: KillParams) -> Result<(),
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ResetPasswordParams { pub struct ResetPasswordParams {
#[arg(name = "old-password")]
old_password: Option<PasswordType>, old_password: Option<PasswordType>,
#[arg(name = "new-password")]
new_password: Option<PasswordType>, new_password: Option<PasswordType>,
} }

View File

@@ -30,7 +30,7 @@ use crate::util::serde::IoFormat;
use crate::version::VersionT; use crate::version::VersionT;
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct BackupParams { pub struct BackupParams {
target_id: BackupTargetId, target_id: BackupTargetId,

View File

@@ -25,7 +25,7 @@ use crate::service::service_map::DownloadInstallFuture;
use crate::util::serde::IoFormat; use crate::util::serde::IoFormat;
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct RestorePackageParams { pub struct RestorePackageParams {
pub ids: Vec<PackageId>, pub ids: Vec<PackageId>,

View File

@@ -36,7 +36,7 @@ impl Map for CifsTargets {
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct CifsBackupTarget { pub struct CifsBackupTarget {
hostname: String, hostname: String,
path: PathBuf, path: PathBuf,
@@ -68,7 +68,7 @@ pub fn cifs() -> ParentHandler {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct AddParams { pub struct AddParams {
pub hostname: String, pub hostname: String,
@@ -122,7 +122,7 @@ pub async fn add(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UpdateParams { pub struct UpdateParams {
pub id: BackupTargetId, pub id: BackupTargetId,
@@ -186,7 +186,7 @@ pub async fn update(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct RemoveParams { pub struct RemoveParams {
pub id: BackupTargetId, pub id: BackupTargetId,

View File

@@ -34,9 +34,9 @@ pub mod cifs;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum BackupTarget { pub enum BackupTarget {
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Disk { Disk {
vendor: Option<String>, vendor: Option<String>,
model: Option<String>, model: Option<String>,
@@ -109,7 +109,7 @@ impl Serialize for BackupTargetId {
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum BackupTargetFS { pub enum BackupTargetFS {
Disk(BlockDev<PathBuf>), Disk(BlockDev<PathBuf>),
Cifs(Cifs), Cifs(Cifs),
@@ -190,7 +190,7 @@ pub async fn list(ctx: RpcContext) -> Result<BTreeMap<BackupTargetId, BackupTarg
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct BackupInfo { pub struct BackupInfo {
pub version: Version, pub version: Version,
pub timestamp: Option<DateTime<Utc>>, pub timestamp: Option<DateTime<Utc>>,
@@ -198,7 +198,7 @@ pub struct BackupInfo {
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct PackageBackupInfo { pub struct PackageBackupInfo {
pub title: String, pub title: String,
pub version: Version, pub version: Version,
@@ -243,7 +243,7 @@ fn display_backup_info(params: WithIoFormat<InfoParams>, info: BackupInfo) {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct InfoParams { pub struct InfoParams {
target_id: BackupTargetId, target_id: BackupTargetId,
@@ -277,7 +277,7 @@ lazy_static::lazy_static! {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct MountParams { pub struct MountParams {
target_id: BackupTargetId, target_id: BackupTargetId,
@@ -312,7 +312,7 @@ pub async fn mount(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UmountParams { pub struct UmountParams {
target_id: Option<BackupTargetId>, target_id: Option<BackupTargetId>,

View File

@@ -9,14 +9,14 @@ use crate::prelude::*;
use crate::status::health_check::HealthCheckId; use crate::status::health_check::HealthCheckId;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct ConfigRes { pub struct ConfigRes {
pub config: Option<Config>, pub config: Option<Config>,
pub spec: ConfigSpec, pub spec: ConfigSpec,
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SetResult { pub struct SetResult {
pub depends_on: BTreeMap<PackageId, BTreeSet<HealthCheckId>>, pub depends_on: BTreeMap<PackageId, BTreeSet<HealthCheckId>>,
} }

View File

@@ -126,7 +126,7 @@ pub enum MatchError {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ConfigParams { pub struct ConfigParams {
pub id: PackageId, pub id: PackageId,
@@ -157,7 +157,7 @@ pub async fn get(ctx: RpcContext, _: Empty, id: PackageId) -> Result<ConfigRes,
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SetParams { pub struct SetParams {
#[arg(long = "timeout")] #[arg(long = "timeout")]
pub timeout: Option<crate::util::serde::Duration>, pub timeout: Option<crate::util::serde::Duration>,

View File

@@ -28,7 +28,7 @@ lazy_static::lazy_static! {
} }
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SetupResult { pub struct SetupResult {
pub tor_address: String, pub tor_address: String,
pub lan_address: String, pub lan_address: String,

View File

@@ -10,7 +10,7 @@ use crate::prelude::*;
use crate::Error; use crate::Error;
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ControlParams { pub struct ControlParams {
pub id: PackageId, pub id: PackageId,

View File

@@ -183,7 +183,7 @@ pub enum RevisionsRes {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct CliDumpParams { pub struct CliDumpParams {
#[arg(long = "include-private", short = 'p')] #[arg(long = "include-private", short = 'p')]
@@ -216,7 +216,7 @@ async fn cli_dump(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct DumpParams { pub struct DumpParams {
#[arg(long = "include-private", short = 'p')] #[arg(long = "include-private", short = 'p')]
@@ -272,7 +272,7 @@ async fn cli_apply(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ApplyParams { pub struct ApplyParams {
expr: String, expr: String,
@@ -310,7 +310,7 @@ pub fn put() -> ParentHandler {
) )
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UiParams { pub struct UiParams {
pointer: JsonPointer, pointer: JsonPointer,

View File

@@ -20,7 +20,7 @@ pub mod private;
pub mod public; pub mod public;
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct Database { pub struct Database {
pub public: Public, pub public: Public,

View File

@@ -35,7 +35,7 @@ pub enum ManifestPreference {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[serde(tag = "state")] #[serde(tag = "state")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub enum PackageState { pub enum PackageState {
@@ -257,14 +257,14 @@ impl Model<PackageState> {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct InstallingState { pub struct InstallingState {
pub installing_info: InstallingInfo, pub installing_info: InstallingInfo,
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct UpdatingState { pub struct UpdatingState {
pub manifest: Manifest, pub manifest: Manifest,
@@ -272,14 +272,14 @@ pub struct UpdatingState {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct InstalledState { pub struct InstalledState {
pub manifest: Manifest, pub manifest: Manifest,
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct InstallingInfo { pub struct InstallingInfo {
pub new_manifest: Manifest, pub new_manifest: Manifest,
@@ -287,7 +287,7 @@ pub struct InstallingInfo {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct PackageDataEntry { pub struct PackageDataEntry {
pub state_info: PackageState, pub state_info: PackageState,
@@ -405,7 +405,7 @@ impl Map for CurrentDependencies {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct StaticDependencyInfo { pub struct StaticDependencyInfo {
pub title: String, pub title: String,
@@ -413,11 +413,11 @@ pub struct StaticDependencyInfo {
} }
#[derive(Clone, Debug, Deserialize, Serialize, TS)] #[derive(Clone, Debug, Deserialize, Serialize, TS)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[serde(tag = "kind")] #[serde(tag = "kind")]
pub enum CurrentDependencyInfo { pub enum CurrentDependencyInfo {
Exists, Exists,
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Running { Running {
#[serde(default)] #[serde(default)]
health_checks: BTreeSet<HealthCheckId>, health_checks: BTreeSet<HealthCheckId>,
@@ -438,7 +438,7 @@ impl Map for InterfaceAddressMap {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct InterfaceAddresses { pub struct InterfaceAddresses {
pub tor_address: Option<String>, pub tor_address: Option<String>,

View File

@@ -14,7 +14,7 @@ use crate::ssh::SshKeys;
use crate::util::serde::Pem; use crate::util::serde::Pem;
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct Private { pub struct Private {
pub key_store: KeyStore, pub key_store: KeyStore,

View File

@@ -24,7 +24,7 @@ use crate::version::{Current, VersionT};
use crate::{ARCH, PLATFORM}; use crate::{ARCH, PLATFORM};
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
// #[macro_debug] // #[macro_debug]
pub struct Public { pub struct Public {
@@ -102,7 +102,7 @@ fn get_platform() -> InternedString {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct ServerInfo { pub struct ServerInfo {
#[serde(default = "get_arch")] #[serde(default = "get_arch")]
@@ -137,7 +137,7 @@ pub struct ServerInfo {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct IpInfo { pub struct IpInfo {
pub ipv4_range: Option<Ipv4Net>, pub ipv4_range: Option<Ipv4Net>,
@@ -165,7 +165,7 @@ pub struct BackupProgress {
} }
#[derive(Debug, Default, Deserialize, Serialize, HasModel)] #[derive(Debug, Default, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct ServerStatus { pub struct ServerStatus {
pub backup_progress: Option<BTreeMap<PackageId, BackupProgress>>, pub backup_progress: Option<BTreeMap<PackageId, BackupProgress>>,
@@ -178,7 +178,7 @@ pub struct ServerStatus {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct UpdateProgress { pub struct UpdateProgress {
pub size: Option<u64>, pub size: Option<u64>,
@@ -186,7 +186,7 @@ pub struct UpdateProgress {
} }
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct WifiInfo { pub struct WifiInfo {
pub ssids: Vec<String>, pub ssids: Vec<String>,
@@ -195,7 +195,7 @@ pub struct WifiInfo {
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct ServerSpecs { pub struct ServerSpecs {
pub cpu: String, pub cpu: String,
pub disk: String, pub disk: String,
@@ -203,7 +203,7 @@ pub struct ServerSpecs {
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct ConnectionAddresses { pub struct ConnectionAddresses {
pub tor: Vec<String>, pub tor: Vec<String>,
pub clearnet: Vec<String>, pub clearnet: Vec<String>,

View File

@@ -36,7 +36,7 @@ impl Map for Dependencies {
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[serde(tag = "type")] #[serde(tag = "type")]
pub enum DependencyRequirement { pub enum DependencyRequirement {
OptIn { how: String }, OptIn { how: String },
@@ -50,7 +50,7 @@ impl DependencyRequirement {
} }
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] #[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct DepInfo { pub struct DepInfo {
pub version: VersionRange, pub version: VersionRange,
@@ -61,12 +61,10 @@ pub struct DepInfo {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ConfigureParams { pub struct ConfigureParams {
#[arg(name = "dependent-id")]
dependent_id: PackageId, dependent_id: PackageId,
#[arg(name = "dependency-id")]
dependency_id: PackageId, dependency_id: PackageId,
} }
pub fn configure() -> ParentHandler<ConfigureParams> { pub fn configure() -> ParentHandler<ConfigureParams> {
@@ -111,7 +109,7 @@ pub async fn configure_impl(
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct ConfigDryRes { pub struct ConfigDryRes {
pub old_config: Config, pub old_config: Config,
pub new_config: Config, pub new_config: Config,

View File

@@ -41,7 +41,7 @@ pub fn error(ctx: DiagnosticContext) -> Result<Arc<RpcError>, Error> {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LogsParams { pub struct LogsParams {
limit: Option<usize>, limit: Option<usize>,

View File

@@ -17,7 +17,7 @@ pub const BOOT_RW_PATH: &str = "/media/boot-rw";
pub const REPAIR_DISK_PATH: &str = "/media/embassy/config/repair-disk"; pub const REPAIR_DISK_PATH: &str = "/media/embassy/config/repair-disk";
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct OsPartitionInfo { pub struct OsPartitionInfo {
pub efi: Option<PathBuf>, pub efi: Option<PathBuf>,
pub bios: Option<PathBuf>, pub bios: Option<PathBuf>,

View File

@@ -10,7 +10,7 @@ use super::FileSystem;
use crate::prelude::*; use crate::prelude::*;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct BlockDev<LogicalName: AsRef<Path>> { pub struct BlockDev<LogicalName: AsRef<Path>> {
logicalname: LogicalName, logicalname: LogicalName,
} }

View File

@@ -63,7 +63,7 @@ pub async fn mount_cifs(
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Cifs { pub struct Cifs {
pub hostname: String, pub hostname: String,
pub path: PathBuf, pub path: PathBuf,

View File

@@ -22,7 +22,7 @@ pub async fn mount_httpdirfs(url: &Url, mountpoint: impl AsRef<Path>) -> Result<
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct HttpDirFS { pub struct HttpDirFS {
url: Url, url: Url,
} }

View File

@@ -14,7 +14,7 @@ use crate::prelude::*;
use crate::util::Invoke; use crate::util::Invoke;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct IdMapped<Fs: FileSystem> { pub struct IdMapped<Fs: FileSystem> {
filesystem: Fs, filesystem: Fs,
from_id: u32, from_id: u32,

View File

@@ -12,7 +12,7 @@ use super::FileSystem;
use crate::prelude::*; use crate::prelude::*;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct LoopDev<LogicalName: AsRef<Path>> { pub struct LoopDev<LogicalName: AsRef<Path>> {
logicalname: LogicalName, logicalname: LogicalName,
offset: u64, offset: u64,

View File

@@ -24,14 +24,14 @@ use crate::util::{Invoke, Version};
use crate::{Error, ResultExt as _}; use crate::{Error, ResultExt as _};
#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum PartitionTable { pub enum PartitionTable {
Mbr, Mbr,
Gpt, Gpt,
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct DiskInfo { pub struct DiskInfo {
pub logicalname: PathBuf, pub logicalname: PathBuf,
pub partition_table: Option<PartitionTable>, pub partition_table: Option<PartitionTable>,
@@ -43,7 +43,7 @@ pub struct DiskInfo {
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct PartitionInfo { pub struct PartitionInfo {
pub logicalname: PathBuf, pub logicalname: PathBuf,
pub label: Option<String>, pub label: Option<String>,
@@ -54,7 +54,7 @@ pub struct PartitionInfo {
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct EmbassyOsRecoveryInfo { pub struct EmbassyOsRecoveryInfo {
pub version: Version, pub version: Version,
pub full: bool, pub full: bool,

View File

@@ -14,7 +14,7 @@ use crate::PLATFORM;
/// Part of the Firmware, look there for more about /// Part of the Firmware, look there for more about
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct VersionMatcher { pub struct VersionMatcher {
/// Strip this prefix on the version matcher /// Strip this prefix on the version matcher
semver_prefix: Option<String>, semver_prefix: Option<String>,
@@ -28,7 +28,7 @@ pub struct VersionMatcher {
/// wanted a structure that could help decide what to do /// wanted a structure that could help decide what to do
/// for each of the firmware versions /// for each of the firmware versions
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Firmware { pub struct Firmware {
id: String, id: String,
/// This is the platform(s) the firmware was built for /// This is the platform(s) the firmware was built for

View File

@@ -24,7 +24,7 @@ pub fn inspect() -> ParentHandler {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct HashParams { pub struct HashParams {
path: PathBuf, path: PathBuf,
@@ -39,11 +39,11 @@ pub async fn hash(_: CliContext, HashParams { path }: HashParams) -> Result<Stri
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ManifestParams { pub struct ManifestParams {
path: PathBuf, path: PathBuf,
#[arg(name = "no-verify", long = "no-verify")] #[arg(long = "no-verify")]
no_verify: bool, no_verify: bool,
} }
@@ -57,11 +57,11 @@ pub async fn manifest(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct InspectParams { pub struct InspectParams {
path: PathBuf, path: PathBuf,
#[arg(name = "no-verify", long = "no-verify")] #[arg(long = "no-verify")]
no_verify: bool, no_verify: bool,
} }
@@ -89,11 +89,11 @@ pub async fn icon(
Ok(()) Ok(())
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct InstructionParams { pub struct InstructionParams {
path: PathBuf, path: PathBuf,
#[arg(name = "no-verify", long = "no-verify")] #[arg(long = "no-verify")]
no_verify: bool, no_verify: bool,
} }

View File

@@ -64,7 +64,7 @@ pub async fn list(ctx: RpcContext) -> Result<Value, Error> {
} }
#[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)] #[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum MinMax { pub enum MinMax {
Min, Min,
Max, Max,
@@ -103,7 +103,7 @@ impl std::fmt::Display for MinMax {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct InstallParams { pub struct InstallParams {
id: PackageId, id: PackageId,
@@ -165,7 +165,7 @@ pub async fn install(
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SideloadResponse { pub struct SideloadResponse {
pub upload: RequestGuid, pub upload: RequestGuid,
pub progress: RequestGuid, pub progress: RequestGuid,
@@ -275,7 +275,7 @@ pub async fn sideload(ctx: RpcContext) -> Result<SideloadResponse, Error> {
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum CliInstallParams { pub enum CliInstallParams {
Marketplace(InstallParams), Marketplace(InstallParams),
Sideload(PathBuf), Sideload(PathBuf),
@@ -392,7 +392,7 @@ pub async fn cli_install(ctx: CliContext, params: CliInstallParams) -> Result<()
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UninstallParams { pub struct UninstallParams {
id: PackageId, id: PackageId,

View File

@@ -80,7 +80,7 @@ use crate::context::CliContext;
use crate::util::serde::HandlerExtSerde; use crate::util::serde::HandlerExtSerde;
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct EchoParams { pub struct EchoParams {
message: String, message: String,

View File

@@ -102,14 +102,14 @@ async fn ws_handler(
} }
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct LogResponse { pub struct LogResponse {
entries: Reversible<LogEntry>, entries: Reversible<LogEntry>,
start_cursor: Option<String>, start_cursor: Option<String>,
end_cursor: Option<String>, end_cursor: Option<String>,
} }
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct LogFollowResponse { pub struct LogFollowResponse {
start_cursor: Option<String>, start_cursor: Option<String>,
guid: RequestGuid, guid: RequestGuid,
@@ -211,7 +211,7 @@ pub enum LogSource {
pub const SYSTEM_UNIT: &str = "startd"; pub const SYSTEM_UNIT: &str = "startd";
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LogsParam { pub struct LogsParam {
id: PackageId, id: PackageId,

View File

@@ -26,7 +26,7 @@ use crate::prelude::*;
pub const LOCAL_AUTH_COOKIE_PATH: &str = "/run/embassy/rpc.authcookie"; pub const LOCAL_AUTH_COOKIE_PATH: &str = "/run/embassy/rpc.authcookie";
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct LoginRes { pub struct LoginRes {
pub session: InternedString, pub session: InternedString,
} }
@@ -245,7 +245,7 @@ impl Borrow<str> for HashSessionToken {
} }
#[derive(Deserialize)] #[derive(Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Metadata { pub struct Metadata {
#[serde(default = "const_true")] #[serde(default = "const_true")]
authenticated: bool, authenticated: bool,

View File

@@ -7,7 +7,7 @@ use serde::Deserialize;
use crate::context::RpcContext; use crate::context::RpcContext;
#[derive(Deserialize)] #[derive(Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Metadata { pub struct Metadata {
#[serde(default)] #[serde(default)]
sync_db: bool, sync_db: bool,

View File

@@ -61,7 +61,7 @@ pub fn dhcp() -> ParentHandler {
) )
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UpdateParams { pub struct UpdateParams {
interface: String, interface: String,

View File

@@ -29,7 +29,7 @@ use crate::SOURCE_DATE;
#[derive(Debug, Deserialize, Serialize, HasModel)] #[derive(Debug, Deserialize, Serialize, HasModel)]
#[model = "Model<Self>"] #[model = "Model<Self>"]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct CertStore { pub struct CertStore {
pub root_key: Pem<PKey<Private>>, pub root_key: Pem<PKey<Private>>,
pub root_cert: Pem<X509>, pub root_cert: Pem<X509>,

View File

@@ -105,7 +105,7 @@ pub fn tor() -> ParentHandler {
) )
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ResetParams { pub struct ResetParams {
#[arg(name = "wipe-state", short = 'w', long = "wipe-state")] #[arg(name = "wipe-state", short = 'w', long = "wipe-state")]
@@ -143,7 +143,7 @@ pub async fn list_services(ctx: RpcContext, _: Empty) -> Result<Vec<OnionAddress
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LogsParams { pub struct LogsParams {
#[arg(short = 'l', long = "limit")] #[arg(short = 'l', long = "limit")]

View File

@@ -88,7 +88,7 @@ pub fn country() -> ParentHandler {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct AddParams { pub struct AddParams {
ssid: String, ssid: String,
@@ -139,7 +139,7 @@ pub async fn add(ctx: RpcContext, AddParams { ssid, password }: AddParams) -> Re
Ok(()) Ok(())
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct SsidParams { pub struct SsidParams {
ssid: String, ssid: String,
@@ -217,7 +217,7 @@ pub async fn delete(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<
Ok(()) Ok(())
} }
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct WiFiInfo { pub struct WiFiInfo {
ssids: HashMap<Ssid, SignalStrength>, ssids: HashMap<Ssid, SignalStrength>,
connected: Option<Ssid>, connected: Option<Ssid>,
@@ -226,13 +226,13 @@ pub struct WiFiInfo {
available_wifi: Vec<WifiListOut>, available_wifi: Vec<WifiListOut>,
} }
#[derive(serde::Serialize, serde::Deserialize, Clone)] #[derive(serde::Serialize, serde::Deserialize, Clone)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct WifiListInfo { pub struct WifiListInfo {
strength: SignalStrength, strength: SignalStrength,
security: Vec<String>, security: Vec<String>,
} }
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct WifiListOut { pub struct WifiListOut {
ssid: Ssid, ssid: Ssid,
strength: SignalStrength, strength: SignalStrength,
@@ -403,7 +403,7 @@ pub async fn get_available(ctx: RpcContext, _: Empty) -> Result<Vec<WifiListOut>
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct SetCountryParams { pub struct SetCountryParams {
#[arg(value_parser = CountryCodeParser)] #[arg(value_parser = CountryCodeParser)]

View File

@@ -49,7 +49,7 @@ pub fn notification() -> ParentHandler {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ListParams { pub struct ListParams {
before: Option<u32>, before: Option<u32>,
@@ -111,7 +111,7 @@ pub async fn list(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct DeleteParams { pub struct DeleteParams {
id: u32, id: u32,
@@ -126,7 +126,7 @@ pub async fn delete(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Resul
.await .await
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct DeleteBeforeParams { pub struct DeleteBeforeParams {
before: u32, before: u32,
@@ -149,7 +149,7 @@ pub async fn delete_before(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct CreateParams { pub struct CreateParams {
package: Option<PackageId>, package: Option<PackageId>,
@@ -173,7 +173,7 @@ pub async fn create(
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum NotificationLevel { pub enum NotificationLevel {
Success, Success,
Info, Info,
@@ -225,7 +225,7 @@ impl fmt::Display for InvalidNotificationLevel {
} }
#[derive(Debug, Default, Serialize, Deserialize)] #[derive(Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Notifications(pub BTreeMap<u32, Notification>); pub struct Notifications(pub BTreeMap<u32, Notification>);
impl Notifications { impl Notifications {
pub fn new() -> Self { pub fn new() -> Self {
@@ -244,7 +244,7 @@ impl Map for Notifications {
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Notification { pub struct Notification {
package_id: Option<PackageId>, package_id: Option<PackageId>,
created_at: DateTime<Utc>, created_at: DateTime<Utc>,
@@ -256,7 +256,7 @@ pub struct Notification {
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct NotificationWithId { pub struct NotificationWithId {
id: u32, id: u32,
#[serde(flatten)] #[serde(flatten)]

View File

@@ -24,7 +24,7 @@ mod gpt;
mod mbr; mod mbr;
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct PostInstallConfig { pub struct PostInstallConfig {
os_partitions: OsPartitionInfo, os_partitions: OsPartitionInfo,
ethernet_interface: String, ethernet_interface: String,
@@ -120,7 +120,7 @@ async fn partition(disk: &mut DiskInfo, overwrite: bool) -> Result<OsPartitionIn
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ExecuteParams { pub struct ExecuteParams {
logicalname: PathBuf, logicalname: PathBuf,

View File

@@ -6,10 +6,10 @@ use models::PackageId;
use rpc_toolkit::command; use rpc_toolkit::command;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::db::model::package::ExposedUI; use crate::context::RpcContext;
use crate::db::model::package::{ExposedUI, StoreExposedUI};
use crate::prelude::*; use crate::prelude::*;
use crate::Error; use crate::Error;
use crate::{context::RpcContext, db::model::package::StoreExposedUI};
pub fn display_properties(response: Value) { pub fn display_properties(response: Value) {
println!("{}", response); println!("{}", response);
@@ -58,7 +58,7 @@ impl IntoProperties for StoreExposedUI {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct PropertiesParam { pub struct PropertiesParam {
id: PackageId, id: PackageId,

View File

@@ -91,7 +91,7 @@ async fn do_upload(
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct PublishParams { pub struct PublishParams {
location: String, location: String,

View File

@@ -37,7 +37,7 @@ pub fn with_query_params(ctx: RpcContext, mut url: Url) -> Url {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct GetParams { pub struct GetParams {
url: Url, url: Url,

View File

@@ -13,7 +13,7 @@ use crate::util::io::from_cbor_async_reader;
use crate::{Error, ErrorKind, ARCH}; use crate::{Error, ErrorKind, ARCH};
#[derive(Default, Deserialize, Serialize)] #[derive(Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct DockerMultiArch { pub struct DockerMultiArch {
pub default: String, pub default: String,
pub available: BTreeSet<String>, pub available: BTreeSet<String>,

View File

@@ -18,7 +18,7 @@ fn current_version() -> Version {
} }
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] #[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct Manifest { pub struct Manifest {
#[serde(default = "current_version")] #[serde(default = "current_version")]
@@ -53,7 +53,7 @@ pub struct Manifest {
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Assets { pub struct Assets {
#[serde(default)] #[serde(default)]
pub license: Option<PathBuf>, pub license: Option<PathBuf>,

View File

@@ -13,7 +13,7 @@ pub mod reader;
pub const SIG_CONTEXT: &[u8] = b"s9pk"; pub const SIG_CONTEXT: &[u8] = b"s9pk";
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct VerifyParams { pub struct VerifyParams {
pub path: PathBuf, pub path: PathBuf,

View File

@@ -53,7 +53,7 @@ pub struct Manifest {
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct HardwareRequirements { pub struct HardwareRequirements {
#[serde(default)] #[serde(default)]
device: BTreeMap<String, Regex>, device: BTreeMap<String, Regex>,
@@ -85,7 +85,7 @@ impl Description {
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Alerts { pub struct Alerts {
pub install: Option<String>, pub install: Option<String>,
pub uninstall: Option<String>, pub uninstall: Option<String>,

View File

@@ -268,7 +268,7 @@ enum AllowedStatuses {
struct ExportActionParams { struct ExportActionParams {
#[ts(type = "string")] #[ts(type = "string")]
id: ActionId, id: ActionId,
metadata: ActionMetadata metadata: ActionMetadata,
} }
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)]
#[ts(export)] #[ts(export)]
@@ -349,13 +349,11 @@ async fn get_container_ip(context: EffectContext, _: Empty) -> Result<Ipv4Addr,
Some(c) => { Some(c) => {
let net_service = c.persistent_container.net_service.lock().await; let net_service = c.persistent_container.net_service.lock().await;
Ok(net_service.get_ip()) Ok(net_service.get_ip())
},
None => {
Err(Error::new(
eyre!("Upgrade on Weak<ServiceActorSeed> resulted in a None variant"),
crate::ErrorKind::NotFound
))
} }
None => Err(Error::new(
eyre!("Upgrade on Weak<ServiceActorSeed> resulted in a None variant"),
crate::ErrorKind::NotFound,
)),
} }
} }
async fn get_service_port_forward( async fn get_service_port_forward(

View File

@@ -100,7 +100,7 @@ async fn setup_init(
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct AttachParams { pub struct AttachParams {
#[serde(rename = "embassy-password")] #[serde(rename = "embassy-password")]
password: Option<EncryptedWire>, password: Option<EncryptedWire>,
@@ -185,7 +185,7 @@ pub async fn attach(
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SetupStatus { pub struct SetupStatus {
pub bytes_transferred: u64, pub bytes_transferred: u64,
pub total_bytes: Option<u64>, pub total_bytes: Option<u64>,
@@ -211,7 +211,7 @@ pub fn cifs() -> ParentHandler {
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct VerifyCifsParams { pub struct VerifyCifsParams {
hostname: String, hostname: String,
path: PathBuf, path: PathBuf,
@@ -247,14 +247,14 @@ pub async fn verify_cifs(
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum RecoverySource { pub enum RecoverySource {
Migrate { guid: String }, Migrate { guid: String },
Backup { target: BackupTargetFS }, Backup { target: BackupTargetFS },
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct ExecuteParams { pub struct ExecuteParams {
embassy_logicalname: PathBuf, embassy_logicalname: PathBuf,
embassy_password: EncryptedWire, embassy_password: EncryptedWire,

View File

@@ -48,7 +48,7 @@ impl ValueParserFactory for SshPubKey {
} }
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct SshKeyResponse { pub struct SshKeyResponse {
pub alg: String, pub alg: String,
pub fingerprint: InternedString, pub fingerprint: InternedString,
@@ -103,7 +103,7 @@ pub fn ssh() -> ParentHandler {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct AddParams { pub struct AddParams {
key: SshPubKey, key: SshPubKey,
@@ -136,7 +136,7 @@ pub async fn add(ctx: RpcContext, AddParams { key }: AddParams) -> Result<SshKey
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct DeleteParams { pub struct DeleteParams {
fingerprint: InternedString, fingerprint: InternedString,

View File

@@ -2,7 +2,7 @@ pub use models::HealthCheckId;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[serde(tag = "result")] #[serde(tag = "result")]
pub enum HealthCheckResult { pub enum HealthCheckResult {
Success, Success,

View File

@@ -11,7 +11,7 @@ use crate::status::health_check::HealthCheckResult;
pub mod health_check; pub mod health_check;
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] #[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct Status { pub struct Status {
pub configured: bool, pub configured: bool,
@@ -21,7 +21,7 @@ pub struct Status {
} }
#[derive(Clone, Debug, Deserialize, Serialize, HasModel, Default)] #[derive(Clone, Debug, Deserialize, Serialize, HasModel, Default)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[model = "Model<Self>"] #[model = "Model<Self>"]
pub struct DependencyConfigErrors(pub BTreeMap<PackageId, String>); pub struct DependencyConfigErrors(pub BTreeMap<PackageId, String>);
impl Map for DependencyConfigErrors { impl Map for DependencyConfigErrors {
@@ -37,7 +37,7 @@ impl Map for DependencyConfigErrors {
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[serde(tag = "status")] #[serde(tag = "status")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum MainStatus { pub enum MainStatus {
Stopped, Stopped,
Restarting, Restarting,

View File

@@ -74,7 +74,7 @@ pub async fn enable_zram() -> Result<(), Error> {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct ZramParams { pub struct ZramParams {
enable: bool, enable: bool,
@@ -136,7 +136,7 @@ fn display_governor_info(params: WithIoFormat<GovernorParams>, result: GovernorI
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct GovernorParams { pub struct GovernorParams {
set: Option<Governor>, set: Option<Governor>,
@@ -230,7 +230,7 @@ pub async fn time(ctx: RpcContext, _: Empty) -> Result<TimeInfo, Error> {
}) })
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct LogsParams { pub struct LogsParams {
#[arg(short = 'l', long = "limit")] #[arg(short = 'l', long = "limit")]
@@ -314,7 +314,7 @@ pub async fn logs_follow(
follow_logs(ctx, LogSource::System, limit).await follow_logs(ctx, LogSource::System, limit).await
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct KernelLogsParams { pub struct KernelLogsParams {
#[arg(short = 'l', long = "limit")] #[arg(short = 'l', long = "limit")]
@@ -509,12 +509,12 @@ impl<'de> Deserialize<'de> for GigaBytes {
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct MetricsGeneral { pub struct MetricsGeneral {
pub temperature: Option<Celsius>, pub temperature: Option<Celsius>,
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct MetricsMemory { pub struct MetricsMemory {
pub percentage_used: Percentage, pub percentage_used: Percentage,
pub total: MebiBytes, pub total: MebiBytes,
@@ -525,7 +525,7 @@ pub struct MetricsMemory {
pub zram_used: MebiBytes, pub zram_used: MebiBytes,
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct MetricsCpu { pub struct MetricsCpu {
percentage_used: Percentage, percentage_used: Percentage,
idle: Percentage, idle: Percentage,
@@ -534,7 +534,7 @@ pub struct MetricsCpu {
wait: Percentage, wait: Percentage,
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct MetricsDisk { pub struct MetricsDisk {
percentage_used: Percentage, percentage_used: Percentage,
used: GigaBytes, used: GigaBytes,
@@ -542,7 +542,7 @@ pub struct MetricsDisk {
capacity: GigaBytes, capacity: GigaBytes,
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub struct Metrics { pub struct Metrics {
general: MetricsGeneral, general: MetricsGeneral,
memory: MetricsMemory, memory: MetricsMemory,

View File

@@ -35,7 +35,7 @@ lazy_static! {
} }
#[derive(Deserialize, Serialize, Parser)] #[derive(Deserialize, Serialize, Parser)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")] #[command(rename_all = "kebab-case")]
pub struct UpdateSystemParams { pub struct UpdateSystemParams {
marketplace_url: Url, marketplace_url: Url,
@@ -60,7 +60,7 @@ pub async fn update_system(
/// What is the status of the updates? /// What is the status of the updates?
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] #[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum UpdateResult { pub enum UpdateResult {
NoUpdates, NoUpdates,
Updating, Updating,

View File

@@ -8,7 +8,7 @@ const KNOWN_CLASSES: &[&str] = &["processor", "display"];
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
#[serde(tag = "class")] #[serde(tag = "class")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum LshwDevice { pub enum LshwDevice {
Processor(LshwProcessor), Processor(LshwProcessor),
Display(LshwDisplay), Display(LshwDisplay),

View File

@@ -111,25 +111,25 @@ pub fn cert_dir(pkg_id: &PackageId, host_id: &HostId) -> PathBuf {
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
pub enum Volume { pub enum Volume {
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Data { Data {
#[serde(skip)] #[serde(skip)]
readonly: bool, readonly: bool,
}, },
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Assets {}, Assets {},
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Pointer { Pointer {
package_id: PackageId, package_id: PackageId,
volume_id: VolumeId, volume_id: VolumeId,
path: PathBuf, path: PathBuf,
readonly: bool, readonly: bool,
}, },
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Certificate { interface_id: HostId }, Certificate { interface_id: HostId },
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")]
Backup { readonly: bool }, Backup { readonly: bool },
} }
impl Volume { impl Volume {

View File

@@ -49,7 +49,7 @@ export class LogsPage {
private async getLogs() { private async getLogs() {
try { try {
const { 'start-cursor': startCursor, entries } = await this.api.getLogs({ const { startCursor, entries } = await this.api.getLogs({
cursor: this.startCursor, cursor: this.startCursor,
before: !!this.startCursor, before: !!this.startCursor,
limit: this.limit, limit: this.limit,

View File

@@ -45,8 +45,8 @@ export class MockApiService implements ApiService {
} }
return { return {
entries, entries,
'start-cursor': 'startCursor', startCursor: 'start-cursor',
'end-cursor': 'endCursor', endCursor: 'end-cursor',
} }
} }
} }

View File

@@ -17,12 +17,12 @@ export class MockApiService implements ApiService {
label: null, label: null,
capacity: 73264762332, capacity: 73264762332,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.2.17', version: '0.2.17',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: null, guid: null,
}, },
@@ -40,12 +40,12 @@ export class MockApiService implements ApiService {
label: null, label: null,
capacity: 73264762332, capacity: 73264762332,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.3.3', version: '0.3.3',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: null, guid: null,
}, },
@@ -63,12 +63,12 @@ export class MockApiService implements ApiService {
label: null, label: null,
capacity: 73264762332, capacity: 73264762332,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.3.2', version: '0.3.2',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: 'guid-guid-guid-guid', guid: 'guid-guid-guid-guid',
}, },

View File

@@ -4,7 +4,7 @@
</ion-item-divider> </ion-item-divider>
<ion-item lines="none" color="transparent"> <ion-item lines="none" color="transparent">
<ion-label> <ion-label>
<div [innerHTML]="pkg.manifest['release-notes'] | markdown"></div> <div [innerHTML]="pkg.manifest.releaseNotes | markdown"></div>
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-button routerLink="notes" fill="clear" strong> <ion-button routerLink="notes" fill="clear" strong>
@@ -18,10 +18,7 @@
<h2>{{ pkg.manifest.description.long }}</h2> <h2>{{ pkg.manifest.description.long }}</h2>
</ion-label> </ion-label>
</ion-item> </ion-item>
<div <div *ngIf="pkg.manifest.marketingSite as url" style="padding: 4px 0 10px 14px">
*ngIf="pkg.manifest['marketing-site'] as url"
style="padding: 4px 0 10px 14px"
>
<ion-button [href]="url" target="_blank" rel="noreferrer" color="tertiary"> <ion-button [href]="url" target="_blank" rel="noreferrer" color="tertiary">
View website View website
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>

View File

@@ -15,7 +15,7 @@
<ion-col responsiveCol sizeXs="12" sizeMd="6"> <ion-col responsiveCol sizeXs="12" sizeMd="6">
<ion-item-group> <ion-item-group>
<ion-item <ion-item
*ngIf="manifest['git-hash'] as gitHash; else noHash" *ngIf="manifest.gitHash as gitHash; else noHash"
button button
detail="false" detail="false"
(click)="copy(gitHash)" (click)="copy(gitHash)"
@@ -64,39 +64,39 @@
<ion-col responsiveCol sizeXs="12" sizeMd="6"> <ion-col responsiveCol sizeXs="12" sizeMd="6">
<ion-item-group> <ion-item-group>
<ion-item <ion-item
[href]="manifest['upstream-repo']" [href]="manifest.upstreamRepo"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
detail="false" detail="false"
> >
<ion-label> <ion-label>
<h2>Source Repository</h2> <h2>Source Repository</h2>
<p>{{ manifest['upstream-repo'] }}</p> <p>{{ manifest.upstreamRepo }}</p>
</ion-label> </ion-label>
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>
</ion-item> </ion-item>
<ion-item <ion-item
[href]="manifest['wrapper-repo']" [href]="manifest.wrapperRepo"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
detail="false" detail="false"
> >
<ion-label> <ion-label>
<h2>Wrapper Repository</h2> <h2>Wrapper Repository</h2>
<p>{{ manifest['wrapper-repo'] }}</p> <p>{{ manifest.wrapperRepo }}</p>
</ion-label> </ion-label>
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>
</ion-item> </ion-item>
<ion-item <ion-item
[href]="manifest['support-site']" [href]="manifest.supportSite"
[disabled]="!manifest['support-site']" [disabled]="!manifest.supportSite"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
detail="false" detail="false"
> >
<ion-label> <ion-label>
<h2>Support Site</h2> <h2>Support Site</h2>
<p>{{ manifest['support-site'] || 'Not provided' }}</p> <p>{{ manifest.supportSite || 'Not provided' }}</p>
</ion-label> </ion-label>
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>
</ion-item> </ion-item>

View File

@@ -17,10 +17,10 @@
</ion-thumbnail> </ion-thumbnail>
<ion-label> <ion-label>
<h2> <h2>
{{ pkg['dependency-metadata'][dep.key].title }} {{ pkg.dependencyMetadata[dep.key].title }}
<span *ngIf="dep.value.optional; else required">(optional)</span> <span *ngIf="dep.value.optional; else required">(optional)</span>
<ng-template #required> <ng-template #required>
<span *ngSwitchCase="'opt-in'">(optional)</span> <span>(Required)</span>
</ng-template> </ng-template>
</h2> </h2>
<p>{{ dep.value.description }}</p> <p>{{ dep.value.description }}</p>

View File

@@ -11,6 +11,6 @@ export class DependenciesComponent {
pkg!: MarketplacePkg pkg!: MarketplacePkg
getImg(key: string): string { getImg(key: string): string {
return this.pkg['dependency-metadata'][key].icon return this.pkg.dependencyMetadata[key].icon
} }
} }

View File

@@ -3,9 +3,7 @@
<div class="text"> <div class="text">
<h1 ticker class="title">{{ pkg.manifest.title }}</h1> <h1 ticker class="title">{{ pkg.manifest.title }}</h1>
<p class="version">{{ pkg.manifest.version | displayEmver }}</p> <p class="version">{{ pkg.manifest.version | displayEmver }}</p>
<p class="published"> <p class="published">Released: {{ pkg.publishedAt | date: 'medium' }}</p>
Released: {{ pkg['published-at'] | date: 'medium' }}
</p>
<ng-content></ng-content> <ng-content></ng-content>
</div> </div>
</div> </div>

View File

@@ -71,8 +71,7 @@ export class FilterPackagesPipe implements PipeTransform {
.filter(p => category === 'all' || p.categories.includes(category)) .filter(p => category === 'all' || p.categories.includes(category))
.sort((a, b) => { .sort((a, b) => {
return ( return (
new Date(b['published-at']).valueOf() - new Date(b.publishedAt).valueOf() - new Date(a.publishedAt).valueOf()
new Date(a['published-at']).valueOf()
) )
}) })
} }

View File

@@ -28,10 +28,10 @@ export interface MarketplacePkg {
manifest: Manifest manifest: Manifest
categories: string[] categories: string[]
versions: string[] versions: string[]
'dependency-metadata': { dependencyMetadata: {
[id: string]: DependencyMetadata [id: string]: DependencyMetadata
} }
'published-at': string publishedAt: string
} }
export interface DependencyMetadata { export interface DependencyMetadata {
@@ -45,19 +45,19 @@ export interface Manifest {
id: string id: string
title: string title: string
version: string version: string
'git-hash'?: string gitHash?: string
description: { description: {
short: string short: string
long: string long: string
} }
replaces?: string[] replaces?: string[]
'release-notes': string releaseNotes: string
license: string // name of license license: string // name of license
'wrapper-repo': Url wrapperRepo: Url
'upstream-repo': Url upstreamRepo: Url
'support-site': Url supportSite: Url
'marketing-site': Url marketingSite: Url
'donation-url': Url | null donationUrl: Url | null
alerts: { alerts: {
install: string | null install: string | null
uninstall: string | null uninstall: string | null
@@ -66,8 +66,8 @@ export interface Manifest {
stop: string | null stop: string | null
} }
dependencies: Record<string, Dependency> dependencies: Record<string, Dependency>
'os-version': string osVersion: string
'has-config': boolean hasConfig: boolean
} }
export interface Dependency { export interface Dependency {

View File

@@ -61,7 +61,7 @@ export class CifsModal {
const target: CifsBackupTarget = { const target: CifsBackupTarget = {
...this.cifs, ...this.cifs,
mountable: true, mountable: true,
'embassy-os': diskInfo, startOs: diskInfo,
} }
const modal = await this.modalController.create({ const modal = await this.modalController.create({

View File

@@ -31,11 +31,11 @@ export class PasswordPage {
} }
async verifyPw() { async verifyPw() {
if (!this.target || !this.target['embassy-os']) if (!this.target || !this.target.startOs)
this.pwError = 'No recovery target' // unreachable this.pwError = 'No recovery target' // unreachable
try { try {
const passwordHash = this.target!['embassy-os']?.['password-hash'] || '' const passwordHash = this.target!.startOs?.passwordHash || ''
argon2.verify(passwordHash, this.password) argon2.verify(passwordHash, this.password)
this.modalController.dismiss({ password: this.password }, 'success') this.modalController.dismiss({ password: this.password }, 'success')

View File

@@ -38,10 +38,7 @@ export class LoadingPage {
if (!progress) return if (!progress) return
const { const { totalBytes, bytesTransferred } = progress
'total-bytes': totalBytes,
'bytes-transferred': bytesTransferred,
} = progress
this.progress$.next({ this.progress$.next({
totalBytes, totalBytes,

View File

@@ -35,7 +35,7 @@ export class RecoverPage {
} }
driveClickable(mapped: MappedDisk) { driveClickable(mapped: MappedDisk) {
return mapped.drive['embassy-os']?.full return mapped.drive.startOs?.full
} }
async getDrives() { async getDrives() {
@@ -53,10 +53,10 @@ export class RecoverPage {
label: p.label, label: p.label,
capacity: p.capacity, capacity: p.capacity,
used: p.used, used: p.used,
'embassy-os': p['embassy-os'], startOs: p.startOs,
} }
this.mappedDrives.push({ this.mappedDrives.push({
hasValidBackup: !!p['embassy-os']?.full, hasValidBackup: !!p.startOs?.full,
drive, drive,
}) })
}) })

View File

@@ -76,9 +76,9 @@ export class SuccessPage {
try { try {
const ret = await this.api.complete() const ret = await this.api.complete()
if (!this.isKiosk) { if (!this.isKiosk) {
this.torAddress = ret['tor-address'].replace(/^https:/, 'http:') this.torAddress = ret.torAddress.replace(/^https:/, 'http:')
this.lanAddress = ret['lan-address'].replace(/^https:/, 'http:') this.lanAddress = ret.lanAddress.replace(/^https:/, 'http:')
this.cert = ret['root-ca'] this.cert = ret.rootCa
await this.api.exit() await this.api.exit()
} }

View File

@@ -28,27 +28,27 @@ type Encrypted = {
} }
export type StatusRes = { export type StatusRes = {
'bytes-transferred': number bytesTransferred: number
'total-bytes': number | null totalBytes: number | null
complete: boolean complete: boolean
} | null } | null
export type AttachReq = { export type AttachReq = {
guid: string guid: string
'embassy-password': Encrypted startOsPassword: Encrypted
} }
export type ExecuteReq = { export type ExecuteReq = {
'embassy-logicalname': string startOsLogicalname: string
'embassy-password': Encrypted startOsPassword: Encrypted
'recovery-source': RecoverySource | null recoverySource: RecoverySource | null
'recovery-password': Encrypted | null recoveryPassword: Encrypted | null
} }
export type CompleteRes = { export type CompleteRes = {
'tor-address': string torAddress: string
'lan-address': string lanAddress: string
'root-ca': string rootCa: string
} }
export type DiskBackupTarget = { export type DiskBackupTarget = {
@@ -58,7 +58,7 @@ export type DiskBackupTarget = {
label: string | null label: string | null
capacity: number capacity: number
used: number | null used: number | null
'embassy-os': StartOSDiskInfo | null startOs: StartOSDiskInfo | null
} }
export type CifsBackupTarget = { export type CifsBackupTarget = {
@@ -66,7 +66,7 @@ export type CifsBackupTarget = {
path: string path: string
username: string username: string
mountable: boolean mountable: boolean
'embassy-os': StartOSDiskInfo | null startOs: StartOSDiskInfo | null
} }
export type DiskRecoverySource = { export type DiskRecoverySource = {

View File

@@ -73,11 +73,10 @@ export class LiveApiService extends ApiService {
} }
async execute(setupInfo: ExecuteReq) { async execute(setupInfo: ExecuteReq) {
if (setupInfo['recovery-source']?.type === 'backup') { if (setupInfo.recoverySource?.type === 'backup') {
if (isCifsSource(setupInfo['recovery-source'].target)) { if (isCifsSource(setupInfo.recoverySource.target)) {
setupInfo['recovery-source'].target.path = setupInfo[ setupInfo.recoverySource.target.path =
'recovery-source' setupInfo.recoverySource.target.path.replace('/\\/g', '/')
].target.path.replace('/\\/g', '/')
} }
} }
@@ -95,7 +94,7 @@ export class LiveApiService extends ApiService {
return { return {
...res, ...res,
'root-ca': encodeBase64(res['root-ca']), rootCa: encodeBase64(res.rootCa),
} }
} }

View File

@@ -30,8 +30,8 @@ export class MockApiService extends ApiService {
const progress = tries > 4 ? (tries - 4) * 268435456 : 0 const progress = tries > 4 ? (tries - 4) * 268435456 : 0
return { return {
'bytes-transferred': restoreOrMigrate ? progress : 0, bytesTransferred: restoreOrMigrate ? progress : 0,
'total-bytes': restoreOrMigrate ? total : null, totalBytes: restoreOrMigrate ? total : null,
complete: progress === total, complete: progress === total,
} }
} }
@@ -65,12 +65,12 @@ export class MockApiService extends ApiService {
label: null, label: null,
capacity: 1979120929996, capacity: 1979120929996,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.2.17', version: '0.2.17',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: null, guid: null,
}, },
@@ -88,12 +88,12 @@ export class MockApiService extends ApiService {
label: null, label: null,
capacity: 73264762332, capacity: 73264762332,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.3.3', version: '0.3.3',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: null, guid: null,
}, },
@@ -111,12 +111,12 @@ export class MockApiService extends ApiService {
label: null, label: null,
capacity: 73264762332, capacity: 73264762332,
used: null, used: null,
'embassy-os': { startOs: {
version: '0.3.2', version: '0.3.2',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': null, wrappedKey: null,
}, },
guid: 'guid-guid-guid-guid', guid: 'guid-guid-guid-guid',
}, },
@@ -132,9 +132,9 @@ export class MockApiService extends ApiService {
return { return {
version: '0.3.0', version: '0.3.0',
full: true, full: true,
'password-hash': passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ', '$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': '', wrappedKey: '',
} }
} }
@@ -149,9 +149,9 @@ export class MockApiService extends ApiService {
async complete(): Promise<CompleteRes> { async complete(): Promise<CompleteRes> {
await pauseFor(1000) await pauseFor(1000)
return { return {
'tor-address': 'https://asdafsadasdasasdasdfasdfasdf.onion', torAddress: 'https://asdafsadasdasasdasdfasdfasdf.onion',
'lan-address': 'https://adjective-noun.local', lanAddress: 'https://adjective-noun.local',
'root-ca': encodeBase64(rootCA), rootCa: encodeBase64(rootCA),
} }
} }

View File

@@ -15,7 +15,7 @@ export class StateService {
async importDrive(guid: string, password: string): Promise<void> { async importDrive(guid: string, password: string): Promise<void> {
await this.api.attach({ await this.api.attach({
guid, guid,
'embassy-password': await this.api.encrypt(password), startOsPassword: await this.api.encrypt(password),
}) })
} }
@@ -24,10 +24,10 @@ export class StateService {
password: string, password: string,
): Promise<void> { ): Promise<void> {
await this.api.execute({ await this.api.execute({
'embassy-logicalname': storageLogicalname, startOsLogicalname: storageLogicalname,
'embassy-password': await this.api.encrypt(password), startOsPassword: await this.api.encrypt(password),
'recovery-source': this.recoverySource || null, recoverySource: this.recoverySource || null,
'recovery-password': this.recoveryPassword recoveryPassword: this.recoveryPassword
? await this.api.encrypt(this.recoveryPassword) ? await this.api.encrypt(this.recoveryPassword)
: null, : null,
}) })

View File

@@ -6,8 +6,8 @@ export type ServerLogsReq = {
export type LogsRes = { export type LogsRes = {
entries: Log[] entries: Log[]
'start-cursor'?: string startCursor?: string
'end-cursor'?: string endCursor?: string
} }
export interface Log { export interface Log {
@@ -31,13 +31,13 @@ export interface PartitionInfo {
label: string | null label: string | null
capacity: number capacity: number
used: number | null used: number | null
'embassy-os': StartOSDiskInfo | null startOs: StartOSDiskInfo | null
guid: string | null guid: string | null
} }
export type StartOSDiskInfo = { export type StartOSDiskInfo = {
version: string version: string
full: boolean full: boolean
'password-hash': string | null passwordHash: string | null
'wrapped-key': string | null wrappedKey: string | null
} }

View File

@@ -63,15 +63,6 @@ const routes: Routes = [
m => m.AppsRoutingModule, m => m.AppsRoutingModule,
), ),
}, },
{
path: 'developer',
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
loadChildren: () =>
import('./pages/developer-routes/developer-routing.module').then(
m => m.DeveloperRoutingModule,
),
},
] ]
@NgModule({ @NgModule({

View File

@@ -29,13 +29,12 @@ export class AppComponent implements OnDestroy {
this.authService.isVerified$, this.authService.isVerified$,
this.connection.connected$, this.connection.connected$,
this.patch this.patch
.watch$('server-info', 'status-info') .watch$('serverInfo', 'statusInfo')
.pipe(startWith({ restarting: false, 'shutting-down': false })), .pipe(startWith({ restarting: false, shuttingDown: false })),
]).pipe( ]).pipe(
map( map(
([verified, connected, status]) => ([verified, connected, status]) =>
verified && verified && (!connected || status.restarting || status.shuttingDown),
(!connected || status.restarting || status['shutting-down']),
), ),
) )

View File

@@ -13,7 +13,7 @@ import { DataModel } from '../../services/patch-db/data-model'
}) })
export class FooterComponent { export class FooterComponent {
readonly progress$ = this.patch readonly progress$ = this.patch
.watch$('server-info', 'status-info', 'update-progress') .watch$('serverInfo', 'statusInfo', 'updateProgress')
.pipe(map(a => a && { ...a })) .pipe(map(a => a && { ...a }))
readonly animation = { readonly animation = {

View File

@@ -11,9 +11,7 @@ import {
filter, filter,
first, first,
map, map,
merge,
Observable, Observable,
of,
pairwise, pairwise,
startWith, startWith,
switchMap, switchMap,
@@ -24,14 +22,7 @@ import { DataModel, PackageState } from 'src/app/services/patch-db/data-model'
import { SplitPaneTracker } from 'src/app/services/split-pane.service' import { SplitPaneTracker } from 'src/app/services/split-pane.service'
import { Emver, THEME } from '@start9labs/shared' import { Emver, THEME } from '@start9labs/shared'
import { ConnectionService } from 'src/app/services/connection.service' import { ConnectionService } from 'src/app/services/connection.service'
import { ConfigService } from 'src/app/services/config.service' import { getManifest } from 'src/app/util/get-package-data'
import {
getManifest,
isInstalled,
isInstalling,
isRestoring,
isUpdating,
} from 'src/app/util/get-package-data'
@Component({ @Component({
selector: 'app-menu', selector: 'app-menu',
@@ -69,19 +60,19 @@ export class MenuComponent {
] ]
readonly notificationCount$ = this.patch.watch$( readonly notificationCount$ = this.patch.watch$(
'server-info', 'serverInfo',
'unread-notification-count', 'unreadNotificationCount',
) )
readonly snekScore$ = this.patch.watch$('ui', 'gaming', 'snake', 'high-score') readonly snekScore$ = this.patch.watch$('ui', 'gaming', 'snake', 'highScore')
readonly showEOSUpdate$ = this.eosService.showUpdate$ readonly showEOSUpdate$ = this.eosService.showUpdate$
private readonly local$ = this.connectionService.connected$.pipe( private readonly local$ = this.connectionService.connected$.pipe(
filter(Boolean), filter(Boolean),
switchMap(() => this.patch.watch$('package-data').pipe(first())), switchMap(() => this.patch.watch$('packageData').pipe(first())),
switchMap(outer => switchMap(outer =>
this.patch.watch$('package-data').pipe( this.patch.watch$('packageData').pipe(
pairwise(), pairwise(),
filter(([prev, curr]) => filter(([prev, curr]) =>
Object.values(prev).some( Object.values(prev).some(
@@ -90,9 +81,9 @@ export class MenuComponent {
PackageState.Installing, PackageState.Installing,
PackageState.Updating, PackageState.Updating,
PackageState.Restoring, PackageState.Restoring,
].includes(p['state-info'].state) && ].includes(p.stateInfo.state) &&
[PackageState.Installed, PackageState.Removing].includes( [PackageState.Installed, PackageState.Removing].includes(
curr[getManifest(p).id]['state-info'].state, curr[getManifest(p).id].stateInfo.state,
), ),
), ),
), ),
@@ -136,6 +127,5 @@ export class MenuComponent {
private readonly splitPane: SplitPaneTracker, private readonly splitPane: SplitPaneTracker,
private readonly emver: Emver, private readonly emver: Emver,
private readonly connectionService: ConnectionService, private readonly connectionService: ConnectionService,
private readonly config: ConfigService,
) {} ) {}
} }

View File

@@ -56,7 +56,7 @@ export class BackupService {
} }
hasValidBackup(target: BackupTarget): boolean { hasValidBackup(target: BackupTarget): boolean {
const backup = target['embassy-os'] const backup = target.startOs
return !!backup && this.emver.compare(backup.version, '0.3.0') !== -1 return !!backup && this.emver.compare(backup.version, '0.3.0') !== -1
} }
} }

View File

@@ -21,8 +21,8 @@ const { enableWidgets } =
}) })
export class BadgeMenuComponent { export class BadgeMenuComponent {
readonly unreadCount$ = this.patch.watch$( readonly unreadCount$ = this.patch.watch$(
'server-info', 'serverInfo',
'unread-notification-count', 'unreadNotificationCount',
) )
readonly sidebarOpen$ = this.splitPane.sidebarOpen$ readonly sidebarOpen$ = this.splitPane.sidebarOpen$
readonly widgetDrawer$ = this.clientStorageService.widgetDrawer$ readonly widgetDrawer$ = this.clientStorageService.widgetDrawer$

View File

@@ -22,8 +22,8 @@ export class ConnectionBarComponent {
this.connectionService.networkConnected$, this.connectionService.networkConnected$,
this.websocket$.pipe(startWith(false)), this.websocket$.pipe(startWith(false)),
this.patch this.patch
.watch$('server-info', 'status-info') .watch$('serverInfo', 'statusInfo')
.pipe(startWith({ restarting: false, 'shutting-down': false })), .pipe(startWith({ restarting: false, shuttingDown: false })),
]).pipe( ]).pipe(
map(([network, websocket, status]) => { map(([network, websocket, status]) => {
if (!network) if (!network)
@@ -40,7 +40,7 @@ export class ConnectionBarComponent {
icon: 'cloud-offline-outline', icon: 'cloud-offline-outline',
dots: true, dots: true,
} }
if (status['shutting-down']) if (status.shuttingDown)
return { return {
message: 'Shutting Down', message: 'Shutting Down',
color: 'dark', color: 'dark',

View File

@@ -78,7 +78,7 @@ export class LogsComponent {
async ngOnInit() { async ngOnInit() {
from(this.followLogs({ limit: this.limit })) from(this.followLogs({ limit: this.limit }))
.pipe( .pipe(
switchMap(({ 'start-cursor': startCursor, guid }) => { switchMap(({ startCursor, guid }) => {
this.startCursor = startCursor this.startCursor = startCursor
return this.connect$(guid) return this.connect$(guid)
}), }),
@@ -206,7 +206,7 @@ export class LogsComponent {
} }
private processRes(res: LogsRes) { private processRes(res: LogsRes) {
const { entries, 'start-cursor': startCursor } = res const { entries, startCursor } = res
if (!entries.length) return if (!entries.length) return

View File

@@ -7,7 +7,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class NotificationsToastService extends Observable<boolean> { export class NotificationsToastService extends Observable<boolean> {
private readonly stream$ = this.patch private readonly stream$ = this.patch
.watch$('server-info', 'unread-notification-count') .watch$('serverInfo', 'unreadNotificationCount')
.pipe( .pipe(
pairwise(), pairwise(),
map(([prev, cur]) => cur > prev), map(([prev, cur]) => cur > prev),

View File

@@ -8,7 +8,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class RefreshAlertService extends Observable<boolean> { export class RefreshAlertService extends Observable<boolean> {
private readonly stream$ = this.patch.watch$('server-info', 'version').pipe( private readonly stream$ = this.patch.watch$('serverInfo', 'version').pipe(
map(version => !!this.emver.compare(this.config.version, version)), map(version => !!this.emver.compare(this.config.version, version)),
endWith(false), endWith(false),
) )

View File

@@ -7,7 +7,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class UpdateToastService extends Observable<boolean> { export class UpdateToastService extends Observable<boolean> {
private readonly stream$ = this.patch private readonly stream$ = this.patch
.watch$('server-info', 'status-info', 'updated') .watch$('serverInfo', 'statusInfo', 'updated')
.pipe(distinctUntilChanged(), filter(Boolean), endWith(false)) .pipe(distinctUntilChanged(), filter(Boolean), endWith(false))
constructor(private readonly patch: PatchDB<DataModel>) { constructor(private readonly patch: PatchDB<DataModel>) {

View File

@@ -9,7 +9,7 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content class="ion-padding" *ngIf="pkg['state-info'].manifest as manifest"> <ion-content class="ion-padding" *ngIf="pkg.stateInfo.manifest as manifest">
<!-- loading --> <!-- loading -->
<text-spinner <text-spinner
*ngIf="loading; else notLoading" *ngIf="loading; else notLoading"
@@ -82,7 +82,7 @@
</ion-item> </ion-item>
<!-- no options --> <!-- no options -->
<ion-item *ngIf="!hasOptions"> <ion-item *ngIf="!hasConfig">
<ion-label> <ion-label>
<p> <p>
No config options for {{ manifest.title }} {{ manifest.version }}. No config options for {{ manifest.title }} {{ manifest.version }}.
@@ -111,11 +111,7 @@
<ion-footer> <ion-footer>
<ion-toolbar> <ion-toolbar>
<ng-container *ngIf="!loading && !loadingError"> <ng-container *ngIf="!loading && !loadingError">
<ion-buttons <ion-buttons *ngIf="hasConfig" slot="start" class="ion-padding-start">
*ngIf="configForm && hasOptions"
slot="start"
class="ion-padding-start"
>
<ion-button fill="clear" (click)="resetDefaults()"> <ion-button fill="clear" (click)="resetDefaults()">
<ion-icon slot="start" name="refresh"></ion-icon> <ion-icon slot="start" name="refresh"></ion-icon>
Reset Defaults Reset Defaults
@@ -123,7 +119,7 @@
</ion-buttons> </ion-buttons>
<ion-buttons slot="end" class="ion-padding-end"> <ion-buttons slot="end" class="ion-padding-end">
<ion-button <ion-button
*ngIf="configForm" *ngIf="hasConfig"
fill="solid" fill="solid"
color="primary" color="primary"
[disabled]="saving" [disabled]="saving"
@@ -134,7 +130,7 @@
Save Save
</ion-button> </ion-button>
<ion-button <ion-button
*ngIf="!configForm" *ngIf="!hasConfig"
fill="solid" fill="solid"
color="dark" color="dark"
(click)="dismiss()" (click)="dismiss()"

View File

@@ -59,8 +59,6 @@ export class AppConfigPage {
saving = false saving = false
loadingError: string | IonicSafeString = '' loadingError: string | IonicSafeString = ''
hasOptions = false
constructor( constructor(
private readonly embassyApi: ApiService, private readonly embassyApi: ApiService,
private readonly errToast: ErrorToastService, private readonly errToast: ErrorToastService,
@@ -71,6 +69,10 @@ export class AppConfigPage {
private readonly patch: PatchDB<DataModel>, private readonly patch: PatchDB<DataModel>,
) {} ) {}
get hasConfig() {
return this.pkg.stateInfo.manifest.hasConfig
}
async ngOnInit() { async ngOnInit() {
try { try {
const pkg = await getPackage(this.patch, this.pkgId) const pkg = await getPackage(this.patch, this.pkgId)
@@ -78,7 +80,7 @@ export class AppConfigPage {
this.pkg = pkg this.pkg = pkg
if (!this.pkg['state-info'].manifest['has-config']) return if (!this.hasConfig) return
let newConfig: object | undefined let newConfig: object | undefined
let patch: Operation[] | undefined let patch: Operation[] | undefined
@@ -86,12 +88,12 @@ export class AppConfigPage {
if (this.dependentInfo) { if (this.dependentInfo) {
this.loadingText = `Setting properties to accommodate ${this.dependentInfo.title}` this.loadingText = `Setting properties to accommodate ${this.dependentInfo.title}`
const { const {
'old-config': oc, oldConfig: oc,
'new-config': nc, newConfig: nc,
spec: s, spec: s,
} = await this.embassyApi.dryConfigureDependency({ } = await this.embassyApi.dryConfigureDependency({
'dependency-id': this.pkgId, dependencyId: this.pkgId,
'dependent-id': this.dependentInfo.id, dependentId: this.dependentInfo.id,
}) })
this.original = oc this.original = oc
newConfig = nc newConfig = nc
@@ -111,10 +113,6 @@ export class AppConfigPage {
newConfig || this.original, newConfig || this.original,
) )
this.hasOptions = !!Object.values(this.configSpec).find(
valSpec => valSpec.type !== 'pointer',
)
if (patch) { if (patch) {
this.diff = this.getDiff(patch) this.diff = this.getDiff(patch)
this.markDirty(patch) this.markDirty(patch)

View File

@@ -1,5 +1,5 @@
<ng-container <ng-container
*ngIf="packageData$ | toOptions : backupInfo['package-backups'] | async as options" *ngIf="packageData$ | toOptions : backupInfo.packageBackups | async as options"
> >
<ion-header> <ion-header>
<ion-toolbar> <ion-toolbar>

View File

@@ -23,7 +23,7 @@ export class AppRecoverSelectPage {
@Input() password!: string @Input() password!: string
@Input() oldPassword?: string @Input() oldPassword?: string
readonly packageData$ = this.patch.watch$('package-data').pipe(take(1)) readonly packageData$ = this.patch.watch$('packageData').pipe(take(1))
hasSelection = false hasSelection = false
error: string | IonicSafeString = '' error: string | IonicSafeString = ''
@@ -53,8 +53,8 @@ export class AppRecoverSelectPage {
try { try {
await this.embassyApi.restorePackages({ await this.embassyApi.restorePackages({
ids, ids,
'target-id': this.id, targetId: this.id,
'old-password': this.oldPassword || null, oldPassword: this.oldPassword || null,
password: this.password, password: this.password,
}) })
this.modalCtrl.dismiss(undefined, 'success') this.modalCtrl.dismiss(undefined, 'success')

View File

@@ -34,7 +34,7 @@ export class ToOptionsPipe implements PipeTransform {
id, id,
installed: !!packageData[id], installed: !!packageData[id],
checked: false, checked: false,
'newer-eos': this.compare(packageBackups[id]['os-version']), 'newer-eos': this.compare(packageBackups[id].osVersion),
})) }))
.sort((a, b) => .sort((a, b) =>
b.title.toLowerCase() > a.title.toLowerCase() ? -1 : 1, b.title.toLowerCase() > a.title.toLowerCase() ? -1 : 1,

View File

@@ -29,7 +29,7 @@ export class BackupSelectPage {
async ngOnInit() { async ngOnInit() {
this.pkgs = await firstValueFrom( this.pkgs = await firstValueFrom(
this.patch.watch$('package-data').pipe( this.patch.watch$('packageData').pipe(
map(pkgs => { map(pkgs => {
return Object.values(pkgs) return Object.values(pkgs)
.map(pkg => { .map(pkg => {
@@ -38,7 +38,7 @@ export class BackupSelectPage {
id, id,
title, title,
icon: pkg.icon, icon: pkg.icon,
disabled: pkg['state-info'].state !== PackageState.Installed, disabled: pkg.stateInfo.state !== PackageState.Installed,
checked: false, checked: false,
} }
}) })

View File

@@ -200,7 +200,7 @@ export class MarketplaceSettingsPage {
): Promise<void> { ): Promise<void> {
// Error on duplicates // Error on duplicates
const hosts = await firstValueFrom( const hosts = await firstValueFrom(
this.patch.watch$('ui', 'marketplace', 'known-hosts'), this.patch.watch$('ui', 'marketplace', 'knownHosts'),
) )
const currentUrls = Object.keys(hosts).map(toUrl) const currentUrls = Object.keys(hosts).map(toUrl)
if (currentUrls.includes(url)) throw new Error('marketplace already added') if (currentUrls.includes(url)) throw new Error('marketplace already added')
@@ -217,7 +217,7 @@ export class MarketplaceSettingsPage {
loader.message = 'Saving...' loader.message = 'Saving...'
await this.api.setDbValue<{ name: string }>( await this.api.setDbValue<{ name: string }>(
['marketplace', 'known-hosts', url], ['marketplace', 'knownHosts', url],
{ name }, { name },
) )
} }
@@ -229,7 +229,7 @@ export class MarketplaceSettingsPage {
await loader.present() await loader.present()
const hosts = await firstValueFrom( const hosts = await firstValueFrom(
this.patch.watch$('ui', 'marketplace', 'known-hosts'), this.patch.watch$('ui', 'marketplace', 'knownHosts'),
) )
const filtered: { [url: string]: UIStore } = Object.keys(hosts) const filtered: { [url: string]: UIStore } = Object.keys(hosts)
@@ -244,7 +244,7 @@ export class MarketplaceSettingsPage {
try { try {
await this.api.setDbValue<{ [url: string]: UIStore }>( await this.api.setDbValue<{ [url: string]: UIStore }>(
['marketplace', 'known-hosts'], ['marketplace', 'knownHosts'],
filtered, filtered,
) )
} catch (e: any) { } catch (e: any) {

View File

@@ -22,7 +22,7 @@ export class OSUpdatePage {
) {} ) {}
ngOnInit() { ngOnInit() {
const releaseNotes = this.eosService.eos?.['release-notes']! const releaseNotes = this.eosService.eos?.releaseNotes!
this.versions = Object.keys(releaseNotes) this.versions = Object.keys(releaseNotes)
.sort() .sort()

View File

@@ -9,7 +9,7 @@
<ion-content class="ion-padding-top with-widgets"> <ion-content class="ion-padding-top with-widgets">
<ng-container *ngIf="pkg$ | async as pkg"> <ng-container *ngIf="pkg$ | async as pkg">
<ion-item-group *ngIf="pkg['state-info'].state === 'installed'"> <ion-item-group *ngIf="pkg.stateInfo.state === 'installed'">
<!-- ** standard actions ** --> <!-- ** standard actions ** -->
<ion-item-divider>Standard Actions</ion-item-divider> <ion-item-divider>Standard Actions</ion-item-divider>
<app-actions-item <app-actions-item
@@ -23,7 +23,7 @@
<!-- ** specific actions ** --> <!-- ** specific actions ** -->
<ion-item-divider *ngIf="!(pkg.actions | empty)"> <ion-item-divider *ngIf="!(pkg.actions | empty)">
Actions for {{ pkg['state-info'].manifest.title }} Actions for {{ pkg.stateInfo.manifest.title }}
</ion-item-divider> </ion-item-divider>
<app-actions-item <app-actions-item
*ngFor="let action of pkg.actions | keyvalue: asIsOrder" *ngFor="let action of pkg.actions | keyvalue: asIsOrder"

View File

@@ -29,7 +29,7 @@ import { ActionMetadata } from '@start9labs/start-sdk/cjs/sdk/lib/types'
}) })
export class AppActionsPage { export class AppActionsPage {
readonly pkgId = getPkgId(this.route) readonly pkgId = getPkgId(this.route)
readonly pkg$ = this.patch.watch$('package-data', this.pkgId) readonly pkg$ = this.patch.watch$('packageData', this.pkgId)
constructor( constructor(
private readonly route: ActivatedRoute, private readonly route: ActivatedRoute,
@@ -184,7 +184,7 @@ export class AppActionsPage {
try { try {
const res = await this.embassyApi.executePackageAction({ const res = await this.embassyApi.executePackageAction({
id: this.pkgId, id: this.pkgId,
'action-id': actionId, actionId,
input, input,
}) })

View File

@@ -29,7 +29,7 @@ export class AppInterfacesPage {
readonly pkgId = getPkgId(this.route) readonly pkgId = getPkgId(this.route)
readonly serviceInterfaces$ = this.patch readonly serviceInterfaces$ = this.patch
.watch$('package-data', this.pkgId, 'service-interfaces') .watch$('packageData', this.pkgId, 'serviceInterfaces')
.pipe( .pipe(
map(interfaces => { map(interfaces => {
const sorted = Object.values(interfaces) const sorted = Object.values(interfaces)

View File

@@ -14,20 +14,20 @@
<p>{{ manifest.version | displayEmver }}</p> <p>{{ manifest.version | displayEmver }}</p>
<status <status
[rendering]="pkg.primaryRendering" [rendering]="pkg.primaryRendering"
[installingInfo]="$any(pkg.entry['state-info'])['installing-info']" [installingInfo]="$any(pkg.entry.stateInfo).installingInfo"
weight="bold" weight="bold"
size="small" size="small"
[sigtermTimeout]="sigtermTimeout" [sigtermTimeout]="sigtermTimeout"
></status> ></status>
</ion-label> </ion-label>
<ion-button <ion-button
*ngIf="pkg.entry['service-interfaces'] | hasUi" *ngIf="pkg.entry.serviceInterfaces | hasUi"
slot="end" slot="end"
fill="clear" fill="clear"
color="primary" color="primary"
(click)="launchUi($event, pkg.entry['service-interfaces'])" (click)="launchUi($event, pkg.entry.serviceInterfaces)"
[disabled]=" [disabled]="
!(pkg.entry['state-info'].state | isLaunchable: pkgMainStatus.status) !(pkg.entry.stateInfo.state | isLaunchable: pkgMainStatus.status)
" "
> >
<ion-icon slot="icon-only" name="open-outline"></ion-icon> <ion-icon slot="icon-only" name="open-outline"></ion-icon>

View File

@@ -32,7 +32,7 @@ export class AppListPkgComponent {
: null : null
} }
launchUi(e: Event, interfaces: PackageDataEntry['service-interfaces']): void { launchUi(e: Event, interfaces: PackageDataEntry['serviceInterfaces']): void {
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
this.launcherService.launch(interfaces) this.launcherService.launch(interfaces)

View File

@@ -11,7 +11,7 @@ import { getManifest } from 'src/app/util/get-package-data'
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class AppListPage { export class AppListPage {
readonly pkgs$ = this.patch.watch$('package-data').pipe( readonly pkgs$ = this.patch.watch$('packageData').pipe(
map(pkgs => Object.values(pkgs)), map(pkgs => Object.values(pkgs)),
startWith([]), startWith([]),
pairwise(), pairwise(),

View File

@@ -17,7 +17,7 @@ export class PackageInfoPipe implements PipeTransform {
transform(pkgId: string): Observable<PkgInfo> { transform(pkgId: string): Observable<PkgInfo> {
return combineLatest([ return combineLatest([
this.patch.watch$('package-data', pkgId).pipe(filter(Boolean)), this.patch.watch$('packageData', pkgId).pipe(filter(Boolean)),
this.depErrorService.getPkgDepErrors$(pkgId), this.depErrorService.getPkgDepErrors$(pkgId),
]).pipe(map(([pkg, depErrors]) => getPackageInfo(pkg, depErrors))) ]).pipe(map(([pkg, depErrors]) => getPackageInfo(pkg, depErrors)))
} }

View File

@@ -41,7 +41,7 @@ export class AppPropertiesPage {
unmasked: { [key: string]: boolean } = {} unmasked: { [key: string]: boolean } = {}
stopped$ = this.patch stopped$ = this.patch
.watch$('package-data', this.pkgId, 'status', 'main', 'status') .watch$('packageData', this.pkgId, 'status', 'main', 'status')
.pipe(map(status => status === PackageMainStatus.Stopped)) .pipe(map(status => status === PackageMainStatus.Stopped))
@ViewChild(IonBackButtonDelegate, { static: false }) @ViewChild(IonBackButtonDelegate, { static: false })

Some files were not shown because too many files have changed in this diff Show More