smbcloud_ascapi_frontend/lib.rs
1//! Operations shared by the `asc` command line and its MCP server.
2//!
3//! Both surfaces need the same things: resolve credentials, call the App
4//! Store Connect client, and shape the result into something worth showing
5//! a human or handing a model. Putting that here means the two front ends
6//! cannot drift, and in particular that the ordering guarantee in
7//! [`certificates::issue_certificate`] (private key written before the
8//! network call) has exactly one implementation.
9//!
10//! Two rules the result types are built around, because one of the
11//! consumers is a language model:
12//!
13//! - **No key material in a result.** [`certificates::IssuedCertificate`]
14//! carries the path a key was written to, never the key. Enforced by
15//! construction rather than filtered at the edge, since a filter is one
16//! refactor away from being bypassed.
17//! - **No certificate bodies either.** They are large, never needed to
18//! decide what to do next, and would otherwise land in a transcript.
19//! [`profiles::ProfileSummary`] applies the same rule to
20//! `profileContent`, and [`profiles::download_profile`] returns the path
21//! it wrote instead.
22
23pub mod certificates;
24pub mod enums;
25pub mod env;
26pub mod profiles;
27pub mod review;
28pub mod time;
29pub mod upload;
30
31pub use certificates::{
32 certificate_type_from_str, issue_certificate, CertificateSummary, IssuedCertificate,
33};
34pub use enums::{bundle_id_platform_from_str, display_type_from_str, platform_from_str};
35pub use env::api_key_from_env;
36pub use profiles::{download_profile, profile_type_from_str, DownloadedProfile, ProfileSummary};
37pub use review::{plan_submission, submit_for_review, SubmissionPlan, SubmittedReview};
38pub use time::{is_expired, now_iso8601};
39pub use upload::{upload_package, AltoolAuth, UploadOutcome};