NobGit
public anord read

Ledger

Why work hard when you can work easier?

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 86% CSS 10% SQL 3% Shell 1% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/anord/ledger.git
ssh://[email protected]:2222/orgs/anord/ledger.git

Trace

apps/api/src/http/routes/pages.ts

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

pages.ts on main
Author Date Commit Line Code
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
1
import { Router } from "express";
Open commit View diff
1 import { Router } from "express";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
2
import { z } from "zod";
Open commit View diff
2 import { z } from "zod";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
3
import { requireEditor } from "../middleware/auth.js";
Open commit View diff
3 import { requireEditor } from "../middleware/auth.js";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
4
import {
Open commit View diff
4 import {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
5
  createOrUpdatePage,
Open commit View diff
5 createOrUpdatePage,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
6
  getPageBySlug,
Open commit View diff
6 getPageBySlug,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
7
  listPageRevisions,
Open commit View diff
7 listPageRevisions,
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
8
  listDraftPages,
Open commit View diff
8 listDraftPages,
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
9
  listPagesForSpace,
Open commit View diff
9 listPagesForSpace,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
10
  rollbackPageRevision
Open commit View diff
10 rollbackPageRevision
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
11
} from "../../services/pages.js";
Open commit View diff
11 } from "../../services/pages.js";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
12
import { enqueueWebhookEvent } from "../../services/webhooks.js";
Open commit View diff
12 import { enqueueWebhookEvent } from "../../services/webhooks.js";
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
13
import { logAudit } from "../../services/audit.js";
Open commit View diff
13 import { logAudit } from "../../services/audit.js";
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
14
import { pool } from "../../db/pool.js";
Open commit View diff
14 import { pool } from "../../db/pool.js";
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
15
Open commit View diff
15
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
16
const pageSchema = z
Open commit View diff
16 const pageSchema = z
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
17
  .object({
Open commit View diff
17 .object({
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
18
    spaceId: z.string().uuid(),
Open commit View diff
18 spaceId: z.string().uuid(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
19
    title: z.string().min(3),
Open commit View diff
19 title: z.string().min(3),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
20
    slug: z.string().optional(),
Open commit View diff
20 slug: z.string().optional(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
21
    bodyMarkdown: z.string().min(1),
Open commit View diff
21 bodyMarkdown: z.string().min(1),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
22
    excerpt: z.string().max(240).optional(),
Open commit View diff
22 excerpt: z.string().max(240).optional(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
23
    visibility: z.enum(["public", "internal", "restricted"]),
Open commit View diff
23 visibility: z.enum(["public", "internal", "restricted"]),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
24
    state: z.enum(["draft", "published"]),
Open commit View diff
24 state: z.enum(["draft", "published"]),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
25
    parentPageId: z.string().uuid().nullable().optional(),
Open commit View diff
25 parentPageId: z.string().uuid().nullable().optional(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
26
    tagNames: z.array(z.string()).optional(),
Open commit View diff
26 tagNames: z.array(z.string()).optional(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
27
    allowedRoleKeys: z.array(z.enum(["owner", "admin", "editor", "viewer", "public"])).optional(),
Open commit View diff
27 allowedRoleKeys: z.array(z.enum(["owner", "admin", "editor", "viewer", "public"])).optional(),
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
28
    allowedGroupIds: z.array(z.string().uuid()).optional()
Open commit View diff
28 allowedGroupIds: z.array(z.string().uuid()).optional()
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
29
  })
Open commit View diff
29 })
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
30
  .superRefine((input, context) => {
Open commit View diff
30 .superRefine((input, context) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
31
    const permissionsCount =
Open commit View diff
31 const permissionsCount =
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
32
      (input.allowedRoleKeys?.length ?? 0) + (input.allowedGroupIds?.length ?? 0);
Open commit View diff
32 (input.allowedRoleKeys?.length ?? 0) + (input.allowedGroupIds?.length ?? 0);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
33
Open commit View diff
33
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
34
    if (input.visibility === "restricted" && permissionsCount === 0) {
Open commit View diff
34 if (input.visibility === "restricted" && permissionsCount === 0) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
35
      context.addIssue({
Open commit View diff
35 context.addIssue({
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
36
        code: z.ZodIssueCode.custom,
Open commit View diff
36 code: z.ZodIssueCode.custom,
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
37
        message: "Restricted pages require at least one role or group permission",
Open commit View diff
37 message: "Restricted pages require at least one role or group permission",
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
38
        path: ["allowedRoleKeys"]
Open commit View diff
38 path: ["allowedRoleKeys"]
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
39
      });
Open commit View diff
39 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
40
    }
Open commit View diff
40 }
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
41
  });
Open commit View diff
41 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
42
Open commit View diff
42
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
43
export const pagesRouter = Router();
Open commit View diff
43 export const pagesRouter = Router();
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
44
Open commit View diff
44
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
45
pagesRouter.get("/space/:spaceKey", async (req, res) => {
Open commit View diff
45 pagesRouter.get("/space/:spaceKey", async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
46
  const pages = await listPagesForSpace(req.params.spaceKey, req.user ?? null);
Open commit View diff
46 const pages = await listPagesForSpace(req.params.spaceKey, req.user ?? null);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
47
  return res.json({ pages });
Open commit View diff
47 return res.json({ pages });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
48
});
Open commit View diff
48 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
49
Open commit View diff
49
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
50
pagesRouter.get("/drafts", requireEditor, async (req, res) => {
Open commit View diff
50 pagesRouter.get("/drafts", requireEditor, async (req, res) => {
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
51
  const pages = await listDraftPages(req.user ?? null);
Open commit View diff
51 const pages = await listDraftPages(req.user ?? null);
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
52
  return res.json({ pages });
Open commit View diff
52 return res.json({ pages });
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
53
});
Open commit View diff
53 });
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
54
Open commit View diff
54
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
55
pagesRouter.get("/slug/:slug", async (req, res) => {
Open commit View diff
55 pagesRouter.get("/slug/:slug", async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
56
  const page = await getPageBySlug(req.params.slug, req.user ?? null);
Open commit View diff
56 const page = await getPageBySlug(req.params.slug, req.user ?? null);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
57
  if (!page) {
Open commit View diff
57 if (!page) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
58
    return res.status(404).json({ error: "Page not found" });
Open commit View diff
58 return res.status(404).json({ error: "Page not found" });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
59
  }
Open commit View diff
59 }
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
60
  return res.json({ page });
Open commit View diff
60 return res.json({ page });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
61
});
Open commit View diff
61 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
62
Open commit View diff
62
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
63
pagesRouter.post("/", requireEditor, async (req, res) => {
Open commit View diff
63 pagesRouter.post("/", requireEditor, async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
64
  const input = pageSchema.parse(req.body);
Open commit View diff
64 const input = pageSchema.parse(req.body);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
65
  const result = await createOrUpdatePage(null, input, req.user!.id);
Open commit View diff
65 const result = await createOrUpdatePage(null, input, req.user!.id);
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
66
  const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [input.spaceId]);
Open commit View diff
66 const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [input.spaceId]);
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
67
  const actor = {
Open commit View diff
67 const actor = {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
68
    id: req.user!.id,
Open commit View diff
68 id: req.user!.id,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
69
    name: req.user!.displayName,
Open commit View diff
69 name: req.user!.displayName,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
70
    email: req.user!.email
Open commit View diff
70 email: req.user!.email
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
71
  };
Open commit View diff
71 };
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
72
  await logAudit(req.user!.id, "page.create", "page", result.pageId, { slug: result.slug });
Open commit View diff
72 await logAudit(req.user!.id, "page.create", "page", result.pageId, { slug: result.slug });
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
73
  await enqueueWebhookEvent("page.created", { pageId: result.pageId, slug: result.slug }, {
Open commit View diff
73 await enqueueWebhookEvent("page.created", { pageId: result.pageId, slug: result.slug }, {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
74
    actor,
Open commit View diff
74 actor,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
75
    workspaceId: workspace.rows[0]?.key ?? null
Open commit View diff
75 workspaceId: workspace.rows[0]?.key ?? null
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
76
  });
Open commit View diff
76 });
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
77
  if (input.state === "published") {
Open commit View diff
77 if (input.state === "published") {
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
78
    await enqueueWebhookEvent("page.published", { pageId: result.pageId, slug: result.slug }, {
Open commit View diff
78 await enqueueWebhookEvent("page.published", { pageId: result.pageId, slug: result.slug }, {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
79
      actor,
Open commit View diff
79 actor,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
80
      workspaceId: workspace.rows[0]?.key ?? null
Open commit View diff
80 workspaceId: workspace.rows[0]?.key ?? null
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
81
    });
Open commit View diff
81 });
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
82
  }
Open commit View diff
82 }
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
83
  return res.status(201).json(result);
Open commit View diff
83 return res.status(201).json(result);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
84
});
Open commit View diff
84 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
85
Open commit View diff
85
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
86
pagesRouter.put("/:pageId", requireEditor, async (req, res) => {
Open commit View diff
86 pagesRouter.put("/:pageId", requireEditor, async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
87
  const input = pageSchema.parse(req.body);
Open commit View diff
87 const input = pageSchema.parse(req.body);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
88
  const result = await createOrUpdatePage(req.params.pageId, input, req.user!.id);
Open commit View diff
88 const result = await createOrUpdatePage(req.params.pageId, input, req.user!.id);
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
89
  const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [input.spaceId]);
Open commit View diff
89 const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [input.spaceId]);
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
90
  await logAudit(req.user!.id, "page.update", "page", req.params.pageId, { slug: result.slug });
Open commit View diff
90 await logAudit(req.user!.id, "page.update", "page", req.params.pageId, { slug: result.slug });
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
91
  await enqueueWebhookEvent("page.updated", { pageId: req.params.pageId, slug: result.slug }, {
Open commit View diff
91 await enqueueWebhookEvent("page.updated", { pageId: req.params.pageId, slug: result.slug }, {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
92
    actor: {
Open commit View diff
92 actor: {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
93
      id: req.user!.id,
Open commit View diff
93 id: req.user!.id,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
94
      name: req.user!.displayName,
Open commit View diff
94 name: req.user!.displayName,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
95
      email: req.user!.email
Open commit View diff
95 email: req.user!.email
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
96
    },
Open commit View diff
96 },
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
97
    workspaceId: workspace.rows[0]?.key ?? null
Open commit View diff
97 workspaceId: workspace.rows[0]?.key ?? null
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
98
  });
Open commit View diff
98 });
Alex Nord 3 months ago 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
99
  return res.json(result);
Open commit View diff
99 return res.json(result);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
100
});
Open commit View diff
100 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
101
Open commit View diff
101
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
102
pagesRouter.get("/:pageId/revisions", async (req, res) => {
Open commit View diff
102 pagesRouter.get("/:pageId/revisions", async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
103
  const revisions = await listPageRevisions(req.params.pageId, req.user ?? null);
Open commit View diff
103 const revisions = await listPageRevisions(req.params.pageId, req.user ?? null);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
104
  if (!revisions) {
Open commit View diff
104 if (!revisions) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
105
    return res.status(404).json({ error: "Page not found" });
Open commit View diff
105 return res.status(404).json({ error: "Page not found" });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
106
  }
Open commit View diff
106 }
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
107
  return res.json({ revisions });
Open commit View diff
107 return res.json({ revisions });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
108
});
Open commit View diff
108 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
109
Open commit View diff
109
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
110
pagesRouter.post("/:pageId/revisions/:revisionId/rollback", requireEditor, async (req, res) => {
Open commit View diff
110 pagesRouter.post("/:pageId/revisions/:revisionId/rollback", requireEditor, async (req, res) => {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
111
  const result = await rollbackPageRevision(req.params.pageId, req.params.revisionId, req.user!.id);
Open commit View diff
111 const result = await rollbackPageRevision(req.params.pageId, req.params.revisionId, req.user!.id);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
112
  if (!result) {
Open commit View diff
112 if (!result) {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
113
    return res.status(404).json({ error: "Revision not found" });
Open commit View diff
113 return res.status(404).json({ error: "Revision not found" });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
114
  }
Open commit View diff
114 }
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
115
  await logAudit(req.user!.id, "page.rollback", "page", req.params.pageId, {
Open commit View diff
115 await logAudit(req.user!.id, "page.rollback", "page", req.params.pageId, {
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
116
    revisionId: req.params.revisionId
Open commit View diff
116 revisionId: req.params.revisionId
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
117
  });
Open commit View diff
117 });
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
118
  return res.json(result);
Open commit View diff
118 return res.json(result);
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
119
});
Open commit View diff
119 });
Alex Nord 3 months ago 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
120
Open commit View diff
120
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
121
pagesRouter.delete("/:pageId", requireEditor, async (req, res) => {
Open commit View diff
121 pagesRouter.delete("/:pageId", requireEditor, async (req, res) => {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
122
  const existing = await pool.query(`SELECT slug, space_id FROM pages WHERE id = $1`, [req.params.pageId]);
Open commit View diff
122 const existing = await pool.query(`SELECT slug, space_id FROM pages WHERE id = $1`, [req.params.pageId]);
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
123
  if (!existing.rowCount) {
Open commit View diff
123 if (!existing.rowCount) {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
124
    return res.status(404).json({ error: "Page not found" });
Open commit View diff
124 return res.status(404).json({ error: "Page not found" });
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
125
  }
Open commit View diff
125 }
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
126
Open commit View diff
126
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
127
  await pool.query(`DELETE FROM pages WHERE id = $1`, [req.params.pageId]);
Open commit View diff
127 await pool.query(`DELETE FROM pages WHERE id = $1`, [req.params.pageId]);
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
128
  const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [existing.rows[0].space_id]);
Open commit View diff
128 const workspace = await pool.query(`SELECT key FROM spaces WHERE id = $1`, [existing.rows[0].space_id]);
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
129
  await enqueueWebhookEvent("page.deleted", { pageId: req.params.pageId, slug: existing.rows[0].slug }, {
Open commit View diff
129 await enqueueWebhookEvent("page.deleted", { pageId: req.params.pageId, slug: existing.rows[0].slug }, {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
130
    actor: {
Open commit View diff
130 actor: {
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
131
      id: req.user!.id,
Open commit View diff
131 id: req.user!.id,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
132
      name: req.user!.displayName,
Open commit View diff
132 name: req.user!.displayName,
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
133
      email: req.user!.email
Open commit View diff
133 email: req.user!.email
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
134
    },
Open commit View diff
134 },
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
135
    workspaceId: workspace.rows[0]?.key ?? null
Open commit View diff
135 workspaceId: workspace.rows[0]?.key ?? null
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
136
  });
Open commit View diff
136 });
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
137
  await logAudit(req.user!.id, "page.delete", "page", req.params.pageId);
Open commit View diff
137 await logAudit(req.user!.id, "page.delete", "page", req.params.pageId);
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
138
  return res.status(204).send();
Open commit View diff
138 return res.status(204).send();
same change 5600eb6

Build enterprise imports webhooks and AI admin workflows

Full commit hash
5600eb6c876ab31ee652ee6abe12884b31088496
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
139
});
Open commit View diff
139 });