Skip to content

Commit

Permalink
Add rev to sync.listRepos (#1709)
Browse files Browse the repository at this point in the history
add rev to listRepos
  • Loading branch information
dholms authored Oct 4, 2023
1 parent 27a8dee commit 8853bc1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lexicons/com/atproto/sync/listRepos.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
},
"repo": {
"type": "object",
"required": ["did", "head"],
"required": ["did", "head", "rev"],
"properties": {
"did": { "type": "string", "format": "did" },
"head": { "type": "string", "format": "cid" }
"head": { "type": "string", "format": "cid" },
"rev": { "type": "string" }
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,7 @@ export const schemaDict = {
},
repo: {
type: 'object',
required: ['did', 'head'],
required: ['did', 'head', 'rev'],
properties: {
did: {
type: 'string',
Expand All @@ -3386,6 +3386,9 @@ export const schemaDict = {
type: 'string',
format: 'cid',
},
rev: {
type: 'string',
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function toKnownErr(e: any) {
export interface Repo {
did: string
head: string
rev: string
[k: string]: unknown
}

Expand Down
5 changes: 4 additions & 1 deletion packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,7 @@ export const schemaDict = {
},
repo: {
type: 'object',
required: ['did', 'head'],
required: ['did', 'head', 'rev'],
properties: {
did: {
type: 'string',
Expand All @@ -3386,6 +3386,9 @@ export const schemaDict = {
type: 'string',
format: 'cid',
},
rev: {
type: 'string',
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type Handler<HA extends HandlerAuth = never> = (
export interface Repo {
did: string
head: string
rev: string
[k: string]: unknown
}

Expand Down
7 changes: 6 additions & 1 deletion packages/pds/src/api/com/atproto/sync/listRepos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function (server: Server, ctx: AppContext) {
.select([
'user_account.did as did',
'repo_root.root as head',
'repo_root.rev as rev',
'user_account.createdAt as createdAt',
])
const keyset = new TimeDidKeyset(
Expand All @@ -29,7 +30,11 @@ export default function (server: Server, ctx: AppContext) {
tryIndex: true,
})
const res = await builder.execute()
const repos = res.map((row) => ({ did: row.did, head: row.head }))
const repos = res.map((row) => ({
did: row.did,
head: row.head,
rev: row.rev ?? '',
}))
return {
encoding: 'application/json',
body: {
Expand Down
5 changes: 4 additions & 1 deletion packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,7 @@ export const schemaDict = {
},
repo: {
type: 'object',
required: ['did', 'head'],
required: ['did', 'head', 'rev'],
properties: {
did: {
type: 'string',
Expand All @@ -3386,6 +3386,9 @@ export const schemaDict = {
type: 'string',
format: 'cid',
},
rev: {
type: 'string',
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type Handler<HA extends HandlerAuth = never> = (
export interface Repo {
did: string
head: string
rev: string
[k: string]: unknown
}

Expand Down

0 comments on commit 8853bc1

Please sign in to comment.