[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: remove @atproto/api

+44 -55
+14 -7
data-plane/indexing/index.ts
··· 1 - import { AtpAgent, ComAtprotoSyncGetLatestCommit } from "@atproto/api"; 2 1 import { DAY, HOUR } from "@atp/common"; 3 2 import { getPds, IdResolver } from "@atp/identity"; 4 - import { Cid, l } from "@atp/lex"; 3 + import { Cid, type DidString, l } from "@atp/lex"; 5 4 import { parseCid } from "@atp/lex/data"; 5 + import { Client, XRPCError } from "@atp/xrpc"; 6 6 7 7 import { 8 8 getAndParseRecord, ··· 14 14 } from "@atp/repo"; 15 15 import { AtUri } from "@atp/syntax"; 16 16 import { retryXrpc } from "../../utils/retry.ts"; 17 + import * as com from "../../lex/com.ts"; 17 18 import { BackgroundQueue } from "../background.ts"; 18 19 import { Database } from "../db/index.ts"; 19 20 import { ActorDocument } from "../db/models.ts"; ··· 179 180 did, 180 181 true, 181 182 ); 182 - const agent = new AtpAgent({ service: pds }); 183 + const client = new Client(pds); 183 184 184 185 const { data: car } = await retryXrpc(() => 185 - agent.com.atproto.sync.getRepo({ did }) 186 + client.call(com.atproto.sync.getRepo, { 187 + params: { did: did as DidString }, 188 + }) 186 189 ); 187 190 const { root, blocks } = await readCarWithRoot(car); 188 191 const verifiedRepo = await verifyRepo(blocks, root, did, signingKey); ··· 292 295 const doc = await this.idResolver.did.resolve(did, true); 293 296 const pds = doc && getPds(doc); 294 297 if (!pds) return false; 295 - const agent = new AtpAgent({ service: pds }); 298 + const client = new Client(pds); 296 299 try { 297 - await retryXrpc(() => agent.com.atproto.sync.getLatestCommit({ did })); 300 + await retryXrpc(() => 301 + client.call(com.atproto.sync.getLatestCommit, { 302 + params: { did: did as DidString }, 303 + }) 304 + ); 298 305 return true; 299 306 } catch (err) { 300 - if (err instanceof ComAtprotoSyncGetLatestCommit.RepoNotFoundError) { 307 + if (err instanceof XRPCError && err.error === "RepoNotFound") { 301 308 return false; 302 309 } 303 310 return null;
+2 -3
deno.json
··· 27 27 "@atp/xrpc-server": "jsr:@atp/xrpc-server@^0.1.0-alpha.11", 28 28 "@std/assert": "jsr:@std/assert@^1.0.19", 29 29 "dotenv": "npm:dotenv@^17.4.2", 30 - "hono": "jsr:@hono/hono@^4.12.14", 30 + "hono": "jsr:@hono/hono@^4.12.15", 31 31 "@std/encoding": "jsr:@std/encoding@^1.0.10", 32 - "@atproto/api": "npm:@atproto/api@^0.18.21", 33 32 "jose": "npm:jose@^6.2.2", 34 33 "mongoose": "npm:mongoose@^9.5.0", 35 - "p-queue": "npm:p-queue@^9.1.2", 34 + "p-queue": "npm:p-queue@^9.2.0", 36 35 "mongodb-memory-server-core": "npm:mongodb-memory-server-core@^11.0.1", 37 36 "structured-headers": "npm:structured-headers@^2.0.2" 38 37 },
+28 -45
deno.lock
··· 27 27 "jsr:@cliffy/internal@1.0.1": "1.0.1", 28 28 "jsr:@cliffy/table@1.0.1": "1.0.1", 29 29 "jsr:@david/code-block-writer@13": "13.0.3", 30 - "jsr:@hono/hono@^4.10.8": "4.12.14", 31 - "jsr:@hono/hono@^4.12.14": "4.12.14", 30 + "jsr:@hono/hono@^4.10.8": "4.12.15", 31 + "jsr:@hono/hono@^4.12.15": "4.12.15", 32 32 "jsr:@logtape/file@^1.2.2": "1.3.7", 33 33 "jsr:@logtape/logtape@^1.2.2": "1.3.7", 34 34 "jsr:@logtape/logtape@^1.3.7": "1.3.7", ··· 47 47 "jsr:@ts-morph/common@0.27": "0.27.0", 48 48 "jsr:@ts-morph/ts-morph@26": "26.0.0", 49 49 "jsr:@zod/zod@^4.1.13": "4.3.6", 50 - "npm:@atproto/api@~0.18.21": "0.18.21", 51 50 "npm:@atproto/sync@*": "0.1.39", 52 51 "npm:@bufbuild/protobuf@1.5.0": "1.5.0", 53 52 "npm:@dprint/formatter@~0.5.1": "0.5.1", ··· 62 61 "npm:mongoose@^9.5.0": "9.5.0", 63 62 "npm:multiformats@^13.4.1": "13.4.2", 64 63 "npm:p-queue@^8.1.1": "8.1.1", 65 - "npm:p-queue@^9.1.2": "9.1.2", 64 + "npm:p-queue@^9.2.0": "9.2.0", 66 65 "npm:rate-limiter-flexible@9": "9.1.1", 67 66 "npm:structured-headers@^2.0.2": "2.0.2" 68 67 }, ··· 156 155 "jsr:@atp/syntax", 157 156 "jsr:@atp/xrpc-server@~0.1.0-alpha.9", 158 157 "npm:@opentelemetry/api", 159 - "npm:multiformats", 160 158 "npm:p-queue@^8.1.1" 161 159 ] 162 160 }, ··· 218 216 "@hono/hono@4.9.8": { 219 217 "integrity": "908150f13e90181a051a3af3bf15203aff00190682afedfd38824d0cb9299a95" 220 218 }, 221 - "@hono/hono@4.12.14": { 222 - "integrity": "4eedba4b53f27c8e0db683d515e11ec3b88b8fdc1748e229cd7988d243ca018d" 219 + "@hono/hono@4.12.15": { 220 + "integrity": "06a0aef73d9072e73b8db570b81a5b56a94095d697578202a87fccdf04ce352d" 223 221 }, 224 222 "@logtape/file@1.3.7": { 225 223 "integrity": "8cacd752ac49671135e80abc8cf4a843c377ab80906d075ece0e9105fc24677e", ··· 298 296 } 299 297 }, 300 298 "npm": { 301 - "@atproto/api@0.18.21": { 302 - "integrity": "sha512-s35MIJerGT/pKe2xJtKKswqlIr/ola2r2iURBKBL0Mk1OKe6jP4YvTMh1N2d2PEANFzNNTbKoDaLfJPo2Uvc/w==", 299 + "@atproto/common-web@0.4.21": { 300 + "integrity": "sha512-Odq+wdk3YNasGCjjlpl3bCIPvqYHige5DLfMkIffNv/2PI/iIj5ZvAvMvJlJ59OhReKSxtpI0invx5UQPc3+fw==", 303 301 "dependencies": [ 304 - "@atproto/common-web", 305 - "@atproto/lexicon", 306 - "@atproto/syntax", 307 - "@atproto/xrpc", 308 - "await-lock", 309 - "multiformats@9.9.0", 310 - "tlds", 311 - "zod" 312 - ] 313 - }, 314 - "@atproto/common-web@0.4.16": { 315 - "integrity": "sha512-Ufvaff5JgxUyUyTAG0/3o7ltpy3lnZ1DvLjyAnvAf+hHfiK7OMQg+8byr+orN+KP9MtIQaRTsCgYPX+PxMKUoA==", 316 - "dependencies": [ 317 - "@atproto/lex-data@0.0.11", 302 + "@atproto/lex-data@0.0.15", 318 303 "@atproto/lex-json", 319 - "@atproto/syntax", 304 + "@atproto/syntax@0.5.4", 320 305 "zod" 321 306 ] 322 307 }, ··· 362 347 "unicode-segmenter" 363 348 ] 364 349 }, 365 - "@atproto/lex-data@0.0.11": { 366 - "integrity": "sha512-4+KTtHdqwlhiTKA7D4SACea4jprsNpCQsNALW09wsZ6IHhCDGO5tr1cmV+QnLYe3G3mu1E1yXHXbPUHrUUDT/A==", 350 + "@atproto/lex-data@0.0.15": { 351 + "integrity": "sha512-ZsbGiaM5S3CnGrcTMbDGON3bLZzCi/Mx9UvcMREKSRujnF68eHgMiXxJqvykP7+QpOX6tYCK93axZkuJVhtSEw==", 367 352 "dependencies": [ 368 353 "multiformats@9.9.0", 369 354 "tslib", ··· 371 356 "unicode-segmenter" 372 357 ] 373 358 }, 374 - "@atproto/lex-json@0.0.11": { 375 - "integrity": "sha512-2IExAoQ4KsR5fyPa1JjIvtR316PvdgRH/l3BVGLBd3cSxM3m5MftIv1B6qZ9HjNiK60SgkWp0mi9574bTNDhBQ==", 359 + "@atproto/lex-json@0.0.16": { 360 + "integrity": "sha512-IgLgQ0krshVlrIYZ+heTBDbCnM3LmAgWvsaYn5MxvKA3LcBot3PG3ptdO8VOweVZ+WgCLuo39cz9EbUmIbqdtg==", 376 361 "dependencies": [ 377 - "@atproto/lex-data@0.0.11", 362 + "@atproto/lex-data@0.0.15", 378 363 "tslib" 379 364 ] 380 365 }, 381 - "@atproto/lexicon@0.6.1": { 382 - "integrity": "sha512-/vI1kVlY50Si+5MXpvOucelnYwb0UJ6Qto5mCp+7Q5C+Jtp+SoSykAPVvjVtTnQUH2vrKOFOwpb3C375vSKzXw==", 366 + "@atproto/lexicon@0.6.2": { 367 + "integrity": "sha512-p3Ly6hinVZW0ETuAXZMeUGwuMm3g8HvQMQ41yyEE6AL0hAkfeKFaZKos6BdBrr6CjkpbrDZqE8M+5+QOceysMw==", 383 368 "dependencies": [ 384 369 "@atproto/common-web", 385 - "@atproto/syntax", 370 + "@atproto/syntax@0.5.4", 386 371 "iso-datestring-validator", 387 372 "multiformats@9.9.0", 388 373 "zod" ··· 409 394 "@atproto/identity", 410 395 "@atproto/lexicon", 411 396 "@atproto/repo", 412 - "@atproto/syntax", 397 + "@atproto/syntax@0.4.3", 413 398 "@atproto/xrpc-server", 414 399 "multiformats@9.9.0", 415 400 "p-queue@6.6.2", ··· 422 407 "tslib" 423 408 ] 424 409 }, 410 + "@atproto/syntax@0.5.4": { 411 + "integrity": "sha512-9XJOpMAgsGFxMEIp8nJ8AIWv+krrY1xQMj+wULbbXhQztQV+9aZ0TbG9Jtn3Op2or8Kr6OqyWR4ga9Z189kKDw==", 412 + "dependencies": [ 413 + "tslib" 414 + ] 415 + }, 425 416 "@atproto/ws-client@0.0.4": { 426 417 "integrity": "sha512-dox1XIymuC7/ZRhUqKezIGgooZS45C6vHCfu0PnWjfvsLCK2kAlnvX4IBkA/WpcoijDhQ9ejChnFbo/sLmgvAg==", 427 418 "dependencies": [ ··· 531 522 }, 532 523 "atomic-sleep@1.0.0": { 533 524 "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==" 534 - }, 535 - "await-lock@2.2.2": { 536 - "integrity": "sha512-aDczADvlvTGajTDjcjpJMqRkOF6Qdz3YbPZm/PyW6tKPkx2hlYBzxMhEywM/tU72HrVZjgl5VCdRuMlA7pZ8Gw==" 537 525 }, 538 526 "b4a@1.7.3": { 539 527 "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==" ··· 1005 993 "p-timeout@6.1.4" 1006 994 ] 1007 995 }, 1008 - "p-queue@9.1.2": { 1009 - "integrity": "sha512-ktsDOALzTYTWWF1PbkNVg2rOt+HaOaMWJMUnt7T3qf5tvZ1L8dBW3tObzprBcXNMKkwj+yFSLqHso0x+UFcJXw==", 996 + "p-queue@9.2.0": { 997 + "integrity": "sha512-dWgLE8AH0HjQ9fe74pUkKkvzzYT18Inp4zra3lKHnnwqGvcfcUBrvF2EAVX+envufDNBOzpPq/IBUONDbI7+3g==", 1010 998 "dependencies": [ 1011 999 "eventemitter3@5.0.4", 1012 1000 "p-timeout@7.0.1" ··· 1269 1257 "real-require" 1270 1258 ] 1271 1259 }, 1272 - "tlds@1.261.0": { 1273 - "integrity": "sha512-QXqwfEl9ddlGBaRFXIvNKK6OhipSiLXuRuLJX5DErz0o0Q0rYxulWLdFryTkV5PkdZct5iMInwYEGe/eR++1AA==", 1274 - "bin": true 1275 - }, 1276 1260 "toidentifier@1.0.1": { 1277 1261 "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" 1278 1262 }, ··· 1350 1334 "jsr:@atp/syntax@~0.1.0-alpha.2", 1351 1335 "jsr:@atp/xrpc-server@~0.1.0-alpha.11", 1352 1336 "jsr:@atp/xrpc@~0.1.0-alpha.6", 1353 - "jsr:@hono/hono@^4.12.14", 1337 + "jsr:@hono/hono@^4.12.15", 1354 1338 "jsr:@std/assert@^1.0.19", 1355 1339 "jsr:@std/encoding@^1.0.10", 1356 - "npm:@atproto/api@~0.18.21", 1357 1340 "npm:dotenv@^17.4.2", 1358 1341 "npm:jose@^6.2.2", 1359 1342 "npm:mongodb-memory-server-core@^11.0.1", 1360 1343 "npm:mongoose@^9.5.0", 1361 - "npm:p-queue@^9.1.2", 1344 + "npm:p-queue@^9.2.0", 1362 1345 "npm:structured-headers@^2.0.2" 1363 1346 ] 1364 1347 }