com.atproto.sync.listReposByCollection Lexicon, for collections directory (#3524)
* com.atproto.sync.listReposByCollection, for collections directory * bump listReposByCollection limit * update max+default to align more with listRepos * codegen * changeset for listReposByCollection
This commit is contained in:
parent
b41ff4b4e3
commit
010f10c6f2
5
.changeset/slimy-trainers-tease.md
Normal file
5
.changeset/slimy-trainers-tease.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@atproto/api": patch
|
||||
---
|
||||
|
||||
add com.atproto.sync.listReposByCollection Lexicon
|
46
lexicons/com/atproto/sync/listReposByCollection.json
Normal file
46
lexicons/com/atproto/sync/listReposByCollection.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"lexicon": 1,
|
||||
"id": "com.atproto.sync.listReposByCollection",
|
||||
"defs": {
|
||||
"main": {
|
||||
"type": "query",
|
||||
"description": "Enumerates all the DIDs which have records with the given collection NSID.",
|
||||
"parameters": {
|
||||
"type": "params",
|
||||
"required": ["collection"],
|
||||
"properties": {
|
||||
"collection": { "type": "string", "format": "nsid" },
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"description": "Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.",
|
||||
"minimum": 1,
|
||||
"maximum": 2000,
|
||||
"default": 500
|
||||
},
|
||||
"cursor": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"output": {
|
||||
"encoding": "application/json",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["repos"],
|
||||
"properties": {
|
||||
"cursor": { "type": "string" },
|
||||
"repos": {
|
||||
"type": "array",
|
||||
"items": { "type": "ref", "ref": "#repo" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo": {
|
||||
"type": "object",
|
||||
"required": ["did"],
|
||||
"properties": {
|
||||
"did": { "type": "string", "format": "did" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -80,6 +80,7 @@ import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
||||
import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
||||
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
||||
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
||||
import * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
||||
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
||||
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
|
||||
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
|
||||
@ -310,6 +311,7 @@ export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
||||
export * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
||||
export * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
||||
export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
||||
export * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
||||
export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
||||
export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
|
||||
export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
|
||||
@ -1473,6 +1475,18 @@ export class ComAtprotoSyncNS {
|
||||
)
|
||||
}
|
||||
|
||||
listReposByCollection(
|
||||
params?: ComAtprotoSyncListReposByCollection.QueryParams,
|
||||
opts?: ComAtprotoSyncListReposByCollection.CallOptions,
|
||||
): Promise<ComAtprotoSyncListReposByCollection.Response> {
|
||||
return this._client.call(
|
||||
'com.atproto.sync.listReposByCollection',
|
||||
params,
|
||||
undefined,
|
||||
opts,
|
||||
)
|
||||
}
|
||||
|
||||
notifyOfUpdate(
|
||||
data?: ComAtprotoSyncNotifyOfUpdate.InputSchema,
|
||||
opts?: ComAtprotoSyncNotifyOfUpdate.CallOptions,
|
||||
|
@ -3661,6 +3661,67 @@ export const schemaDict = {
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncListReposByCollection: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.listReposByCollection',
|
||||
defs: {
|
||||
main: {
|
||||
type: 'query',
|
||||
description:
|
||||
'Enumerates all the DIDs which have records with the given collection NSID.',
|
||||
parameters: {
|
||||
type: 'params',
|
||||
required: ['collection'],
|
||||
properties: {
|
||||
collection: {
|
||||
type: 'string',
|
||||
format: 'nsid',
|
||||
},
|
||||
limit: {
|
||||
type: 'integer',
|
||||
description:
|
||||
'Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.',
|
||||
minimum: 1,
|
||||
maximum: 2000,
|
||||
default: 500,
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
encoding: 'application/json',
|
||||
schema: {
|
||||
type: 'object',
|
||||
required: ['repos'],
|
||||
properties: {
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
repos: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.sync.listReposByCollection#repo',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
repo: {
|
||||
type: 'object',
|
||||
required: ['did'],
|
||||
properties: {
|
||||
did: {
|
||||
type: 'string',
|
||||
format: 'did',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncNotifyOfUpdate: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.notifyOfUpdate',
|
||||
@ -14091,6 +14152,7 @@ export const ids = {
|
||||
ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
|
||||
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
||||
ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
|
||||
ComAtprotoSyncListReposByCollection: 'com.atproto.sync.listReposByCollection',
|
||||
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
||||
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
||||
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
||||
|
@ -0,0 +1,56 @@
|
||||
/**
|
||||
* GENERATED CODE - DO NOT MODIFY
|
||||
*/
|
||||
import { HeadersMap, XRPCError } from '@atproto/xrpc'
|
||||
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
||||
import { CID } from 'multiformats/cid'
|
||||
import { validate as _validate } from '../../../../lexicons'
|
||||
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
|
||||
|
||||
const is$typed = _is$typed,
|
||||
validate = _validate
|
||||
const id = 'com.atproto.sync.listReposByCollection'
|
||||
|
||||
export interface QueryParams {
|
||||
collection: string
|
||||
/** Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. */
|
||||
limit?: number
|
||||
cursor?: string
|
||||
}
|
||||
|
||||
export type InputSchema = undefined
|
||||
|
||||
export interface OutputSchema {
|
||||
cursor?: string
|
||||
repos: Repo[]
|
||||
}
|
||||
|
||||
export interface CallOptions {
|
||||
signal?: AbortSignal
|
||||
headers?: HeadersMap
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
success: boolean
|
||||
headers: HeadersMap
|
||||
data: OutputSchema
|
||||
}
|
||||
|
||||
export function toKnownErr(e: any) {
|
||||
return e
|
||||
}
|
||||
|
||||
export interface Repo {
|
||||
$type?: 'com.atproto.sync.listReposByCollection#repo'
|
||||
did: string
|
||||
}
|
||||
|
||||
const hashRepo = 'repo'
|
||||
|
||||
export function isRepo<V>(v: V) {
|
||||
return is$typed(v, id, hashRepo)
|
||||
}
|
||||
|
||||
export function validateRepo<V>(v: V) {
|
||||
return validate<Repo & V>(v, id, hashRepo)
|
||||
}
|
@ -77,6 +77,7 @@ import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
||||
import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
||||
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
||||
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
||||
import * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
||||
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
||||
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
|
||||
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
|
||||
@ -1065,6 +1066,17 @@ export class ComAtprotoSyncNS {
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
listReposByCollection<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
ComAtprotoSyncListReposByCollection.Handler<ExtractAuth<AV>>,
|
||||
ComAtprotoSyncListReposByCollection.HandlerReqCtx<ExtractAuth<AV>>
|
||||
>,
|
||||
) {
|
||||
const nsid = 'com.atproto.sync.listReposByCollection' // @ts-ignore
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
notifyOfUpdate<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
|
@ -3661,6 +3661,67 @@ export const schemaDict = {
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncListReposByCollection: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.listReposByCollection',
|
||||
defs: {
|
||||
main: {
|
||||
type: 'query',
|
||||
description:
|
||||
'Enumerates all the DIDs which have records with the given collection NSID.',
|
||||
parameters: {
|
||||
type: 'params',
|
||||
required: ['collection'],
|
||||
properties: {
|
||||
collection: {
|
||||
type: 'string',
|
||||
format: 'nsid',
|
||||
},
|
||||
limit: {
|
||||
type: 'integer',
|
||||
description:
|
||||
'Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.',
|
||||
minimum: 1,
|
||||
maximum: 2000,
|
||||
default: 500,
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
encoding: 'application/json',
|
||||
schema: {
|
||||
type: 'object',
|
||||
required: ['repos'],
|
||||
properties: {
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
repos: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.sync.listReposByCollection#repo',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
repo: {
|
||||
type: 'object',
|
||||
required: ['did'],
|
||||
properties: {
|
||||
did: {
|
||||
type: 'string',
|
||||
format: 'did',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncNotifyOfUpdate: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.notifyOfUpdate',
|
||||
@ -11055,6 +11116,7 @@ export const ids = {
|
||||
ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
|
||||
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
||||
ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
|
||||
ComAtprotoSyncListReposByCollection: 'com.atproto.sync.listReposByCollection',
|
||||
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
||||
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
||||
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
||||
|
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* GENERATED CODE - DO NOT MODIFY
|
||||
*/
|
||||
import express from 'express'
|
||||
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
||||
import { CID } from 'multiformats/cid'
|
||||
import { validate as _validate } from '../../../../lexicons'
|
||||
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
|
||||
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
||||
|
||||
const is$typed = _is$typed,
|
||||
validate = _validate
|
||||
const id = 'com.atproto.sync.listReposByCollection'
|
||||
|
||||
export interface QueryParams {
|
||||
collection: string
|
||||
/** Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. */
|
||||
limit: number
|
||||
cursor?: string
|
||||
}
|
||||
|
||||
export type InputSchema = undefined
|
||||
|
||||
export interface OutputSchema {
|
||||
cursor?: string
|
||||
repos: Repo[]
|
||||
}
|
||||
|
||||
export type HandlerInput = undefined
|
||||
|
||||
export interface HandlerSuccess {
|
||||
encoding: 'application/json'
|
||||
body: OutputSchema
|
||||
headers?: { [key: string]: string }
|
||||
}
|
||||
|
||||
export interface HandlerError {
|
||||
status: number
|
||||
message?: string
|
||||
}
|
||||
|
||||
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
||||
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
||||
auth: HA
|
||||
params: QueryParams
|
||||
input: HandlerInput
|
||||
req: express.Request
|
||||
res: express.Response
|
||||
resetRouteRateLimits: () => Promise<void>
|
||||
}
|
||||
export type Handler<HA extends HandlerAuth = never> = (
|
||||
ctx: HandlerReqCtx<HA>,
|
||||
) => Promise<HandlerOutput> | HandlerOutput
|
||||
|
||||
export interface Repo {
|
||||
$type?: 'com.atproto.sync.listReposByCollection#repo'
|
||||
did: string
|
||||
}
|
||||
|
||||
const hashRepo = 'repo'
|
||||
|
||||
export function isRepo<V>(v: V) {
|
||||
return is$typed(v, id, hashRepo)
|
||||
}
|
||||
|
||||
export function validateRepo<V>(v: V) {
|
||||
return validate<Repo & V>(v, id, hashRepo)
|
||||
}
|
@ -77,6 +77,7 @@ import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
||||
import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
||||
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
||||
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
||||
import * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
||||
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
||||
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
|
||||
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
|
||||
@ -1109,6 +1110,17 @@ export class ComAtprotoSyncNS {
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
listReposByCollection<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
ComAtprotoSyncListReposByCollection.Handler<ExtractAuth<AV>>,
|
||||
ComAtprotoSyncListReposByCollection.HandlerReqCtx<ExtractAuth<AV>>
|
||||
>,
|
||||
) {
|
||||
const nsid = 'com.atproto.sync.listReposByCollection' // @ts-ignore
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
notifyOfUpdate<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
|
@ -3661,6 +3661,67 @@ export const schemaDict = {
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncListReposByCollection: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.listReposByCollection',
|
||||
defs: {
|
||||
main: {
|
||||
type: 'query',
|
||||
description:
|
||||
'Enumerates all the DIDs which have records with the given collection NSID.',
|
||||
parameters: {
|
||||
type: 'params',
|
||||
required: ['collection'],
|
||||
properties: {
|
||||
collection: {
|
||||
type: 'string',
|
||||
format: 'nsid',
|
||||
},
|
||||
limit: {
|
||||
type: 'integer',
|
||||
description:
|
||||
'Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.',
|
||||
minimum: 1,
|
||||
maximum: 2000,
|
||||
default: 500,
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
encoding: 'application/json',
|
||||
schema: {
|
||||
type: 'object',
|
||||
required: ['repos'],
|
||||
properties: {
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
repos: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.sync.listReposByCollection#repo',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
repo: {
|
||||
type: 'object',
|
||||
required: ['did'],
|
||||
properties: {
|
||||
did: {
|
||||
type: 'string',
|
||||
format: 'did',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncNotifyOfUpdate: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.notifyOfUpdate',
|
||||
@ -14091,6 +14152,7 @@ export const ids = {
|
||||
ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
|
||||
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
||||
ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
|
||||
ComAtprotoSyncListReposByCollection: 'com.atproto.sync.listReposByCollection',
|
||||
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
||||
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
||||
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
||||
|
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* GENERATED CODE - DO NOT MODIFY
|
||||
*/
|
||||
import express from 'express'
|
||||
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
||||
import { CID } from 'multiformats/cid'
|
||||
import { validate as _validate } from '../../../../lexicons'
|
||||
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
|
||||
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
||||
|
||||
const is$typed = _is$typed,
|
||||
validate = _validate
|
||||
const id = 'com.atproto.sync.listReposByCollection'
|
||||
|
||||
export interface QueryParams {
|
||||
collection: string
|
||||
/** Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. */
|
||||
limit: number
|
||||
cursor?: string
|
||||
}
|
||||
|
||||
export type InputSchema = undefined
|
||||
|
||||
export interface OutputSchema {
|
||||
cursor?: string
|
||||
repos: Repo[]
|
||||
}
|
||||
|
||||
export type HandlerInput = undefined
|
||||
|
||||
export interface HandlerSuccess {
|
||||
encoding: 'application/json'
|
||||
body: OutputSchema
|
||||
headers?: { [key: string]: string }
|
||||
}
|
||||
|
||||
export interface HandlerError {
|
||||
status: number
|
||||
message?: string
|
||||
}
|
||||
|
||||
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
||||
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
||||
auth: HA
|
||||
params: QueryParams
|
||||
input: HandlerInput
|
||||
req: express.Request
|
||||
res: express.Response
|
||||
resetRouteRateLimits: () => Promise<void>
|
||||
}
|
||||
export type Handler<HA extends HandlerAuth = never> = (
|
||||
ctx: HandlerReqCtx<HA>,
|
||||
) => Promise<HandlerOutput> | HandlerOutput
|
||||
|
||||
export interface Repo {
|
||||
$type?: 'com.atproto.sync.listReposByCollection#repo'
|
||||
did: string
|
||||
}
|
||||
|
||||
const hashRepo = 'repo'
|
||||
|
||||
export function isRepo<V>(v: V) {
|
||||
return is$typed(v, id, hashRepo)
|
||||
}
|
||||
|
||||
export function validateRepo<V>(v: V) {
|
||||
return validate<Repo & V>(v, id, hashRepo)
|
||||
}
|
@ -77,6 +77,7 @@ import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
||||
import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
||||
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
||||
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
||||
import * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
||||
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
||||
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js'
|
||||
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js'
|
||||
@ -1109,6 +1110,17 @@ export class ComAtprotoSyncNS {
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
listReposByCollection<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
ComAtprotoSyncListReposByCollection.Handler<ExtractAuth<AV>>,
|
||||
ComAtprotoSyncListReposByCollection.HandlerReqCtx<ExtractAuth<AV>>
|
||||
>,
|
||||
) {
|
||||
const nsid = 'com.atproto.sync.listReposByCollection' // @ts-ignore
|
||||
return this._server.xrpc.method(nsid, cfg)
|
||||
}
|
||||
|
||||
notifyOfUpdate<AV extends AuthVerifier>(
|
||||
cfg: ConfigOf<
|
||||
AV,
|
||||
|
@ -3661,6 +3661,67 @@ export const schemaDict = {
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncListReposByCollection: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.listReposByCollection',
|
||||
defs: {
|
||||
main: {
|
||||
type: 'query',
|
||||
description:
|
||||
'Enumerates all the DIDs which have records with the given collection NSID.',
|
||||
parameters: {
|
||||
type: 'params',
|
||||
required: ['collection'],
|
||||
properties: {
|
||||
collection: {
|
||||
type: 'string',
|
||||
format: 'nsid',
|
||||
},
|
||||
limit: {
|
||||
type: 'integer',
|
||||
description:
|
||||
'Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.',
|
||||
minimum: 1,
|
||||
maximum: 2000,
|
||||
default: 500,
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
output: {
|
||||
encoding: 'application/json',
|
||||
schema: {
|
||||
type: 'object',
|
||||
required: ['repos'],
|
||||
properties: {
|
||||
cursor: {
|
||||
type: 'string',
|
||||
},
|
||||
repos: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.sync.listReposByCollection#repo',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
repo: {
|
||||
type: 'object',
|
||||
required: ['did'],
|
||||
properties: {
|
||||
did: {
|
||||
type: 'string',
|
||||
format: 'did',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ComAtprotoSyncNotifyOfUpdate: {
|
||||
lexicon: 1,
|
||||
id: 'com.atproto.sync.notifyOfUpdate',
|
||||
@ -14091,6 +14152,7 @@ export const ids = {
|
||||
ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
|
||||
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
||||
ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
|
||||
ComAtprotoSyncListReposByCollection: 'com.atproto.sync.listReposByCollection',
|
||||
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
||||
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
||||
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
||||
|
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* GENERATED CODE - DO NOT MODIFY
|
||||
*/
|
||||
import express from 'express'
|
||||
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
||||
import { CID } from 'multiformats/cid'
|
||||
import { validate as _validate } from '../../../../lexicons'
|
||||
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
|
||||
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
||||
|
||||
const is$typed = _is$typed,
|
||||
validate = _validate
|
||||
const id = 'com.atproto.sync.listReposByCollection'
|
||||
|
||||
export interface QueryParams {
|
||||
collection: string
|
||||
/** Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. */
|
||||
limit: number
|
||||
cursor?: string
|
||||
}
|
||||
|
||||
export type InputSchema = undefined
|
||||
|
||||
export interface OutputSchema {
|
||||
cursor?: string
|
||||
repos: Repo[]
|
||||
}
|
||||
|
||||
export type HandlerInput = undefined
|
||||
|
||||
export interface HandlerSuccess {
|
||||
encoding: 'application/json'
|
||||
body: OutputSchema
|
||||
headers?: { [key: string]: string }
|
||||
}
|
||||
|
||||
export interface HandlerError {
|
||||
status: number
|
||||
message?: string
|
||||
}
|
||||
|
||||
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
||||
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
||||
auth: HA
|
||||
params: QueryParams
|
||||
input: HandlerInput
|
||||
req: express.Request
|
||||
res: express.Response
|
||||
resetRouteRateLimits: () => Promise<void>
|
||||
}
|
||||
export type Handler<HA extends HandlerAuth = never> = (
|
||||
ctx: HandlerReqCtx<HA>,
|
||||
) => Promise<HandlerOutput> | HandlerOutput
|
||||
|
||||
export interface Repo {
|
||||
$type?: 'com.atproto.sync.listReposByCollection#repo'
|
||||
did: string
|
||||
}
|
||||
|
||||
const hashRepo = 'repo'
|
||||
|
||||
export function isRepo<V>(v: V) {
|
||||
return is$typed(v, id, hashRepo)
|
||||
}
|
||||
|
||||
export function validateRepo<V>(v: V) {
|
||||
return validate<Repo & V>(v, id, hashRepo)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user