Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lexicons/com/atproto/sync/notifyOfUpdate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"lexicon": 1,
"id": "com.atproto.sync.notifyOfUpdate",
"defs": {
"main": {
"type": "query",
"description": "Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break."
}
}
}
17 changes: 17 additions & 0 deletions lexicons/com/atproto/sync/requestCrawl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"lexicon": 1,
"id": "com.atproto.sync.requestCrawl",
"defs": {
"main": {
"type": "query",
"description": "Request a service to persistently crawl hosted repos.",
"parameters": {
"type": "params",
"required": ["hostname"],
"properties": {
"host": {"type": "string", "description": "Hostname of the service that is requesting to be crawled."}
}
}
}
}
}
26 changes: 26 additions & 0 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommit
import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
import * as ComAtprotoSyncSubscribeAllRepos from './types/com/atproto/sync/subscribeAllRepos'
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'
Expand Down Expand Up @@ -143,6 +145,8 @@ export * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommit
export * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
export * as ComAtprotoSyncSubscribeAllRepos from './types/com/atproto/sync/subscribeAllRepos'
export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'
Expand Down Expand Up @@ -764,6 +768,28 @@ export class SyncNS {
throw ComAtprotoSyncGetRepo.toKnownErr(e)
})
}

notifyOfUpdate(
params?: ComAtprotoSyncNotifyOfUpdate.QueryParams,
opts?: ComAtprotoSyncNotifyOfUpdate.CallOptions,
): Promise<ComAtprotoSyncNotifyOfUpdate.Response> {
return this._service.xrpc
.call('com.atproto.sync.notifyOfUpdate', params, undefined, opts)
.catch((e) => {
throw ComAtprotoSyncNotifyOfUpdate.toKnownErr(e)
})
}

requestCrawl(
params?: ComAtprotoSyncRequestCrawl.QueryParams,
opts?: ComAtprotoSyncRequestCrawl.CallOptions,
): Promise<ComAtprotoSyncRequestCrawl.Response> {
return this._service.xrpc
.call('com.atproto.sync.requestCrawl', params, undefined, opts)
.catch((e) => {
throw ComAtprotoSyncRequestCrawl.toKnownErr(e)
})
}
}

export class AppNS {
Expand Down
34 changes: 34 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,38 @@ export const schemaDict = {
},
},
},
ComAtprotoSyncNotifyOfUpdate: {
lexicon: 1,
id: 'com.atproto.sync.notifyOfUpdate',
defs: {
main: {
type: 'query',
description:
'Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break.',
},
},
},
ComAtprotoSyncRequestCrawl: {
lexicon: 1,
id: 'com.atproto.sync.requestCrawl',
defs: {
main: {
type: 'query',
description: 'Request a service to persistently crawl hosted repos.',
parameters: {
type: 'params',
required: ['hostname'],
properties: {
host: {
type: 'string',
description:
'Hostname of the service that is requesting to be crawled.',
},
},
},
},
},
},
ComAtprotoSyncSubscribeAllRepos: {
lexicon: 1,
id: 'com.atproto.sync.subscribeAllRepos',
Expand Down Expand Up @@ -4118,6 +4150,8 @@ export const ids = {
ComAtprotoSyncGetHead: 'com.atproto.sync.getHead',
ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
ComAtprotoSyncSubscribeAllRepos: 'com.atproto.sync.subscribeAllRepos',
AppBskyActorGetProfile: 'app.bsky.actor.getProfile',
AppBskyActorGetProfiles: 'app.bsky.actor.getProfiles',
Expand Down
26 changes: 26 additions & 0 deletions packages/api/src/client/types/com/atproto/sync/notifyOfUpdate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { Headers, XRPCError } from '@atproto/xrpc'
import { ValidationResult } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'

export interface QueryParams {}

export type InputSchema = undefined

export interface CallOptions {
headers?: Headers
}

export interface Response {
success: boolean
headers: Headers
}

export function toKnownErr(e: any) {
if (e instanceof XRPCError) {
}
return e
}
29 changes: 29 additions & 0 deletions packages/api/src/client/types/com/atproto/sync/requestCrawl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { Headers, XRPCError } from '@atproto/xrpc'
import { ValidationResult } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'

export interface QueryParams {
/** Hostname of the service that is requesting to be crawled. */
host?: string
}

export type InputSchema = undefined

export interface CallOptions {
headers?: Headers
}

export interface Response {
success: boolean
headers: Headers
}

export function toKnownErr(e: any) {
if (e instanceof XRPCError) {
}
return e
}
16 changes: 16 additions & 0 deletions packages/pds/src/lexicon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommit
import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
import * as ComAtprotoSyncSubscribeAllRepos from './types/com/atproto/sync/subscribeAllRepos'
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'
Expand Down Expand Up @@ -513,6 +515,20 @@ export class SyncNS {
return this._server.xrpc.method(nsid, cfg)
}

notifyOfUpdate<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncNotifyOfUpdate.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.notifyOfUpdate' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

requestCrawl<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncRequestCrawl.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.requestCrawl' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

subscribeAllRepos<AV extends StreamAuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncSubscribeAllRepos.Handler<ExtractAuth<AV>>>,
) {
Expand Down
34 changes: 34 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,38 @@ export const schemaDict = {
},
},
},
ComAtprotoSyncNotifyOfUpdate: {
lexicon: 1,
id: 'com.atproto.sync.notifyOfUpdate',
defs: {
main: {
type: 'query',
description:
'Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break.',
},
},
},
ComAtprotoSyncRequestCrawl: {
lexicon: 1,
id: 'com.atproto.sync.requestCrawl',
defs: {
main: {
type: 'query',
description: 'Request a service to persistently crawl hosted repos.',
parameters: {
type: 'params',
required: ['hostname'],
properties: {
host: {
type: 'string',
description:
'Hostname of the service that is requesting to be crawled.',
},
},
},
},
},
},
ComAtprotoSyncSubscribeAllRepos: {
lexicon: 1,
id: 'com.atproto.sync.subscribeAllRepos',
Expand Down Expand Up @@ -4118,6 +4150,8 @@ export const ids = {
ComAtprotoSyncGetHead: 'com.atproto.sync.getHead',
ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
ComAtprotoSyncSubscribeAllRepos: 'com.atproto.sync.subscribeAllRepos',
AppBskyActorGetProfile: 'app.bsky.actor.getProfile',
AppBskyActorGetProfiles: 'app.bsky.actor.getProfiles',
Expand Down
27 changes: 27 additions & 0 deletions packages/pds/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { HandlerAuth } from '@atproto/xrpc-server'

export interface QueryParams {}

export type InputSchema = undefined
export type HandlerInput = undefined

export interface HandlerError {
status: number
message?: string
}

export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
30 changes: 30 additions & 0 deletions packages/pds/src/lexicon/types/com/atproto/sync/requestCrawl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { HandlerAuth } from '@atproto/xrpc-server'

export interface QueryParams {
/** Hostname of the service that is requesting to be crawled. */
host?: string
}

export type InputSchema = undefined
export type HandlerInput = undefined

export interface HandlerError {
status: number
message?: string
}

export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput