This commit is contained in:
Rizky 2023-10-30 12:44:35 +07:00
parent caba4368ca
commit d47cf0af12
7 changed files with 64 additions and 9 deletions

View File

@ -0,0 +1,11 @@
import { SAction } from "../actions";
import { SyncConnection } from "../type";
export const code_create: SAction["code"]["create"] = async function (
this: SyncConnection,
) {
let result = null as unknown as Awaited<
ReturnType<SAction["code"]["create"]>
>;
return result;
}

View File

@ -0,0 +1,11 @@
import { SAction } from "../actions";
import { SyncConnection } from "../type";
export const comp_list: SAction["comp"]["list"] = async function (
this: SyncConnection,
) {
let result = null as unknown as Awaited<
ReturnType<SAction["comp"]["list"]>
>;
return result;
}

View File

@ -1,13 +1,17 @@
export * from "./activity"; export * from "./code_create";
export * from "./client_info"; export * from "./site_list";
export * from "./site_update";
export * from "./site_load";
export * from "./site_group"; export * from "./site_group";
export * from "./page_load"; export * from "./site_load";
export * from "./comp_load"; export * from "./site_update";
export * from "./comp_new"; export * from "./comp_new";
export * from "./comp_list";
export * from "./comp_group"; export * from "./comp_group";
export * from "./comp_load";
export * from "./page_list";
export * from "./page_load";
export * from "./yjs_um"; export * from "./yjs_um";
export * from "./yjs_sv_local"; export * from "./yjs_sv_local";
export * from "./yjs_diff_local"; export * from "./yjs_diff_local";
export * from "./yjs_sv_remote"; export * from "./yjs_sv_remote";
export * from "./activity";
export * from "./client_info";

View File

@ -0,0 +1,11 @@
import { SAction } from "../actions";
import { SyncConnection } from "../type";
export const page_list: SAction["page"]["list"] = async function (
this: SyncConnection,
) {
let result = null as unknown as Awaited<
ReturnType<SAction["page"]["list"]>
>;
return result;
}

View File

@ -0,0 +1,11 @@
import { SAction } from "../actions";
import { SyncConnection } from "../type";
export const site_list: SAction["site"]["list"] = async function (
this: SyncConnection,
) {
let result = null as unknown as Awaited<
ReturnType<SAction["site"]["list"]>
>;
return result;
}

View File

@ -94,7 +94,9 @@ export const syncHandler: WebSocketHandler<WSData> = {
if (actionName) { if (actionName) {
const baseAction = (actions as any)[actionName]; const baseAction = (actions as any)[actionName];
if (!baseAction) { if (!baseAction) {
console.log(`app/ws/edit/sync/${actionName}.ts not found`); console.log(
`app/srv/ws/sync/actions/${actionName}.ts not found`
);
} }
if (baseAction) { if (baseAction) {
const action = baseAction.bind(conn); const action = baseAction.bind(conn);

View File

@ -45,6 +45,11 @@ export const ${name}: SAction${saction} = async function (
index_js.push(`export * from "./${name}";`); index_js.push(`export * from "./${name}";`);
} }
await writeAsync(
dir.path(`app/srv/ws/sync/actions/index.ts`),
index_js.join("\n")
);
const content = `\ const content = `\
export const SyncActionDefinition = ${JSON.stringify(def, null, 2)}; export const SyncActionDefinition = ${JSON.stringify(def, null, 2)};
export const SyncActionPaths = ${JSON.stringify(paths, null, 2)}; export const SyncActionPaths = ${JSON.stringify(paths, null, 2)};