#![doc(
html_logo_url = "https://raw.githubusercontent.com/leptoskit/leptoskit/main/docs/src/assets/icon.svg"
)]
#![doc(
html_favicon_url = "https://raw.githubusercontent.com/leptoskit/leptoskit/main/docs/src/assets/mark.svg"
)]
pub use ed25519_dalek;
pub use semver;
pub mod client;
pub mod delta;
pub mod dev;
mod durable;
pub mod installed;
pub mod layout;
pub mod manifest;
pub mod provenance;
pub mod publish;
#[cfg(feature = "server")]
pub mod routes;
pub mod signing;
pub mod store;
pub use client::CodePushClient;
pub use client::FileTransport;
pub use client::SyncReport;
pub use client::Transport;
pub use client::UpdateOffer;
pub use client::UpdatePlan;
pub use delta::Delta;
pub use delta::DeltaOp;
pub use delta::apply_delta;
pub use delta::create_delta;
pub use layout::ChannelIndex;
pub use layout::ObjectKey;
pub use layout::ObjectKind;
pub use layout::StaticObject;
pub use manifest::BundleFile;
pub use manifest::BundleManifest;
pub use manifest::bundle_directory;
pub use manifest::bundle_directory_as;
pub use manifest::hash_bytes;
pub use manifest::read_container;
pub use provenance::ProvenanceConfiguration;
pub use provenance::ProvenancePolicy;
pub use provenance::ReleaseApprovals;
pub use provenance::SignedApproval;
pub use provenance::SourceApproval;
pub use provenance::VerifiedSource;
pub use publish::Bucket;
pub use publish::PublishReport;
pub use publish::PullReport;
pub use publish::publish_channel;
pub use publish::pull_channel;
#[cfg(feature = "server")]
pub use routes::codepush_router;
pub use signing::ReleasePublicKey;
pub use signing::ReleaseSignature;
pub use signing::ReleaseSigningKey;
pub use signing::TrustedKeys;
pub use store::AttachedApprovals;
pub use store::IngestedRelease;
pub use store::ReleaseRecord;
pub use store::ReleaseStore;
pub use store::StoreError;
#[derive(Debug, thiserror::Error)]
pub enum CodePushError {
#[error("native update error: {0}")]
Activation(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("serialization error: {0}")]
Serialize(#[from] serde_json::Error),
#[error("hash mismatch for {path}: expected {expected}, got {actual}")]
HashMismatch {
path: String,
expected: String,
actual: String,
},
#[error("delta base hash mismatch: expected {expected}, got {actual}")]
DeltaBaseMismatch {
expected: String,
actual: String,
},
#[error("transport error: {0}")]
Transport(String),
#[error("{0} was not found")]
NotFound(String),
#[error("release {0} does not exist")]
UnknownRelease(String),
#[error("release {0} already exists")]
ReleaseExists(String),
#[error("malformed artifact: {0}")]
Malformed(String),
#[error("unsupported manifest format version {0}")]
UnsupportedFormatVersion(u32),
#[error("invalid bundle file path {0:?}")]
InvalidPath(String),
#[error("invalid key: {0}")]
InvalidKey(String),
#[error("release {0} is not signed")]
Unsigned(String),
#[error("release is signed by an untrusted key {0}")]
UntrustedKey(String),
#[error("release {0} has an invalid signature")]
BadSignature(String),
#[error("invalid source approval: {0}")]
InvalidApproval(String),
#[error("invalid provenance policy: {0}")]
InvalidProvenance(String),
#[error(
"release {release} has {approvals} of the {threshold} source approvals this app requires"
)]
Unapproved {
release: String,
approvals: usize,
threshold: usize,
},
#[error("approvers disagree on the source of release {release}: {first} and {second}")]
ConflictingApprovals {
release: String,
first: String,
second: String,
},
#[error("offer is for {offered}, but the client tracks {tracked}")]
WrongTarget {
tracked: String,
offered: String,
},
#[error("offered release {offered} is not newer than the running {current}")]
NotNewer {
current: String,
offered: String,
},
#[error("channel {0} has no releases to publish")]
NoReleases(String),
#[error(
"the registry's newest release {registry} is newer than the store's {store}; publish from \
the store that released it"
)]
RegistryAhead {
registry: String,
store: String,
},
#[error("{0} differs between the store and the registry")]
RegistryConflict(String),
#[error("directory walk failed: {0}")]
Walk(#[from] walkdir::Error),
}
impl From<StoreError> for CodePushError {
fn from(error: StoreError) -> Self {
match error {
StoreError::Io(error) => Self::Io(error),
StoreError::Serialize(error) => Self::Serialize(error),
StoreError::CodePush(error) => error,
}
}
}