Fix StartOS 0.4 TypeScript packaging to match SDK API

This commit is contained in:
MacPro
2026-04-09 15:10:44 -05:00
parent d5046a0daf
commit 0b70cbb2bf
3436 changed files with 867051 additions and 92 deletions
+38
View File
@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupBackups = setupBackups;
const Backups_1 = require("./Backups");
/**
* Set up backup and restore exports for the service.
*
* Returns `{ createBackup, restoreInit }` which should be exported and wired into
* the service's init and backup entry points.
*
* @param options - Either an array of volume IDs or an async factory returning a Backups instance
* @returns An object with `createBackup` (the backup export) and `restoreInit` (an InitScript for restore)
*/
function setupBackups(options) {
let backupsFactory;
if (options instanceof Function) {
backupsFactory = options;
}
else {
backupsFactory = async () => Backups_1.Backups.ofVolumes(...options);
}
const answer = {
get createBackup() {
return (async (options) => {
return (await backupsFactory(options)).createBackup(options.effects);
});
},
get restoreInit() {
return {
init: async (effects, kind) => {
return (await backupsFactory({ effects })).init(effects, kind);
},
};
},
};
return answer;
}
//# sourceMappingURL=setupBackups.js.map