Currently there are 3 web calls to get a repo's star count if all you have is {handle}/{repo_name} on a Bobbin.
- Get the user's did from their handle
- Make a call to
org.tangled.repo.getRepoByNameto get the repo's subject - Make a call to
org.tangled.feed.countStarsto get the star count, same fororg.tangled.repo.countForks
As a user(npmx.dev) whose wanting to add an easier way to get tangled counts,
it would be nice if it was 1-2 calls. Like org.tangled.feed.countStars?identity={handle/did}&name={repo name} and get the subject. Same for owner on org.tangled.repo.getRepoByName, would be nice to be an identity?
This would make it easier to make these calls as simple as possible for consumers. I know on the backend it will still need to do the 3 web calls, but giving the cosumer a nicer API to call would be nice. Happy to do any of the work here to update these schemas! Or if there's another approach wanted.
We can make
org.tangled.repo.getRepoByNameto accept at-identifier formatownerso it can be 2 calls, sounds reasonable and it's also what bsky APIs provide.I'd probably avoid using owner+name pair for repo identity but I get the need. hmm we want to keep DID-based queries but having two slightly different xrpcs for all repo-related queries sounds bit too much...
Maybe we can just make
repoinput asat-uritype and allow either:bit too verbose, but fits into one at-uri format. not sure tbh