























@@ -62,6 +62,14 @@ export type ClawHubArtifactScanState =
6262| "not-run"
6363| (string & {});
6464export type ClawHubArtifactModerationState = "approved" | "quarantined" | "revoked" | (string & {});
65+export type ClawHubPackageSecurityState =
66+| "pending"
67+| "approved"
68+| "limited"
69+| "quarantined"
70+| "rejected"
71+| "revoked"
72+| (string & {});
6573export type ClawHubResolvedArtifact =
6674| {
6775source: "clawhub";
@@ -90,6 +98,17 @@ export type ClawHubPackageArtifactResolverResponse = {
9098version?: { version?: string | null } | string | null;
9199artifact?: ClawHubResolvedArtifact | null;
92100};
101+export type ClawHubPackageSecurityResponse = {
102+packageId?: string | null;
103+releaseId?: string | null;
104+state: ClawHubPackageSecurityState;
105+reasonCode?: string | null;
106+moderatorNote?: string | null;
107+actorId?: string | null;
108+createdAt?: number | null;
109+scanState?: ClawHubArtifactScanState | null;
110+moderationState?: ClawHubArtifactModerationState | null;
111+};
93112export type ClawHubPackageClawPackSummary = {
94113available: boolean;
95114specVersion?: number | null;
@@ -674,6 +693,25 @@ export async function fetchClawHubPackageArtifact(params: {
674693});
675694}
676695696+export async function fetchClawHubPackageSecurity(params: {
697+name: string;
698+version: string;
699+baseUrl?: string;
700+token?: string;
701+timeoutMs?: number;
702+fetchImpl?: FetchLike;
703+}): Promise<ClawHubPackageSecurityResponse> {
704+return await fetchJson<ClawHubPackageSecurityResponse>({
705+baseUrl: params.baseUrl,
706+path: `/api/v1/packages/${encodeURIComponent(params.name)}/versions/${encodeURIComponent(
707+ params.version,
708+ )}/security`,
709+token: params.token,
710+timeoutMs: params.timeoutMs,
711+fetchImpl: params.fetchImpl,
712+});
713+}
714+677715export async function fetchClawHubPackageReadiness(params: {
678716name: string;
679717baseUrl?: string;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。