-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
response.rs
88 lines (65 loc) · 2.09 KB
/
response.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use std::collections::BTreeMap;
use serde::Serialize;
use ulid::Ulid;
use crate::components::profile::Profile;
use crate::components::site::Site;
use crate::storage::Config;
/// TODO: Docs
#[derive(Serialize, Debug, PartialEq, Clone)]
#[serde(tag = "type", content = "data")]
pub enum ConnectorResponse {
/// Versions of the installed system components.
SystemVersions {
/// Version of the PWAsForFirefox native program.
///
/// Always set. When using a development version,
/// commonly set to `0.0.0`.
firefoxpwa: Option<String>,
/// Version of the Firefox runtime.
///
/// Only set if the runtime is installed.
firefox: Option<String>,
/// Version of the 7-Zip program.
///
/// Only set on Windows, and if 7-Zip is installed.
/// May also be `0.0.0` if 7-Zip was located through
/// the `PATH` environment variable.
_7zip: Option<String>,
},
/// Config of the native program.
Config(Config),
/// Config of the native program has been set.
ConfigSet,
/// Runtime has been installed.
RuntimeInstalled,
/// Runtime has been uninstalled.
RuntimeUninstalled,
/// List of all installed web apps.
SiteList(BTreeMap<Ulid, Site>),
/// Web app has been launched.
SiteLaunched,
/// Web app has been installed.
SiteInstalled(Ulid),
/// Web app has been uninstalled.
SiteUninstalled,
/// Web app has been updated.
SiteUpdated,
/// All web apps have been updated.
AllSitesUpdated,
/// List of all available profiles.
ProfileList(BTreeMap<Ulid, Profile>),
/// Profile has been created.
ProfileCreated(Ulid),
/// Profile has been removed.
ProfileRemoved,
/// Profile has been updated.
ProfileUpdated,
/// All profiles and runtime have been patched.
AllProfilesPatched,
/// Protocol handler has been registered.
ProtocolHandlerRegistered,
/// Protocol handler has been unregistered.
ProtocolHandlerUnregistered,
/// Something went wrong...
Error(String),
}