From 815ac43224757b0c6647849ead6041f6d5002e6c Mon Sep 17 00:00:00 2001 From: dholms Date: Wed, 4 Oct 2023 16:08:35 -0500 Subject: [PATCH] add rev to listRepos --- lexicons/com/atproto/sync/listRepos.json | 5 +++-- packages/api/src/client/lexicons.ts | 5 ++++- .../api/src/client/types/com/atproto/sync/listRepos.ts | 1 + packages/bsky/src/lexicon/lexicons.ts | 5 ++++- .../bsky/src/lexicon/types/com/atproto/sync/listRepos.ts | 1 + packages/pds/src/api/com/atproto/sync/listRepos.ts | 7 ++++++- packages/pds/src/lexicon/lexicons.ts | 5 ++++- .../pds/src/lexicon/types/com/atproto/sync/listRepos.ts | 1 + 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lexicons/com/atproto/sync/listRepos.json b/lexicons/com/atproto/sync/listRepos.json index 9fdd57a55cd..ad4eabdabf1 100644 --- a/lexicons/com/atproto/sync/listRepos.json +++ b/lexicons/com/atproto/sync/listRepos.json @@ -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" } } } } diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 77b4939d758..ded6b1f86f6 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -3376,7 +3376,7 @@ export const schemaDict = { }, repo: { type: 'object', - required: ['did', 'head'], + required: ['did', 'head', 'rev'], properties: { did: { type: 'string', @@ -3386,6 +3386,9 @@ export const schemaDict = { type: 'string', format: 'cid', }, + rev: { + type: 'string', + }, }, }, }, diff --git a/packages/api/src/client/types/com/atproto/sync/listRepos.ts b/packages/api/src/client/types/com/atproto/sync/listRepos.ts index 2bcf97a38ff..669dba37e85 100644 --- a/packages/api/src/client/types/com/atproto/sync/listRepos.ts +++ b/packages/api/src/client/types/com/atproto/sync/listRepos.ts @@ -39,6 +39,7 @@ export function toKnownErr(e: any) { export interface Repo { did: string head: string + rev: string [k: string]: unknown } diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 77b4939d758..ded6b1f86f6 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -3376,7 +3376,7 @@ export const schemaDict = { }, repo: { type: 'object', - required: ['did', 'head'], + required: ['did', 'head', 'rev'], properties: { did: { type: 'string', @@ -3386,6 +3386,9 @@ export const schemaDict = { type: 'string', format: 'cid', }, + rev: { + type: 'string', + }, }, }, }, diff --git a/packages/bsky/src/lexicon/types/com/atproto/sync/listRepos.ts b/packages/bsky/src/lexicon/types/com/atproto/sync/listRepos.ts index afbc9df8475..783a8e314c2 100644 --- a/packages/bsky/src/lexicon/types/com/atproto/sync/listRepos.ts +++ b/packages/bsky/src/lexicon/types/com/atproto/sync/listRepos.ts @@ -49,6 +49,7 @@ export type Handler = ( export interface Repo { did: string head: string + rev: string [k: string]: unknown } diff --git a/packages/pds/src/api/com/atproto/sync/listRepos.ts b/packages/pds/src/api/com/atproto/sync/listRepos.ts index 597b949449f..d2829ddcc4a 100644 --- a/packages/pds/src/api/com/atproto/sync/listRepos.ts +++ b/packages/pds/src/api/com/atproto/sync/listRepos.ts @@ -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( @@ -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: { diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 77b4939d758..ded6b1f86f6 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -3376,7 +3376,7 @@ export const schemaDict = { }, repo: { type: 'object', - required: ['did', 'head'], + required: ['did', 'head', 'rev'], properties: { did: { type: 'string', @@ -3386,6 +3386,9 @@ export const schemaDict = { type: 'string', format: 'cid', }, + rev: { + type: 'string', + }, }, }, }, diff --git a/packages/pds/src/lexicon/types/com/atproto/sync/listRepos.ts b/packages/pds/src/lexicon/types/com/atproto/sync/listRepos.ts index afbc9df8475..783a8e314c2 100644 --- a/packages/pds/src/lexicon/types/com/atproto/sync/listRepos.ts +++ b/packages/pds/src/lexicon/types/com/atproto/sync/listRepos.ts @@ -49,6 +49,7 @@ export type Handler = ( export interface Repo { did: string head: string + rev: string [k: string]: unknown }