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/services/setup.ts

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

setup.ts on main
Author Date Commit Line Code
Alex Nord 3 months ago 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
1
import { hashPassword, createSessionToken, getUserForSession } from "./auth.js";
Open commit View diff
1 import { hashPassword, createSessionToken, getUserForSession } from "./auth.js";
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
2
import { logAudit } from "./audit.js";
Open commit View diff
2 import { logAudit } from "./audit.js";
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
3
import { pool } from "../db/pool.js";
Open commit View diff
3 import { pool } from "../db/pool.js";
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
4
Open commit View diff
4
Alex Nord 3 months ago 7b9fd81

Continues UI Fixes

Full commit hash
7b9fd81fba50e4e63f3a981dc8ac583996c2482c
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
5
const FIXED_FOOTER = "Powered by Ledger made by ANord.cc";
Open commit View diff
5 const FIXED_FOOTER = "Powered by Ledger made by ANord.cc";
same change 7b9fd81

Continues UI Fixes

Full commit hash
7b9fd81fba50e4e63f3a981dc8ac583996c2482c
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
6
Open commit View diff
6
Alex Nord 3 months ago 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
7
interface SetupInput {
Open commit View diff
7 interface SetupInput {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
8
  siteName: string;
Open commit View diff
8 siteName: string;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
9
  brandColor: string;
Open commit View diff
9 brandColor: string;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
10
  publicKnowledgeBaseEnabled: boolean;
Open commit View diff
10 publicKnowledgeBaseEnabled: boolean;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
11
  ownerEmail: string;
Open commit View diff
11 ownerEmail: string;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
12
  ownerDisplayName: string;
Open commit View diff
12 ownerDisplayName: string;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
13
  password: string;
Open commit View diff
13 password: string;
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
14
}
Open commit View diff
14 }
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
16
export async function getSetupStatus() {
Open commit View diff
16 export async function getSetupStatus() {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
17
  const users = await pool.query(`SELECT COUNT(*)::int AS count FROM users`);
Open commit View diff
17 const users = await pool.query(`SELECT COUNT(*)::int AS count FROM users`);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
18
  const branding = await pool.query(`SELECT site_name, brand_color FROM branding_settings ORDER BY created_at ASC LIMIT 1`);
Open commit View diff
18 const branding = await pool.query(`SELECT site_name, brand_color FROM branding_settings ORDER BY created_at ASC LIMIT 1`);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
19
Open commit View diff
19
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
20
  return {
Open commit View diff
20 return {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
21
    isInitialized: users.rows[0].count > 0,
Open commit View diff
21 isInitialized: users.rows[0].count > 0,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
22
    branding: branding.rows[0] ?? null
Open commit View diff
22 branding: branding.rows[0] ?? null
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
23
  };
Open commit View diff
23 };
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
24
}
Open commit View diff
24 }
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
25
Open commit View diff
25
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
26
export async function initializeLedger(input: SetupInput) {
Open commit View diff
26 export async function initializeLedger(input: SetupInput) {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
27
  const existingUsers = await pool.query(`SELECT COUNT(*)::int AS count FROM users`);
Open commit View diff
27 const existingUsers = await pool.query(`SELECT COUNT(*)::int AS count FROM users`);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
28
  if (existingUsers.rows[0].count > 0) {
Open commit View diff
28 if (existingUsers.rows[0].count > 0) {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
29
    throw new Error("Ledger has already been initialized");
Open commit View diff
29 throw new Error("Ledger has already been initialized");
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
30
  }
Open commit View diff
30 }
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
31
Open commit View diff
31
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
32
  await pool.query("BEGIN");
Open commit View diff
32 await pool.query("BEGIN");
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
33
  try {
Open commit View diff
33 try {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
34
    const ownerRole = await pool.query(`SELECT id FROM roles WHERE key = 'owner'`);
Open commit View diff
34 const ownerRole = await pool.query(`SELECT id FROM roles WHERE key = 'owner'`);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
35
Open commit View diff
35
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
36
    const user = await pool.query(
Open commit View diff
36 const user = await pool.query(
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
37
      `
Open commit View diff
37 `
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
38
        INSERT INTO users (email, password_hash, display_name, primary_role_id)
Open commit View diff
38 INSERT INTO users (email, password_hash, display_name, primary_role_id)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
39
        VALUES ($1, $2, $3, $4)
Open commit View diff
39 VALUES ($1, $2, $3, $4)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
40
        RETURNING id
Open commit View diff
40 RETURNING id
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
41
      `,
Open commit View diff
41 `,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
42
      [input.ownerEmail, await hashPassword(input.password), input.ownerDisplayName, ownerRole.rows[0].id]
Open commit View diff
42 [input.ownerEmail, await hashPassword(input.password), input.ownerDisplayName, ownerRole.rows[0].id]
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
43
    );
Open commit View diff
43 );
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
45
    const ownerUserId = user.rows[0].id;
Open commit View diff
45 const ownerUserId = user.rows[0].id;
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
47
    const branding = await pool.query(
Open commit View diff
47 const branding = await pool.query(
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
48
      `
Open commit View diff
48 `
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
49
        UPDATE branding_settings
Open commit View diff
49 UPDATE branding_settings
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
50
        SET site_name = $1, brand_color = $2, footer_text = $3,
Open commit View diff
50 SET site_name = $1, brand_color = $2, footer_text = $3,
Alex Nord 3 months ago b71e6dd

Fixing loading issue when putting Ledger behind domain

Full commit hash
b71e6dd42f7e2cd7409b68365a17c561433e6687
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
51
            public_knowledge_base_enabled = $4, footer_links = '[]'::jsonb, updated_at = now()
Open commit View diff
51 public_knowledge_base_enabled = $4, footer_links = '[]'::jsonb, updated_at = now()
Alex Nord 3 months ago 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
52
        WHERE id = (SELECT id FROM branding_settings ORDER BY created_at ASC LIMIT 1)
Open commit View diff
52 WHERE id = (SELECT id FROM branding_settings ORDER BY created_at ASC LIMIT 1)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
53
        RETURNING id
Open commit View diff
53 RETURNING id
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
54
      `,
Open commit View diff
54 `,
Alex Nord 3 months ago 7b9fd81

Continues UI Fixes

Full commit hash
7b9fd81fba50e4e63f3a981dc8ac583996c2482c
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
55
      [input.siteName, input.brandColor, FIXED_FOOTER, input.publicKnowledgeBaseEnabled]
Open commit View diff
55 [input.siteName, input.brandColor, FIXED_FOOTER, input.publicKnowledgeBaseEnabled]
Alex Nord 3 months ago 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
58
    await pool.query(
Open commit View diff
58 await pool.query(
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
59
      `
Open commit View diff
59 `
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
60
        INSERT INTO spaces (name, key, description, visibility, created_by_user_id)
Open commit View diff
60 INSERT INTO spaces (name, key, description, visibility, created_by_user_id)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
61
        VALUES
Open commit View diff
61 VALUES
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
62
          ('Docs', 'docs', 'Public documentation for your organization', 'public', $1),
Open commit View diff
62 ('Docs', 'docs', 'Public documentation for your organization', 'public', $1),
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
63
          ('Team', 'team', 'Internal knowledge for your organization', 'internal', $1)
Open commit View diff
63 ('Team', 'team', 'Internal knowledge for your organization', 'internal', $1)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
64
        ON CONFLICT (key) DO NOTHING
Open commit View diff
64 ON CONFLICT (key) DO NOTHING
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
65
      `,
Open commit View diff
65 `,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
66
      [ownerUserId]
Open commit View diff
66 [ownerUserId]
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
67
    );
Open commit View diff
67 );
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
68
Open commit View diff
68
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
69
    const docsSpace = await pool.query(`SELECT id FROM spaces WHERE key = 'docs'`);
Open commit View diff
69 const docsSpace = await pool.query(`SELECT id FROM spaces WHERE key = 'docs'`);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
70
    const welcomePage = await pool.query(
Open commit View diff
70 const welcomePage = await pool.query(
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
72
        INSERT INTO pages (space_id, title, slug, excerpt, visibility, state, is_public, owner_user_id)
Open commit View diff
72 INSERT INTO pages (space_id, title, slug, excerpt, visibility, state, is_public, owner_user_id)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
73
        VALUES ($1, 'Welcome to Ledger', 'welcome-to-ledger', 'Start customizing your new knowledge base.', 'public', 'published', true, $2)
Open commit View diff
73 VALUES ($1, 'Welcome to Ledger', 'welcome-to-ledger', 'Start customizing your new knowledge base.', 'public', 'published', true, $2)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
74
        RETURNING id
Open commit View diff
74 RETURNING id
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
75
      `,
Open commit View diff
75 `,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
76
      [docsSpace.rows[0].id, ownerUserId]
Open commit View diff
76 [docsSpace.rows[0].id, ownerUserId]
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
77
    );
Open commit View diff
77 );
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
78
Open commit View diff
78
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
79
    const welcomeRevision = await pool.query(
Open commit View diff
79 const welcomeRevision = await pool.query(
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
80
      `
Open commit View diff
80 `
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
81
        INSERT INTO page_revisions (page_id, title, slug, excerpt, visibility, state, body_markdown, edited_by_user_id)
Open commit View diff
81 INSERT INTO page_revisions (page_id, title, slug, excerpt, visibility, state, body_markdown, edited_by_user_id)
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
82
        VALUES (
Open commit View diff
82 VALUES (
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
83
          $1,
Open commit View diff
83 $1,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
84
          'Welcome to Ledger',
Open commit View diff
84 'Welcome to Ledger',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
85
          'welcome-to-ledger',
Open commit View diff
85 'welcome-to-ledger',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
86
          'Start customizing your new knowledge base.',
Open commit View diff
86 'Start customizing your new knowledge base.',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
87
          'public',
Open commit View diff
87 'public',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
88
          'published',
Open commit View diff
88 'published',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
89
          '# Welcome to Ledger\n\nYour knowledge base is ready.\n\n## Next steps\n\n- Customize branding\n- Invite your team\n- Publish your first public and internal pages',
Open commit View diff
89 '# Welcome to Ledger\n\nYour knowledge base is ready.\n\n## Next steps\n\n- Customize branding\n- Invite your team\n- Publish your first public and internal pages',
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
90
          $2
Open commit View diff
90 $2
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
91
        )
Open commit View diff
91 )
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
92
        RETURNING id
Open commit View diff
92 RETURNING id
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
93
      `,
Open commit View diff
93 `,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
94
      [welcomePage.rows[0].id, ownerUserId]
Open commit View diff
94 [welcomePage.rows[0].id, ownerUserId]
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
95
    );
Open commit View diff
95 );
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
96
Open commit View diff
96
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
97
    await pool.query(`UPDATE pages SET current_revision_id = $2 WHERE id = $1`, [
Open commit View diff
97 await pool.query(`UPDATE pages SET current_revision_id = $2 WHERE id = $1`, [
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
98
      welcomePage.rows[0].id,
Open commit View diff
98 welcomePage.rows[0].id,
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
99
      welcomeRevision.rows[0].id
Open commit View diff
99 welcomeRevision.rows[0].id
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
100
    ]);
Open commit View diff
100 ]);
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
102
    await pool.query("COMMIT");
Open commit View diff
102 await pool.query("COMMIT");
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
103
Open commit View diff
103
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
104
    const sessionUser = await getUserForSession(ownerUserId);
Open commit View diff
104 const sessionUser = await getUserForSession(ownerUserId);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
105
    const token = createSessionToken(sessionUser!);
Open commit View diff
105 const token = createSessionToken(sessionUser!);
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
106
    await logAudit(ownerUserId, "setup.initialize", "ledger", "instance", {
Open commit View diff
106 await logAudit(ownerUserId, "setup.initialize", "ledger", "instance", {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
107
      brandingSettingsId: branding.rows[0].id
Open commit View diff
107 brandingSettingsId: branding.rows[0].id
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
110
    return { token, user: sessionUser };
Open commit View diff
110 return { token, user: sessionUser };
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
111
  } catch (error) {
Open commit View diff
111 } catch (error) {
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
112
    await pool.query("ROLLBACK");
Open commit View diff
112 await pool.query("ROLLBACK");
same change 462c463

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
113
    throw error;
Open commit View diff
113 throw error;
same change 462c463

Add first-run setup and gate demo seed behind config

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

Add first-run setup and gate demo seed behind config

Full commit hash
462c463a79b4fe09e752f88c5c4eca69dac468fc
Author
Alex Nord <[email protected]>
Date
3 months ago
Selected line
115
}
Open commit View diff
115 }