Add publish preview retention policy, normalize refresh/cached contract, and add storage audit and cleanup admin endpoints
This commit is contained in:
@@ -59,6 +59,28 @@ async def list_scheme_artifacts(
|
||||
return list(result.scalars().all())
|
||||
|
||||
|
||||
async def list_artifacts_by_type(
|
||||
*,
|
||||
artifact_type: str,
|
||||
artifact_variant: str | None = None,
|
||||
) -> list[SchemeArtifactRecord]:
|
||||
async with AsyncSessionLocal() as session:
|
||||
stmt = select(SchemeArtifactRecord).where(
|
||||
SchemeArtifactRecord.artifact_type == artifact_type
|
||||
)
|
||||
|
||||
if artifact_variant is not None:
|
||||
stmt = stmt.where(SchemeArtifactRecord.artifact_variant == artifact_variant)
|
||||
|
||||
stmt = stmt.order_by(
|
||||
asc(SchemeArtifactRecord.created_at),
|
||||
asc(SchemeArtifactRecord.id),
|
||||
)
|
||||
|
||||
result = await session.execute(stmt)
|
||||
return list(result.scalars().all())
|
||||
|
||||
|
||||
async def artifact_exists(
|
||||
*,
|
||||
scheme_version_id: str,
|
||||
|
||||
Reference in New Issue
Block a user