A zero-dependency AT Protocol Personal Data Server written in JavaScript

add xyz.fake.inbox.getState endpoint

returns accepted and blocked DID lists for inbox state visibility

๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+21
+21
src/pds.js
··· 1661 method: 'POST', 1662 handler: (pds, req, _url) => pds.handleInboxReject(req), 1663 }, 1664 }; 1665 1666 // โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— ··· 3447 } 3448 3449 /** 3450 * Verify session auth from Authorization header 3451 * @param {Request} request 3452 * @returns {Promise<{did: string} | null>} ··· 3924 '/xrpc/xyz.fake.inbox.listRequests', 3925 '/xrpc/xyz.fake.inbox.accept', 3926 '/xrpc/xyz.fake.inbox.reject', 3927 ]; 3928 if (inboxAuthEndpoints.includes(url.pathname)) { 3929 const auth = await requireAuth(request, env);
··· 1661 method: 'POST', 1662 handler: (pds, req, _url) => pds.handleInboxReject(req), 1663 }, 1664 + '/xrpc/xyz.fake.inbox.getState': { 1665 + handler: (pds, _req, _url) => pds.handleInboxGetState(), 1666 + }, 1667 }; 1668 1669 // โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— ··· 3450 } 3451 3452 /** 3453 + * Get inbox state (accepted and blocked lists) 3454 + */ 3455 + handleInboxGetState() { 3456 + const accepted = this.sql 3457 + .exec('SELECT did FROM inbox_accepted') 3458 + .toArray() 3459 + .map((r) => r.did); 3460 + 3461 + const blocked = this.sql 3462 + .exec('SELECT did FROM inbox_blocked') 3463 + .toArray() 3464 + .map((r) => r.did); 3465 + 3466 + return Response.json({ accepted, blocked }); 3467 + } 3468 + 3469 + /** 3470 * Verify session auth from Authorization header 3471 * @param {Request} request 3472 * @returns {Promise<{did: string} | null>} ··· 3944 '/xrpc/xyz.fake.inbox.listRequests', 3945 '/xrpc/xyz.fake.inbox.accept', 3946 '/xrpc/xyz.fake.inbox.reject', 3947 + '/xrpc/xyz.fake.inbox.getState', 3948 ]; 3949 if (inboxAuthEndpoints.includes(url.pathname)) { 3950 const auth = await requireAuth(request, env);