Skip to main content

RegistryApi

Struct RegistryApi 

Source
pub struct RegistryApi { /* private fields */ }
Expand description

Spec registry — publish, search, yank, share spec artifacts

Implementations§

Source§

impl RegistryApi

Source

pub async fn feature_registry_spec( &self, scope: &str, name: &str, ) -> Result<RegistrySpecFeatureState>

Add a SPEC to the featured set (super-admin)

The SPEC’s existence is confirmed BEFORE the featured set is touched, so a typo cannot leave a dangling id in a shared list — that is what the 404 protects. The set itself is mutated under a compare-and-set retry, because it is one shared record and a plain read-modify-write was last-writer-wins.

Idempotent: featuring an already-featured SPEC is 200, not a conflict.

POST /api/v1/registry/admin/specs/{scope}/{name}/feature

Source

pub async fn registry_admin_list_specs( &self, params: &RegistryAdminListSpecsParams, ) -> Result<RegistryAdminListSpecsResponse>

Admin: list all specs (regardless of visibility)

GET /api/v1/registry/admin/specs

Source

pub async fn registry_get_artifact( &self, scope: &str, name: &str, version: &str, ) -> Result<Bytes>

Download tarball/artifact bundle for a spec version

GET /api/v1/registry/spec/{scope}/{name}/{version}/artifact

Source

pub async fn registry_get_file( &self, scope: &str, name: &str, version: &str, params: &RegistryGetFileParams, ) -> Result<RegistryGetFileResponse>

Get a single file from inside a spec version artifact

GET /api/v1/registry/spec/{scope}/{name}/{version}/file

Source

pub async fn registry_get_readme( &self, scope: &str, name: &str, version: &str, ) -> Result<RegistryGetReadmeResponse>

Get README for a spec version

GET /api/v1/registry/spec/{scope}/{name}/{version}/readme

Source

pub async fn registry_get_share( &self, scope: &str, name: &str, ) -> Result<RegistryGetShareResponse>

Get share/visibility settings for a spec

GET /api/v1/registry/spec/{scope}/{name}/share

Source

pub async fn registry_get_sparse_index( &self, shard: &str, scope: &str, name: &str, ) -> Result<RegistryGetSparseIndexResponse>

Get sparse-index entry for a spec

GET /api/v1/registry/index/{shard}/{scope}/{name}

Source

pub async fn registry_get_spec_metadata( &self, scope: &str, name: &str, ) -> Result<RegistryGetSpecMetadataResponse>

Get spec metadata (latest version pointers, owners)

GET /api/v1/registry/spec/{scope}/{name}

Source

pub async fn registry_get_spec_version( &self, scope: &str, name: &str, version: &str, ) -> Result<RegistryGetSpecVersionResponse>

Get a specific version of a spec

Returns the full PublishedSpec record plus a download_url pointing at the artifact endpoint.

GET /api/v1/registry/spec/{scope}/{name}/{version}

Source

pub async fn registry_list_files( &self, scope: &str, name: &str, version: &str, ) -> Result<RegistryListFilesResponse>

List files inside a spec version artifact

GET /api/v1/registry/spec/{scope}/{name}/{version}/files

Source

pub async fn registry_publish( &self, body: &RegistryPublishRequest, ) -> Result<RegistryPublishResponse>

Publish a new spec version to the registry

Multipart upload of a tarball + manifest. Server validates manifest, verifies optional sha256, and persists the artifact. Returns the full PublishedSpec record. Location header points at the version’s metadata endpoint.

POST /api/v1/registry/publish

Search the registry for specs

GET /api/v1/registry/search

Source

pub async fn registry_set_share( &self, scope: &str, name: &str, body: &RegistrySetShareRequest, ) -> Result<RegistrySetShareResponse>

Set share/visibility settings for a spec

POST /api/v1/registry/spec/{scope}/{name}/share

Source

pub async fn registry_unyank_version( &self, scope: &str, name: &str, version: &str, ) -> Result<RegistryUnyankVersionResponse>

Reverse a yank on a published spec version

POST /api/v1/registry/spec/{scope}/{name}/{version}/unyank

Source

pub async fn registry_yank_version( &self, scope: &str, name: &str, version: &str, body: &RegistryYankVersionRequest, ) -> Result<RegistryYankVersionResponse>

Yank (mark unsafe) a published spec version

POST /api/v1/registry/spec/{scope}/{name}/{version}/yank

Source

pub async fn seed_starter_specs(&self) -> Result<SeedStarterSpecsResponse>

Bulk-publish the bundled starter SPECs (super-admin)

Idempotent: a starter SPEC already present is counted in skipped, not republished, so re-running is safe and is how a partially-failed seed is completed.

errors is present ONLY when at least one SPEC failed. Its absence means no failures — not that the field is unavailable — so a client should treat missing as empty rather than unknown. A run can be partially successful: added and errors are both meaningful in the same response, and the status is still 200.

POST /api/v1/registry/admin/specs/seed

Source

pub async fn set_registry_spec_visibility( &self, scope: &str, name: &str, body: &SetRegistrySpecVisibilityRequest, ) -> Result<SetRegistrySpecVisibilityResponse>

Make a SPEC public or private (super-admin)

PATCH and only PATCH — a PUT is 405 with the allowed methods named.

WRITE SEMANTICS: replaces the visibility, which is the only field this route touches. visibility is required and must be exactly public or private; anything else, including a missing body or a near-miss like unlisted, is 400 rather than being coerced or ignored.

PATCH /api/v1/registry/admin/specs/{scope}/{name}/visibility

Source

pub async fn unfeature_registry_spec( &self, scope: &str, name: &str, ) -> Result<RegistrySpecFeatureState>

Remove a SPEC from the featured set (super-admin)

Same shape and same guards as the POST; the response’s featured is simply false. Idempotent — un-featuring something that was not featured is 200.

DELETE /api/v1/registry/admin/specs/{scope}/{name}/feature

Trait Implementations§

Source§

impl Clone for RegistryApi

Source§

fn clone(&self) -> RegistryApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegistryApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more