@musnows/scriverse 0.6.13 → 0.7.0
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 +8 -0
- package/dist/app.js.map +1 -1
- package/dist/public/app.js +206 -11
- package/dist/public/display-labels.js +1 -1
- package/dist/public/entity-version.js +2 -1
- package/dist/public/index.html +29 -3
- package/dist/public/styles.css +27 -1
- package/dist/store.js +75 -0
- package/dist/store.js.map +1 -1
- package/dist/user-auth.js +8 -0
- package/dist/user-auth.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -150,6 +150,11 @@ const settingSchema = z.object({
|
|
|
150
150
|
scope: jsonObject.optional(),
|
|
151
151
|
authorNote: z.string().max(20_000).optional()
|
|
152
152
|
});
|
|
153
|
+
const globalReplaceSchema = z.object({
|
|
154
|
+
find: z.string().min(1).max(500),
|
|
155
|
+
replacement: z.string().max(200_000),
|
|
156
|
+
scope: z.enum(["prose", "settings", "prose-and-settings"]).default("prose")
|
|
157
|
+
}).strict();
|
|
153
158
|
const draftSchema = z.object({
|
|
154
159
|
draftType: z.enum(["prose", "setting"]),
|
|
155
160
|
volumeId: identifier.nullable().optional(),
|
|
@@ -1299,6 +1304,9 @@ export function createRuntime(options) {
|
|
|
1299
1304
|
const expectedVersionNo = parse(expectedVersionNoSchema, request.body.expectedVersionNo);
|
|
1300
1305
|
data(response, store.importNovel(String(request.params.workId), originalFileName, extension.slice(1), parsed, mode, expectedVersionNo), 201);
|
|
1301
1306
|
});
|
|
1307
|
+
app.post("/api/works/:workId/replace", (request, response) => {
|
|
1308
|
+
data(response, store.replaceWorkText(request.params.workId, parse(globalReplaceSchema, request.body)));
|
|
1309
|
+
});
|
|
1302
1310
|
app.post("/api/works/:workId/volumes", (request, response) => {
|
|
1303
1311
|
const input = parse(z.object({ title: nonEmpty.max(200), kind: z.enum(["main", "prequel", "extra", "epilogue", "appendix"]).optional(), description: z.string().max(5_000).optional(), keywords: z.array(nonEmpty.max(100)).max(100).optional() }), request.body);
|
|
1304
1312
|
data(response, store.createVolume(request.params.workId, input), 201);
|