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 16 "@atproto/oauth-client-node": "^0.2.2", 17 17 "@atproto/sync": "^0.1.4", 18 18 "@atproto/syntax": "^0.3.0", 19 - "@atproto/xrpc-server": "^0.6.3", 19 + "@atproto/xrpc-server": "^0.7.9", 20 20 "better-sqlite3": "^11.1.2", 21 21 "dotenv": "^16.4.5", 22 22 "envalid": "^8.0.0", ··· 158 158 } 159 159 }, 160 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==", 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", 164 165 "dependencies": { 165 - "@atproto/common-web": "^0.3.1", 166 + "@atproto/common-web": "^0.3.2", 166 167 "@ipld/dag-cbor": "^7.0.3", 167 168 "cbor-x": "^1.5.1", 168 169 "iso-datestring-validator": "^2.2.2", ··· 171 172 } 172 173 }, 173 174 "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==", 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", 177 179 "dependencies": { 178 180 "graphemer": "^1.4.0", 179 181 "multiformats": "^9.9.0", ··· 229 231 } 230 232 }, 231 233 "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==", 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", 235 238 "dependencies": { 236 - "@noble/curves": "^1.1.0", 237 - "@noble/hashes": "^1.3.1", 239 + "@noble/curves": "^1.7.0", 240 + "@noble/hashes": "^1.6.1", 238 241 "uint8arrays": "3.0.0" 239 242 } 240 243 }, ··· 304 307 } 305 308 }, 306 309 "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 + "version": "0.4.5", 311 + "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.4.5.tgz", 312 + "integrity": "sha512-fljWqMGKn+XWtTprBcS3F1hGBREnQYh6qYHv2sjENucc7REms1gtmZXSerB9N6pVeHVNOnXiILdukeAcic5OEw==", 310 313 "license": "MIT", 311 314 "dependencies": { 312 - "@atproto/common-web": "^0.3.1", 315 + "@atproto/common-web": "^0.3.2", 313 316 "@atproto/syntax": "^0.3.1", 314 317 "iso-datestring-validator": "^2.2.2", 315 318 "multiformats": "^9.9.0", ··· 394 397 "p-queue": "^6.6.2" 395 398 } 396 399 }, 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 400 "node_modules/@atproto/syntax": { 417 401 "version": "0.3.1", 418 402 "resolved": "https://registry.npmjs.org/@atproto/syntax/-/syntax-0.3.1.tgz", ··· 430 414 } 431 415 }, 432 416 "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==", 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", 436 421 "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", 422 + "@atproto/common": "^0.4.7", 423 + "@atproto/crypto": "^0.4.3", 424 + "@atproto/lexicon": "^0.4.5", 425 + "@atproto/xrpc": "^0.6.7", 441 426 "cbor-x": "^1.5.1", 442 427 "express": "^4.17.2", 443 428 "http-errors": "^2.0.0", ··· 445 430 "rate-limiter-flexible": "^2.4.1", 446 431 "uint8arrays": "3.0.0", 447 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", 448 443 "zod": "^3.23.8" 449 444 } 450 445 }, ··· 1011 1006 } 1012 1007 }, 1013 1008 "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==", 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", 1017 1013 "dependencies": { 1018 - "@noble/hashes": "1.5.0" 1014 + "@noble/hashes": "1.7.1" 1019 1015 }, 1020 1016 "engines": { 1021 1017 "node": "^14.21.3 || >=16" ··· 1025 1021 } 1026 1022 }, 1027 1023 "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==", 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", 1031 1028 "engines": { 1032 1029 "node": "^14.21.3 || >=16" 1033 1030 },
+1 -1
package.json
··· 21 21 "@atproto/oauth-client-node": "^0.2.2", 22 22 "@atproto/sync": "^0.1.4", 23 23 "@atproto/syntax": "^0.3.0", 24 - "@atproto/xrpc-server": "^0.6.3", 24 + "@atproto/xrpc-server": "^0.7.9", 25 25 "better-sqlite3": "^11.1.2", 26 26 "dotenv": "^16.4.5", 27 27 "envalid": "^8.0.0",
+6 -3
src/routes.ts
··· 176 176 } 177 177 178 178 // Fetch additional information about the logged-in user 179 - const { data: profileRecord } = await agent.com.atproto.repo.getRecord({ 179 + const profileResponse = await agent.com.atproto.repo.getRecord({ 180 180 repo: agent.assertDid, 181 181 collection: 'app.bsky.actor.profile', 182 182 rkey: 'self', 183 - }) 184 - const profile = 183 + }).catch(() => undefined); 184 + 185 + const profileRecord = profileResponse?.data; 186 + 187 + const profile = profileRecord && 185 188 Profile.isRecord(profileRecord.value) && 186 189 Profile.validateRecord(profileRecord.value).success 187 190 ? profileRecord.value