Expose sync reset API

This commit is contained in:
2026-05-08 19:10:04 -04:00
parent e9f8b1eb43
commit ed44db3034
9 changed files with 597 additions and 1 deletions
+5
View File
@@ -138,6 +138,11 @@ export async function getVerifiedObject(
return payload;
}
export async function deleteKnownObject(bucket: ElyR2Bucket, key: string): Promise<void> {
assertKnownObjectKey(key);
await bucket.delete(key);
}
function assertKnownObjectKey(key: string): void {
const matches = [
/^sync-payloads\/[a-z0-9][a-z0-9-]{1,31}\/[a-f0-9]{64}\/[a-z0-9][a-z0-9._-]{0,127}\/[a-z0-9][a-z0-9._-]{0,127}\/[a-f0-9]{64}\.bin$/,