/** * webapi/schedule.ts — 直接 import web 端 task.ts (v0.11+ Phase 2) * * 镜像 web/apps/jnpf-web-apps-main/src/api/system/task.ts 7 函数: * getTaskList / create / update / getInfo / delTask / getTaskLogList / getTaskMethodsList * * 端点: /api/scheduletask (Quartz cron 任务, 不是日历日程) */ import { JnpfClient } from '../core/client.ts' import { loadWebModule } from './_loader.ts' const SCHEDULE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/system/task.ts' let cached: any = null export async function initWebapi(client: JnpfClient): Promise { if (cached) return const { initDefHttpShim } = await import('./_defhttp_shim.ts') initDefHttpShim(client) cached = await loadWebModule(SCHEDULE_SRC) } export function isWebapiLoaded(): boolean { return cached !== null } export const loadSchedule: any = new Proxy({} as any, { get(_target, prop) { if (!cached) throw new Error('schedule 模块未初始化, 请先 await initWebapi(client)') return cached[prop] }, })