prasi-bun/app/srv/ws/sync/actions.ts

31 lines
894 B
TypeScript

import { component, page } from "dbgen";
import { EPage, ESite } from "../../../web/src/render/ed/logic/ed-global";
/*
WARNING:
CHANGING FUNCTION NAME / OBJECT STRUCTURE
WILL *BREAK* OFFLINE STORAGE --
ONLY ADDITION IS ALLOWED
*/
export type SAction = typeof SyncActions;
export const SyncActions = {
site: {
list: async () =>
({}) as Record<string, { id: string; name: string; domain: string }>,
group: async () => ({}) as Record<string, string[]>,
load: async (id: string) => ({}) as ESite | void,
},
comp: {
list: () => ({}) as Record<string, Exclude<component, "content_tree">>,
group: () => ({}) as Record<string, string[]>,
doc: (id: string) => ({}) as Uint8Array,
},
page: {
list: (id_site: string) =>
({}) as Record<string, Exclude<page, "content_tree">>,
load: async (id: string) => ({}) as EPage | void,
},
};