feat(database): add account-scoped database manager
This commit is contained in:
1 parent
1606c41f43
commit
33e80a566e
18 files changed
+444
-25
No files matched your search
+4
-1
@@ -1,5 +1,6 @@
|
||||
import { addonsJs, bootGuardJs, i18nJs, localeEn, localeZh, localeEnJs, localeZhJs, tasksJs, calendarJs, i18nRenderersJs, browserAppJs, dataActionsJs, terminalAppJs, indexHtml, manifest, serviceWorker, icon } from "./assets.js";
|
||||
import { addonsJs, bootGuardJs, i18nJs, localeEn, localeZh, localeEnJs, localeZhJs, tasksJs, calendarJs, i18nRenderersJs, browserAppJs, dataActionsJs, terminalAppJs, dbAdminJs, indexHtml, manifest, serviceWorker, icon } from "./assets.js";
|
||||
import { cloudApi } from "./cloud-state.js";
|
||||
import { dbAdminApi } from "./db-admin.js";
|
||||
|
||||
const BING_ARCHIVE = "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US";
|
||||
|
||||
@@ -26,6 +27,7 @@ export default {
|
||||
const url = new URL(request.url);
|
||||
const id = userId(request);
|
||||
if (["/api/lifeos-state", "/api/lifeos-initialize", "/api/lifeos-sync"].includes(url.pathname)) return cloudApi(request, env, id, url.pathname);
|
||||
if (url.pathname.startsWith("/api/db-admin/")) return dbAdminApi(request, env, id, url.pathname);
|
||||
try {
|
||||
if (url.pathname === "/api/bing-wallpaper") return Response.json(await bingMetadata(), { headers: { "cache-control": "public, max-age=3600" } });
|
||||
if (url.pathname === "/api/bing-wallpaper-image") {
|
||||
@@ -49,6 +51,7 @@ export default {
|
||||
if (url.pathname === "/calendar.js") return new Response(calendarJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/data-actions.js") return new Response(dataActionsJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/terminal-app.js") return new Response(terminalAppJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/db-admin.js") return new Response(dbAdminJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/browser-app.js") return new Response(browserAppJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/i18n-renderers.js") return new Response(i18nRenderersJs, { headers: headers("application/javascript; charset=utf-8", "no-cache") });
|
||||
if (url.pathname === "/" || url.pathname === "/index.html") {
|
||||
|
||||
Reference in new issue
Block a user