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/webhooks.ts

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

webhooks.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 { requireAdmin } from "../middleware/auth.js";
Open commit View diff
3 import { requireAdmin } 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 { pool } from "../../db/pool.js";
Open commit View diff
4 import { pool } from "../../db/pool.js";
same change 4527dbd

First commit v2

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
6
import { enqueueWebhookEvent } from "../../services/webhooks.js";
Open commit View diff
6 import { enqueueWebhookEvent } from "../../services/webhooks.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
7
Open commit View diff
7
same change 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
11
  signingSecret: z.string().min(8),
Open commit View diff
11 signingSecret: z.string().min(8),
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
12
  events: z.array(z.enum([
Open commit View diff
12 events: z.array(z.enum([
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
13
    "page.created",
Open commit View diff
13 "page.created",
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
14
    "page.updated",
Open commit View diff
14 "page.updated",
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
15
    "page.deleted",
Open commit View diff
15 "page.deleted",
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
16
    "page.published",
Open commit View diff
16 "page.published",
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
17
    "feedback.created",
Open commit View diff
17 "feedback.created",
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
18
    "user.invited",
Open commit View diff
18 "user.invited",
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
19
    "search.no_results"
Open commit View diff
19 "search.no_results"
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
20
  ])).min(1),
Open commit View diff
20 ])).min(1),
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
21
  isActive: z.boolean().default(true)
