home-hosted 0.13.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -322
- package/bin/home-hosted.mjs +41 -0
- package/dist/chunks/account-DiLrSyww.js +359 -0
- package/dist/chunks/account-DiLrSyww.js.map +1 -0
- package/dist/chunks/add-DEIYVkNK.js +183 -0
- package/dist/chunks/add-DEIYVkNK.js.map +1 -0
- package/dist/chunks/{archive-DP-XQR8X.js → archive-DFi3qK1c.js} +25 -73
- package/dist/chunks/archive-DFi3qK1c.js.map +1 -0
- package/dist/chunks/{atomic-C1PfJpE7.js → atomic-SZUwDtGD.js} +3 -6
- package/dist/chunks/atomic-SZUwDtGD.js.map +1 -0
- package/dist/chunks/{backup-DeAJ3pbO.js → backup-DnyxIzw0.js} +110 -190
- package/dist/chunks/backup-DnyxIzw0.js.map +1 -0
- package/dist/chunks/backups-BrrN6cwW.js +2203 -0
- package/dist/chunks/backups-BrrN6cwW.js.map +1 -0
- package/dist/chunks/bind-DIxrnUst.js +43 -0
- package/dist/chunks/bind-DIxrnUst.js.map +1 -0
- package/dist/chunks/config-text-DxMOQQnk.js +34 -0
- package/dist/chunks/config-text-DxMOQQnk.js.map +1 -0
- package/dist/chunks/{contracts-CMBD1TF9.js → contracts-CxZ7u1L3.js} +1239 -1454
- package/dist/chunks/contracts-CxZ7u1L3.js.map +1 -0
- package/dist/chunks/daemon-BAAYUYQC.js +211 -0
- package/dist/chunks/daemon-BAAYUYQC.js.map +1 -0
- package/dist/chunks/daemon-log-Ccu-69vB.js +179 -0
- package/dist/chunks/daemon-log-Ccu-69vB.js.map +1 -0
- package/dist/chunks/deploy-CggSOEkq.js +144 -0
- package/dist/chunks/deploy-CggSOEkq.js.map +1 -0
- package/dist/chunks/{docker-Cy9Lyvda.js → docker--Un0uLfF.js} +32 -68
- package/dist/chunks/docker--Un0uLfF.js.map +1 -0
- package/dist/chunks/{down-C59ne5aM.js → down-CpIN7LEQ.js} +34 -94
- package/dist/chunks/down-CpIN7LEQ.js.map +1 -0
- package/dist/chunks/exposure-CDJNvOCK.js +229 -0
- package/dist/chunks/exposure-CDJNvOCK.js.map +1 -0
- package/dist/chunks/import-Bd4VZH0f.js +205 -0
- package/dist/chunks/import-Bd4VZH0f.js.map +1 -0
- package/dist/chunks/import-plan--fDS_l5r.js +147 -0
- package/dist/chunks/import-plan--fDS_l5r.js.map +1 -0
- package/dist/chunks/import-write-BTfbeV26.js +42 -0
- package/dist/chunks/import-write-BTfbeV26.js.map +1 -0
- package/dist/chunks/{init-BZ7hK9Vf.js → init-Bv3oH65x.js} +14 -50
- package/dist/chunks/init-Bv3oH65x.js.map +1 -0
- package/dist/chunks/job-CYOdN6Ub.js +341 -0
- package/dist/chunks/job-CYOdN6Ub.js.map +1 -0
- package/dist/chunks/jobs-BX4ahcfh.js +489 -0
- package/dist/chunks/jobs-BX4ahcfh.js.map +1 -0
- package/dist/chunks/last-stop-DD3lHwo_.js +42 -0
- package/dist/chunks/last-stop-DD3lHwo_.js.map +1 -0
- package/dist/chunks/layout-D0ysDNav.js +18 -0
- package/dist/chunks/layout-D0ysDNav.js.map +1 -0
- package/dist/chunks/lazy-kfcBNeqj.js +48 -0
- package/dist/chunks/lazy-kfcBNeqj.js.map +1 -0
- package/dist/chunks/log-buffer-B7jmn7ts.js +110 -0
- package/dist/chunks/log-buffer-B7jmn7ts.js.map +1 -0
- package/dist/chunks/log-files-CZL2UhuE.js +488 -0
- package/dist/chunks/log-files-CZL2UhuE.js.map +1 -0
- package/dist/chunks/{logger-B5U4GD3j.js → logger-BnrKTBHQ.js} +2 -6
- package/dist/chunks/logger-BnrKTBHQ.js.map +1 -0
- package/dist/chunks/{logs---TI_bxM.js → logs-DxKI6OW2.js} +23 -73
- package/dist/chunks/logs-DxKI6OW2.js.map +1 -0
- package/dist/chunks/ls-BseUHy_m.js +128 -0
- package/dist/chunks/ls-BseUHy_m.js.map +1 -0
- package/dist/chunks/migrate-D4w_dXDm.js +268 -0
- package/dist/chunks/migrate-D4w_dXDm.js.map +1 -0
- package/dist/chunks/{nanny-rewguyXg.js → nanny-BWh7nuvv.js} +21 -14
- package/dist/chunks/nanny-BWh7nuvv.js.map +1 -0
- package/dist/chunks/{nanny-Dnun3hVB.js → nanny-BjF2-1pv.js} +3 -3
- package/dist/chunks/{nanny-Dnun3hVB.js.map → nanny-BjF2-1pv.js.map} +1 -1
- package/dist/chunks/nanny-DGTXVq5d.js +806 -0
- package/dist/chunks/nanny-DGTXVq5d.js.map +1 -0
- package/dist/chunks/{nanny-sweep-ClVuNJRo.js → nanny-sweep-hjmZ_p7S.js} +14 -24
- package/dist/chunks/nanny-sweep-hjmZ_p7S.js.map +1 -0
- package/dist/chunks/{nearest-6KgQEDUe.js → nearest-DOx4jySJ.js} +2 -10
- package/dist/chunks/nearest-DOx4jySJ.js.map +1 -0
- package/dist/chunks/{parse-DhmG26fI.js → parse-DVMPLUDe.js} +47 -72
- package/dist/chunks/parse-DVMPLUDe.js.map +1 -0
- package/dist/chunks/password-policy-Clq6PGE-.js +9 -0
- package/dist/chunks/password-policy-Clq6PGE-.js.map +1 -0
- package/dist/chunks/{paths-CGlGDrOU.js → paths-C34-TJLh.js} +32 -56
- package/dist/chunks/paths-C34-TJLh.js.map +1 -0
- package/dist/chunks/{port-k5VBw8t9.js → port-CnsrxKNR.js} +23 -70
- package/dist/chunks/port-CnsrxKNR.js.map +1 -0
- package/dist/chunks/process-CboOFPU_.js +192 -0
- package/dist/chunks/process-CboOFPU_.js.map +1 -0
- package/dist/chunks/{restart-BYu_E7x5.js → restart-C0J8dZ2L.js} +11 -29
- package/dist/chunks/restart-C0J8dZ2L.js.map +1 -0
- package/dist/chunks/run-deploy-DoNDvwT4.js +91 -0
- package/dist/chunks/run-deploy-DoNDvwT4.js.map +1 -0
- package/dist/chunks/{schema-B240VXcV.js → schema-CZ6f-PHD.js} +7 -20
- package/dist/chunks/schema-CZ6f-PHD.js.map +1 -0
- package/dist/chunks/secret-MY397r90.js +219 -0
- package/dist/chunks/secret-MY397r90.js.map +1 -0
- package/dist/chunks/secrets-CG5N4lwY.js +1061 -0
- package/dist/chunks/secrets-CG5N4lwY.js.map +1 -0
- package/dist/chunks/server-Dm_dXfTW.js +255 -0
- package/dist/chunks/server-Dm_dXfTW.js.map +1 -0
- package/dist/chunks/server-attention-UQwYXqKe.js +10 -0
- package/dist/chunks/server-attention-UQwYXqKe.js.map +1 -0
- package/dist/chunks/server-create-D7nvhgBd.js +96 -0
- package/dist/chunks/server-create-D7nvhgBd.js.map +1 -0
- package/dist/chunks/server-ids-BEQD2rFz.js +23 -0
- package/dist/chunks/server-ids-BEQD2rFz.js.map +1 -0
- package/dist/chunks/server-vars-DMYmHutL.js +27 -0
- package/dist/chunks/server-vars-DMYmHutL.js.map +1 -0
- package/dist/chunks/service-C8l-ewNA.js +585 -0
- package/dist/chunks/service-C8l-ewNA.js.map +1 -0
- package/dist/chunks/{settings-xu-XTfWg.js → settings-CtYDs5PX.js} +62 -78
- package/dist/chunks/settings-CtYDs5PX.js.map +1 -0
- package/dist/chunks/{setup-temp-CAN4_bA-.js → setup-temp-TAtDmMMU.js} +43 -37
- package/dist/chunks/setup-temp-TAtDmMMU.js.map +1 -0
- package/dist/chunks/shape-CDGeYl_J.js +9 -0
- package/dist/chunks/shape-CDGeYl_J.js.map +1 -0
- package/dist/chunks/{src-BOBh9MBf.js → src-BnzkVy_M.js} +12547 -10578
- package/dist/chunks/src-BnzkVy_M.js.map +1 -0
- package/dist/chunks/{status-B6f2-qhs.js → status-efbbfYZQ.js} +53 -26
- package/dist/chunks/status-efbbfYZQ.js.map +1 -0
- package/dist/chunks/store-Bs_Lljjm.js +2082 -0
- package/dist/chunks/store-Bs_Lljjm.js.map +1 -0
- package/dist/chunks/template-xan58bJh.js +28 -0
- package/dist/chunks/template-xan58bJh.js.map +1 -0
- package/dist/chunks/token-DDeWfZA4.js +142 -0
- package/dist/chunks/token-DDeWfZA4.js.map +1 -0
- package/dist/chunks/{ui-D562aqw5.js → ui-BcIAtyxE.js} +68 -79
- package/dist/chunks/ui-BcIAtyxE.js.map +1 -0
- package/dist/chunks/{ui-dir-CsU3uLNV.js → ui-dir-ClCzVRc3.js} +3 -7
- package/dist/chunks/ui-dir-ClCzVRc3.js.map +1 -0
- package/dist/chunks/ui-format-CDvvqOoi.js +53 -0
- package/dist/chunks/ui-format-CDvvqOoi.js.map +1 -0
- package/dist/chunks/{ui-release-DKzVvlLd.js → ui-release-XbJ85pYI.js} +36 -38
- package/dist/chunks/ui-release-XbJ85pYI.js.map +1 -0
- package/dist/chunks/{ui-revert-EkBBwRTt.js → ui-revert-Dgawq7ze.js} +4 -4
- package/dist/chunks/ui-revert-Dgawq7ze.js.map +1 -0
- package/dist/chunks/{ui-switch-BnZTdMDd.js → ui-switch-CfQMbZ0g.js} +31 -38
- package/dist/chunks/ui-switch-CfQMbZ0g.js.map +1 -0
- package/dist/chunks/{ui-update-_xryLYxw.js → ui-update-B3PPivUm.js} +30 -48
- package/dist/chunks/ui-update-B3PPivUm.js.map +1 -0
- package/dist/chunks/ui-update-CAiH2tFb.js +109 -0
- package/dist/chunks/ui-update-CAiH2tFb.js.map +1 -0
- package/dist/chunks/{up-DNZuTi2q.js → up-BQSnYxYd.js} +47 -53
- package/dist/chunks/up-BQSnYxYd.js.map +1 -0
- package/dist/chunks/{usage-BrnDARNM.js → usage-KG8TeOio.js} +7 -20
- package/dist/chunks/usage-KG8TeOio.js.map +1 -0
- package/dist/chunks/{workspaces-DYcfvKV_.js → workspaces-D9akpzU8.js} +80 -68
- package/dist/chunks/workspaces-D9akpzU8.js.map +1 -0
- package/dist/chunks/{wsl-temperature-BiCI4iK6.js → wsl-temperature-D-_d4Yk1.js} +47 -42
- package/dist/chunks/wsl-temperature-D-_d4Yk1.js.map +1 -0
- package/dist/cli.js +306 -238
- package/dist/cli.js.map +1 -1
- package/dist/client.js +76 -29
- package/dist/client.js.map +1 -1
- package/dist/types/api/acme.d.ts +3 -7
- package/dist/types/api/auth/$.routes.d.ts +107 -16
- package/dist/types/api/backups.d.ts +5 -5
- package/dist/types/api/control.d.ts +747 -38
- package/dist/types/api/ddns.d.ts +13 -18
- package/dist/types/api/events.d.ts +9 -3
- package/dist/types/api/health.d.ts +2 -4
- package/dist/types/api/jobs.d.ts +438 -0
- package/dist/types/api/logs.d.ts +20 -0
- package/dist/types/api/metrics.d.ts +2 -5
- package/dist/types/api/notifications.d.ts +3 -6
- package/dist/types/api/proxy.d.ts +63 -23
- package/dist/types/api/server-ops.d.ts +17 -0
- package/dist/types/api/servers/$.routes.d.ts +418 -186
- package/dist/types/api/session-required.d.ts +16 -0
- package/dist/types/api/settings.d.ts +7 -7
- package/dist/types/api/state.d.ts +100 -10
- package/dist/types/api/static.d.ts +2 -2
- package/dist/types/api/tls.d.ts +2 -5
- package/dist/types/api/workspaces/$.routes.d.ts +186 -12
- package/dist/types/api/wsl-temperature.d.ts +4 -10
- package/dist/types/app.d.ts +4511 -2778
- package/dist/types/cli/account.d.ts +23 -0
- package/dist/types/cli/add.d.ts +96 -0
- package/dist/types/cli/args.d.ts +24 -35
- package/dist/types/cli/backup-offline.d.ts +2 -8
- package/dist/types/cli/backup.d.ts +12 -21
- package/dist/types/cli/down.d.ts +15 -41
- package/dist/types/cli/import-plan.d.ts +55 -0
- package/dist/types/cli/import-write.d.ts +5 -0
- package/dist/types/cli/import.d.ts +86 -0
- package/dist/types/cli/io.d.ts +26 -35
- package/dist/types/cli/job.d.ts +99 -0
- package/dist/types/cli/logs.d.ts +1 -10
- package/dist/types/cli/ls.d.ts +57 -0
- package/dist/types/cli/migrate.d.ts +31 -8
- package/dist/types/cli/nearest.d.ts +1 -9
- package/dist/types/cli/run-deploy.d.ts +36 -0
- package/dist/types/cli/secret.d.ts +90 -0
- package/dist/types/cli/server.d.ts +6 -15
- package/dist/types/cli/service.d.ts +135 -0
- package/dist/types/cli/setup-temp.d.ts +17 -13
- package/dist/types/cli/status.d.ts +7 -1
- package/dist/types/cli/token.d.ts +6 -0
- package/dist/types/cli/ui-switch.d.ts +3 -14
- package/dist/types/cli/ui-update.d.ts +3 -16
- package/dist/types/cli/up.d.ts +9 -22
- package/dist/types/cli/usage.d.ts +2 -6
- package/dist/types/cli.d.ts +1 -10
- package/dist/types/client.d.ts +4099 -1142
- package/dist/types/config/accounts.d.ts +16 -0
- package/dist/types/config/jobs.d.ts +68 -0
- package/dist/types/config/layout.d.ts +2 -8
- package/dist/types/config/migrations.d.ts +9 -41
- package/dist/types/config/parse.d.ts +8 -13
- package/dist/types/config/patch.d.ts +1 -6
- package/dist/types/config/schema.d.ts +16 -18
- package/dist/types/config/secret-parts.d.ts +6 -27
- package/dist/types/config/secrets.d.ts +167 -88
- package/dist/types/config/seed.d.ts +1 -6
- package/dist/types/config/server-ids.d.ts +2 -11
- package/dist/types/config/settings.d.ts +13 -49
- package/dist/types/config/store.d.ts +17 -54
- package/dist/types/config/workspaces.d.ts +24 -56
- package/dist/types/helpers/action-result.d.ts +18 -32
- package/dist/types/helpers/atomic.d.ts +1 -4
- package/dist/types/helpers/backoff.d.ts +0 -1
- package/dist/types/helpers/bind.d.ts +3 -11
- package/dist/types/helpers/config-text.d.ts +4 -19
- package/dist/types/helpers/cookies.d.ts +2 -7
- package/dist/types/helpers/copy-tree.d.ts +4 -12
- package/dist/types/helpers/daemon-log.d.ts +8 -33
- package/dist/types/helpers/daemon.d.ts +20 -70
- package/dist/types/helpers/deferred.d.ts +2 -4
- package/dist/types/helpers/env-file.d.ts +2 -7
- package/dist/types/helpers/error.d.ts +3 -14
- package/dist/types/helpers/event-stream.d.ts +18 -10
- package/dist/types/helpers/factory.d.ts +2 -3
- package/dist/types/helpers/last-stop.d.ts +5 -12
- package/dist/types/helpers/logger.d.ts +1 -5
- package/dist/types/helpers/open.d.ts +0 -1
- package/dist/types/helpers/openapi.d.ts +19 -5
- package/dist/types/helpers/paths.d.ts +18 -53
- package/dist/types/helpers/restore-lock.d.ts +2 -17
- package/dist/types/helpers/runtime.d.ts +3 -13
- package/dist/types/helpers/secret-compare.d.ts +2 -10
- package/dist/types/helpers/server-create.d.ts +15 -0
- package/dist/types/helpers/shell.d.ts +2 -16
- package/dist/types/helpers/sse.d.ts +8 -6
- package/dist/types/helpers/ui-dir.d.ts +1 -5
- package/dist/types/helpers/utf8-chunks.d.ts +2 -8
- package/dist/types/helpers/validate.d.ts +2 -4
- package/dist/types/helpers/validator.d.ts +8 -4
- package/dist/types/helpers/version.d.ts +1 -6
- package/dist/types/helpers/workspace.d.ts +24 -16
- package/dist/types/index.d.ts +2 -3
- package/dist/types/middleware/auth.d.ts +8 -27
- package/dist/types/middleware/body-limit.d.ts +10 -0
- package/dist/types/middleware/host.d.ts +4 -23
- package/dist/types/middleware/loopback.d.ts +1 -8
- package/dist/types/middleware/token-scope.d.ts +34 -0
- package/dist/types/node-compat.d.ts +43 -0
- package/dist/types/openapi-reference.d.ts +4 -19
- package/dist/types/openapi.d.ts +5 -8
- package/dist/types/providers/archive.d.ts +8 -25
- package/dist/types/providers/backup-hook.d.ts +4 -19
- package/dist/types/providers/ddns/dyndns2.d.ts +0 -3
- package/dist/types/providers/ddns/index.d.ts +2 -3
- package/dist/types/providers/ddns/ip.d.ts +2 -12
- package/dist/types/providers/ddns/namecheap-api.d.ts +3 -2
- package/dist/types/providers/ddns/types.d.ts +6 -32
- package/dist/types/providers/ddns/zone.d.ts +1 -4
- package/dist/types/providers/docker.d.ts +18 -45
- package/dist/types/providers/entry-state.d.ts +4 -9
- package/dist/types/providers/health-check.d.ts +1 -5
- package/dist/types/providers/host.d.ts +33 -108
- package/dist/types/providers/identity.d.ts +9 -34
- package/dist/types/providers/log-tail.d.ts +14 -24
- package/dist/types/providers/nanny-sweep.d.ts +8 -25
- package/dist/types/providers/nanny.d.ts +16 -58
- package/dist/types/providers/port.d.ts +28 -83
- package/dist/types/providers/proc.d.ts +22 -80
- package/dist/types/providers/process.d.ts +12 -36
- package/dist/types/providers/proxy/admin.d.ts +11 -0
- package/dist/types/providers/proxy/types.d.ts +4 -16
- package/dist/types/providers/telegram.d.ts +1 -17
- package/dist/types/providers/ui-release.d.ts +15 -25
- package/dist/types/providers/webhook.d.ts +8 -29
- package/dist/types/providers/wsl-temperature.d.ts +13 -22
- package/dist/types/services/acme-challenge.d.ts +2 -16
- package/dist/types/services/auth.d.ts +65 -80
- package/dist/types/services/backups/archive-safety.d.ts +30 -0
- package/dist/types/services/backups/paths.d.ts +31 -0
- package/dist/types/services/backups.d.ts +61 -271
- package/dist/types/services/config-watch.d.ts +3 -15
- package/dist/types/services/control-server.d.ts +6 -10
- package/dist/types/services/ddns.d.ts +12 -13
- package/dist/types/services/dependencies.d.ts +3 -14
- package/dist/types/services/deploy.d.ts +34 -0
- package/dist/types/services/events.d.ts +15 -9
- package/dist/types/services/exposure.d.ts +13 -63
- package/dist/types/services/history.d.ts +5 -14
- package/dist/types/services/host-monitor.d.ts +6 -11
- package/dist/types/services/init.d.ts +5 -35
- package/dist/types/services/job-ledger.d.ts +27 -0
- package/dist/types/services/jobs.d.ts +113 -0
- package/dist/types/services/log-buffer.d.ts +7 -8
- package/dist/types/services/log-files.d.ts +12 -42
- package/dist/types/services/log-relay.d.ts +3 -13
- package/dist/types/services/nanny.d.ts +3 -10
- package/dist/types/services/notifications.d.ts +31 -61
- package/dist/types/services/panel.d.ts +32 -78
- package/dist/types/services/proxy-certificates/certificates.d.ts +31 -69
- package/dist/types/services/proxy-config.d.ts +15 -36
- package/dist/types/services/proxy-dns01.d.ts +14 -0
- package/dist/types/services/proxy.d.ts +73 -254
- package/dist/types/services/scheduler.d.ts +46 -0
- package/dist/types/services/state.d.ts +17 -8
- package/dist/types/services/supervisor/compose.d.ts +2 -6
- package/dist/types/services/supervisor/entry.d.ts +29 -32
- package/dist/types/services/supervisor/health.d.ts +8 -31
- package/dist/types/services/supervisor/job-run.d.ts +36 -0
- package/dist/types/services/supervisor/output.d.ts +13 -77
- package/dist/types/services/supervisor/persistent.d.ts +5 -11
- package/dist/types/services/supervisor/port-preflight.d.ts +4 -10
- package/dist/types/services/supervisor/records.d.ts +27 -60
- package/dist/types/services/supervisor/restart-required.d.ts +13 -0
- package/dist/types/services/supervisor/spawn.d.ts +3 -5
- package/dist/types/services/supervisor/view.d.ts +3 -1
- package/dist/types/services/supervisor.d.ts +31 -43
- package/dist/types/services/tls.d.ts +6 -17
- package/dist/types/services/ui-update.d.ts +19 -17
- package/dist/types/services/ui.d.ts +10 -19
- package/dist/types/shared/action-outcome.d.ts +2 -7
- package/dist/types/shared/api-client.d.ts +133 -177
- package/dist/types/shared/api-scopes.d.ts +17 -0
- package/dist/types/shared/backup-scope.d.ts +16 -90
- package/dist/types/shared/clone.d.ts +2 -11
- package/dist/types/shared/contracts/accounts.d.ts +99 -0
- package/dist/types/shared/contracts/backups.d.ts +219 -0
- package/dist/types/shared/contracts/ddns.d.ts +208 -0
- package/dist/types/shared/contracts/frames.d.ts +1395 -0
- package/dist/types/shared/contracts/index.d.ts +3 -0
- package/dist/types/shared/contracts/logs.d.ts +107 -0
- package/dist/types/shared/contracts/proxy.d.ts +303 -0
- package/dist/types/shared/contracts.d.ts +852 -1982
- package/dist/types/shared/cpu-scale.d.ts +3 -19
- package/dist/types/shared/crash-cause.d.ts +8 -0
- package/dist/types/shared/cron.d.ts +70 -0
- package/dist/types/shared/ddns-form.d.ts +9 -43
- package/dist/types/shared/endpoint.d.ts +1 -7
- package/dist/types/shared/error-codes.d.ts +438 -0
- package/dist/types/shared/error-message.d.ts +1 -7
- package/dist/types/shared/fields.d.ts +7 -17
- package/dist/types/shared/form-repair.d.ts +1 -5
- package/dist/types/shared/generated.d.ts +3 -19
- package/dist/types/shared/host-readings.d.ts +25 -128
- package/dist/types/shared/lazy.d.ts +1 -1
- package/dist/types/shared/live-frames.d.ts +2 -8
- package/dist/types/shared/live-series.d.ts +2 -8
- package/dist/types/shared/live-store.d.ts +4 -8
- package/dist/types/shared/log-download.d.ts +6 -0
- package/dist/types/shared/meta.d.ts +6 -0
- package/dist/types/shared/password-policy.d.ts +10 -0
- package/dist/types/shared/patch-diff.d.ts +13 -72
- package/dist/types/shared/port-reading.d.ts +18 -0
- package/dist/types/shared/probe-latency.d.ts +3 -21
- package/dist/types/shared/proxy-form.d.ts +33 -74
- package/dist/types/shared/proxy-validate.d.ts +11 -0
- package/dist/types/shared/query-params.d.ts +8 -0
- package/dist/types/shared/server-attention.d.ts +2 -27
- package/dist/types/shared/server-form.d.ts +15 -54
- package/dist/types/shared/server-key.d.ts +1 -12
- package/dist/types/shared/server-readings.d.ts +7 -32
- package/dist/types/shared/server-url.d.ts +9 -31
- package/dist/types/shared/shape.d.ts +1 -16
- package/dist/types/shared/stream-access.d.ts +2 -8
- package/dist/types/shared/ui-format.d.ts +25 -65
- package/docs/API.md +315 -107
- package/docs/BACKUPS.md +61 -56
- package/docs/CLI.md +255 -49
- package/docs/DDNS.md +35 -49
- package/docs/JOBS.md +129 -0
- package/docs/NOTIFICATIONS.md +58 -90
- package/docs/REVERSE_PROXY.md +116 -188
- package/docs/SECURITY.md +126 -44
- package/docs/SERVERS.md +282 -409
- package/docs/UI_CREATION.md +90 -47
- package/docs/demo/blank-host-restore.sh +31 -7
- package/package.json +15 -6
- package/scripts/prepare.mjs +47 -0
- package/uis/stock/dist/assets/CopyButton-8mliL0xi.js +1 -0
- package/uis/stock/dist/assets/GlobalSettingsView-BINXY77E.js +1 -0
- package/uis/stock/dist/assets/LogViewer-kiSnTwdY.js +1 -0
- package/uis/stock/dist/assets/LogsView-DDXf_ONs.js +1 -0
- package/uis/stock/dist/assets/Modal-lrUuViF2.js +39 -0
- package/uis/stock/dist/assets/ProxyView-uXMaJdSQ.js +1 -0
- package/uis/stock/dist/assets/ServerDetailView-CW0Vb_c0.js +4 -0
- package/uis/stock/dist/assets/SettingsShell-B135xWjJ.js +1 -0
- package/uis/stock/dist/assets/SettingsView-BLtWxVkl.js +2 -0
- package/uis/stock/dist/assets/de-BIoTrHBQ.js +1 -0
- package/uis/stock/dist/assets/es-x4-ih8lH.js +1 -0
- package/uis/stock/dist/assets/fr-DatqBBkO.js +1 -0
- package/uis/stock/dist/assets/index-CnojaKcA.css +2 -0
- package/uis/stock/dist/assets/index-D-CiZReu.js +16 -0
- package/uis/stock/dist/assets/ja-CW1703Gw.js +1 -0
- package/uis/stock/dist/assets/ko-wFbT4XtK.js +1 -0
- package/uis/stock/dist/assets/ru-C1p5C4VN.js +1 -0
- package/uis/stock/dist/assets/useUnsavedGuard-BcsXsfCC.js +9 -0
- package/uis/stock/dist/assets/vi-CDqr0uie.js +1 -0
- package/uis/stock/dist/assets/zh-CN-BJ7iit-X.js +1 -0
- package/uis/stock/dist/index.html +4 -3
- package/uis/stock/dist/ui.json +3 -3
- package/dist/chunks/archive-DP-XQR8X.js.map +0 -1
- package/dist/chunks/atomic-C1PfJpE7.js.map +0 -1
- package/dist/chunks/backup-DeAJ3pbO.js.map +0 -1
- package/dist/chunks/backups-twva7x2n.js +0 -4691
- package/dist/chunks/backups-twva7x2n.js.map +0 -1
- package/dist/chunks/config-text-DifCHhnz.js +0 -50
- package/dist/chunks/config-text-DifCHhnz.js.map +0 -1
- package/dist/chunks/contracts-CMBD1TF9.js.map +0 -1
- package/dist/chunks/daemon-CofN9k6Q.js +0 -247
- package/dist/chunks/daemon-CofN9k6Q.js.map +0 -1
- package/dist/chunks/daemon-log-BVj8cDEo.js +0 -241
- package/dist/chunks/daemon-log-BVj8cDEo.js.map +0 -1
- package/dist/chunks/docker-Cy9Lyvda.js.map +0 -1
- package/dist/chunks/down-C59ne5aM.js.map +0 -1
- package/dist/chunks/init-BZ7hK9Vf.js.map +0 -1
- package/dist/chunks/last-stop-C-BXz_XI.js +0 -53
- package/dist/chunks/last-stop-C-BXz_XI.js.map +0 -1
- package/dist/chunks/layout-DwTtmund.js +0 -24
- package/dist/chunks/layout-DwTtmund.js.map +0 -1
- package/dist/chunks/lazy-Ce5zEAq1.js +0 -66
- package/dist/chunks/lazy-Ce5zEAq1.js.map +0 -1
- package/dist/chunks/log-buffer-Dy9HHDMD.js +0 -414
- package/dist/chunks/log-buffer-Dy9HHDMD.js.map +0 -1
- package/dist/chunks/logger-B5U4GD3j.js.map +0 -1
- package/dist/chunks/logs---TI_bxM.js.map +0 -1
- package/dist/chunks/migrate-Cfoq-Vgh.js +0 -155
- package/dist/chunks/migrate-Cfoq-Vgh.js.map +0 -1
- package/dist/chunks/nanny-COyCJXj9.js +0 -1172
- package/dist/chunks/nanny-COyCJXj9.js.map +0 -1
- package/dist/chunks/nanny-rewguyXg.js.map +0 -1
- package/dist/chunks/nanny-sweep-ClVuNJRo.js.map +0 -1
- package/dist/chunks/nearest-6KgQEDUe.js.map +0 -1
- package/dist/chunks/parse-DhmG26fI.js.map +0 -1
- package/dist/chunks/paths-CGlGDrOU.js.map +0 -1
- package/dist/chunks/port-k5VBw8t9.js.map +0 -1
- package/dist/chunks/restart-BYu_E7x5.js.map +0 -1
- package/dist/chunks/schema-B240VXcV.js.map +0 -1
- package/dist/chunks/secrets-BieELnZh.js +0 -562
- package/dist/chunks/secrets-BieELnZh.js.map +0 -1
- package/dist/chunks/server-By-zktjx.js +0 -169
- package/dist/chunks/server-By-zktjx.js.map +0 -1
- package/dist/chunks/server-ids-DRuNLVCV.js +0 -32
- package/dist/chunks/server-ids-DRuNLVCV.js.map +0 -1
- package/dist/chunks/set-password-D5vZqqSX.js +0 -43
- package/dist/chunks/set-password-D5vZqqSX.js.map +0 -1
- package/dist/chunks/set-token-xJkA1IZp.js +0 -78
- package/dist/chunks/set-token-xJkA1IZp.js.map +0 -1
- package/dist/chunks/settings-xu-XTfWg.js.map +0 -1
- package/dist/chunks/setup-temp-CAN4_bA-.js.map +0 -1
- package/dist/chunks/shape-DnTKzjQ2.js +0 -24
- package/dist/chunks/shape-DnTKzjQ2.js.map +0 -1
- package/dist/chunks/src-BOBh9MBf.js.map +0 -1
- package/dist/chunks/status-B6f2-qhs.js.map +0 -1
- package/dist/chunks/ui-D562aqw5.js.map +0 -1
- package/dist/chunks/ui-dir-CsU3uLNV.js.map +0 -1
- package/dist/chunks/ui-release-DKzVvlLd.js.map +0 -1
- package/dist/chunks/ui-revert-EkBBwRTt.js.map +0 -1
- package/dist/chunks/ui-switch-BnZTdMDd.js.map +0 -1
- package/dist/chunks/ui-update-_xryLYxw.js.map +0 -1
- package/dist/chunks/up-DNZuTi2q.js.map +0 -1
- package/dist/chunks/usage-BrnDARNM.js.map +0 -1
- package/dist/chunks/workspaces-DYcfvKV_.js.map +0 -1
- package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +0 -1
- package/dist/types/cli/set-password.d.ts +0 -14
- package/dist/types/cli/set-token.d.ts +0 -21
- package/uis/stock/dist/assets/CopyButton-BUBKRJyY.js +0 -1
- package/uis/stock/dist/assets/GlobalSettingsView-yYMcRWvt.js +0 -1
- package/uis/stock/dist/assets/LogViewer-DIliXy62.js +0 -1
- package/uis/stock/dist/assets/LogsView-B7Z-7RNg.js +0 -1
- package/uis/stock/dist/assets/Modal-DmKa5Qpp.js +0 -39
- package/uis/stock/dist/assets/ProxyView-DvZiNkwb.js +0 -1
- package/uis/stock/dist/assets/ServerDetailView-6idGT_EX.js +0 -2
- package/uis/stock/dist/assets/SettingsShell-CeGtleYI.js +0 -1
- package/uis/stock/dist/assets/SettingsView-BrhJIrmk.js +0 -2
- package/uis/stock/dist/assets/de-BRITeb0H.js +0 -1
- package/uis/stock/dist/assets/es-B2zIEssV.js +0 -1
- package/uis/stock/dist/assets/fr-s0ZOBEqh.js +0 -1
- package/uis/stock/dist/assets/index-C1MehbKy.css +0 -2
- package/uis/stock/dist/assets/index-CnBN54wF.js +0 -15
- package/uis/stock/dist/assets/ja-CU7MR85V.js +0 -1
- package/uis/stock/dist/assets/ko-tL5Me6d-.js +0 -1
- package/uis/stock/dist/assets/ru-92yrvkNJ.js +0 -1
- package/uis/stock/dist/assets/vi-CzvY16k2.js +0 -1
- package/uis/stock/dist/assets/zh-CN-DDwFW_uW.js +0 -1
|
@@ -1,44 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* These were byte-identical copies in `uis/stock/src/lib/api.ts` and `uis/noc-console/src/lib/api.ts` —
|
|
5
|
-
* the duplication class `proxy-form.ts` was created for, and one that has already drifted twice: the
|
|
6
|
-
* `request` helper read a bare `error` field in one UI and not the other, so the same failed call
|
|
7
|
-
* reported different text depending on where you were.
|
|
8
|
-
*
|
|
9
|
-
* Every dependency here is already in `src/shared`, so this module imports nothing upward — the
|
|
10
|
-
* constraint that keeps `rpc.ts` and the `ddns`/`proxy` helpers in the UIs, which import Vue.
|
|
11
|
-
*
|
|
12
|
-
* **The workspace-scoped half lives here too** (see "Workspace-scoped calls" at the foot of this
|
|
13
|
-
* file). It used to be a hand-maintained copy in each UI's `lib/api.ts`, on the theory that each
|
|
14
|
-
* spells the workspace differently. They did not: 387 and 386 lines, 61% identical, 31 of 35 shared
|
|
15
|
-
* names, and three drifts. The only genuine difference was *where the workspace comes from*, which
|
|
16
|
-
* is now one injected resolver — see `useWorkspaceResolver`.
|
|
17
|
-
*/
|
|
18
|
-
import type { AppState, BackupSelection, DdnsConfig, DdnsView, FreePortResult, LogHistoryView, LogServerView, ProxyPatch, ProxyView, RestorePlan, ServerCreate, ServerPatch, ServerView, SessionView, SettingsPatch, SettingsSaved, SettingsView, UiStatus, WorkspaceCreate, WorkspaceSettingsPatch, WorkspaceSettingsView, WorkspaceView, WslTemperatureStatus } from './contracts.js';
|
|
1
|
+
/** The panel API calls both UIs make, with the helpers they build on. Imports nothing upward (no Vue). */
|
|
2
|
+
import type { AppState, BackupSelection, DdnsConfig, DdnsView, FreePortResult, JobCreate, JobEntryView, JobLogView, JobPatch, JobRun, JobRunDetail, JobRunStarted, JobsList, LogHistoryView, LogServerView, ProxyPatch, ProxyView, RestorePlan, ServerCreate, ServerPatch, ServerView, SessionView, SettingsPatch, SettingsSaved, SettingsView, UiStatus, WorkspaceCreate, WorkspaceSettingsPatch, WorkspaceSettingsView, WorkspaceView, WslTemperatureStatus } from './contracts.js';
|
|
19
3
|
import { tlsReviewResponseSchema } from './contracts.js';
|
|
20
4
|
/** Thrown on a 401 with `code: "AUTH_REQUIRED"`, so the SPA can route to the login view. */
|
|
21
5
|
export declare class AuthRequiredError extends Error {
|
|
22
6
|
name: string;
|
|
23
7
|
constructor();
|
|
24
8
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Thrown on a 401 that signing in cannot fix: no password is in force, so only the machine running
|
|
27
|
-
* the panel may use `/api`. `AUTH_UNARMED` is auth on without a password; `AUTH_DISABLED_REMOTE` is
|
|
28
|
-
* auth off and a caller that is not this machine. Both are answered the same way — set a password on
|
|
29
|
-
* that machine — and the message is the panel's own sentence saying so.
|
|
30
|
-
*/
|
|
9
|
+
/** A 401 that signing in cannot fix: no password is in force, so only this machine may use `/api`. */
|
|
31
10
|
export declare class LocalOnlyError extends Error {
|
|
32
11
|
readonly code: string;
|
|
33
12
|
name: string;
|
|
34
13
|
constructor(message: string, code: string);
|
|
35
14
|
}
|
|
36
|
-
/** The 401 codes `LocalOnlyError` stands for. */
|
|
37
15
|
export declare const LOCAL_ONLY_CODES: ReadonlySet<string>;
|
|
38
|
-
/**
|
|
39
|
-
* What a restore may carry. Identical in both UIs apart from one doc comment; the fuller wording is
|
|
40
|
-
* kept.
|
|
41
|
-
*/
|
|
42
16
|
export interface RestoreOptions {
|
|
43
17
|
password?: string;
|
|
44
18
|
/** Leaf/entry item ids to restore; omitted means every restorable item. */
|
|
@@ -46,31 +20,17 @@ export interface RestoreOptions {
|
|
|
46
20
|
/** Leaf/entry item ids to leave out, applied after `include` — the CLI's `--exclude`. */
|
|
47
21
|
exclude?: string[];
|
|
48
22
|
}
|
|
49
|
-
/**
|
|
50
|
-
* One JSON request, with the panel's error envelope turned into an `Error`.
|
|
51
|
-
*
|
|
52
|
-
* Reads `message` first, then a bare `error` field. The two UIs disagreed on that fallback until it was
|
|
53
|
-
* aligned, and this is the one place it now lives.
|
|
54
|
-
*/
|
|
23
|
+
/** One JSON request, with the panel's error envelope turned into an `Error`. */
|
|
55
24
|
export declare function request<T>(path: string, init?: RequestInit): Promise<T>;
|
|
56
|
-
/**
|
|
57
|
-
* The sentence a failed request should show, from either error envelope this API uses.
|
|
58
|
-
*
|
|
59
|
-
* There are two, and they are both real: a thrown `DetailedError` answers `{ message, code, detail }`,
|
|
60
|
-
* while a **lifecycle refusal** answers `{ ok: false, error }` — "port 3000 is already in use", "server
|
|
61
|
-
* \"web\" is disabled". Reading only `message` threw the second away and showed
|
|
62
|
-
* `request failed with 409`, which is the one message that tells a person nothing about a start that
|
|
63
|
-
* refused. The CLI has always read `error` first (`src/cli/server.ts`), so the two transports disagreed
|
|
64
|
-
* about the same refusal — the class this module exists to prevent.
|
|
65
|
-
*/
|
|
25
|
+
/** Reads both envelopes: a `DetailedError`'s `message`, then a lifecycle refusal's `{ ok: false, error }`. */
|
|
66
26
|
export declare function failureMessage(payload: unknown, status: number): string;
|
|
27
|
+
export declare function refusalMessage(payload: unknown): string;
|
|
67
28
|
/** Validated at the boundary: contract drift fails loudly here, not in the UI. */
|
|
68
29
|
export declare function proxyView(payload: unknown): Promise<ProxyView>;
|
|
69
30
|
export declare function ddnsView(payload: unknown): Promise<DdnsView>;
|
|
70
31
|
export declare function proxyAction(action: 'start' | 'stop' | 'apply' | 'revert'): Promise<ProxyView>;
|
|
71
32
|
export declare function applyProxy(): Promise<ProxyView>;
|
|
72
33
|
export declare function backupDownloadUrl(name: string): string;
|
|
73
|
-
/** What a create may carry: a password, and a selection in either direction. */
|
|
74
34
|
export interface CreateBackupOptions {
|
|
75
35
|
password?: string;
|
|
76
36
|
/** Leaf ids to capture; omitted means everything. */
|
|
@@ -78,37 +38,65 @@ export interface CreateBackupOptions {
|
|
|
78
38
|
/** Leaf ids to leave out, applied after `include`. */
|
|
79
39
|
exclude?: string[];
|
|
80
40
|
}
|
|
81
|
-
/** The create request body: a password, then the selection in either direction. */
|
|
82
41
|
export declare function createBackupBody(options?: CreateBackupOptions): Record<string, unknown>;
|
|
83
42
|
/** The caller re-reads `/api/state` afterwards, which carries the fresh list. */
|
|
84
43
|
export declare function createBackup(options?: CreateBackupOptions): Promise<unknown>;
|
|
85
|
-
/**
|
|
86
|
-
* What a created backup wants a person to look at: a declared path that held no files, say. The
|
|
87
|
-
* archive was still written. Absent on an older panel, and anything that is not a string is ignored.
|
|
88
|
-
*/
|
|
44
|
+
/** Non-fatal notes on a created backup (a declared path held no files). Absent on an older panel. */
|
|
89
45
|
export declare function backupWarnings(result: unknown): string[];
|
|
90
|
-
/**
|
|
91
|
-
export
|
|
92
|
-
|
|
93
|
-
|
|
46
|
+
/** One account: it signs in to the panel and authenticates the API. `list` never shows a secret. */
|
|
47
|
+
export interface AccountRow {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
scopes: string[];
|
|
51
|
+
workspaces?: string[];
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
isDefault: boolean;
|
|
54
|
+
short: boolean;
|
|
55
|
+
createdAt: number;
|
|
56
|
+
updatedAt: number;
|
|
57
|
+
lastUsedAt?: number;
|
|
58
|
+
}
|
|
59
|
+
/** One scope as the panel publishes it: the id, and whether a workspace limit can narrow it. */
|
|
60
|
+
export interface ScopeRow {
|
|
61
|
+
scope: string;
|
|
62
|
+
workspaceLimited: boolean;
|
|
63
|
+
}
|
|
64
|
+
export declare function listAccounts(): Promise<{
|
|
65
|
+
accounts: AccountRow[];
|
|
66
|
+
scopes?: ScopeRow[];
|
|
67
|
+
}>;
|
|
68
|
+
export declare function createAccount(body: {
|
|
69
|
+
id: string;
|
|
70
|
+
label?: string;
|
|
71
|
+
scopes: string[];
|
|
72
|
+
workspaces?: string[];
|
|
73
|
+
secret?: string;
|
|
74
|
+
}): Promise<{
|
|
75
|
+
account: AccountRow;
|
|
76
|
+
secret: string;
|
|
77
|
+
}>;
|
|
78
|
+
export declare function updateAccount(id: string, body: {
|
|
79
|
+
label?: string;
|
|
80
|
+
scopes?: string[];
|
|
81
|
+
workspaces?: string[] | null;
|
|
82
|
+
enabled?: boolean;
|
|
83
|
+
}): Promise<{
|
|
84
|
+
account: AccountRow;
|
|
85
|
+
}>;
|
|
86
|
+
export declare function revokeAccount(id: string): Promise<{
|
|
87
|
+
ok: boolean;
|
|
94
88
|
}>;
|
|
95
|
-
|
|
96
|
-
export declare function
|
|
89
|
+
/** Changes **your own** secret, proving the current one. */
|
|
90
|
+
export declare function setMySecret(currentSecret: string | undefined, newSecret: string): Promise<{
|
|
91
|
+
ok: boolean;
|
|
92
|
+
}>;
|
|
93
|
+
/** Turns the auth guard off. The accounts stay on disk. */
|
|
94
|
+
export declare function disableAuth(): Promise<unknown>;
|
|
97
95
|
export declare function clearProxyCertificate(id: string): Promise<ProxyView>;
|
|
98
96
|
export declare function deleteBackup(name: string): Promise<unknown>;
|
|
99
|
-
/**
|
|
100
|
-
* The WSL2 temperature bridge: read its state, install it, remove it.
|
|
101
|
-
*
|
|
102
|
-
* A guest has no readable sensor, so these three are what the settings page offers instead of a tile
|
|
103
|
-
* that says `n/a` with no explanation.
|
|
104
|
-
*/
|
|
97
|
+
/** The WSL2 temperature bridge: a guest has no readable sensor. */
|
|
105
98
|
export declare function fetchWslTemperature(): Promise<WslTemperatureStatus>;
|
|
106
|
-
/**
|
|
107
|
-
* Write the helper and point the config at it.
|
|
108
|
-
*
|
|
109
|
-
* `download` is the person's consent to fetch LibreHardwareMonitor: without it the panel answers
|
|
110
|
-
* `needsDownload` and writes nothing but the helper, so no click installs a binary it did not mention.
|
|
111
|
-
*/
|
|
99
|
+
/** `download` is consent to fetch LibreHardwareMonitor; without it only the helper is written. */
|
|
112
100
|
export declare function installWslTemperature(options?: {
|
|
113
101
|
download?: boolean;
|
|
114
102
|
}): Promise<WslTemperatureStatus>;
|
|
@@ -117,25 +105,13 @@ export declare function fetchProxy(): Promise<ProxyView>;
|
|
|
117
105
|
export declare function fetchSession(): Promise<SessionView>;
|
|
118
106
|
export declare function fetchSettings(): Promise<SettingsView>;
|
|
119
107
|
export declare function installProxyEngine(version?: string): Promise<ProxyView>;
|
|
120
|
-
export declare function login(
|
|
108
|
+
export declare function login(id: string, secret: string): Promise<SessionView>;
|
|
121
109
|
export declare function logout(): Promise<unknown>;
|
|
122
110
|
export declare function patchProxy(patch: ProxyPatch): Promise<ProxyView>;
|
|
123
|
-
/**
|
|
124
|
-
* The restore request body — the same pair the CLI's `backup restore … --exclude …` sends.
|
|
125
|
-
*
|
|
126
|
-
* It went through its own copy that carried only `password` and `include`, so a UI could tick items
|
|
127
|
-
* but never say "everything except these": the one shape the docs recommend for a shared archive.
|
|
128
|
-
*/
|
|
111
|
+
/** The restore body: the same pair as the CLI's `backup restore … --exclude`. */
|
|
129
112
|
export declare function restoreBody(options: RestoreOptions): Record<string, unknown>;
|
|
130
113
|
export declare function restoreStoredBackup(name: string, confirm: boolean, options?: RestoreOptions): Promise<RestorePlan>;
|
|
131
|
-
/**
|
|
132
|
-
* A restore from a file the person picked, which cannot travel as JSON.
|
|
133
|
-
*
|
|
134
|
-
* A multipart body can only carry strings, so each selection is JSON — the server parses both
|
|
135
|
-
* fields the same way. This was a byte-identical copy in each UI's `lib/api.ts` (and each had its
|
|
136
|
-
* own `RestoreOptions` beside it), so the pair could only ever be extended in one of them: exactly
|
|
137
|
-
* what happened when `exclude` arrived on the create side.
|
|
138
|
-
*/
|
|
114
|
+
/** A restore from an uploaded file: multipart carries strings, so each selection travels as JSON. */
|
|
139
115
|
export declare function restoreUploadedBackup(file: File, confirm: boolean, options?: RestoreOptions): Promise<RestorePlan>;
|
|
140
116
|
export declare function retryProxyCertificate(id: string): Promise<ProxyView>;
|
|
141
117
|
export declare function revertProxy(): Promise<ProxyView>;
|
|
@@ -144,10 +120,6 @@ export declare function revertUi(): Promise<{
|
|
|
144
120
|
removed: boolean;
|
|
145
121
|
ui: UiStatus;
|
|
146
122
|
}>;
|
|
147
|
-
export declare function setPassword(currentPassword: string | undefined, newPassword: string): Promise<{
|
|
148
|
-
ok: boolean;
|
|
149
|
-
enabled: boolean;
|
|
150
|
-
}>;
|
|
151
123
|
export declare function startProxy(): Promise<ProxyView>;
|
|
152
124
|
export declare function stopProxy(): Promise<ProxyView>;
|
|
153
125
|
export declare function uploadProxyCertificate(id: string, label: string, certificate: string, privateKey: string): Promise<ProxyView>;
|
|
@@ -156,30 +128,14 @@ export declare function uploadUi(file: File): Promise<{
|
|
|
156
128
|
meta: UiStatus['meta'];
|
|
157
129
|
ui: UiStatus;
|
|
158
130
|
}>;
|
|
159
|
-
/**
|
|
160
|
-
* Install the workspace resolver; called once per UI at module load.
|
|
161
|
-
*
|
|
162
|
-
* A setter rather than a constructor argument because the call sites are free functions the views
|
|
163
|
-
* import directly (`api.fetchLogServers()`), and threading an instance through every component
|
|
164
|
-
* would rewrite every view to buy nothing.
|
|
165
|
-
*/
|
|
131
|
+
/** Install the workspace resolver; called once per UI at module load. */
|
|
166
132
|
export declare function useWorkspaceResolver(resolve: () => string | null): void;
|
|
167
133
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* A caller that names a workspace wins; the resolver is consulted only when it did not. An empty
|
|
171
|
-
* string counts as omitted — a blank id is never a workspace, and `?workspace=` would be a 404 on
|
|
172
|
-
* any panel whose default is not blank.
|
|
173
|
-
*
|
|
174
|
-
* The separator is chosen against the **path**, so a route already carrying a query (the log
|
|
175
|
-
* download link) appends with `&` instead of a second `?`. `stock`'s copy lacked that and was saved
|
|
176
|
-
* from being a live bug only by having no such caller; shared, it would have become both UIs'.
|
|
134
|
+
* `path` plus a `workspace` query merged with `extra`. A named workspace wins over the resolver and a
|
|
135
|
+
* blank id counts as omitted. Appends with `&` when the path already carries a query.
|
|
177
136
|
*/
|
|
178
137
|
export declare function scoped(path: string, workspace?: string | null, extra?: URLSearchParams): string;
|
|
179
|
-
/**
|
|
180
|
-
* The typed view of a frame: the schema accepts a request-shaped `port` (possibly absent) while the
|
|
181
|
-
* panel always emits the normalized `number | null`, so these carry that one narrowing.
|
|
182
|
-
*/
|
|
138
|
+
/** The schema accepts a request-shaped `port`; the panel always emits `number | null`. */
|
|
183
139
|
export type WorkspaceState = Omit<WorkspaceView, 'servers'> & {
|
|
184
140
|
servers: ServerView[];
|
|
185
141
|
};
|
|
@@ -199,35 +155,17 @@ export interface LogQuery {
|
|
|
199
155
|
}
|
|
200
156
|
export interface WorkspaceRemoved {
|
|
201
157
|
ok: boolean;
|
|
202
|
-
removed:
|
|
158
|
+
removed: {
|
|
159
|
+
id: string;
|
|
160
|
+
label: string;
|
|
161
|
+
};
|
|
203
162
|
}
|
|
204
163
|
/** Validated at the boundary: contract drift fails loudly here, not in the UI. */
|
|
205
164
|
export declare function fetchState(): Promise<AppStateView>;
|
|
206
|
-
/** Every workspace the panel serves, in panel order; the first is the default. */
|
|
207
|
-
export declare function fetchWorkspaces(): Promise<WorkspaceState[]>;
|
|
208
165
|
export declare function createWorkspace(input?: WorkspaceCreate): Promise<WorkspaceState>;
|
|
209
166
|
export declare function renameWorkspace(id: string, label: string): Promise<WorkspaceState>;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
*
|
|
213
|
-
* One spelling, returning the removal the route documents. The copies differed — one typed the
|
|
214
|
-
* answer as `WorkspaceRemoved`, the other as an inline duplicate of the same object literal — and
|
|
215
|
-
* only this one was validated.
|
|
216
|
-
*/
|
|
217
|
-
export declare function deleteWorkspace(id: string): Promise<{
|
|
218
|
-
ok: boolean;
|
|
219
|
-
removed: {
|
|
220
|
-
id: string;
|
|
221
|
-
label: string;
|
|
222
|
-
};
|
|
223
|
-
}>;
|
|
224
|
-
/**
|
|
225
|
-
* Writes the panel-wide groups, answering with where the listener lands.
|
|
226
|
-
*
|
|
227
|
-
* Validated, because this answer decides a redirect: `rebinding`/`targetUrl` is what tells the page
|
|
228
|
-
* to follow the panel to a new origin. A cast here would let a missing pair read as `undefined`,
|
|
229
|
-
* which is falsy, and leave the browser on a stale socket with no error.
|
|
230
|
-
*/
|
|
167
|
+
export declare function deleteWorkspace(id: string): Promise<WorkspaceRemoved>;
|
|
168
|
+
/** Validated: `rebinding`/`targetUrl` decides a redirect, and a missing pair would strand the page. */
|
|
231
169
|
export declare function patchSettings(patch: SettingsPatch): Promise<SettingsSaved>;
|
|
232
170
|
/** `GET /api/settings/workspace?workspace=<id>`: defaults, logs and notifications. */
|
|
233
171
|
export declare function fetchWorkspaceSettings(workspace?: string | null): Promise<WorkspaceSettingsView>;
|
|
@@ -237,20 +175,9 @@ export declare function fetchLogHistory(id: string, query: LogQuery, workspace?:
|
|
|
237
175
|
export declare function clearLogHistory(id: string, workspace?: string | null): Promise<unknown>;
|
|
238
176
|
/** Direct link; the session cookie is sent by the browser. */
|
|
239
177
|
export declare function logDownloadUrl(id: string, file: string, workspace?: string | null): string;
|
|
240
|
-
/**
|
|
241
|
-
* Backups are panel-wide: every workspace is a selectable entry in the archive.
|
|
242
|
-
*
|
|
243
|
-
* Validated, which is the half of this pair that used to differ — one UI checked the payload, the
|
|
244
|
-
* other cast it, so a contract change would have surfaced as an empty capture tree in exactly one
|
|
245
|
-
* product.
|
|
246
|
-
*/
|
|
178
|
+
/** Backups are panel-wide: every workspace is a selectable entry in the archive. */
|
|
247
179
|
export declare function fetchBackups(): Promise<BackupSelection>;
|
|
248
|
-
/**
|
|
249
|
-
* A Telegram destination's bot token.
|
|
250
|
-
*
|
|
251
|
-
* Keyed by destination id in the path: a workspace may point at several chats and each carries its
|
|
252
|
-
* own bot. The token never travels in the settings patch, so it never lands in a config file.
|
|
253
|
-
*/
|
|
180
|
+
/** Keyed by destination id; the token never travels in the settings patch. */
|
|
254
181
|
export declare function saveTelegramToken(id: string, botToken: string, workspace?: string | null): Promise<{
|
|
255
182
|
ok: boolean;
|
|
256
183
|
username: string | null;
|
|
@@ -270,10 +197,7 @@ export declare function detectTelegramChats(id: string, payload: {
|
|
|
270
197
|
title: string;
|
|
271
198
|
}>;
|
|
272
199
|
}>;
|
|
273
|
-
/**
|
|
274
|
-
* One webhook destination, as a settings form holds it. The whole draft travels, so an unsaved URL
|
|
275
|
-
* and header block are what gets tried — `id` is echoed so the result lands against the right row.
|
|
276
|
-
*/
|
|
200
|
+
/** The whole draft travels, so an unsaved destination is what gets tried. */
|
|
277
201
|
export interface WebhookTestTarget {
|
|
278
202
|
url: string;
|
|
279
203
|
method: 'POST' | 'PUT';
|
|
@@ -302,50 +226,82 @@ export declare function saveDdnsCredentials(id: string, provider: string, creden
|
|
|
302
226
|
export declare function clearDdnsCredentials(id: string, workspace?: string | null): Promise<DdnsView>;
|
|
303
227
|
/** Runs a pass now; the answer carries the fresh status. */
|
|
304
228
|
export declare function checkDdns(workspace?: string | null): Promise<DdnsView>;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
229
|
+
export declare function deployServer(id: string, workspace?: string | null): Promise<{
|
|
230
|
+
ok: boolean;
|
|
231
|
+
}>;
|
|
232
|
+
/** A Jobs page row, as `GET /api/jobs` and the state frame's `jobs` slice carry it. */
|
|
233
|
+
export type JobRow = JobEntryView;
|
|
234
|
+
export declare function listJobs(workspace: string | null): Promise<JobsList>;
|
|
235
|
+
export declare function createJob(input: JobCreate, workspace: string | null): Promise<{
|
|
236
|
+
job: JobRow;
|
|
237
|
+
}>;
|
|
238
|
+
/** Only the keys sent change; a list is replaced whole, so send one only when the form changed it. */
|
|
239
|
+
export declare function updateJob(id: string, patch: JobPatch, workspace: string | null): Promise<{
|
|
240
|
+
job: JobRow;
|
|
241
|
+
}>;
|
|
242
|
+
/** Removes the job with its run history, log and stored secrets; a run in flight is stopped first. */
|
|
243
|
+
export declare function deleteJob(id: string, workspace: string | null): Promise<{
|
|
244
|
+
ok: boolean;
|
|
245
|
+
}>;
|
|
246
|
+
/** Starts a run and answers at once with its id; follow it in the state frame. `409 JOB_RUNNING` when one is in flight. */
|
|
247
|
+
export declare function runJob(id: string, workspace: string | null): Promise<JobRunStarted>;
|
|
248
|
+
/** Ends the run in flight and waits for it; `stopped: false` when nothing was running. */
|
|
249
|
+
export declare function stopJob(id: string, workspace: string | null): Promise<{
|
|
250
|
+
ok: boolean;
|
|
251
|
+
stopped: boolean;
|
|
252
|
+
}>;
|
|
253
|
+
/** A job's recent runs, newest first. */
|
|
254
|
+
export declare function listJobRuns(id: string, workspace: string | null): Promise<{
|
|
255
|
+
runs: JobRun[];
|
|
256
|
+
}>;
|
|
257
|
+
/** One run and the lines it wrote. */
|
|
258
|
+
export declare function fetchJobRun(id: string, runId: string, workspace: string | null): Promise<JobRunDetail>;
|
|
259
|
+
/** A job's whole log, across runs. */
|
|
260
|
+
export declare function fetchJobLog(id: string, query: {
|
|
261
|
+
tail?: number;
|
|
262
|
+
search?: string;
|
|
263
|
+
stream?: string;
|
|
264
|
+
}, workspace: string | null): Promise<JobLogView>;
|
|
265
|
+
/** Write-only: the panel never echoes a value; `unset` clears one, and an undeclared name is refused. */
|
|
266
|
+
export declare function setJobSecrets(id: string, body: {
|
|
267
|
+
set?: Record<string, string>;
|
|
268
|
+
unset?: string[];
|
|
269
|
+
}, workspace: string | null): Promise<{
|
|
270
|
+
ok: boolean;
|
|
271
|
+
}>;
|
|
272
|
+
/** Start, stop or restart an entry. Plain `fetch`: `src/shared` may not import the server's `AppType`. */
|
|
314
273
|
export declare function serverAction(id: string, action: 'start' | 'stop' | 'restart', workspace?: string | null): Promise<ActionResult>;
|
|
315
274
|
/** Stops a process the panel started that no entry claims any more; see the workspace view. */
|
|
316
275
|
export declare function stopOrphan(workspace: string | null | undefined, serverId: string): Promise<ActionResult>;
|
|
317
276
|
export declare function startAll(workspace?: string | null): Promise<unknown>;
|
|
318
|
-
/**
|
|
319
|
-
* Frees a server's port by asking the listener holding it to stop. The server re-lists the holders
|
|
320
|
-
* itself, so a pid quoted in an old banner is never signalled.
|
|
321
|
-
*/
|
|
277
|
+
/** The server re-lists the port's holders itself, so a pid quoted in an old banner is never signalled. */
|
|
322
278
|
export declare function freePort(id: string, workspace?: string | null): Promise<FreePortResult>;
|
|
323
|
-
/**
|
|
324
|
-
* Stop every server in a workspace.
|
|
325
|
-
*
|
|
326
|
-
* `withPersistent` is the CLI's `--with-persistent`: a persistent entry outlives the panel, so
|
|
327
|
-
* leaving it running is the default and ending it has to be asked for.
|
|
328
|
-
*/
|
|
279
|
+
/** `withPersistent` also stops persistent entries, which otherwise outlive the panel. */
|
|
329
280
|
export declare function stopAll(workspace?: string | null, options?: {
|
|
330
281
|
withPersistent?: boolean;
|
|
331
282
|
}): Promise<unknown>;
|
|
332
283
|
export declare function clearLogs(id: string, workspace?: string | null): Promise<unknown>;
|
|
333
284
|
export type ServerPatchPayload = Partial<ServerPatch> & Record<string, unknown>;
|
|
285
|
+
/** Write-only: a route that echoed a value would publish what the 0600 secrets file protects. */
|
|
286
|
+
export declare function setServerSecrets(id: string, body: {
|
|
287
|
+
set?: Record<string, string>;
|
|
288
|
+
unset?: string[];
|
|
289
|
+
}, workspace?: string | null): Promise<{
|
|
290
|
+
ok: boolean;
|
|
291
|
+
}>;
|
|
334
292
|
export declare function patchServer(id: string, patch: ServerPatchPayload, workspace?: string | null): Promise<unknown>;
|
|
335
293
|
export declare function removeServer(id: string, workspace?: string | null): Promise<unknown>;
|
|
336
294
|
/** The create body is exactly the strict, defaulted schema the route validates. */
|
|
337
295
|
export type CreateServerPayload = ServerCreate;
|
|
338
|
-
|
|
296
|
+
/** `warnings` reports what only shows once the entry runs (a whole command line in `command`). */
|
|
297
|
+
export interface ServerWriteResult {
|
|
298
|
+
server?: unknown;
|
|
299
|
+
warnings?: string[];
|
|
300
|
+
}
|
|
301
|
+
export declare function createServer(payload: CreateServerPayload, workspace?: string | null): Promise<ServerWriteResult>;
|
|
339
302
|
/** The per-server event stream, addressed by the workspace that owns it. */
|
|
340
303
|
export declare function serverStreamUrl(id: string, workspace?: string | null): string;
|
|
341
|
-
/**
|
|
342
|
-
* What the panel's own TLS routes answer: the listener as it stands, and the move in flight.
|
|
343
|
-
*
|
|
344
|
-
* Deliberately **not** `SettingsSaved`. The routes return `{ control, rebinding, targetUrl }` only —
|
|
345
|
-
* no `host`, `backups` or `ui` — so the console's old `uploadTls(): Promise<SettingsSaveResult>`
|
|
346
|
-
* promised three fields the response never carried. A page that read one would have got `undefined`
|
|
347
|
-
* with nothing to fail on.
|
|
348
|
-
*/
|
|
304
|
+
/** What the TLS routes answer: `{ control, rebinding, targetUrl }` only, not `SettingsSaved`. */
|
|
349
305
|
export type TlsReview = typeof tlsReviewResponseSchema.infer;
|
|
350
306
|
export declare function uploadTls(certificate: string, privateKey: string): Promise<TlsReview>;
|
|
351
307
|
export declare function clearTls(): Promise<TlsReview>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API scope names, apart from `#src/config/secrets.ts` (which re-exports them) so `src/cli.ts` can
|
|
3
|
+
* read them without importing a state module before `--home` applies.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What a credential may do.
|
|
7
|
+
*
|
|
8
|
+
* - `read` — every `GET`;
|
|
9
|
+
* - `lifecycle` — start, stop, restart, free-port, clear-logs;
|
|
10
|
+
* - `config` — server, workspace and settings writes, and backups;
|
|
11
|
+
* - `proxy` — the reverse proxy: the engine, its routes and its certificates;
|
|
12
|
+
* - `admin` — everything, including tokens, the password, UI install and restoring secrets.
|
|
13
|
+
*/
|
|
14
|
+
export declare const API_TOKEN_SCOPES: readonly ["read", "lifecycle", "config", "proxy", "admin"];
|
|
15
|
+
export type ApiTokenScope = typeof API_TOKEN_SCOPES[number];
|
|
16
|
+
/** Scopes with no per-workspace meaning: granting either grants the whole panel whatever `workspaces` says. */
|
|
17
|
+
export declare const PANEL_WIDE_SCOPES: readonly ["proxy", "admin"];
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import type { BackupScope } from './contracts.js';
|
|
2
|
-
/**
|
|
3
|
-
* What a configured automatic scope asks a `create` for.
|
|
4
|
-
*
|
|
5
|
-
* `only` is `--include` and `except` is `--all --exclude`, because a schedule and a person typing
|
|
6
|
-
* flags have to mean the same thing. An absent scope is the full default the schedule took before
|
|
7
|
-
* it could be configured, which is what keeps an existing config exactly as it was.
|
|
8
|
-
*/
|
|
2
|
+
/** `only` is `--include` and `except` is `--all --exclude`; an absent scope is the full default. */
|
|
9
3
|
export declare function scopeSelection(scope: BackupScope | undefined): {
|
|
10
4
|
include?: string[];
|
|
11
5
|
exclude?: string[];
|
|
12
6
|
};
|
|
13
7
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* One implementation for `create`, `restore`, the control channel's plan and both UIs: a second
|
|
17
|
-
* copy of "does this id count as selected" is how an `--exclude` that works on backup silently does
|
|
18
|
-
* nothing on restore, or how a page ticks a row the panel will not capture.
|
|
19
|
-
*
|
|
20
|
-
* `include` omitted means everything; `exclude` is applied after it, and an id under an excluded
|
|
21
|
-
* entry is excluded too.
|
|
8
|
+
* The one "is this id selected" rule for create, restore, the control plan and both UIs. `include`
|
|
9
|
+
* omitted means everything; `exclude` applies after it, and covers every id beneath an excluded one.
|
|
22
10
|
*/
|
|
23
11
|
export declare function selectionOf(options: {
|
|
24
12
|
include?: readonly string[];
|
|
@@ -26,25 +14,13 @@ export declare function selectionOf(options: {
|
|
|
26
14
|
}): ((id: string) => boolean) & {
|
|
27
15
|
isExcluded: (id: string) => boolean;
|
|
28
16
|
};
|
|
29
|
-
/**
|
|
30
|
-
* One entry of the capture tree as a **selection** sees it: its id, plus the short ids that name it.
|
|
31
|
-
*
|
|
32
|
-
* The alias is not a second way to spell the id, it is part of the item: `config` is what the person
|
|
33
|
-
* ticks in a UI, `global:settings` is what the archive stores, and both name one file.
|
|
34
|
-
*/
|
|
17
|
+
/** A capture-tree entry as a selection sees it; an alias (`config`) names the same item as its id. */
|
|
35
18
|
export interface SelectableItem {
|
|
36
19
|
id: string;
|
|
37
20
|
/** Coarse ids that select this item too (`config` for `global:settings`). */
|
|
38
21
|
aliases?: readonly string[];
|
|
39
22
|
}
|
|
40
|
-
/**
|
|
41
|
-
* The panel-wide entries, declared once.
|
|
42
|
-
*
|
|
43
|
-
* The restore's own item list and the credential guard both read this, so "which item is the
|
|
44
|
-
* credential file" cannot be answered two ways — which it was: the guard tested the exact id while
|
|
45
|
-
* the restore also honoured the alias, so `include: ["secrets"]` selected the item and skipped the
|
|
46
|
-
* guard. A second string literal at the guard would be the same defect one rename later.
|
|
47
|
-
*/
|
|
23
|
+
/** The panel-wide entries, declared once so the credential guard and the restore agree on aliases. */
|
|
48
24
|
export declare const GLOBAL_RESTORE_ITEMS: {
|
|
49
25
|
readonly settings: {
|
|
50
26
|
readonly id: "global:settings";
|
|
@@ -59,48 +35,23 @@ export declare const GLOBAL_RESTORE_ITEMS: {
|
|
|
59
35
|
readonly aliases: readonly ["tls"];
|
|
60
36
|
};
|
|
61
37
|
};
|
|
62
|
-
/**
|
|
63
|
-
* The one rule for "does this selection choose this item", aliases included.
|
|
64
|
-
*
|
|
65
|
-
* An exclusion beats an alias (`--exclude global:secrets` must not be undone by the item's own
|
|
66
|
-
* short alias selecting it back in), then any of the item's ids may select it.
|
|
67
|
-
*/
|
|
38
|
+
/** Whether a selection chooses this item: an exclusion beats an alias, then any of its ids selects it. */
|
|
68
39
|
export declare function selectedBy(selects: ((id: string) => boolean) & {
|
|
69
40
|
isExcluded: (id: string) => boolean;
|
|
70
41
|
}, item: SelectableItem): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Whether a selection reaches anything inside one item: the item itself, an alias, or a leaf of it.
|
|
73
|
-
*
|
|
74
|
-
* A leaf counts because selection is downwards only — naming `global:secrets:password` does not
|
|
75
|
-
* select `global:secrets` — yet the restore still writes that one field of the same file.
|
|
76
|
-
*
|
|
77
|
-
* Both spellings of a leaf are recognised (`global:secrets:password` and its alias
|
|
78
|
-
* `secrets:password`), because an exclusion the person wrote as `--exclude secrets` reaches the
|
|
79
|
-
* leaves of that item through `selectionOf`'s prefix rule. Answering "the item is untouched" there
|
|
80
|
-
* while the restore still wrote its leaves was a real bypass: `{"exclude":["secrets"]}` — the
|
|
81
|
-
* spelling the docs recommend to leave credentials behind — rewrote the password and token hashes.
|
|
82
|
-
*/
|
|
42
|
+
/** Whether a selection reaches anything inside one item: the item, an alias, or a leaf of it. */
|
|
83
43
|
export declare function selectionTouches(options: {
|
|
84
44
|
include?: readonly string[];
|
|
85
45
|
exclude?: readonly string[];
|
|
86
46
|
}, item: SelectableItem): boolean;
|
|
87
47
|
/**
|
|
88
|
-
* Whether a restore
|
|
89
|
-
*
|
|
90
|
-
* `global:secrets` holds the password hash and the API token hash, so a restore that carries it can
|
|
91
|
-
* replace the credentials of the panel doing the restoring. That is a legitimate move for the owner
|
|
92
|
-
* (a fresh host taking its own archive back) and a panel takeover for anyone holding only a token:
|
|
93
|
-
* measured, a token-only upload restore left the victim's password hash byte-identical to the
|
|
94
|
-
* attacker's, and the owner locked out.
|
|
95
|
-
*
|
|
96
|
-
* The predicate exists so the guard has one definition rather than a string literal at each call
|
|
97
|
-
* site. It answers *whether* the store is touched; who may touch it is the route's decision.
|
|
48
|
+
* Whether a restore would write the credential store (password and token hashes). Who may do that is
|
|
49
|
+
* the route's decision.
|
|
98
50
|
*/
|
|
99
51
|
export declare function selectionWritesCredentials(options: {
|
|
100
52
|
include?: readonly string[];
|
|
101
53
|
exclude?: readonly string[];
|
|
102
54
|
}): boolean;
|
|
103
|
-
/** One entry of the panel's two-level capture tree, with the person's ticks on it. */
|
|
104
55
|
export interface ScopeChoice {
|
|
105
56
|
id: string;
|
|
106
57
|
selected: boolean;
|
|
@@ -110,16 +61,10 @@ export interface ScopeChoice {
|
|
|
110
61
|
selected: boolean;
|
|
111
62
|
}>;
|
|
112
63
|
}
|
|
113
|
-
/**
|
|
64
|
+
/** A wholly-ticked entry travels as its own id, a partial one by leaf. */
|
|
114
65
|
export declare function capturedIds(choices: readonly ScopeChoice[]): string[];
|
|
115
|
-
/**
|
|
116
|
-
* The ids the ticks leave out — the complement, for writing the scope down as an exclusion.
|
|
117
|
-
*
|
|
118
|
-
* An entry no leaf of which is captured is named whole; a partly ticked one has to be spelled leaf
|
|
119
|
-
* by leaf, because its other leaves are still wanted.
|
|
120
|
-
*/
|
|
66
|
+
/** The complement, for an exclusion scope: an untouched entry whole, a partial one leaf by leaf. */
|
|
121
67
|
export declare function excludedIds(choices: readonly ScopeChoice[]): string[];
|
|
122
|
-
/** What a picked tree should be stored as. */
|
|
123
68
|
export type ScopeOutcome = {
|
|
124
69
|
kind: 'everything';
|
|
125
70
|
} | {
|
|
@@ -129,18 +74,10 @@ export type ScopeOutcome = {
|
|
|
129
74
|
scope: BackupScope;
|
|
130
75
|
};
|
|
131
76
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* A tree with nothing left out is stored as **no scope at all**, whatever the mode: the two capture
|
|
135
|
-
* the same thing today, and only the empty setting also covers a workspace declared tomorrow.
|
|
136
|
-
* Storing the full id list instead would silently narrow every future schedule.
|
|
137
|
-
*
|
|
138
|
-
* `nothing` is refused by the caller rather than sent: an empty `include` reads as "everything" to
|
|
139
|
-
* the API (it is what omitting the key means) and as "nothing" to a person, which is the one
|
|
140
|
-
* reading a backup must never get wrong.
|
|
77
|
+
* A tree with nothing left out is stored as **no scope**, so a workspace declared later is covered too.
|
|
78
|
+
* `nothing` is refused by the caller: an empty `include` means "everything" to the API.
|
|
141
79
|
*/
|
|
142
80
|
export declare function scopeOf(choices: readonly ScopeChoice[], mode: BackupScope['mode']): ScopeOutcome;
|
|
143
|
-
/** One entry of the panel's two-level capture tree, as the id check needs it. */
|
|
144
81
|
export interface ScopeEntry {
|
|
145
82
|
id: string;
|
|
146
83
|
items?: ReadonlyArray<{
|
|
@@ -148,20 +85,9 @@ export interface ScopeEntry {
|
|
|
148
85
|
}>;
|
|
149
86
|
}
|
|
150
87
|
/**
|
|
151
|
-
* Which of `ids` name nothing
|
|
152
|
-
*
|
|
153
|
-
* The rule `backup create --include` already applies: an id names something when it is an entry or
|
|
154
|
-
* leaf id, or a prefix of one (`workspace:default` covers its leaves). A typo matters more on a
|
|
155
|
-
* schedule than anywhere else — nobody is watching — and it cuts both ways: an unknown `only` id
|
|
156
|
-
* silently narrows the archive, an unknown `except` id silently widens it back over what the
|
|
157
|
-
* person meant to leave out.
|
|
88
|
+
* Which of `ids` name nothing capturable (an id may be a prefix of one). On a schedule a typo silently
|
|
89
|
+
* narrows (`only`) or widens (`except`) the archive.
|
|
158
90
|
*/
|
|
159
91
|
export declare function unknownBackupIds(ids: readonly string[], entries: readonly ScopeEntry[]): string[];
|
|
160
|
-
/**
|
|
161
|
-
* Two scopes are the same when they name the same ids the same way.
|
|
162
|
-
*
|
|
163
|
-
* Both UIs diff a freshly built object against the config one, so a reference check reported the
|
|
164
|
-
* scope changed on a save nobody made, and the order the panel wrote the ids in is not part of
|
|
165
|
-
* what it means.
|
|
166
|
-
*/
|
|
92
|
+
/** Same ids, same mode, order ignored. */
|
|
167
93
|
export declare function sameScope(a: BackupScope | null | undefined, b: BackupScope | null | undefined): boolean;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A deep copy that unwraps a reactive proxy at **every** level
|
|
3
|
-
*
|
|
4
|
-
* `structuredClone(toRaw(value))` looks detached and is not: reading a reactive array hands back
|
|
5
|
-
* proxies for its members, so a list a form rebuilt (`domains = domains.filter(...)`) stores
|
|
6
|
-
* proxies **inside** the raw array. `toRaw` on the parent then unwraps nothing below it, and the
|
|
7
|
-
* clone throws `DataCloneError: #<Object> could not be cloned` — measured on the DDNS form, where
|
|
8
|
-
* removing one hostname left every later edit unable to publish a patch.
|
|
9
|
-
*
|
|
10
|
-
* Rebuilding every object is what removes the proxies, so no `toRaw` is needed here and this module
|
|
11
|
-
* stays Vue-free. Config data is JSON: a `Date` is copied, and any other non-plain value is handed
|
|
12
|
-
* back by reference rather than silently flattened into `{}`.
|
|
2
|
+
* A deep copy that unwraps a reactive proxy at **every** level — `structuredClone(toRaw(x))` does not,
|
|
3
|
+
* since a rebuilt list holds proxies inside the raw array. Non-plain values other than `Date` pass by reference.
|
|
13
4
|
*/
|
|
14
5
|
export declare function clonePlain<T>(value: T): T;
|