Refactor/sdk init (#2947)

* fixes for main

* refactor package initialization

* fixes from testing

* more fixes

* beta.21

* do not use instanceof

* closes #2921

* beta22

* allow disabling kiosk

* migration

* fix /etc/shadow

* actionRequest -> task

* beta.23
This commit is contained in:
Aiden McClelland
2025-05-21 10:24:37 -06:00
committed by GitHub
parent 46fd01c264
commit 44560c8da8
237 changed files with 1827 additions and 98800 deletions

View File

@@ -1,6 +1,7 @@
import { Backups } from "./Backups"
import * as T from "../../../base/lib/types"
import { _ } from "../util"
import { InitScript } from "../../../base/lib/inits"
export type SetupBackupsParams<M extends T.SDKManifest> =
| M["volumes"][number][]
@@ -8,7 +9,7 @@ export type SetupBackupsParams<M extends T.SDKManifest> =
type SetupBackupsRes = {
createBackup: T.ExpectedExports.createBackup
restoreBackup: T.ExpectedExports.restoreBackup
restoreInit: InitScript
}
export function setupBackups<M extends T.SDKManifest>(
@@ -20,19 +21,18 @@ export function setupBackups<M extends T.SDKManifest>(
} else {
backupsFactory = async () => Backups.withVolumes(...options)
}
const answer: {
createBackup: T.ExpectedExports.createBackup
restoreBackup: T.ExpectedExports.restoreBackup
} = {
const answer: SetupBackupsRes = {
get createBackup() {
return (async (options) => {
return (await backupsFactory(options)).createBackup(options.effects)
}) as T.ExpectedExports.createBackup
},
get restoreBackup() {
return (async (options) => {
return (await backupsFactory(options)).restoreBackup(options.effects)
}) as T.ExpectedExports.restoreBackup
get restoreInit(): InitScript {
return {
init: async (effects, kind) => {
return (await backupsFactory({ effects })).init(effects, kind)
},
}
},
}
return answer