Open commit View diff
21 isActive: z.boolean().default(true)
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
24
const webhookUpdateSchema = webhookSchema.extend({
Open commit View diff
24 const webhookUpdateSchema = webhookSchema.extend({
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
25
  signingSecret: z.string().optional()
Open commit View diff
25 signingSecret: z.string().optional()
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
30
Open commit View diff
30
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
31
function toWebhookResponse(row: Record<string, unknown>) {
Open commit View diff
31 function toWebhookResponse(row: Record<string, unknown>) {
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
32
  return {
Open commit View diff
32 return {
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
33
    id: row.id,
Open commit View diff
33 id: row.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
34
    name: row.name,
Open commit View diff
34 name: row.name,
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
35
    targetUrl: row.target_url,
Open commit View diff
35 targetUrl: row.target_url,
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
36
    isActive: row.is_active,
Open commit View diff
36 isActive: row.is_active,
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
37
    events: row.events,
Open commit View diff
37 events: row.events,
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
38
    createdAt: row.created_at
Open commit View diff
38 createdAt: row.created_at
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
39
  };
Open commit View diff
39 };
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
40
}
Open commit View diff
40 }
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
41
Open commit View diff
41
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
43
  const result = await pool.query(`SELECT * FROM webhooks ORDER BY created_at DESC`);
Open commit View diff
43 const result = await pool.query(`SELECT * FROM webhooks ORDER BY created_at DESC`);
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
44
  return res.json({ webhooks: result.rows.map((row) => toWebhookResponse(row)) });
Open commit View diff
44 return res.json({ webhooks: result.rows.map((row) => toWebhookResponse(row)) });
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
49
  const created = await pool.query(
Open commit View diff
49 const created = await pool.query(
same change 4527dbd

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
50
    `
Open commit View diff
50 `
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
51
      INSERT INTO webhooks (name, target_url, signing_secret, events, is_active)
Open commit View diff
51 INSERT INTO webhooks (name, target_url, signing_secret, events, is_active)
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
52
      VALUES ($1, $2, $3, $4, $5)
Open commit View diff
52 VALUES ($1, $2, $3, $4, $5)
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
54
    `,
Open commit View diff
54 `,
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
55
    [input.name, input.targetUrl, input.signingSecret, JSON.stringify(input.events), input.isActive]
Open commit View diff
55 [input.name, input.targetUrl, input.signingSecret, JSON.stringify(input.events), input.isActive]
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
58
  await logAudit(req.user!.id, "webhook.create", "webhook", created.rows[0].id, {
Open commit View diff
58 await logAudit(req.user!.id, "webhook.create", "webhook", created.rows[0].id, {
same change 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
60
  });
Open commit View diff
60 });
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
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
62
  return res.status(201).json(toWebhookResponse(created.rows[0]));
Open commit View diff
62 return res.status(201).json(toWebhookResponse(created.rows[0]));
Alex Nord 3 months ago 4527dbd

First commit v2

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

First commit v2

Full commit hash
4527dbdfcb1470a5c2476e2a5208f7bf48cc9d27
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
64
Open commit View diff
64
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
65
webhooksRouter.put("/:webhookId", async (req, res) => {
Open commit View diff
65 webhooksRouter.put("/:webhookId", async (req, res) => {
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
66
  const input = webhookUpdateSchema.parse(req.body);
Open commit View diff
66 const input = webhookUpdateSchema.parse(req.body);
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
67
  const existing = await pool.query(`SELECT signing_secret FROM webhooks WHERE id = $1`, [req.params.webhookId]);
Open commit View diff
67 const existing = await pool.query(`SELECT signing_secret FROM webhooks WHERE id = $1`, [req.params.webhookId]);
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
72
  const signingSecret = input.signingSecret?.trim() ? input.signingSecret : existing.rows[0].signing_secret;
Open commit View diff
72 const signingSecret = input.signingSecret?.trim() ? input.signingSecret : existing.rows[0].signing_secret;
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
  const updated = await pool.query(
Open commit View diff
73 const updated = await pool.query(
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
    `
Open commit View diff
74 `
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
      UPDATE webhooks
Open commit View diff
75 UPDATE webhooks
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
      SET name = $2, target_url = $3, signing_secret = $4, events = $5, is_active = $6
Open commit View diff
76 SET name = $2, target_url = $3, signing_secret = $4, events = $5, is_active = $6
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
77
      WHERE id = $1
Open commit View diff
77 WHERE id = $1
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
78
      RETURNING *
Open commit View diff
78 RETURNING *
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
    `,
Open commit View diff
79 `,
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
    [
Open commit View diff
80 [
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
      req.params.webhookId,
Open commit View diff
81 req.params.webhookId,
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
82
      input.name,
Open commit View diff
82 input.name,
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
83
      input.targetUrl,
Open commit View diff
83 input.targetUrl,
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
84
      signingSecret,
Open commit View diff
84 signingSecret,
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
85
      JSON.stringify(input.events),
Open commit View diff
85 JSON.stringify(input.events),
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
86
      input.isActive
Open commit View diff
86 input.isActive
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
87
    ]
Open commit View diff
87 ]
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
88
  );
Open commit View diff
88 );
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
89
Open commit View diff
89
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
90
  await logAudit(req.user!.id, "webhook.update", "webhook", req.params.webhookId, {
Open commit View diff
90 await logAudit(req.user!.id, "webhook.update", "webhook", req.params.webhookId, {
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
91
    events: input.events
Open commit View diff
91 events: input.events
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
  });
Open commit View diff
92 });
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
Open commit View diff
93
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
  return res.json(toWebhookResponse(updated.rows[0]));
Open commit View diff
94 return res.json(toWebhookResponse(updated.rows[0]));
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
});
Open commit View diff
95 });
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
webhooksRouter.get("/:webhookId/deliveries", async (req, res) => {
Open commit View diff
97 webhooksRouter.get("/:webhookId/deliveries", 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
98
  const deliveries = await pool.query(
Open commit View diff
98 const deliveries = await pool.query(
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
99
    `
Open commit View diff
99 `
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
100
      SELECT id, event_name, response_status, success, delivered_at, created_at, error_message, attempt_count
Open commit View diff
100 SELECT id, event_name, response_status, success, delivered_at, created_at, error_message, attempt_count
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
101
      FROM webhook_deliveries
Open commit View diff
101 FROM webhook_deliveries
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
102
      WHERE webhook_id = $1
Open commit View diff
102 WHERE webhook_id = $1
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
103
      ORDER BY created_at DESC
Open commit View diff
103 ORDER BY created_at DESC
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
104
      LIMIT 50
Open commit View diff
104 LIMIT 50
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
105
    `,
Open commit View diff
105 `,
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
106
    [req.params.webhookId]
Open commit View diff
106 [req.params.webhookId]
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
107
  );
Open commit View diff
107 );
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
108
Open commit View diff
108
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
109
  return res.json({ deliveries: deliveries.rows });
Open commit View diff
109 return res.json({ deliveries: deliveries.rows });
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
110
});
Open commit View diff
110 });
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
111
Open commit View diff
111
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
112
webhooksRouter.delete("/:webhookId", async (req, res) => {
Open commit View diff
112 webhooksRouter.delete("/:webhookId", 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
113
  const deleted = await pool.query(`DELETE FROM webhooks WHERE id = $1 RETURNING id`, [req.params.webhookId]);
Open commit View diff
113 const deleted = await pool.query(`DELETE FROM webhooks WHERE id = $1 RETURNING id`, [req.params.webhookId]);
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
114
  if (!deleted.rowCount) {
Open commit View diff
114 if (!deleted.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
115
    return res.status(404).json({ error: "Webhook not found" });
Open commit View diff
115 return res.status(404).json({ error: "Webhook 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
116
  }
Open commit View diff
116 }
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
117
Open commit View diff
117
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
118
  await logAudit(req.user!.id, "webhook.delete", "webhook", req.params.webhookId);
Open commit View diff
118 await logAudit(req.user!.id, "webhook.delete", "webhook", req.params.webhookId);
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
119
  return res.status(204).send();
Open commit View diff
119 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
120
});
Open commit View diff
120 });
Alex Nord 3 months ago ea3e37e

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
122
webhooksRouter.post("/:webhookId/test", async (req, res) => {
Open commit View diff
122 webhooksRouter.post("/:webhookId/test", async (req, res) => {
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
123
  const webhook = await pool.query(`SELECT id FROM webhooks WHERE id = $1`, [req.params.webhookId]);
Open commit View diff
123 const webhook = await pool.query(`SELECT id FROM webhooks WHERE id = $1`, [req.params.webhookId]);
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
124
  if (!webhook.rowCount) {
Open commit View diff
124 if (!webhook.rowCount) {
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
128
  await enqueueWebhookEvent(
Open commit View diff
128 await enqueueWebhookEvent(
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
129
    "page.updated",
Open commit View diff
129 "page.updated",
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
131
      pageId: "test-page",
Open commit View diff
131 pageId: "test-page",
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
132
      slug: "webhook-test",
Open commit View diff
132 slug: "webhook-test",
same change ea3e37e

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
133
      test: true
Open commit View diff
133 test: true
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
136
      actor: {
Open commit View diff
136 actor: {
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

Full commit hash
ea3e37e37b76a90a5a290f47538dfb1ceac8c446
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
141
      workspaceId: "test-workspace"
Open commit View diff
141 workspaceId: "test-workspace"
same change ea3e37e

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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

Continuing UI fixes

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