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
at feat/atb-60-theme-import-export 59 lines 1.9 kB view raw
1meta { 2 name: Update Theme Policy 3 type: http 4 seq: 4 5} 6 7put { 8 url: {{appview_url}}/api/admin/theme-policy 9} 10 11body:json { 12 { 13 "availableThemes": [ 14 { "uri": "at://did:plc:example/space.atbb.forum.theme/3lbllight1" }, 15 { "uri": "at://did:plc:example/space.atbb.forum.theme/3lbldark11" } 16 ], 17 "defaultLightThemeUri": "at://did:plc:example/space.atbb.forum.theme/3lbllight1", 18 "defaultDarkThemeUri": "at://did:plc:example/space.atbb.forum.theme/3lbldark11", 19 "allowUserChoice": true 20 } 21} 22 23assert { 24 res.status: eq 200 25 res.body.uri: isDefined 26 res.body.cid: isDefined 27} 28 29docs { 30 Create or update the themePolicy singleton on the Forum DID's PDS. 31 Uses upsert semantics: works whether or not a policy record exists yet. 32 33 **Requires:** space.atbb.permission.manageThemes 34 35 Body: 36 - availableThemes (required): Non-empty array of { uri, cid? } theme references. 37 cid is optional — if omitted, this is a live ref that always resolves to the current 38 version of the theme record. Canonical atbb.space presets use live refs by default. 39 Both defaultLightThemeUri and defaultDarkThemeUri must be present in this list. 40 - defaultLightThemeUri (required): AT-URI of the default light-mode theme. 41 Must be in availableThemes. 42 - defaultDarkThemeUri (required): AT-URI of the default dark-mode theme. 43 Must be in availableThemes. 44 - allowUserChoice (optional, default true): Whether users can pick their own theme. 45 46 Returns (200): 47 { 48 "uri": "at://did:plc:.../space.atbb.forum.themePolicy/self", 49 "cid": "bafyrei..." 50 } 51 52 Error codes: 53 - 400: Missing/empty availableThemes, missing defaultLightThemeUri/defaultDarkThemeUri, 54 default URI not in availableThemes list, malformed JSON 55 - 401: Not authenticated 56 - 403: Missing manageThemes permission 57 - 500: ForumAgent not configured (server configuration issue) 58 - 503: ForumAgent not authenticated or PDS network error 59}