canic_host/frontend/view/
mod.rs1use crate::{frontend::model::FrontendManifestRecord, registry::RegistryEntry};
4use canic_core::ids::CanonicalNetworkId;
5use std::collections::BTreeMap;
6
7pub struct FrontendAssetChunkView {
14 pub content: Vec<u8>,
15 pub total_length: u64,
16 pub encoding: String,
17 pub sha256: Option<Vec<u8>>,
18}
19
20#[derive(Debug, Eq, PartialEq, serde::Serialize)]
27pub struct FrontendUploadedFileView {
28 pub key: String,
29 pub bytes: u64,
30 pub sha256: String,
31}
32
33#[derive(Debug, Eq, PartialEq, serde::Serialize)]
40pub struct FrontendUploadView {
41 pub environment: String,
42 pub canister_id: candid::Principal,
43 pub manifest_sha256: String,
44 pub files: Vec<FrontendUploadedFileView>,
45}
46
47#[derive(Debug, Eq, PartialEq, serde::Serialize)]
49pub struct FrontendPayloadView {
50 pub files: u32,
51 pub bytes: u64,
52 pub sha256: String,
53}
54
55#[derive(Debug, Eq, PartialEq, serde::Serialize)]
57pub struct FrontendAssetCapacityView {
58 pub environment: String,
59 pub canister_id: String,
60 pub observed_at_unix_secs: u64,
61 pub native_cycles: String,
62 pub minimum_native_cycles: String,
63 pub payload: FrontendPayloadView,
64 pub sufficient: bool,
65}
66
67pub struct FrontendAuthorityView {
69 pub app: String,
70 pub fleet: String,
71 pub fleet_id: String,
72 pub source_plan_sha256: String,
73 pub network: CanonicalNetworkId,
74 pub admission_nonempty: bool,
75 pub admission_origin: Option<String>,
76 pub entries: Vec<RegistryEntry>,
77}
78
79pub struct FrontendBundleView {
81 pub manifest: FrontendManifestRecord,
82 pub files: BTreeMap<String, Vec<u8>>,
83}
84
85pub struct FrontendBindingsView {
87 pub javascript: Vec<u8>,
88 pub typescript: Vec<u8>,
89}