Rename to tranquil PDS, sounds better than bullshit PDS

This commit is contained in:
lewis
2025-12-18 23:17:51 +02:00
parent 95958bb119
commit 80a3e04ec6
62 changed files with 744 additions and 590 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BSPDS</title>
<title>Tranquil PDS</title>
<style>
html { background: #fafafa; }
@media (prefers-color-scheme: dark) { html { background: #1a1a1a; } }
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "bspds-frontend",
"name": "tranquil-pds-frontend",
"private": true,
"version": "0.0.0",
"type": "module",
+8 -8
View File
@@ -255,7 +255,7 @@ export const api = {
signalNumber: string | null
signalVerified: boolean
}> {
return xrpc('com.bspds.account.getNotificationPrefs', { token })
return xrpc('com.tranquil.account.getNotificationPrefs', { token })
},
async updateNotificationPrefs(token: string, prefs: {
@@ -264,7 +264,7 @@ export const api = {
telegramUsername?: string
signalNumber?: string
}): Promise<{ success: boolean }> {
return xrpc('com.bspds.account.updateNotificationPrefs', {
return xrpc('com.tranquil.account.updateNotificationPrefs', {
method: 'POST',
token,
body: prefs,
@@ -272,7 +272,7 @@ export const api = {
},
async confirmChannelVerification(token: string, channel: string, code: string): Promise<{ success: boolean }> {
return xrpc('com.bspds.account.confirmChannelVerification', {
return xrpc('com.tranquil.account.confirmChannelVerification', {
method: 'POST',
token,
body: { channel, code },
@@ -289,7 +289,7 @@ export const api = {
body: string
}>
}> {
return xrpc('com.bspds.account.getNotificationHistory', { token })
return xrpc('com.tranquil.account.getNotificationHistory', { token })
},
async getServerStats(token: string): Promise<{
@@ -298,11 +298,11 @@ export const api = {
recordCount: number
blobStorageBytes: number
}> {
return xrpc('com.bspds.admin.getServerStats', { token })
return xrpc('com.tranquil.admin.getServerStats', { token })
},
async changePassword(token: string, currentPassword: string, newPassword: string): Promise<void> {
await xrpc('com.bspds.account.changePassword', {
await xrpc('com.tranquil.account.changePassword', {
method: 'POST',
token,
body: { currentPassword, newPassword },
@@ -317,11 +317,11 @@ export const api = {
isCurrent: boolean
}>
}> {
return xrpc('com.bspds.account.listSessions', { token })
return xrpc('com.tranquil.account.listSessions', { token })
},
async revokeSession(token: string, sessionId: string): Promise<void> {
await xrpc('com.bspds.account.revokeSession', {
await xrpc('com.tranquil.account.revokeSession', {
method: 'POST',
token,
body: { sessionId },
+2 -2
View File
@@ -1,8 +1,8 @@
import { api, type Session, type CreateAccountParams, type CreateAccountResult, ApiError } from './api'
import { startOAuthLogin, handleOAuthCallback, checkForOAuthCallback, clearOAuthCallbackParams, refreshOAuthToken } from './oauth'
const STORAGE_KEY = 'bspds_session'
const ACCOUNTS_KEY = 'bspds_accounts'
const STORAGE_KEY = 'tranquil_pds_session'
const ACCOUNTS_KEY = 'tranquil_pds_accounts'
export interface SavedAccount {
did: string
+2 -2
View File
@@ -1,5 +1,5 @@
const OAUTH_STATE_KEY = 'bspds_oauth_state'
const OAUTH_VERIFIER_KEY = 'bspds_oauth_verifier'
const OAUTH_STATE_KEY = 'tranquil_pds_oauth_state'
const OAUTH_VERIFIER_KEY = 'tranquil_pds_oauth_verifier'
interface OAuthState {
state: string
+1 -1
View File
@@ -3,7 +3,7 @@
import { navigate } from '../lib/router.svelte'
import { api, ApiError, type VerificationChannel } from '../lib/api'
const STORAGE_KEY = 'bspds_pending_verification'
const STORAGE_KEY = 'tranquil_pds_pending_verification'
let handle = $state('')
let email = $state('')
+1 -1
View File
@@ -2,7 +2,7 @@
import { confirmSignup, resendVerification, getAuthState } from '../lib/auth.svelte'
import { navigate } from '../lib/router.svelte'
const STORAGE_KEY = 'bspds_pending_verification'
const STORAGE_KEY = 'tranquil_pds_pending_verification'
interface PendingVerification {
did: string
+3 -3
View File
@@ -10,7 +10,7 @@ import {
setupAuthenticatedUser,
setupUnauthenticatedUser,
} from './mocks'
const STORAGE_KEY = 'bspds_session'
const STORAGE_KEY = 'tranquil_pds_session'
describe('Dashboard', () => {
beforeEach(() => {
clearMocks()
@@ -38,8 +38,8 @@ describe('Dashboard', () => {
await waitFor(() => {
expect(screen.getByRole('heading', { name: /dashboard/i })).toBeInTheDocument()
expect(screen.getByRole('heading', { name: /account overview/i })).toBeInTheDocument()
expect(screen.getByText(/@testuser\.test\.bspds\.dev/)).toBeInTheDocument()
expect(screen.getByText(/did:web:test\.bspds\.dev:u:testuser/)).toBeInTheDocument()
expect(screen.getByText(/@testuser\.test\.tranquil\.dev/)).toBeInTheDocument()
expect(screen.getByText(/did:web:test\.tranquil\.dev:u:testuser/)).toBeInTheDocument()
expect(screen.getByText('test@example.com')).toBeInTheDocument()
expect(screen.getByText('Verified')).toBeInTheDocument()
expect(screen.getByText('Verified')).toHaveClass('badge', 'success')
+2 -2
View File
@@ -95,7 +95,7 @@ describe('Login', () => {
json: async () => ({
error: 'AccountNotVerified',
message: 'Account not verified',
did: 'did:web:test.bspds.dev:u:testuser',
did: 'did:web:test.tranquil.dev:u:testuser',
}),
}))
render(Login)
@@ -116,7 +116,7 @@ describe('Login', () => {
json: async () => ({
error: 'AccountNotVerified',
message: 'Account not verified',
did: 'did:web:test.bspds.dev:u:testuser',
did: 'did:web:test.tranquil.dev:u:testuser',
}),
}))
render(Login)
+27 -27
View File
@@ -28,7 +28,7 @@ describe('Notifications', () => {
describe('page structure', () => {
beforeEach(() => {
setupAuthenticatedUser()
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
})
@@ -48,7 +48,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('shows loading text while fetching preferences', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', async () => {
mockEndpoint('com.tranquil.account.getNotificationPrefs', async () => {
await new Promise(resolve => setTimeout(resolve, 100))
return jsonResponse(mockData.notificationPrefs())
})
@@ -61,7 +61,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('displays all four channel options', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -73,7 +73,7 @@ describe('Notifications', () => {
})
})
it('email channel is always selectable', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -83,7 +83,7 @@ describe('Notifications', () => {
})
})
it('discord channel is disabled when not configured', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({ discordId: null }))
)
render(Notifications)
@@ -93,7 +93,7 @@ describe('Notifications', () => {
})
})
it('discord channel is enabled when configured', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({ discordId: '123456789' }))
)
render(Notifications)
@@ -103,7 +103,7 @@ describe('Notifications', () => {
})
})
it('shows hint for disabled channels', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -112,7 +112,7 @@ describe('Notifications', () => {
})
})
it('selects current preferred channel', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({ preferredChannel: 'email' }))
)
render(Notifications)
@@ -127,7 +127,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('displays email as readonly with current value', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -138,7 +138,7 @@ describe('Notifications', () => {
})
})
it('displays all channel inputs with current values', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({
discordId: '123456789',
telegramUsername: 'testuser',
@@ -158,7 +158,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('shows Primary badge for email', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -167,7 +167,7 @@ describe('Notifications', () => {
})
})
it('shows Verified badge for verified discord', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({
discordId: '123456789',
discordVerified: true,
@@ -180,7 +180,7 @@ describe('Notifications', () => {
})
})
it('shows Not verified badge for unverified discord', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({
discordId: '123456789',
discordVerified: false,
@@ -192,7 +192,7 @@ describe('Notifications', () => {
})
})
it('does not show badge when channel not configured', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -208,10 +208,10 @@ describe('Notifications', () => {
})
it('calls updateNotificationPrefs with correct data', async () => {
let capturedBody: Record<string, unknown> | null = null
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
mockEndpoint('com.bspds.account.updateNotificationPrefs', (_url, options) => {
mockEndpoint('com.tranquil.account.updateNotificationPrefs', (_url, options) => {
capturedBody = JSON.parse((options?.body as string) || '{}')
return jsonResponse({ success: true })
})
@@ -228,10 +228,10 @@ describe('Notifications', () => {
})
})
it('shows loading state while saving', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
mockEndpoint('com.bspds.account.updateNotificationPrefs', async () => {
mockEndpoint('com.tranquil.account.updateNotificationPrefs', async () => {
await new Promise(resolve => setTimeout(resolve, 100))
return jsonResponse({ success: true })
})
@@ -244,10 +244,10 @@ describe('Notifications', () => {
expect(screen.getByRole('button', { name: /saving/i })).toBeDisabled()
})
it('shows success message after saving', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
mockEndpoint('com.bspds.account.updateNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.updateNotificationPrefs', () =>
jsonResponse({ success: true })
)
render(Notifications)
@@ -260,10 +260,10 @@ describe('Notifications', () => {
})
})
it('shows error when save fails', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
mockEndpoint('com.bspds.account.updateNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.updateNotificationPrefs', () =>
errorResponse('InvalidRequest', 'Invalid channel configuration', 400)
)
render(Notifications)
@@ -278,11 +278,11 @@ describe('Notifications', () => {
})
it('reloads preferences after successful save', async () => {
let loadCount = 0
mockEndpoint('com.bspds.account.getNotificationPrefs', () => {
mockEndpoint('com.tranquil.account.getNotificationPrefs', () => {
loadCount++
return jsonResponse(mockData.notificationPrefs())
})
mockEndpoint('com.bspds.account.updateNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.updateNotificationPrefs', () =>
jsonResponse({ success: true })
)
render(Notifications)
@@ -301,7 +301,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('enables discord channel after entering discord ID', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
render(Notifications)
@@ -314,7 +314,7 @@ describe('Notifications', () => {
})
})
it('allows selecting a configured channel', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs({
discordId: '123456789',
discordVerified: true,
@@ -334,7 +334,7 @@ describe('Notifications', () => {
setupAuthenticatedUser()
})
it('shows error when loading preferences fails', async () => {
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
errorResponse('InternalError', 'Database connection failed', 500)
)
render(Notifications)
+2 -2
View File
@@ -176,7 +176,7 @@ describe('Settings', () => {
it('displays current handle', async () => {
render(Settings)
await waitFor(() => {
expect(screen.getByText(/current: @testuser\.test\.bspds\.dev/i)).toBeInTheDocument()
expect(screen.getByText(/current: @testuser\.test\.tranquil\.dev/i)).toBeInTheDocument()
})
})
it('calls updateHandle with new handle', async () => {
@@ -314,7 +314,7 @@ describe('Settings', () => {
await waitFor(() => {
expect(capturedBody?.token).toBe('DEL123')
expect(capturedBody?.password).toBe('mypassword')
expect(capturedBody?.did).toBe('did:web:test.bspds.dev:u:testuser')
expect(capturedBody?.did).toBe('did:web:test.tranquil.dev:u:testuser')
})
})
it('navigates to login after successful deletion', async () => {
+8 -8
View File
@@ -85,8 +85,8 @@ export function errorResponse(error: string, message: string, status = 400): Moc
}
export const mockData = {
session: (overrides?: Partial<Session>): Session => ({
did: 'did:web:test.bspds.dev:u:testuser',
handle: 'testuser.test.bspds.dev',
did: 'did:web:test.tranquil.dev:u:testuser',
handle: 'testuser.test.tranquil.dev',
email: 'test@example.com',
emailConfirmed: true,
accessJwt: 'mock-access-jwt-token',
@@ -102,8 +102,8 @@ export const mockData = {
code: 'test-invite-123',
available: 1,
disabled: false,
forAccount: 'did:web:test.bspds.dev:u:testuser',
createdBy: 'did:web:test.bspds.dev:u:testuser',
forAccount: 'did:web:test.tranquil.dev:u:testuser',
createdBy: 'did:web:test.tranquil.dev:u:testuser',
createdAt: new Date().toISOString(),
uses: [],
...overrides,
@@ -120,7 +120,7 @@ export const mockData = {
...overrides,
}),
describeServer: () => ({
availableUserDomains: ['test.bspds.dev'],
availableUserDomains: ['test.tranquil.dev'],
inviteCodeRequired: false,
links: {
privacyPolicy: 'https://example.com/privacy',
@@ -128,7 +128,7 @@ export const mockData = {
},
}),
describeRepo: (did: string) => ({
handle: 'testuser.test.bspds.dev',
handle: 'testuser.test.tranquil.dev',
did,
didDoc: {},
collections: ['app.bsky.feed.post', 'app.bsky.feed.like', 'app.bsky.graph.follow'],
@@ -173,10 +173,10 @@ export function setupDefaultMocks(): void {
mockEndpoint('com.atproto.server.createInviteCode', () =>
jsonResponse({ code: 'new-invite-' + Date.now() })
)
mockEndpoint('com.bspds.account.getNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.getNotificationPrefs', () =>
jsonResponse(mockData.notificationPrefs())
)
mockEndpoint('com.bspds.account.updateNotificationPrefs', () =>
mockEndpoint('com.tranquil.account.updateNotificationPrefs', () =>
jsonResponse({ success: true })
)
mockEndpoint('com.atproto.server.requestEmailUpdate', () =>