@musnows/scriverse 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -1626,7 +1626,7 @@ export function createRuntime(options) {
1626
1626
  await cleanupAttachments();
1627
1627
  noContent(response);
1628
1628
  });
1629
- app.post("/api/works", (request, response) => data(response, store.createWork(parse(workSchema, request.body)), 201));
1629
+ app.post("/api/works", (request, response) => data(response, store.createWork(parse(workSchema, request.body), request.authUser?.userId ?? null), 201));
1630
1630
  app.post("/api/works/import", upload.single("file"), async (request, response) => {
1631
1631
  if (!request.file)
1632
1632
  throw new AppError(400, "FILE_REQUIRED", "请选择要导入的 TXT 或 DOCX 文件");
@@ -1644,7 +1644,7 @@ export function createRuntime(options) {
1644
1644
  author: typeof request.body.author === "string" ? request.body.author : "",
1645
1645
  description: typeof request.body.description === "string" ? request.body.description : ""
1646
1646
  });
1647
- data(response, store.createImportedWork(input, originalFileName, extension.slice(1), parsedNovel), 201);
1647
+ data(response, store.createImportedWork(input, originalFileName, extension.slice(1), parsedNovel, request.authUser?.userId ?? null), 201);
1648
1648
  });
1649
1649
  app.get("/api/works/:workId", (request, response) => {
1650
1650
  if (request.query.directory === "volumes") {