@gmickel/gno 0.34.0 → 0.35.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.
@@ -19,24 +19,30 @@ import {
19
19
  handleCapabilities,
20
20
  handleCollections,
21
21
  handleConnectors,
22
+ handleCreateFolder,
22
23
  handleCreateCollection,
23
24
  handleCreateEditableCopy,
24
25
  handleCreateDoc,
25
26
  handleDeactivateDoc,
26
27
  handleDeleteCollection,
27
28
  handleDoc,
29
+ handleDocSections,
28
30
  handleDocsAutocomplete,
29
31
  handleDocs,
32
+ handleDuplicateDoc,
30
33
  handleEmbed,
31
34
  handleEmbedStatus,
32
35
  handleHealth,
33
36
  handleImportPreview,
34
37
  handleInstallConnector,
38
+ handleMoveDoc,
39
+ handleNotePresets,
35
40
  handleJob,
36
41
  handleModelPull,
37
42
  handleModelStatus,
38
43
  handlePresets,
39
44
  handleQuery,
45
+ handleRefactorPlan,
40
46
  handleRenameDoc,
41
47
  handleRevealDoc,
42
48
  handleSearch,
@@ -257,6 +263,21 @@ export async function startServer(
257
263
  );
258
264
  },
259
265
  },
266
+ "/api/note-presets": {
267
+ GET: async () =>
268
+ withSecurityHeaders(await handleNotePresets(), isDev),
269
+ },
270
+ "/api/folders": {
271
+ POST: async (req: Request) => {
272
+ if (!isRequestAllowed(req, port)) {
273
+ return withSecurityHeaders(forbiddenResponse(), isDev);
274
+ }
275
+ return withSecurityHeaders(
276
+ await handleCreateFolder(ctxHolder, req),
277
+ isDev
278
+ );
279
+ },
280
+ },
260
281
  "/api/browse/tree": {
261
282
  GET: async () =>
262
283
  withSecurityHeaders(await handleBrowseTree(store), isDev),
@@ -290,6 +311,48 @@ export async function startServer(
290
311
  );
291
312
  },
292
313
  },
314
+ "/api/docs/:id/move": {
315
+ POST: async (req: Request) => {
316
+ if (!isRequestAllowed(req, port)) {
317
+ return withSecurityHeaders(forbiddenResponse(), isDev);
318
+ }
319
+ const url = new URL(req.url);
320
+ const parts = url.pathname.split("/");
321
+ const id = decodeURIComponent(parts[3] || "");
322
+ return withSecurityHeaders(
323
+ await handleMoveDoc(ctxHolder, store, id, req),
324
+ isDev
325
+ );
326
+ },
327
+ },
328
+ "/api/docs/:id/duplicate": {
329
+ POST: async (req: Request) => {
330
+ if (!isRequestAllowed(req, port)) {
331
+ return withSecurityHeaders(forbiddenResponse(), isDev);
332
+ }
333
+ const url = new URL(req.url);
334
+ const parts = url.pathname.split("/");
335
+ const id = decodeURIComponent(parts[3] || "");
336
+ return withSecurityHeaders(
337
+ await handleDuplicateDoc(ctxHolder, store, id, req),
338
+ isDev
339
+ );
340
+ },
341
+ },
342
+ "/api/docs/:id/refactor-plan": {
343
+ POST: async (req: Request) => {
344
+ if (!isRequestAllowed(req, port)) {
345
+ return withSecurityHeaders(forbiddenResponse(), isDev);
346
+ }
347
+ const url = new URL(req.url);
348
+ const parts = url.pathname.split("/");
349
+ const id = decodeURIComponent(parts[3] || "");
350
+ return withSecurityHeaders(
351
+ await handleRefactorPlan(ctxHolder, store, id, req),
352
+ isDev
353
+ );
354
+ },
355
+ },
293
356
  "/api/docs/:id/trash": {
294
357
  POST: async (req: Request) => {
295
358
  if (!isRequestAllowed(req, port)) {
@@ -479,6 +542,17 @@ export async function startServer(
479
542
  );
480
543
  },
481
544
  },
545
+ "/api/doc/:id/sections": {
546
+ GET: async (req: Request) => {
547
+ const url = new URL(req.url);
548
+ const parts = url.pathname.split("/");
549
+ const id = decodeURIComponent(parts[3] || "");
550
+ return withSecurityHeaders(
551
+ await handleDocSections(store, id, req),
552
+ isDev
553
+ );
554
+ },
555
+ },
482
556
  "/api/doc/:id/backlinks": {
483
557
  GET: async (req: Request) => {
484
558
  const url = new URL(req.url);