the statusphere demo reworked into a vite/react app in a monorepo

Merge pull request #34 from barrysteyn/fix-firehose-and-personal-pds

fixed firehose lexicon problem and allow for personal PDS

authored by

Paul Frazee and committed by
GitHub
e4721616 eff56eec

+54 -54
+47 -50
package-lock.json
··· 16 "@atproto/oauth-client-node": "^0.2.2", 17 "@atproto/sync": "^0.1.4", 18 "@atproto/syntax": "^0.3.0", 19 - "@atproto/xrpc-server": "^0.6.3", 20 "better-sqlite3": "^11.1.2", 21 "dotenv": "^16.4.5", 22 "envalid": "^8.0.0", ··· 158 } 159 }, 160 "node_modules/@atproto/common": { 161 - "version": "0.4.4", 162 - "resolved": "https://registry.npmjs.org/@atproto/common/-/common-0.4.4.tgz", 163 - "integrity": "sha512-58tMbn6A1Zu296s/l3uIj8z9d7IRHpZvLOfsFRikaQaYrzhJpL2aPY4uFQ8GJcxnsxeUnxBCrQz9we5jVVJI5Q==", 164 "dependencies": { 165 - "@atproto/common-web": "^0.3.1", 166 "@ipld/dag-cbor": "^7.0.3", 167 "cbor-x": "^1.5.1", 168 "iso-datestring-validator": "^2.2.2", ··· 171 } 172 }, 173 "node_modules/@atproto/common-web": { 174 - "version": "0.3.1", 175 - "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.3.1.tgz", 176 - "integrity": "sha512-N7wiTnus5vAr+lT//0y8m/FaHHLJ9LpGuEwkwDAeV3LCiPif4m/FS8x/QOYrx1PdZQwKso95RAPzCGWQBH5j6Q==", 177 "dependencies": { 178 "graphemer": "^1.4.0", 179 "multiformats": "^9.9.0", ··· 229 } 230 }, 231 "node_modules/@atproto/crypto": { 232 - "version": "0.4.1", 233 - "resolved": "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.4.1.tgz", 234 - "integrity": "sha512-7pQNHWYyx8jGhYdPbmcuPD9W73nd/5v3mfBlncO0sBzxnPbmA6aXAWOz+fNVZwHwBJPeb/Gzf/FT/uDx7/eYFg==", 235 "dependencies": { 236 - "@noble/curves": "^1.1.0", 237 - "@noble/hashes": "^1.3.1", 238 "uint8arrays": "3.0.0" 239 } 240 }, ··· 304 } 305 }, 306 "node_modules/@atproto/lexicon": { 307 - "version": "0.4.3", 308 - "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.4.3.tgz", 309 - "integrity": "sha512-lFVZXe1S1pJP0dcxvJuHP3r/a+EAIBwwU7jUK+r8iLhIja+ml6NmYv8KeFHmIJATh03spEQ9s02duDmFVdCoXg==", 310 "license": "MIT", 311 "dependencies": { 312 - "@atproto/common-web": "^0.3.1", 313 "@atproto/syntax": "^0.3.1", 314 "iso-datestring-validator": "^2.2.2", 315 "multiformats": "^9.9.0", ··· 394 "p-queue": "^6.6.2" 395 } 396 }, 397 - "node_modules/@atproto/sync/node_modules/@atproto/xrpc-server": { 398 - "version": "0.7.1", 399 - "resolved": "https://registry.npmjs.org/@atproto/xrpc-server/-/xrpc-server-0.7.1.tgz", 400 - "integrity": "sha512-6S3PiKmbdT2TwEEWmnKdEJkgBJtQHYNlAVB4PSNum50R2Xw3c1SV4NK6zLsxPqNpV2WhAlYEJUSTPAOTV3QMbw==", 401 - "dependencies": { 402 - "@atproto/common": "^0.4.4", 403 - "@atproto/crypto": "^0.4.1", 404 - "@atproto/lexicon": "^0.4.2", 405 - "@atproto/xrpc": "^0.6.3", 406 - "cbor-x": "^1.5.1", 407 - "express": "^4.17.2", 408 - "http-errors": "^2.0.0", 409 - "mime-types": "^2.1.35", 410 - "rate-limiter-flexible": "^2.4.1", 411 - "uint8arrays": "3.0.0", 412 - "ws": "^8.12.0", 413 - "zod": "^3.23.8" 414 - } 415 - }, 416 "node_modules/@atproto/syntax": { 417 "version": "0.3.1", 418 "resolved": "https://registry.npmjs.org/@atproto/syntax/-/syntax-0.3.1.tgz", ··· 430 } 431 }, 432 "node_modules/@atproto/xrpc-server": { 433 - "version": "0.6.3", 434 - "resolved": "https://registry.npmjs.org/@atproto/xrpc-server/-/xrpc-server-0.6.3.tgz", 435 - "integrity": "sha512-0YXeBM9NjiIlR5eXWo8qzArRcBOKhwVimpH+ajKgZzlncPO53brVZ9+3BUnD5J1PG8mEQFRERi+Jt77QyF89qA==", 436 "dependencies": { 437 - "@atproto/common": "^0.4.1", 438 - "@atproto/crypto": "^0.4.1", 439 - "@atproto/lexicon": "^0.4.1", 440 - "@atproto/xrpc": "^0.6.1", 441 "cbor-x": "^1.5.1", 442 "express": "^4.17.2", 443 "http-errors": "^2.0.0", ··· 445 "rate-limiter-flexible": "^2.4.1", 446 "uint8arrays": "3.0.0", 447 "ws": "^8.12.0", 448 "zod": "^3.23.8" 449 } 450 }, ··· 1011 } 1012 }, 1013 "node_modules/@noble/curves": { 1014 - "version": "1.6.0", 1015 - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.6.0.tgz", 1016 - "integrity": "sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==", 1017 "dependencies": { 1018 - "@noble/hashes": "1.5.0" 1019 }, 1020 "engines": { 1021 "node": "^14.21.3 || >=16" ··· 1025 } 1026 }, 1027 "node_modules/@noble/hashes": { 1028 - "version": "1.5.0", 1029 - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", 1030 - "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", 1031 "engines": { 1032 "node": "^14.21.3 || >=16" 1033 },
··· 16 "@atproto/oauth-client-node": "^0.2.2", 17 "@atproto/sync": "^0.1.4", 18 "@atproto/syntax": "^0.3.0", 19 + "@atproto/xrpc-server": "^0.7.9", 20 "better-sqlite3": "^11.1.2", 21 "dotenv": "^16.4.5", 22 "envalid": "^8.0.0", ··· 158 } 159 }, 160 "node_modules/@atproto/common": { 161 + "version": "0.4.7", 162 + "resolved": "https://registry.npmjs.org/@atproto/common/-/common-0.4.7.tgz", 163 + "integrity": "sha512-C844ILV66sqHjQCJDb8tN/yZB2MBaLpZ1qptDT8zWRMx0uw7j/B6/EuN9R9a57Nj99Hhi93QkvQxOujURqpPeA==", 164 + "license": "MIT", 165 "dependencies": { 166 + "@atproto/common-web": "^0.3.2", 167 "@ipld/dag-cbor": "^7.0.3", 168 "cbor-x": "^1.5.1", 169 "iso-datestring-validator": "^2.2.2", ··· 172 } 173 }, 174 "node_modules/@atproto/common-web": { 175 + "version": "0.3.2", 176 + "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.3.2.tgz", 177 + "integrity": "sha512-Vx0JtL1/CssJbFAb0UOdvTrkbUautsDfHNOXNTcX2vyPIxH9xOameSqLLunM1hZnOQbJwyjmQCt6TV+bhnanDg==", 178 + "license": "MIT", 179 "dependencies": { 180 "graphemer": "^1.4.0", 181 "multiformats": "^9.9.0", ··· 231 } 232 }, 233 "node_modules/@atproto/crypto": { 234 + "version": "0.4.3", 235 + "resolved": "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.4.3.tgz", 236 + "integrity": "sha512-YSSUAvkx+ldpXw97NXZWfLx/prgh5YJ2K0BCw51JCJmXSRp6KhhwvOm4J+K/s5hwpssyuDCVTXknyS4PHwaK5g==", 237 + "license": "MIT", 238 "dependencies": { 239 + "@noble/curves": "^1.7.0", 240 + "@noble/hashes": "^1.6.1", 241 "uint8arrays": "3.0.0" 242 } 243 }, ··· 307 } 308 }, 309 "node_modules/@atproto/lexicon": { 310 + "version": "0.4.5", 311 + "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.4.5.tgz", 312 + "integrity": "sha512-fljWqMGKn+XWtTprBcS3F1hGBREnQYh6qYHv2sjENucc7REms1gtmZXSerB9N6pVeHVNOnXiILdukeAcic5OEw==", 313 "license": "MIT", 314 "dependencies": { 315 + "@atproto/common-web": "^0.3.2", 316 "@atproto/syntax": "^0.3.1", 317 "iso-datestring-validator": "^2.2.2", 318 "multiformats": "^9.9.0", ··· 397 "p-queue": "^6.6.2" 398 } 399 }, 400 "node_modules/@atproto/syntax": { 401 "version": "0.3.1", 402 "resolved": "https://registry.npmjs.org/@atproto/syntax/-/syntax-0.3.1.tgz", ··· 414 } 415 }, 416 "node_modules/@atproto/xrpc-server": { 417 + "version": "0.7.9", 418 + "resolved": "https://registry.npmjs.org/@atproto/xrpc-server/-/xrpc-server-0.7.9.tgz", 419 + "integrity": "sha512-x6CqV6KycIUyZs+J4V+wujc3R98QIkVRU4KmbUgAJ9AtJuTDnOOEbUFrNVVes45UfjJw4ztg021R0M2y0aI3fQ==", 420 + "license": "MIT", 421 "dependencies": { 422 + "@atproto/common": "^0.4.7", 423 + "@atproto/crypto": "^0.4.3", 424 + "@atproto/lexicon": "^0.4.5", 425 + "@atproto/xrpc": "^0.6.7", 426 "cbor-x": "^1.5.1", 427 "express": "^4.17.2", 428 "http-errors": "^2.0.0", ··· 430 "rate-limiter-flexible": "^2.4.1", 431 "uint8arrays": "3.0.0", 432 "ws": "^8.12.0", 433 + "zod": "^3.23.8" 434 + } 435 + }, 436 + "node_modules/@atproto/xrpc-server/node_modules/@atproto/xrpc": { 437 + "version": "0.6.7", 438 + "resolved": "https://registry.npmjs.org/@atproto/xrpc/-/xrpc-0.6.7.tgz", 439 + "integrity": "sha512-pbzZIONIskyGKxxG3s2wB7rQ2W1xu3ycfeYhKwk/E/ippeJFVxcof64iSC7f22+7JSKUJcxBeZ1piBB82vLj7g==", 440 + "license": "MIT", 441 + "dependencies": { 442 + "@atproto/lexicon": "^0.4.5", 443 "zod": "^3.23.8" 444 } 445 }, ··· 1006 } 1007 }, 1008 "node_modules/@noble/curves": { 1009 + "version": "1.8.1", 1010 + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", 1011 + "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", 1012 + "license": "MIT", 1013 "dependencies": { 1014 + "@noble/hashes": "1.7.1" 1015 }, 1016 "engines": { 1017 "node": "^14.21.3 || >=16" ··· 1021 } 1022 }, 1023 "node_modules/@noble/hashes": { 1024 + "version": "1.7.1", 1025 + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", 1026 + "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", 1027 + "license": "MIT", 1028 "engines": { 1029 "node": "^14.21.3 || >=16" 1030 },
+1 -1
package.json
··· 21 "@atproto/oauth-client-node": "^0.2.2", 22 "@atproto/sync": "^0.1.4", 23 "@atproto/syntax": "^0.3.0", 24 - "@atproto/xrpc-server": "^0.6.3", 25 "better-sqlite3": "^11.1.2", 26 "dotenv": "^16.4.5", 27 "envalid": "^8.0.0",
··· 21 "@atproto/oauth-client-node": "^0.2.2", 22 "@atproto/sync": "^0.1.4", 23 "@atproto/syntax": "^0.3.0", 24 + "@atproto/xrpc-server": "^0.7.9", 25 "better-sqlite3": "^11.1.2", 26 "dotenv": "^16.4.5", 27 "envalid": "^8.0.0",
+6 -3
src/routes.ts
··· 176 } 177 178 // Fetch additional information about the logged-in user 179 - const { data: profileRecord } = await agent.com.atproto.repo.getRecord({ 180 repo: agent.assertDid, 181 collection: 'app.bsky.actor.profile', 182 rkey: 'self', 183 - }) 184 - const profile = 185 Profile.isRecord(profileRecord.value) && 186 Profile.validateRecord(profileRecord.value).success 187 ? profileRecord.value
··· 176 } 177 178 // Fetch additional information about the logged-in user 179 + const profileResponse = await agent.com.atproto.repo.getRecord({ 180 repo: agent.assertDid, 181 collection: 'app.bsky.actor.profile', 182 rkey: 'self', 183 + }).catch(() => undefined); 184 + 185 + const profileRecord = profileResponse?.data; 186 + 187 + const profile = profileRecord && 188 Profile.isRecord(profileRecord.value) && 189 Profile.validateRecord(profileRecord.value).success 190 ? profileRecord.value