Restructure into Wiki, Studio and Python monorepo with scoped CI
python CI and deployment / verify-and-deploy (push) Successful in 7m23s
studio CI and deployment / verify-and-deploy (push) Failing after 5m28s
wiki CI and deployment / verify-and-deploy (push) Failing after 6m13s

This commit is contained in:
2026-10-25 21:13:43 +08:00
parent c898e41672
commit a2330b22e2
152 changed files with 3525 additions and 3287 deletions
@@ -0,0 +1,8 @@
import type {NextApiRequest,NextApiResponse} from "next";
import {snapshotState,queueSnapshots} from "@/lib/snapshots";
import {sameOrigin,apiError} from "@/lib/api";
export default async function handler(req:NextApiRequest,res:NextApiResponse){
res.setHeader('Cache-Control','no-store');
if(!['GET','POST'].includes(req.method||''))return res.status(405).end();
try{const state=await snapshotState(String(req.query.slug));if(!state)return res.status(404).end();if(req.method==='POST'){sameOrigin(req);const page=req.body?.page;if(page!==undefined&&(!Number.isInteger(page)||page<1||page>8))return res.status(400).json({error:'页码应为 1—8'});await queueSnapshots(state.postId,page);return res.status(202).json({queued:true});}return res.json(state);}catch(e){return apiError(res,e);}
}
+7
View File
@@ -0,0 +1,7 @@
import type { NextApiRequest,NextApiResponse } from "next";
import { createPost,postInput } from "@/lib/write";
import { sameOrigin,apiError } from "@/lib/api";
export default async function handler(req:NextApiRequest,res:NextApiResponse){
if(req.method!=='POST')return res.status(405).end();
try{sameOrigin(req);return res.status(201).json(await createPost(postInput.parse(req.body)));}catch(e){return apiError(res,e);}
}