tangled
alpha
login
or
join now
malpercio.dev
/
atbb
5
fork
atom
WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node
typescript
hono
htmx
atproto
5
fork
atom
overview
issues
pulls
pipelines
docs(bruno): add board management API collection (ATB-45)
malpercio.dev
1 week ago
f34289d1
2e5a0fd0
+153
3 changed files
expand all
collapse all
unified
split
bruno
AppView API
Admin
Create Board.bru
Delete Board.bru
Update Board.bru
+52
bruno/AppView API/Admin/Create Board.bru
···
1
1
+
meta {
2
2
+
name: Create Board
3
3
+
type: http
4
4
+
seq: 13
5
5
+
}
6
6
+
7
7
+
post {
8
8
+
url: {{appview_url}}/api/admin/boards
9
9
+
}
10
10
+
11
11
+
body:json {
12
12
+
{
13
13
+
"name": "General Chat",
14
14
+
"description": "Talk about anything.",
15
15
+
"sortOrder": 1,
16
16
+
"categoryUri": "{{category_uri}}"
17
17
+
}
18
18
+
}
19
19
+
20
20
+
assert {
21
21
+
res.status: eq 201
22
22
+
res.body.uri: isDefined
23
23
+
res.body.cid: isDefined
24
24
+
}
25
25
+
26
26
+
docs {
27
27
+
Create a new forum board within a category. Fetches the category's CID from DB
28
28
+
to build the categoryRef strongRef. Writes space.atbb.forum.board to the Forum
29
29
+
DID's PDS. The firehose indexer creates the DB row asynchronously.
30
30
+
31
31
+
**Requires:** space.atbb.permission.manageCategories
32
32
+
33
33
+
Body:
34
34
+
- name (required): Board display name
35
35
+
- categoryUri (required): AT URI of the parent category
36
36
+
- description (optional): Short description
37
37
+
- sortOrder (optional): Numeric sort position (lower = first)
38
38
+
39
39
+
Returns (201):
40
40
+
{
41
41
+
"uri": "at://did:plc:.../space.atbb.forum.board/abc123",
42
42
+
"cid": "bafyrei..."
43
43
+
}
44
44
+
45
45
+
Error codes:
46
46
+
- 400: Missing or empty name, missing categoryUri, malformed JSON
47
47
+
- 401: Not authenticated
48
48
+
- 403: Missing manageCategories permission
49
49
+
- 404: categoryUri references unknown category
50
50
+
- 500: ForumAgent not configured
51
51
+
- 503: PDS network error
52
52
+
}
+43
bruno/AppView API/Admin/Delete Board.bru
···
1
1
+
meta {
2
2
+
name: Delete Board
3
3
+
type: http
4
4
+
seq: 15
5
5
+
}
6
6
+
7
7
+
delete {
8
8
+
url: {{appview_url}}/api/admin/boards/:id
9
9
+
}
10
10
+
11
11
+
params:path {
12
12
+
id: {{board_id}}
13
13
+
}
14
14
+
15
15
+
assert {
16
16
+
res.status: eq 200
17
17
+
res.body.success: isTrue
18
18
+
}
19
19
+
20
20
+
docs {
21
21
+
Delete a forum board. Pre-flight check refuses with 409 if any posts reference
22
22
+
this board. If clear, calls deleteRecord on the Forum DID's PDS.
23
23
+
The firehose indexer removes the DB row asynchronously.
24
24
+
25
25
+
**Requires:** space.atbb.permission.manageCategories
26
26
+
27
27
+
Path params:
28
28
+
- id: Board database ID (bigint as string)
29
29
+
30
30
+
Returns (200):
31
31
+
{
32
32
+
"success": true
33
33
+
}
34
34
+
35
35
+
Error codes:
36
36
+
- 400: Invalid ID format
37
37
+
- 401: Not authenticated
38
38
+
- 403: Missing manageCategories permission
39
39
+
- 404: Board not found
40
40
+
- 409: Board has posts — remove them first
41
41
+
- 500: ForumAgent not configured
42
42
+
- 503: PDS network error
43
43
+
}
+58
bruno/AppView API/Admin/Update Board.bru
···
1
1
+
meta {
2
2
+
name: Update Board
3
3
+
type: http
4
4
+
seq: 14
5
5
+
}
6
6
+
7
7
+
put {
8
8
+
url: {{appview_url}}/api/admin/boards/:id
9
9
+
}
10
10
+
11
11
+
params:path {
12
12
+
id: {{board_id}}
13
13
+
}
14
14
+
15
15
+
body:json {
16
16
+
{
17
17
+
"name": "General Chat (renamed)",
18
18
+
"description": "Updated description.",
19
19
+
"sortOrder": 2
20
20
+
}
21
21
+
}
22
22
+
23
23
+
assert {
24
24
+
res.status: eq 200
25
25
+
res.body.uri: isDefined
26
26
+
res.body.cid: isDefined
27
27
+
}
28
28
+
29
29
+
docs {
30
30
+
Update an existing forum board's name, description, and sortOrder.
31
31
+
Fetches existing rkey and categoryRef from DB, calls putRecord with updated
32
32
+
fields preserving the original category and createdAt. Category cannot be
33
33
+
changed on edit (no reparenting).
34
34
+
35
35
+
**Requires:** space.atbb.permission.manageCategories
36
36
+
37
37
+
Path params:
38
38
+
- id: Board database ID (bigint as string)
39
39
+
40
40
+
Body:
41
41
+
- name (required): New display name
42
42
+
- description (optional): New description (falls back to existing if omitted)
43
43
+
- sortOrder (optional): New sort position (falls back to existing if omitted)
44
44
+
45
45
+
Returns (200):
46
46
+
{
47
47
+
"uri": "at://did:plc:.../space.atbb.forum.board/abc123",
48
48
+
"cid": "bafyrei..."
49
49
+
}
50
50
+
51
51
+
Error codes:
52
52
+
- 400: Missing name, empty name, invalid ID format, malformed JSON
53
53
+
- 401: Not authenticated
54
54
+
- 403: Missing manageCategories permission
55
55
+
- 404: Board not found
56
56
+
- 500: ForumAgent not configured
57
57
+
- 503: PDS network error
58
58
+
}