feat(backups): 主人和管理员可删除单个备份,归档由 reaper 下一轮删除、异地副本随下次同步删除,恢复可能在读时拒绝

This commit is contained in:
Lemon-miaow committed 2026-09-27 18:09:49 +08:00
1 parent db7fbfec46
commit b6751eac0f
23 files changed
+969 -45

No files matched your search

+65
View File
@@ -1174,6 +1174,26 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/v1/backups/{id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post?: never;
/**
* Delete one world backup (admin, or the user who owned the world).
* @description The backup leaves every list, restore and the backup budget at once; the reaper's next daily run deletes the archive and the off-site copy's next sync removes the bucket's copy. A user gets 404 for a backup outside their scope, as their list never shows it. Refused while a restore on the backup's server may still read it.
*/
delete: operations["deleteBackup"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/v1/servers/{name}/restore-backup": {
parameters: {
query?: never;
@@ -5685,6 +5705,51 @@ export interface operations {
401: components["responses"]["Unauthorized"];
};
};
deleteBackup: {
parameters: {
query?: never;
header?: never;
path: {
id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description The backup is deleted; its archive goes at the reaper's next run. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
id: string;
/** @constant */
status: "expired";
};
};
};
401: components["responses"]["Unauthorized"];
/** @description No present backup with this id in the caller's scope (no_backup). */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description A restore running on the backup's server may be reading it (restore_in_progress). */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
restoreBackup: {
parameters: {
query?: never;