From ce7e2eea80a477c2d4f8558b00e8c51d408fa63c Mon Sep 17 00:00:00 2001 From: brandonrc Date: Thu, 9 Jul 2026 22:54:40 +0000 Subject: [PATCH] refactor(sdk): replace glob re-export with explicit public API facade The SDK crate re-exported everything from the generated module via pub use generated_sdk::*, making all generated items public API and turning every regeneration into a potential breaking change. Replace the glob with an explicit facade in sdk/src/lib.rs: - Client plus the progenitor runtime types (ByteStream, ClientInfo, Error, ResponseValue) re-exported by name - types, builder, and prelude kept as namespaced modules - all 37 Client*Ext operation traits listed explicitly The generated_sdk module stays private, so new generated items no longer leak into the public surface implicitly; additions to the API now require an intentional edit to the facade list. No behavior change; pure re-export restructuring. Closes #72 --- sdk/src/lib.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index ce22c4d..d833871 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -1,3 +1,12 @@ +//! Rust SDK for the Artifact Keeper REST API. +//! +//! The items re-exported below form the crate's intentional public API. +//! The `generated_sdk` module is produced by `cargo xtask generate` and is +//! deliberately private: only the names listed here are exposed, so an SDK +//! regeneration cannot silently change the public surface. When regeneration +//! adds a new operation tag (a new `Client*Ext` trait) or top-level item, +//! add it to the explicit re-export list below. + /// Re-export progenitor_client for consumers. pub use progenitor_client; pub use reqwest; @@ -5,4 +14,22 @@ pub use reqwest; #[allow(clippy::all, unused, dead_code, unreachable_code)] mod generated_sdk; -pub use generated_sdk::*; +// Core client and progenitor runtime types used in operation signatures. +pub use generated_sdk::{ByteStream, Client, ClientInfo, Error, ResponseValue}; + +// Namespaced modules: request/response types, operation builders, and the +// convenience prelude (Client + all extension traits). +pub use generated_sdk::{builder, prelude, types}; + +// Per-tag operation extension traits. +pub use generated_sdk::{ + ClientAdminExt, ClientAgeGateExt, ClientAnalyticsExt, ClientApprovalExt, + ClientArtifactLabelsExt, ClientArtifactsExt, ClientAuthExt, ClientBuildsExt, ClientCurationExt, + ClientEmailSubscriptionsExt, ClientGroupsExt, ClientHealthExt, ClientLifecycleExt, + ClientMigrationExt, ClientMonitoringExt, ClientPackagesExt, ClientPeerInstanceLabelsExt, + ClientPeersExt, ClientPermissionsExt, ClientPluginsExt, ClientPromotionExt, ClientQualityExt, + ClientQuarantineExt, ClientRepositoriesExt, ClientRepositoryLabelsExt, + ClientRepositoryTokensExt, ClientSbomExt, ClientSearchExt, ClientSecurityExt, + ClientServiceAccountsExt, ClientSigningExt, ClientSsoExt, ClientSystemExt, ClientTelemetryExt, + ClientUploadsExt, ClientUsersExt, ClientWebhooksExt, +};