diff --git a/package.json b/package.json index c234f4c..2423c8c 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,12 @@ "build": "tsc" }, "dependencies": { - "@atproto/api": "^0.3.7", - "@atproto/did-resolver": "^0.1.0", - "@atproto/lexicon": "^0.1.0", - "@atproto/repo": "^0.1.0", - "@atproto/uri": "^0.0.2", - "@atproto/xrpc-server": "^0.2.0", + "@atproto/api": "^0.6.20", + "@atproto/identity": "^0.2.1", + "@atproto/lexicon": "^0.2.2", + "@atproto/repo": "^0.3.2", + "@atproto/syntax": "^0.1.2", + "@atproto/xrpc-server": "^0.3.2", "better-sqlite3": "^8.3.0", "dotenv": "^16.0.3", "express": "^4.18.2", diff --git a/src/auth.ts b/src/auth.ts index 9ccaa99..eef583e 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,6 +1,6 @@ import express from 'express' import { verifyJwt, AuthRequiredError } from '@atproto/xrpc-server' -import { DidResolver } from '@atproto/did-resolver' +import { DidResolver } from '@atproto/identity' export const validateAuth = async ( req: express.Request, diff --git a/src/config.ts b/src/config.ts index c394fc9..3a2844b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,5 @@ import { Database } from './db' -import { DidResolver } from '@atproto/did-resolver' +import { DidResolver } from '@atproto/identity' export type AppContext = { db: Database diff --git a/src/lexicon/index.ts b/src/lexicon/index.ts index 02e3ada..3dd2b51 100644 --- a/src/lexicon/index.ts +++ b/src/lexicon/index.ts @@ -22,6 +22,7 @@ import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' import * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports' import * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction' import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' +import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' import * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction' import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' @@ -37,7 +38,6 @@ import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRe import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord' import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords' import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord' -import * as ComAtprotoRepoRebaseRepo from './types/com/atproto/repo/rebaseRepo' import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob' import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' @@ -58,8 +58,8 @@ import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/r import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout' -import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath' import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead' +import * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit' import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord' import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo' import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs' @@ -76,33 +76,42 @@ import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors' import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead' import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator' import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds' +import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes' import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed' import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed' import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator' +import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators' import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton' import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes' +import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed' import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread' import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts' import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy' -import * as AppBskyFeedGetSavedFeeds from './types/app/bsky/feed/getSavedFeeds' +import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds' import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline' -import * as AppBskyFeedSaveFeed from './types/app/bsky/feed/saveFeed' -import * as AppBskyFeedUnsaveFeed from './types/app/bsky/feed/unsaveFeed' +import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts' import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks' import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers' import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows' import * as AppBskyGraphGetList from './types/app/bsky/graph/getList' +import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks' import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes' import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists' import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes' +import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor' import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor' import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList' import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor' import * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList' import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount' import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' +import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' +import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' +import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton' +import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' +import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' export const COM_ATPROTO_ADMIN = { DefsTakedown: 'com.atproto.admin.defs#takedown', @@ -120,6 +129,7 @@ export const COM_ATPROTO_MODERATION = { } export const APP_BSKY_GRAPH = { DefsModlist: 'app.bsky.graph.defs#modlist', + DefsCuratelist: 'app.bsky.graph.defs#curatelist', } export function createServer(options?: XrpcOptions): Server { @@ -180,7 +190,8 @@ export class AdminNS { disableAccountInvites( cfg: ConfigOf< AV, - ComAtprotoAdminDisableAccountInvites.Handler> + ComAtprotoAdminDisableAccountInvites.Handler>, + ComAtprotoAdminDisableAccountInvites.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.disableAccountInvites' // @ts-ignore @@ -190,7 +201,8 @@ export class AdminNS { disableInviteCodes( cfg: ConfigOf< AV, - ComAtprotoAdminDisableInviteCodes.Handler> + ComAtprotoAdminDisableInviteCodes.Handler>, + ComAtprotoAdminDisableInviteCodes.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.disableInviteCodes' // @ts-ignore @@ -200,7 +212,8 @@ export class AdminNS { enableAccountInvites( cfg: ConfigOf< AV, - ComAtprotoAdminEnableAccountInvites.Handler> + ComAtprotoAdminEnableAccountInvites.Handler>, + ComAtprotoAdminEnableAccountInvites.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.enableAccountInvites' // @ts-ignore @@ -208,7 +221,11 @@ export class AdminNS { } getInviteCodes( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoAdminGetInviteCodes.Handler>, + ComAtprotoAdminGetInviteCodes.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.admin.getInviteCodes' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -217,7 +234,8 @@ export class AdminNS { getModerationAction( cfg: ConfigOf< AV, - ComAtprotoAdminGetModerationAction.Handler> + ComAtprotoAdminGetModerationAction.Handler>, + ComAtprotoAdminGetModerationAction.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.getModerationAction' // @ts-ignore @@ -227,7 +245,8 @@ export class AdminNS { getModerationActions( cfg: ConfigOf< AV, - ComAtprotoAdminGetModerationActions.Handler> + ComAtprotoAdminGetModerationActions.Handler>, + ComAtprotoAdminGetModerationActions.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.getModerationActions' // @ts-ignore @@ -237,7 +256,8 @@ export class AdminNS { getModerationReport( cfg: ConfigOf< AV, - ComAtprotoAdminGetModerationReport.Handler> + ComAtprotoAdminGetModerationReport.Handler>, + ComAtprotoAdminGetModerationReport.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.getModerationReport' // @ts-ignore @@ -247,7 +267,8 @@ export class AdminNS { getModerationReports( cfg: ConfigOf< AV, - ComAtprotoAdminGetModerationReports.Handler> + ComAtprotoAdminGetModerationReports.Handler>, + ComAtprotoAdminGetModerationReports.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.getModerationReports' // @ts-ignore @@ -255,14 +276,22 @@ export class AdminNS { } getRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoAdminGetRecord.Handler>, + ComAtprotoAdminGetRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.admin.getRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getRepo( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoAdminGetRepo.Handler>, + ComAtprotoAdminGetRepo.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.admin.getRepo' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -271,7 +300,8 @@ export class AdminNS { resolveModerationReports( cfg: ConfigOf< AV, - ComAtprotoAdminResolveModerationReports.Handler> + ComAtprotoAdminResolveModerationReports.Handler>, + ComAtprotoAdminResolveModerationReports.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.resolveModerationReports' // @ts-ignore @@ -281,7 +311,8 @@ export class AdminNS { reverseModerationAction( cfg: ConfigOf< AV, - ComAtprotoAdminReverseModerationAction.Handler> + ComAtprotoAdminReverseModerationAction.Handler>, + ComAtprotoAdminReverseModerationAction.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.reverseModerationAction' // @ts-ignore @@ -289,16 +320,32 @@ export class AdminNS { } searchRepos( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoAdminSearchRepos.Handler>, + ComAtprotoAdminSearchRepos.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.admin.searchRepos' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + sendEmail( + cfg: ConfigOf< + AV, + ComAtprotoAdminSendEmail.Handler>, + ComAtprotoAdminSendEmail.HandlerReqCtx> + >, + ) { + const nsid = 'com.atproto.admin.sendEmail' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + takeModerationAction( cfg: ConfigOf< AV, - ComAtprotoAdminTakeModerationAction.Handler> + ComAtprotoAdminTakeModerationAction.Handler>, + ComAtprotoAdminTakeModerationAction.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.takeModerationAction' // @ts-ignore @@ -308,7 +355,8 @@ export class AdminNS { updateAccountEmail( cfg: ConfigOf< AV, - ComAtprotoAdminUpdateAccountEmail.Handler> + ComAtprotoAdminUpdateAccountEmail.Handler>, + ComAtprotoAdminUpdateAccountEmail.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.updateAccountEmail' // @ts-ignore @@ -318,7 +366,8 @@ export class AdminNS { updateAccountHandle( cfg: ConfigOf< AV, - ComAtprotoAdminUpdateAccountHandle.Handler> + ComAtprotoAdminUpdateAccountHandle.Handler>, + ComAtprotoAdminUpdateAccountHandle.HandlerReqCtx> >, ) { const nsid = 'com.atproto.admin.updateAccountHandle' // @ts-ignore @@ -334,14 +383,22 @@ export class IdentityNS { } resolveHandle( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoIdentityResolveHandle.Handler>, + ComAtprotoIdentityResolveHandle.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.identity.resolveHandle' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } updateHandle( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoIdentityUpdateHandle.Handler>, + ComAtprotoIdentityUpdateHandle.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.identity.updateHandle' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -356,14 +413,22 @@ export class LabelNS { } queryLabels( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoLabelQueryLabels.Handler>, + ComAtprotoLabelQueryLabels.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.label.queryLabels' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } subscribeLabels( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoLabelSubscribeLabels.Handler>, + ComAtprotoLabelSubscribeLabels.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.label.subscribeLabels' // @ts-ignore return this._server.xrpc.streamMethod(nsid, cfg) @@ -380,7 +445,8 @@ export class ModerationNS { createReport( cfg: ConfigOf< AV, - ComAtprotoModerationCreateReport.Handler> + ComAtprotoModerationCreateReport.Handler>, + ComAtprotoModerationCreateReport.HandlerReqCtx> >, ) { const nsid = 'com.atproto.moderation.createReport' // @ts-ignore @@ -396,63 +462,88 @@ export class RepoNS { } applyWrites( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoApplyWrites.Handler>, + ComAtprotoRepoApplyWrites.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.applyWrites' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } createRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoCreateRecord.Handler>, + ComAtprotoRepoCreateRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.createRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } deleteRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoDeleteRecord.Handler>, + ComAtprotoRepoDeleteRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.deleteRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } describeRepo( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoDescribeRepo.Handler>, + ComAtprotoRepoDescribeRepo.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.describeRepo' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoGetRecord.Handler>, + ComAtprotoRepoGetRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.getRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } listRecords( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoListRecords.Handler>, + ComAtprotoRepoListRecords.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.listRecords' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } putRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoPutRecord.Handler>, + ComAtprotoRepoPutRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.putRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } - rebaseRepo( - cfg: ConfigOf>>, - ) { - const nsid = 'com.atproto.repo.rebaseRepo' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - uploadBlob( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoRepoUploadBlob.Handler>, + ComAtprotoRepoUploadBlob.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.repo.uploadBlob' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -467,7 +558,11 @@ export class ServerNS { } createAccount( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerCreateAccount.Handler>, + ComAtprotoServerCreateAccount.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.createAccount' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -476,7 +571,8 @@ export class ServerNS { createAppPassword( cfg: ConfigOf< AV, - ComAtprotoServerCreateAppPassword.Handler> + ComAtprotoServerCreateAppPassword.Handler>, + ComAtprotoServerCreateAppPassword.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.createAppPassword' // @ts-ignore @@ -486,7 +582,8 @@ export class ServerNS { createInviteCode( cfg: ConfigOf< AV, - ComAtprotoServerCreateInviteCode.Handler> + ComAtprotoServerCreateInviteCode.Handler>, + ComAtprotoServerCreateInviteCode.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.createInviteCode' // @ts-ignore @@ -496,7 +593,8 @@ export class ServerNS { createInviteCodes( cfg: ConfigOf< AV, - ComAtprotoServerCreateInviteCodes.Handler> + ComAtprotoServerCreateInviteCodes.Handler>, + ComAtprotoServerCreateInviteCodes.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.createInviteCodes' // @ts-ignore @@ -504,28 +602,44 @@ export class ServerNS { } createSession( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerCreateSession.Handler>, + ComAtprotoServerCreateSession.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.createSession' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } deleteAccount( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerDeleteAccount.Handler>, + ComAtprotoServerDeleteAccount.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.deleteAccount' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } deleteSession( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerDeleteSession.Handler>, + ComAtprotoServerDeleteSession.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.deleteSession' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } describeServer( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerDescribeServer.Handler>, + ComAtprotoServerDescribeServer.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.describeServer' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -534,7 +648,8 @@ export class ServerNS { getAccountInviteCodes( cfg: ConfigOf< AV, - ComAtprotoServerGetAccountInviteCodes.Handler> + ComAtprotoServerGetAccountInviteCodes.Handler>, + ComAtprotoServerGetAccountInviteCodes.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.getAccountInviteCodes' // @ts-ignore @@ -542,7 +657,11 @@ export class ServerNS { } getSession( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerGetSession.Handler>, + ComAtprotoServerGetSession.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.getSession' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -551,7 +670,8 @@ export class ServerNS { listAppPasswords( cfg: ConfigOf< AV, - ComAtprotoServerListAppPasswords.Handler> + ComAtprotoServerListAppPasswords.Handler>, + ComAtprotoServerListAppPasswords.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.listAppPasswords' // @ts-ignore @@ -559,7 +679,11 @@ export class ServerNS { } refreshSession( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerRefreshSession.Handler>, + ComAtprotoServerRefreshSession.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.refreshSession' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -568,7 +692,8 @@ export class ServerNS { requestAccountDelete( cfg: ConfigOf< AV, - ComAtprotoServerRequestAccountDelete.Handler> + ComAtprotoServerRequestAccountDelete.Handler>, + ComAtprotoServerRequestAccountDelete.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.requestAccountDelete' // @ts-ignore @@ -578,7 +703,8 @@ export class ServerNS { requestPasswordReset( cfg: ConfigOf< AV, - ComAtprotoServerRequestPasswordReset.Handler> + ComAtprotoServerRequestPasswordReset.Handler>, + ComAtprotoServerRequestPasswordReset.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.requestPasswordReset' // @ts-ignore @@ -586,7 +712,11 @@ export class ServerNS { } resetPassword( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoServerResetPassword.Handler>, + ComAtprotoServerResetPassword.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.server.resetPassword' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -595,7 +725,8 @@ export class ServerNS { revokeAppPassword( cfg: ConfigOf< AV, - ComAtprotoServerRevokeAppPassword.Handler> + ComAtprotoServerRevokeAppPassword.Handler>, + ComAtprotoServerRevokeAppPassword.HandlerReqCtx> >, ) { const nsid = 'com.atproto.server.revokeAppPassword' // @ts-ignore @@ -611,84 +742,132 @@ export class SyncNS { } getBlob( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetBlob.Handler>, + ComAtprotoSyncGetBlob.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getBlob' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getBlocks( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetBlocks.Handler>, + ComAtprotoSyncGetBlocks.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getBlocks' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getCheckout( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetCheckout.Handler>, + ComAtprotoSyncGetCheckout.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getCheckout' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } - getCommitPath( - cfg: ConfigOf>>, - ) { - const nsid = 'com.atproto.sync.getCommitPath' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getHead( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetHead.Handler>, + ComAtprotoSyncGetHead.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getHead' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getLatestCommit( + cfg: ConfigOf< + AV, + ComAtprotoSyncGetLatestCommit.Handler>, + ComAtprotoSyncGetLatestCommit.HandlerReqCtx> + >, + ) { + const nsid = 'com.atproto.sync.getLatestCommit' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getRecord( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetRecord.Handler>, + ComAtprotoSyncGetRecord.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getRecord' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getRepo( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncGetRepo.Handler>, + ComAtprotoSyncGetRepo.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.getRepo' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } listBlobs( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncListBlobs.Handler>, + ComAtprotoSyncListBlobs.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.listBlobs' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } listRepos( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncListRepos.Handler>, + ComAtprotoSyncListRepos.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.listRepos' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } notifyOfUpdate( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncNotifyOfUpdate.Handler>, + ComAtprotoSyncNotifyOfUpdate.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.notifyOfUpdate' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } requestCrawl( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncRequestCrawl.Handler>, + ComAtprotoSyncRequestCrawl.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.requestCrawl' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } subscribeRepos( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + ComAtprotoSyncSubscribeRepos.Handler>, + ComAtprotoSyncSubscribeRepos.HandlerReqCtx> + >, ) { const nsid = 'com.atproto.sync.subscribeRepos' // @ts-ignore return this._server.xrpc.streamMethod(nsid, cfg) @@ -735,42 +914,66 @@ export class ActorNS { } getPreferences( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorGetPreferences.Handler>, + AppBskyActorGetPreferences.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.getPreferences' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getProfile( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorGetProfile.Handler>, + AppBskyActorGetProfile.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.getProfile' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getProfiles( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorGetProfiles.Handler>, + AppBskyActorGetProfiles.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.getProfiles' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getSuggestions( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorGetSuggestions.Handler>, + AppBskyActorGetSuggestions.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.getSuggestions' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } putPreferences( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorPutPreferences.Handler>, + AppBskyActorPutPreferences.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.putPreferences' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } searchActors( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyActorSearchActors.Handler>, + AppBskyActorSearchActors.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.actor.searchActors' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -779,7 +982,8 @@ export class ActorNS { searchActorsTypeahead( cfg: ConfigOf< AV, - AppBskyActorSearchActorsTypeahead.Handler> + AppBskyActorSearchActorsTypeahead.Handler>, + AppBskyActorSearchActorsTypeahead.HandlerReqCtx> >, ) { const nsid = 'app.bsky.actor.searchActorsTypeahead' // @ts-ignore @@ -805,7 +1009,8 @@ export class FeedNS { describeFeedGenerator( cfg: ConfigOf< AV, - AppBskyFeedDescribeFeedGenerator.Handler> + AppBskyFeedDescribeFeedGenerator.Handler>, + AppBskyFeedDescribeFeedGenerator.HandlerReqCtx> >, ) { const nsid = 'app.bsky.feed.describeFeedGenerator' // @ts-ignore @@ -813,93 +1018,167 @@ export class FeedNS { } getActorFeeds( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetActorFeeds.Handler>, + AppBskyFeedGetActorFeeds.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getActorFeeds' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getActorLikes( + cfg: ConfigOf< + AV, + AppBskyFeedGetActorLikes.Handler>, + AppBskyFeedGetActorLikes.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.feed.getActorLikes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getAuthorFeed( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetAuthorFeed.Handler>, + AppBskyFeedGetAuthorFeed.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getFeed( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetFeed.Handler>, + AppBskyFeedGetFeed.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getFeed' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getFeedGenerator( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetFeedGenerator.Handler>, + AppBskyFeedGetFeedGenerator.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getFeedGenerator' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getFeedGenerators( + cfg: ConfigOf< + AV, + AppBskyFeedGetFeedGenerators.Handler>, + AppBskyFeedGetFeedGenerators.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.feed.getFeedGenerators' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getFeedSkeleton( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetFeedSkeleton.Handler>, + AppBskyFeedGetFeedSkeleton.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getFeedSkeleton' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getLikes( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetLikes.Handler>, + AppBskyFeedGetLikes.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getLikes' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getListFeed( + cfg: ConfigOf< + AV, + AppBskyFeedGetListFeed.Handler>, + AppBskyFeedGetListFeed.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.feed.getListFeed' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getPostThread( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetPostThread.Handler>, + AppBskyFeedGetPostThread.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getPosts( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetPosts.Handler>, + AppBskyFeedGetPosts.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getPosts' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getRepostedBy( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetRepostedBy.Handler>, + AppBskyFeedGetRepostedBy.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getRepostedBy' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } - getSavedFeeds( - cfg: ConfigOf>>, + getSuggestedFeeds( + cfg: ConfigOf< + AV, + AppBskyFeedGetSuggestedFeeds.Handler>, + AppBskyFeedGetSuggestedFeeds.HandlerReqCtx> + >, ) { - const nsid = 'app.bsky.feed.getSavedFeeds' // @ts-ignore + const nsid = 'app.bsky.feed.getSuggestedFeeds' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getTimeline( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyFeedGetTimeline.Handler>, + AppBskyFeedGetTimeline.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.feed.getTimeline' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } - saveFeed( - cfg: ConfigOf>>, + searchPosts( + cfg: ConfigOf< + AV, + AppBskyFeedSearchPosts.Handler>, + AppBskyFeedSearchPosts.HandlerReqCtx> + >, ) { - const nsid = 'app.bsky.feed.saveFeed' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - unsaveFeed( - cfg: ConfigOf>>, - ) { - const nsid = 'app.bsky.feed.unsaveFeed' // @ts-ignore + const nsid = 'app.bsky.feed.searchPosts' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } } @@ -912,77 +1191,143 @@ export class GraphNS { } getBlocks( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetBlocks.Handler>, + AppBskyGraphGetBlocks.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getBlocks' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getFollowers( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetFollowers.Handler>, + AppBskyGraphGetFollowers.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getFollowers' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getFollows( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetFollows.Handler>, + AppBskyGraphGetFollows.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getFollows' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getList( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetList.Handler>, + AppBskyGraphGetList.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getList' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getListBlocks( + cfg: ConfigOf< + AV, + AppBskyGraphGetListBlocks.Handler>, + AppBskyGraphGetListBlocks.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.graph.getListBlocks' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + getListMutes( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetListMutes.Handler>, + AppBskyGraphGetListMutes.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getListMutes' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getLists( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetLists.Handler>, + AppBskyGraphGetLists.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getLists' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } getMutes( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphGetMutes.Handler>, + AppBskyGraphGetMutes.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.getMutes' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + getSuggestedFollowsByActor( + cfg: ConfigOf< + AV, + AppBskyGraphGetSuggestedFollowsByActor.Handler>, + AppBskyGraphGetSuggestedFollowsByActor.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.graph.getSuggestedFollowsByActor' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + muteActor( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphMuteActor.Handler>, + AppBskyGraphMuteActor.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.muteActor' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } muteActorList( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphMuteActorList.Handler>, + AppBskyGraphMuteActorList.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.muteActorList' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } unmuteActor( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphUnmuteActor.Handler>, + AppBskyGraphUnmuteActor.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.unmuteActor' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } unmuteActorList( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyGraphUnmuteActorList.Handler>, + AppBskyGraphUnmuteActorList.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.graph.unmuteActorList' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -999,7 +1344,8 @@ export class NotificationNS { getUnreadCount( cfg: ConfigOf< AV, - AppBskyNotificationGetUnreadCount.Handler> + AppBskyNotificationGetUnreadCount.Handler>, + AppBskyNotificationGetUnreadCount.HandlerReqCtx> >, ) { const nsid = 'app.bsky.notification.getUnreadCount' // @ts-ignore @@ -1009,15 +1355,31 @@ export class NotificationNS { listNotifications( cfg: ConfigOf< AV, - AppBskyNotificationListNotifications.Handler> + AppBskyNotificationListNotifications.Handler>, + AppBskyNotificationListNotifications.HandlerReqCtx> >, ) { const nsid = 'app.bsky.notification.listNotifications' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + registerPush( + cfg: ConfigOf< + AV, + AppBskyNotificationRegisterPush.Handler>, + AppBskyNotificationRegisterPush.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.notification.registerPush' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + updateSeen( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyNotificationUpdateSeen.Handler>, + AppBskyNotificationUpdateSeen.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.notification.updateSeen' // @ts-ignore return this._server.xrpc.method(nsid, cfg) @@ -1040,17 +1402,78 @@ export class UnspeccedNS { } getPopular( - cfg: ConfigOf>>, + cfg: ConfigOf< + AV, + AppBskyUnspeccedGetPopular.Handler>, + AppBskyUnspeccedGetPopular.HandlerReqCtx> + >, ) { const nsid = 'app.bsky.unspecced.getPopular' // @ts-ignore return this._server.xrpc.method(nsid, cfg) } + + getPopularFeedGenerators( + cfg: ConfigOf< + AV, + AppBskyUnspeccedGetPopularFeedGenerators.Handler>, + AppBskyUnspeccedGetPopularFeedGenerators.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.unspecced.getPopularFeedGenerators' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getTimelineSkeleton( + cfg: ConfigOf< + AV, + AppBskyUnspeccedGetTimelineSkeleton.Handler>, + AppBskyUnspeccedGetTimelineSkeleton.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.unspecced.getTimelineSkeleton' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + searchActorsSkeleton( + cfg: ConfigOf< + AV, + AppBskyUnspeccedSearchActorsSkeleton.Handler>, + AppBskyUnspeccedSearchActorsSkeleton.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.unspecced.searchActorsSkeleton' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + searchPostsSkeleton( + cfg: ConfigOf< + AV, + AppBskyUnspeccedSearchPostsSkeleton.Handler>, + AppBskyUnspeccedSearchPostsSkeleton.HandlerReqCtx> + >, + ) { + const nsid = 'app.bsky.unspecced.searchPostsSkeleton' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } } -type ConfigOf = +type SharedRateLimitOpts = { + name: string + calcKey?: (ctx: T) => string + calcPoints?: (ctx: T) => number +} +type RouteRateLimitOpts = { + durationMs: number + points: number + calcKey?: (ctx: T) => string + calcPoints?: (ctx: T) => number +} +type HandlerRateLimitOpts = SharedRateLimitOpts | RouteRateLimitOpts +type ConfigOf = | Handler | { auth?: Auth + rateLimit?: HandlerRateLimitOpts | HandlerRateLimitOpts[] handler: Handler } type ExtractAuth = Extract< diff --git a/src/lexicon/lexicons.ts b/src/lexicon/lexicons.ts index 70be29c..177b638 100644 --- a/src/lexicon/lexicons.ts +++ b/src/lexicon/lexicons.ts @@ -28,6 +28,11 @@ export const schemaDict = { type: 'ref', ref: 'lex:com.atproto.admin.defs#actionType', }, + durationInHours: { + type: 'integer', + description: + 'Indicates how long this action was meant to be in effect before automatically expiring.', + }, subject: { type: 'union', refs: [ @@ -96,11 +101,18 @@ export const schemaDict = { type: 'ref', ref: 'lex:com.atproto.admin.defs#actionType', }, + durationInHours: { + type: 'integer', + description: + 'Indicates how long this action was meant to be in effect before automatically expiring.', + }, subject: { type: 'union', refs: [ 'lex:com.atproto.admin.defs#repoView', + 'lex:com.atproto.admin.defs#repoViewNotFound', 'lex:com.atproto.admin.defs#recordView', + 'lex:com.atproto.admin.defs#recordViewNotFound', ], }, subjectBlobs: { @@ -157,6 +169,11 @@ export const schemaDict = { type: 'ref', ref: 'lex:com.atproto.admin.defs#actionType', }, + durationInHours: { + type: 'integer', + description: + 'Indicates how long this action was meant to be in effect before automatically expiring.', + }, }, }, actionReversal: { @@ -226,6 +243,9 @@ export const schemaDict = { reason: { type: 'string', }, + subjectRepoHandle: { + type: 'string', + }, subject: { type: 'union', refs: [ @@ -274,7 +294,9 @@ export const schemaDict = { type: 'union', refs: [ 'lex:com.atproto.admin.defs#repoView', + 'lex:com.atproto.admin.defs#repoViewNotFound', 'lex:com.atproto.admin.defs#recordView', + 'lex:com.atproto.admin.defs#recordViewNotFound', ], }, reportedBy: { @@ -336,6 +358,9 @@ export const schemaDict = { invitesDisabled: { type: 'boolean', }, + inviteNote: { + type: 'string', + }, }, }, repoViewDetail: { @@ -394,6 +419,19 @@ export const schemaDict = { invitesDisabled: { type: 'boolean', }, + inviteNote: { + type: 'string', + }, + }, + }, + repoViewNotFound: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, }, }, repoRef: { @@ -501,9 +539,18 @@ export const schemaDict = { }, }, }, + recordViewNotFound: { + type: 'object', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + }, + }, moderation: { type: 'object', - required: [], properties: { currentAction: { type: 'ref', @@ -613,6 +660,11 @@ export const schemaDict = { type: 'string', format: 'did', }, + note: { + type: 'string', + description: + 'Additionally add a note describing why the invites were disabled', + }, }, }, }, @@ -667,6 +719,11 @@ export const schemaDict = { type: 'string', format: 'did', }, + note: { + type: 'string', + description: + 'Additionally add a note describing why the invites were enabled', + }, }, }, }, @@ -832,6 +889,25 @@ export const schemaDict = { subject: { type: 'string', }, + ignoreSubjects: { + type: 'array', + items: { + type: 'string', + }, + }, + actionedBy: { + type: 'string', + format: 'did', + description: + 'Get all reports that were actioned by a specific moderator', + }, + reporters: { + type: 'array', + items: { + type: 'string', + }, + description: 'Filter reports made by one or more DIDs', + }, resolved: { type: 'boolean', }, @@ -853,6 +929,11 @@ export const schemaDict = { cursor: { type: 'string', }, + reverse: { + type: 'boolean', + description: + 'Reverse the order of the returned records? when true, returns reports in chronological order', + }, }, }, output: { @@ -905,6 +986,11 @@ export const schemaDict = { ref: 'lex:com.atproto.admin.defs#recordViewDetail', }, }, + errors: [ + { + name: 'RecordNotFound', + }, + ], }, }, }, @@ -932,6 +1018,11 @@ export const schemaDict = { ref: 'lex:com.atproto.admin.defs#repoViewDetail', }, }, + errors: [ + { + name: 'RepoNotFound', + }, + ], }, }, }, @@ -1022,6 +1113,10 @@ export const schemaDict = { properties: { term: { type: 'string', + description: "DEPRECATED: use 'q' instead", + }, + q: { + type: 'string', }, invitedBy: { type: 'string', @@ -1059,6 +1154,47 @@ export const schemaDict = { }, }, }, + ComAtprotoAdminSendEmail: { + lexicon: 1, + id: 'com.atproto.admin.sendEmail', + defs: { + main: { + type: 'procedure', + description: "Send email to a user's primary email address", + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['recipientDid', 'content'], + properties: { + recipientDid: { + type: 'string', + format: 'did', + }, + content: { + type: 'string', + }, + subject: { + type: 'string', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['sent'], + properties: { + sent: { + type: 'boolean', + }, + }, + }, + }, + }, + }, + }, ComAtprotoAdminTakeModerationAction: { lexicon: 1, id: 'com.atproto.admin.takeModerationAction', @@ -1109,6 +1245,11 @@ export const schemaDict = { reason: { type: 'string', }, + durationInHours: { + type: 'integer', + description: + 'Indicates how long this action was meant to be in effect before automatically expiring.', + }, createdBy: { type: 'string', format: 'did', @@ -1194,12 +1335,12 @@ export const schemaDict = { description: 'Provides the DID of a repo.', parameters: { type: 'params', + required: ['handle'], properties: { handle: { type: 'string', format: 'handle', - description: - "The handle to resolve. If not supplied, will resolve the host's own handle.", + description: 'The handle to resolve.', }, }, }, @@ -1286,6 +1427,36 @@ export const schemaDict = { }, }, }, + selfLabels: { + type: 'object', + description: + 'Metadata tags on an atproto record, published by the author within the record.', + required: ['values'], + properties: { + values: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#selfLabel', + }, + maxLength: 10, + }, + }, + }, + selfLabel: { + type: 'object', + description: + 'Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel.', + required: ['val'], + properties: { + val: { + type: 'string', + maxLength: 128, + description: + 'the short string name of the value or type of this label', + }, + }, + }, }, }, ComAtprotoLabelQueryLabels: { @@ -1512,7 +1683,7 @@ export const schemaDict = { }, reasonSexual: { type: 'token', - description: 'Unwanted or mis-labeled sexual content', + description: 'Unwanted or mislabeled sexual content', }, reasonRude: { type: 'token', @@ -1577,7 +1748,7 @@ export const schemaDict = { create: { type: 'object', description: 'Create a new record.', - required: ['action', 'collection', 'value'], + required: ['collection', 'value'], properties: { collection: { type: 'string', @@ -1585,6 +1756,7 @@ export const schemaDict = { }, rkey: { type: 'string', + maxLength: 15, }, value: { type: 'unknown', @@ -1594,7 +1766,7 @@ export const schemaDict = { update: { type: 'object', description: 'Update an existing record.', - required: ['action', 'collection', 'rkey', 'value'], + required: ['collection', 'rkey', 'value'], properties: { collection: { type: 'string', @@ -1611,7 +1783,7 @@ export const schemaDict = { delete: { type: 'object', description: 'Delete an existing record.', - required: ['action', 'collection', 'rkey'], + required: ['collection', 'rkey'], properties: { collection: { type: 'string', @@ -1650,6 +1822,7 @@ export const schemaDict = { rkey: { type: 'string', description: 'The key of the record.', + maxLength: 15, }, validate: { type: 'boolean', @@ -1971,6 +2144,7 @@ export const schemaDict = { rkey: { type: 'string', description: 'The key of the record.', + maxLength: 15, }, validate: { type: 'boolean', @@ -2021,41 +2195,6 @@ export const schemaDict = { }, }, }, - ComAtprotoRepoRebaseRepo: { - lexicon: 1, - id: 'com.atproto.repo.rebaseRepo', - defs: { - main: { - type: 'procedure', - description: 'Simple rebase of repo that deletes history', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['repo'], - properties: { - repo: { - type: 'string', - format: 'at-identifier', - description: 'The handle or DID of the repo.', - }, - swapCommit: { - type: 'string', - format: 'cid', - description: - 'Compare and swap with the previous commit by cid.', - }, - }, - }, - }, - errors: [ - { - name: 'InvalidSwap', - }, - ], - }, - }, - }, ComAtprotoRepoStrongRef: { lexicon: 1, id: 'com.atproto.repo.strongRef', @@ -2858,7 +2997,7 @@ export const schemaDict = { defs: { main: { type: 'query', - description: 'Gets the repo state.', + description: 'DEPRECATED - please use com.atproto.sync.getRepo instead', parameters: { type: 'params', required: ['did'], @@ -2868,12 +3007,6 @@ export const schemaDict = { format: 'did', description: 'The DID of the repo.', }, - commit: { - type: 'string', - format: 'cid', - description: - 'The commit to get the checkout from. Defaults to current HEAD.', - }, }, }, output: { @@ -2882,60 +3015,14 @@ export const schemaDict = { }, }, }, - ComAtprotoSyncGetCommitPath: { - lexicon: 1, - id: 'com.atproto.sync.getCommitPath', - defs: { - main: { - type: 'query', - description: 'Gets the path of repo commits', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - description: 'The DID of the repo.', - }, - latest: { - type: 'string', - format: 'cid', - description: 'The most recent commit', - }, - earliest: { - type: 'string', - format: 'cid', - description: 'The earliest commit to start from', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['commits'], - properties: { - commits: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - }, - }, - }, - }, - }, - }, ComAtprotoSyncGetHead: { lexicon: 1, id: 'com.atproto.sync.getHead', defs: { main: { type: 'query', - description: 'Gets the current HEAD CID of a repo.', + description: + 'DEPRECATED - please use com.atproto.sync.getLatestCommit instead', parameters: { type: 'params', required: ['did'], @@ -2960,6 +3047,53 @@ export const schemaDict = { }, }, }, + errors: [ + { + name: 'HeadNotFound', + }, + ], + }, + }, + }, + ComAtprotoSyncGetLatestCommit: { + lexicon: 1, + id: 'com.atproto.sync.getLatestCommit', + defs: { + main: { + type: 'query', + description: 'Gets the current commit CID & revision of the repo.', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['cid', 'rev'], + properties: { + cid: { + type: 'string', + format: 'cid', + }, + rev: { + type: 'string', + }, + }, + }, + }, + errors: [ + { + name: 'RepoNotFound', + }, + ], }, }, }, @@ -3006,7 +3140,8 @@ export const schemaDict = { defs: { main: { type: 'query', - description: 'Gets the repo state.', + description: + "Gets the did's repo, optionally catching up from a specific revision.", parameters: { type: 'params', required: ['did'], @@ -3016,16 +3151,9 @@ export const schemaDict = { format: 'did', description: 'The DID of the repo.', }, - earliest: { + since: { type: 'string', - format: 'cid', - description: - 'The earliest commit in the commit range (not inclusive)', - }, - latest: { - type: 'string', - format: 'cid', - description: 'The latest commit in the commit range (inclusive)', + description: 'The revision of the repo to catch up from.', }, }, }, @@ -3041,7 +3169,7 @@ export const schemaDict = { defs: { main: { type: 'query', - description: 'List blob cids for some range of commits', + description: 'List blob cids since some revision', parameters: { type: 'params', required: ['did'], @@ -3051,15 +3179,18 @@ export const schemaDict = { format: 'did', description: 'The DID of the repo.', }, - latest: { + since: { type: 'string', - format: 'cid', - description: 'The most recent commit', + description: 'Optional revision of the repo to list blobs since', }, - earliest: { + limit: { + type: 'integer', + minimum: 1, + maximum: 1000, + default: 500, + }, + cursor: { type: 'string', - format: 'cid', - description: 'The earliest commit to start from', }, }, }, @@ -3069,6 +3200,9 @@ export const schemaDict = { type: 'object', required: ['cids'], properties: { + cursor: { + type: 'string', + }, cids: { type: 'array', items: { @@ -3144,17 +3278,20 @@ export const schemaDict = { id: 'com.atproto.sync.notifyOfUpdate', defs: { main: { - type: 'query', + type: 'procedure', 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.', - parameters: { - type: 'params', - required: ['hostname'], - properties: { - hostname: { - type: 'string', - description: - 'Hostname of the service that is notifying of update.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['hostname'], + properties: { + hostname: { + type: 'string', + description: + 'Hostname of the service that is notifying of update.', + }, }, }, }, @@ -3166,16 +3303,19 @@ export const schemaDict = { id: 'com.atproto.sync.requestCrawl', defs: { main: { - type: 'query', + type: 'procedure', description: 'Request a service to persistently crawl hosted repos.', - parameters: { - type: 'params', - required: ['hostname'], - properties: { - hostname: { - type: 'string', - description: - 'Hostname of the service that is requesting to be crawled.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['hostname'], + properties: { + hostname: { + type: 'string', + description: + 'Hostname of the service that is requesting to be crawled.', + }, }, }, }, @@ -3214,6 +3354,9 @@ export const schemaDict = { { name: 'FutureCursor', }, + { + name: 'ConsumerTooSlow', + }, ], }, commit: { @@ -3224,13 +3367,14 @@ export const schemaDict = { 'tooBig', 'repo', 'commit', - 'prev', + 'rev', + 'since', 'blocks', 'ops', 'blobs', 'time', ], - nullable: ['prev'], + nullable: ['prev', 'since'], properties: { seq: { type: 'integer', @@ -3251,6 +3395,14 @@ export const schemaDict = { prev: { type: 'cid-link', }, + rev: { + type: 'string', + description: 'The rev of the emitted commit', + }, + since: { + type: 'string', + description: 'The rev of the last emitted commit from this repo', + }, blocks: { type: 'bytes', description: 'CAR file containing relevant blocks', @@ -3350,6 +3502,8 @@ export const schemaDict = { }, repoOp: { type: 'object', + description: + "A repo operation, ie a write of a single record. For creates and updates, cid is the record's CID as of this operation. For deletes, it's null.", required: ['action', 'path', 'cid'], nullable: ['cid'], properties: { @@ -3535,6 +3689,10 @@ export const schemaDict = { refs: [ 'lex:app.bsky.actor.defs#adultContentPref', 'lex:app.bsky.actor.defs#contentLabelPref', + 'lex:app.bsky.actor.defs#savedFeedsPref', + 'lex:app.bsky.actor.defs#personalDetailsPref', + 'lex:app.bsky.actor.defs#feedViewPref', + 'lex:app.bsky.actor.defs#threadViewPref', ], }, }, @@ -3561,6 +3719,83 @@ export const schemaDict = { }, }, }, + savedFeedsPref: { + type: 'object', + required: ['pinned', 'saved'], + properties: { + pinned: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + saved: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + }, + }, + personalDetailsPref: { + type: 'object', + properties: { + birthDate: { + type: 'string', + format: 'datetime', + description: 'The birth date of the owner of the account.', + }, + }, + }, + feedViewPref: { + type: 'object', + required: ['feed'], + properties: { + feed: { + type: 'string', + description: + 'The URI of the feed, or an identifier which describes the feed.', + }, + hideReplies: { + type: 'boolean', + description: 'Hide replies in the feed.', + }, + hideRepliesByUnfollowed: { + type: 'boolean', + description: + 'Hide replies in the feed if they are not by followed users.', + }, + hideRepliesByLikeCount: { + type: 'integer', + description: + 'Hide replies in the feed if they do not have this number of likes.', + }, + hideReposts: { + type: 'boolean', + description: 'Hide reposts in the feed.', + }, + hideQuotePosts: { + type: 'boolean', + description: 'Hide quote posts in the feed.', + }, + }, + }, + threadViewPref: { + type: 'object', + properties: { + sort: { + type: 'string', + description: 'Sorting mode.', + knownValues: ['oldest', 'newest', 'most-likes', 'random'], + }, + prioritizeFollowedUsers: { + type: 'boolean', + description: 'Show followed users at the top of all replies.', + }, + }, + }, }, }, AppBskyActorGetPreferences: { @@ -3729,6 +3964,10 @@ export const schemaDict = { accept: ['image/png', 'image/jpeg'], maxSize: 1000000, }, + labels: { + type: 'union', + refs: ['lex:com.atproto.label.defs#selfLabels'], + }, }, }, }, @@ -3763,18 +4002,24 @@ export const schemaDict = { defs: { main: { type: 'query', - description: 'Find actors matching search criteria.', + description: 'Find actors (profiles) matching search criteria.', parameters: { type: 'params', properties: { term: { type: 'string', + description: "DEPRECATED: use 'q' instead", + }, + q: { + type: 'string', + description: + 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended', }, limit: { type: 'integer', minimum: 1, maximum: 100, - default: 50, + default: 25, }, cursor: { type: 'string', @@ -3815,12 +4060,17 @@ export const schemaDict = { properties: { term: { type: 'string', + description: "DEPRECATED: use 'q' instead", + }, + q: { + type: 'string', + description: 'search query prefix; not a full query string', }, limit: { type: 'integer', minimum: 1, maximum: 100, - default: 50, + default: 10, }, }, }, @@ -3942,6 +4192,26 @@ export const schemaDict = { alt: { type: 'string', }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#aspectRatio', + }, + }, + }, + aspectRatio: { + type: 'object', + description: + 'width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.', + required: ['width', 'height'], + properties: { + width: { + type: 'integer', + minimum: 1, + }, + height: { + type: 'integer', + minimum: 1, + }, }, }, view: { @@ -3971,6 +4241,10 @@ export const schemaDict = { alt: { type: 'string', }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#aspectRatio', + }, }, }, }, @@ -4002,6 +4276,7 @@ export const schemaDict = { 'lex:app.bsky.embed.record#viewNotFound', 'lex:app.bsky.embed.record#viewBlocked', 'lex:app.bsky.feed.defs#generatorView', + 'lex:app.bsky.graph.defs#listView', ], }, }, @@ -4052,22 +4327,34 @@ export const schemaDict = { }, viewNotFound: { type: 'object', - required: ['uri'], + required: ['uri', 'notFound'], properties: { uri: { type: 'string', format: 'at-uri', }, + notFound: { + type: 'boolean', + const: true, + }, }, }, viewBlocked: { type: 'object', - required: ['uri'], + required: ['uri', 'blocked', 'author'], properties: { uri: { type: 'string', format: 'at-uri', }, + blocked: { + type: 'boolean', + const: true, + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#blockedAuthor', + }, }, }, }, @@ -4167,6 +4454,10 @@ export const schemaDict = { ref: 'lex:com.atproto.label.defs#label', }, }, + threadgate: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#threadgateView', + }, }, }, viewerState: { @@ -4263,6 +4554,10 @@ export const schemaDict = { ], }, }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#viewerThreadState', + }, }, }, notFoundPost: { @@ -4281,7 +4576,7 @@ export const schemaDict = { }, blockedPost: { type: 'object', - required: ['uri', 'blocked'], + required: ['uri', 'blocked', 'author'], properties: { uri: { type: 'string', @@ -4291,11 +4586,37 @@ export const schemaDict = { type: 'boolean', const: true, }, + author: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#blockedAuthor', + }, + }, + }, + blockedAuthor: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + }, + }, + viewerThreadState: { + type: 'object', + properties: { + canReply: { + type: 'boolean', + }, }, }, generatorView: { type: 'object', - required: ['uri', 'cid', 'creator', 'indexedAt'], + required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'], properties: { uri: { type: 'string', @@ -4348,9 +4669,6 @@ export const schemaDict = { generatorViewerState: { type: 'object', properties: { - saved: { - type: 'boolean', - }, like: { type: 'string', format: 'at-uri', @@ -4377,7 +4695,30 @@ export const schemaDict = { properties: { repost: { type: 'string', - ref: 'at-uri', + format: 'at-uri', + }, + }, + }, + threadgateView: { + type: 'object', + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + record: { + type: 'unknown', + }, + lists: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewBasic', + }, }, }, }, @@ -4449,7 +4790,7 @@ export const schemaDict = { key: 'any', record: { type: 'object', - required: ['did', 'createdAt'], + required: ['did', 'displayName', 'createdAt'], properties: { did: { type: 'string', @@ -4457,8 +4798,8 @@ export const schemaDict = { }, displayName: { type: 'string', - maxGraphemes: 64, - maxLength: 640, + maxGraphemes: 24, + maxLength: 240, }, description: { type: 'string', @@ -4477,6 +4818,10 @@ export const schemaDict = { accept: ['image/png', 'image/jpeg'], maxSize: 1000000, }, + labels: { + type: 'union', + refs: ['lex:com.atproto.label.defs#selfLabels'], + }, createdAt: { type: 'string', format: 'datetime', @@ -4534,6 +4879,62 @@ export const schemaDict = { }, }, }, + AppBskyFeedGetActorLikes: { + lexicon: 1, + id: 'app.bsky.feed.getActorLikes', + defs: { + main: { + type: 'query', + description: 'A view of the posts liked by an actor.', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + errors: [ + { + name: 'BlockedActor', + }, + { + name: 'BlockedByActor', + }, + ], + }, + }, + }, AppBskyFeedGetAuthorFeed: { lexicon: 1, id: 'app.bsky.feed.getAuthorFeed', @@ -4558,6 +4959,15 @@ export const schemaDict = { cursor: { type: 'string', }, + filter: { + type: 'string', + knownValues: [ + 'posts_with_replies', + 'posts_no_replies', + 'posts_with_media', + ], + default: 'posts_with_replies', + }, }, }, output: { @@ -4684,6 +5094,45 @@ export const schemaDict = { }, }, }, + AppBskyFeedGetFeedGenerators: { + lexicon: 1, + id: 'app.bsky.feed.getFeedGenerators', + defs: { + main: { + type: 'query', + description: 'Get information about a list of feed generators', + parameters: { + type: 'params', + required: ['feeds'], + properties: { + feeds: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feeds'], + properties: { + feeds: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + }, + }, + }, + }, + }, + }, + }, AppBskyFeedGetFeedSkeleton: { lexicon: 1, id: 'app.bsky.feed.getFeedSkeleton', @@ -4814,6 +5263,59 @@ export const schemaDict = { }, }, }, + AppBskyFeedGetListFeed: { + lexicon: 1, + id: 'app.bsky.feed.getListFeed', + defs: { + main: { + type: 'query', + description: 'A view of a recent posts from actors in a list', + parameters: { + type: 'params', + required: ['list'], + properties: { + list: { + type: 'string', + format: 'at-uri', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + errors: [ + { + name: 'UnknownList', + }, + ], + }, + }, + }, AppBskyFeedGetPostThread: { lexicon: 1, id: 'app.bsky.feed.getPostThread', @@ -4830,6 +5332,15 @@ export const schemaDict = { }, depth: { type: 'integer', + default: 6, + minimum: 0, + maximum: 1000, + }, + parentHeight: { + type: 'integer', + default: 80, + minimum: 0, + maximum: 1000, }, }, }, @@ -4957,13 +5468,13 @@ export const schemaDict = { }, }, }, - AppBskyFeedGetSavedFeeds: { + AppBskyFeedGetSuggestedFeeds: { lexicon: 1, - id: 'app.bsky.feed.getSavedFeeds', + id: 'app.bsky.feed.getSuggestedFeeds', defs: { main: { type: 'query', - description: "Retrieve a list of the authenticated user's saved feeds", + description: 'Get a list of suggested feeds for the viewer.', parameters: { type: 'params', properties: { @@ -5114,6 +5625,28 @@ export const schemaDict = { 'lex:app.bsky.embed.recordWithMedia', ], }, + langs: { + type: 'array', + maxLength: 3, + items: { + type: 'string', + format: 'language', + }, + }, + labels: { + type: 'union', + refs: ['lex:com.atproto.label.defs#selfLabels'], + }, + tags: { + type: 'array', + maxLength: 8, + items: { + type: 'string', + maxLength: 640, + maxGraphemes: 64, + }, + description: 'Additional non-inline tags describing this post.', + }, createdAt: { type: 'string', format: 'datetime', @@ -5195,47 +5728,121 @@ export const schemaDict = { }, }, }, - AppBskyFeedSaveFeed: { + AppBskyFeedSearchPosts: { lexicon: 1, - id: 'app.bsky.feed.saveFeed', + id: 'app.bsky.feed.searchPosts', defs: { main: { - type: 'procedure', - description: 'Save a 3rd party feed for use across clients', - input: { + type: 'query', + description: 'Find posts matching search criteria', + parameters: { + type: 'params', + required: ['q'], + properties: { + q: { + type: 'string', + description: + 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 25, + }, + cursor: { + type: 'string', + description: + 'optional pagination mechanism; may not necessarily allow scrolling through entire result set', + }, + }, + }, + output: { encoding: 'application/json', schema: { type: 'object', - required: ['feed'], + required: ['posts'], properties: { - feed: { + cursor: { type: 'string', - format: 'at-uri', + }, + hitsTotal: { + type: 'integer', + description: + 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits', + }, + posts: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, }, }, }, }, + errors: [ + { + name: 'BadQueryString', + }, + ], }, }, }, - AppBskyFeedUnsaveFeed: { + AppBskyFeedThreadgate: { lexicon: 1, - id: 'app.bsky.feed.unsaveFeed', + id: 'app.bsky.feed.threadgate', defs: { main: { - type: 'procedure', - description: 'Unsave a 3rd party feed', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['feed'], - properties: { - feed: { - type: 'string', - format: 'at-uri', + type: 'record', + key: 'tid', + description: + "Defines interaction gating rules for a thread. The rkey of the threadgate record should match the rkey of the thread's root post.", + record: { + type: 'object', + required: ['post', 'createdAt'], + properties: { + post: { + type: 'string', + format: 'at-uri', + }, + allow: { + type: 'array', + maxLength: 5, + items: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.threadgate#mentionRule', + 'lex:app.bsky.feed.threadgate#followingRule', + 'lex:app.bsky.feed.threadgate#listRule', + ], }, }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + mentionRule: { + type: 'object', + description: 'Allow replies from actors mentioned in your post.', + properties: {}, + }, + followingRule: { + type: 'object', + description: 'Allow replies from actors you follow.', + properties: {}, + }, + listRule: { + type: 'object', + description: 'Allow replies from actors on a list.', + required: ['list'], + properties: { + list: { + type: 'string', + format: 'at-uri', }, }, }, @@ -5272,12 +5879,16 @@ export const schemaDict = { defs: { listViewBasic: { type: 'object', - required: ['uri', 'creator', 'name', 'purpose'], + required: ['uri', 'cid', 'name', 'purpose'], properties: { uri: { type: 'string', format: 'at-uri', }, + cid: { + type: 'string', + format: 'cid', + }, name: { type: 'string', maxLength: 64, @@ -5302,12 +5913,16 @@ export const schemaDict = { }, listView: { type: 'object', - required: ['uri', 'creator', 'name', 'purpose', 'indexedAt'], + required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'], properties: { uri: { type: 'string', format: 'at-uri', }, + cid: { + type: 'string', + format: 'cid', + }, creator: { type: 'ref', ref: 'lex:app.bsky.actor.defs#profileView', @@ -5358,19 +5973,31 @@ export const schemaDict = { }, listPurpose: { type: 'string', - knownValues: ['app.bsky.graph.defs#modlist'], + knownValues: [ + 'app.bsky.graph.defs#modlist', + 'app.bsky.graph.defs#curatelist', + ], }, modlist: { type: 'token', description: 'A list of actors to apply an aggregate moderation action (mute/block) on', }, + curatelist: { + type: 'token', + description: + 'A list of actors used for curation purposes such as list feeds or interaction gating', + }, listViewerState: { type: 'object', properties: { muted: { type: 'boolean', }, + blocked: { + type: 'string', + format: 'at-uri', + }, }, }, }, @@ -5599,6 +6226,49 @@ export const schemaDict = { }, }, }, + AppBskyGraphGetListBlocks: { + lexicon: 1, + id: 'app.bsky.graph.getListBlocks', + defs: { + main: { + type: 'query', + description: "Which lists is the requester's account blocking?", + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['lists'], + properties: { + cursor: { + type: 'string', + }, + lists: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listView', + }, + }, + }, + }, + }, + }, + }, + }, AppBskyGraphGetListMutes: { lexicon: 1, id: 'app.bsky.graph.getListMutes', @@ -5733,6 +6403,42 @@ export const schemaDict = { }, }, }, + AppBskyGraphGetSuggestedFollowsByActor: { + lexicon: 1, + id: 'app.bsky.graph.getSuggestedFollowsByActor', + defs: { + main: { + type: 'query', + description: 'Get suggested follows related to a given actor.', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['suggestions'], + properties: { + suggestions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, AppBskyGraphList: { lexicon: 1, id: 'app.bsky.graph.list', @@ -5771,6 +6477,35 @@ export const schemaDict = { accept: ['image/png', 'image/jpeg'], maxSize: 1000000, }, + labels: { + type: 'union', + refs: ['lex:com.atproto.label.defs#selfLabels'], + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + AppBskyGraphListblock: { + lexicon: 1, + id: 'app.bsky.graph.listblock', + defs: { + main: { + type: 'record', + description: 'A block of an entire list of actors.', + key: 'tid', + record: { + type: 'object', + required: ['subject', 'createdAt'], + properties: { + subject: { + type: 'string', + format: 'at-uri', + }, createdAt: { type: 'string', format: 'datetime', @@ -6037,6 +6772,39 @@ export const schemaDict = { }, }, }, + AppBskyNotificationRegisterPush: { + lexicon: 1, + id: 'app.bsky.notification.registerPush', + defs: { + main: { + type: 'procedure', + description: 'Register for push notifications with a service', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['serviceDid', 'token', 'platform', 'appId'], + properties: { + serviceDid: { + type: 'string', + format: 'did', + }, + token: { + type: 'string', + }, + platform: { + type: 'string', + knownValues: ['ios', 'android', 'web'], + }, + appId: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, AppBskyNotificationUpdateSeen: { lexicon: 1, id: 'app.bsky.notification.updateSeen', @@ -6079,6 +6847,7 @@ export const schemaDict = { refs: [ 'lex:app.bsky.richtext.facet#mention', 'lex:app.bsky.richtext.facet#link', + 'lex:app.bsky.richtext.facet#tag', ], }, }, @@ -6106,6 +6875,18 @@ export const schemaDict = { }, }, }, + tag: { + type: 'object', + description: 'A hashtag.', + required: ['tag'], + properties: { + tag: { + type: 'string', + maxLength: 640, + maxGraphemes: 64, + }, + }, + }, byteSlice: { type: 'object', description: @@ -6124,13 +6905,40 @@ export const schemaDict = { }, }, }, + AppBskyUnspeccedDefs: { + lexicon: 1, + id: 'app.bsky.unspecced.defs', + defs: { + skeletonSearchPost: { + type: 'object', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + }, + }, + skeletonSearchActor: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + }, AppBskyUnspeccedGetPopular: { lexicon: 1, id: 'app.bsky.unspecced.getPopular', defs: { main: { type: 'query', - description: 'An unspecced view of globally popular items', + description: + 'DEPRECATED: will be removed soon, please find a feed generator alternative', parameters: { type: 'params', properties: { @@ -6171,6 +6979,226 @@ export const schemaDict = { }, }, }, + AppBskyUnspeccedGetPopularFeedGenerators: { + lexicon: 1, + id: 'app.bsky.unspecced.getPopularFeedGenerators', + defs: { + main: { + type: 'query', + description: 'An unspecced view of globally popular feed generators', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + query: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feeds'], + properties: { + cursor: { + type: 'string', + }, + feeds: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyUnspeccedGetTimelineSkeleton: { + lexicon: 1, + id: 'app.bsky.unspecced.getTimelineSkeleton', + defs: { + main: { + type: 'query', + description: 'A skeleton of a timeline - UNSPECCED & WILL GO AWAY SOON', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#skeletonFeedPost', + }, + }, + }, + }, + }, + errors: [ + { + name: 'UnknownFeed', + }, + ], + }, + }, + }, + AppBskyUnspeccedSearchActorsSkeleton: { + lexicon: 1, + id: 'app.bsky.unspecced.searchActorsSkeleton', + defs: { + main: { + type: 'query', + description: 'Backend Actors (profile) search, returning only skeleton', + parameters: { + type: 'params', + required: ['q'], + properties: { + q: { + type: 'string', + description: + 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax', + }, + typeahead: { + type: 'boolean', + description: "if true, acts as fast/simple 'typeahead' query", + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 25, + }, + cursor: { + type: 'string', + description: + 'optional pagination mechanism; may not necessarily allow scrolling through entire result set', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actors'], + properties: { + cursor: { + type: 'string', + }, + hitsTotal: { + type: 'integer', + description: + 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits', + }, + actors: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.unspecced.defs#skeletonSearchActor', + }, + }, + }, + }, + }, + errors: [ + { + name: 'BadQueryString', + }, + ], + }, + }, + }, + AppBskyUnspeccedSearchPostsSkeleton: { + lexicon: 1, + id: 'app.bsky.unspecced.searchPostsSkeleton', + defs: { + main: { + type: 'query', + description: 'Backend Posts search, returning only skeleton', + parameters: { + type: 'params', + required: ['q'], + properties: { + q: { + type: 'string', + description: + 'search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 25, + }, + cursor: { + type: 'string', + description: + 'optional pagination mechanism; may not necessarily allow scrolling through entire result set', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['posts'], + properties: { + cursor: { + type: 'string', + }, + hitsTotal: { + type: 'integer', + description: + 'count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits', + }, + posts: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.unspecced.defs#skeletonSearchPost', + }, + }, + }, + }, + }, + errors: [ + { + name: 'BadQueryString', + }, + ], + }, + }, + }, } export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) @@ -6192,6 +7220,7 @@ export const ids = { ComAtprotoAdminReverseModerationAction: 'com.atproto.admin.reverseModerationAction', ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', + ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail', ComAtprotoAdminTakeModerationAction: 'com.atproto.admin.takeModerationAction', ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', @@ -6209,7 +7238,6 @@ export const ids = { ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord', ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords', ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord', - ComAtprotoRepoRebaseRepo: 'com.atproto.repo.rebaseRepo', ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob', ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount', @@ -6235,8 +7263,8 @@ export const ids = { ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob', ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks', ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout', - ComAtprotoSyncGetCommitPath: 'com.atproto.sync.getCommitPath', ComAtprotoSyncGetHead: 'com.atproto.sync.getHead', + ComAtprotoSyncGetLatestCommit: 'com.atproto.sync.getLatestCommit', ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord', ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo', ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs', @@ -6261,21 +7289,24 @@ export const ids = { AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator', AppBskyFeedGenerator: 'app.bsky.feed.generator', AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds', + AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes', AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed', AppBskyFeedGetFeed: 'app.bsky.feed.getFeed', AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator', + AppBskyFeedGetFeedGenerators: 'app.bsky.feed.getFeedGenerators', AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton', AppBskyFeedGetLikes: 'app.bsky.feed.getLikes', + AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed', AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread', AppBskyFeedGetPosts: 'app.bsky.feed.getPosts', AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy', - AppBskyFeedGetSavedFeeds: 'app.bsky.feed.getSavedFeeds', + AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds', AppBskyFeedGetTimeline: 'app.bsky.feed.getTimeline', AppBskyFeedLike: 'app.bsky.feed.like', AppBskyFeedPost: 'app.bsky.feed.post', AppBskyFeedRepost: 'app.bsky.feed.repost', - AppBskyFeedSaveFeed: 'app.bsky.feed.saveFeed', - AppBskyFeedUnsaveFeed: 'app.bsky.feed.unsaveFeed', + AppBskyFeedSearchPosts: 'app.bsky.feed.searchPosts', + AppBskyFeedThreadgate: 'app.bsky.feed.threadgate', AppBskyGraphBlock: 'app.bsky.graph.block', AppBskyGraphDefs: 'app.bsky.graph.defs', AppBskyGraphFollow: 'app.bsky.graph.follow', @@ -6283,10 +7314,14 @@ export const ids = { AppBskyGraphGetFollowers: 'app.bsky.graph.getFollowers', AppBskyGraphGetFollows: 'app.bsky.graph.getFollows', AppBskyGraphGetList: 'app.bsky.graph.getList', + AppBskyGraphGetListBlocks: 'app.bsky.graph.getListBlocks', AppBskyGraphGetListMutes: 'app.bsky.graph.getListMutes', AppBskyGraphGetLists: 'app.bsky.graph.getLists', AppBskyGraphGetMutes: 'app.bsky.graph.getMutes', + AppBskyGraphGetSuggestedFollowsByActor: + 'app.bsky.graph.getSuggestedFollowsByActor', AppBskyGraphList: 'app.bsky.graph.list', + AppBskyGraphListblock: 'app.bsky.graph.listblock', AppBskyGraphListitem: 'app.bsky.graph.listitem', AppBskyGraphMuteActor: 'app.bsky.graph.muteActor', AppBskyGraphMuteActorList: 'app.bsky.graph.muteActorList', @@ -6295,7 +7330,15 @@ export const ids = { AppBskyNotificationGetUnreadCount: 'app.bsky.notification.getUnreadCount', AppBskyNotificationListNotifications: 'app.bsky.notification.listNotifications', + AppBskyNotificationRegisterPush: 'app.bsky.notification.registerPush', AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', AppBskyRichtextFacet: 'app.bsky.richtext.facet', + AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular', + AppBskyUnspeccedGetPopularFeedGenerators: + 'app.bsky.unspecced.getPopularFeedGenerators', + AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton', + AppBskyUnspeccedSearchActorsSkeleton: + 'app.bsky.unspecced.searchActorsSkeleton', + AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton', } diff --git a/src/lexicon/types/app/bsky/actor/defs.ts b/src/lexicon/types/app/bsky/actor/defs.ts index deb26d7..b24b04b 100644 --- a/src/lexicon/types/app/bsky/actor/defs.ts +++ b/src/lexicon/types/app/bsky/actor/defs.ts @@ -107,6 +107,10 @@ export function validateViewerState(v: unknown): ValidationResult { export type Preferences = ( | AdultContentPref | ContentLabelPref + | SavedFeedsPref + | PersonalDetailsPref + | FeedViewPref + | ThreadViewPref | { $type: string; [k: string]: unknown } )[] @@ -144,3 +148,87 @@ export function isContentLabelPref(v: unknown): v is ContentLabelPref { export function validateContentLabelPref(v: unknown): ValidationResult { return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v) } + +export interface SavedFeedsPref { + pinned: string[] + saved: string[] + [k: string]: unknown +} + +export function isSavedFeedsPref(v: unknown): v is SavedFeedsPref { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#savedFeedsPref' + ) +} + +export function validateSavedFeedsPref(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#savedFeedsPref', v) +} + +export interface PersonalDetailsPref { + /** The birth date of the owner of the account. */ + birthDate?: string + [k: string]: unknown +} + +export function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#personalDetailsPref' + ) +} + +export function validatePersonalDetailsPref(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v) +} + +export interface FeedViewPref { + /** The URI of the feed, or an identifier which describes the feed. */ + feed: string + /** Hide replies in the feed. */ + hideReplies?: boolean + /** Hide replies in the feed if they are not by followed users. */ + hideRepliesByUnfollowed?: boolean + /** Hide replies in the feed if they do not have this number of likes. */ + hideRepliesByLikeCount?: number + /** Hide reposts in the feed. */ + hideReposts?: boolean + /** Hide quote posts in the feed. */ + hideQuotePosts?: boolean + [k: string]: unknown +} + +export function isFeedViewPref(v: unknown): v is FeedViewPref { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#feedViewPref' + ) +} + +export function validateFeedViewPref(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#feedViewPref', v) +} + +export interface ThreadViewPref { + /** Sorting mode. */ + sort?: 'oldest' | 'newest' | 'most-likes' | 'random' | (string & {}) + /** Show followed users at the top of all replies. */ + prioritizeFollowedUsers?: boolean + [k: string]: unknown +} + +export function isThreadViewPref(v: unknown): v is ThreadViewPref { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#threadViewPref' + ) +} + +export function validateThreadViewPref(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#threadViewPref', v) +} diff --git a/src/lexicon/types/app/bsky/actor/getPreferences.ts b/src/lexicon/types/app/bsky/actor/getPreferences.ts index 018905c..88d78a5 100644 --- a/src/lexicon/types/app/bsky/actor/getPreferences.ts +++ b/src/lexicon/types/app/bsky/actor/getPreferences.ts @@ -23,6 +23,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -31,10 +32,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/getProfile.ts b/src/lexicon/types/app/bsky/actor/getProfile.ts index b5ed609..802afda 100644 --- a/src/lexicon/types/app/bsky/actor/getProfile.ts +++ b/src/lexicon/types/app/bsky/actor/getProfile.ts @@ -20,6 +20,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -28,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/getProfiles.ts b/src/lexicon/types/app/bsky/actor/getProfiles.ts index 992261e..2549b26 100644 --- a/src/lexicon/types/app/bsky/actor/getProfiles.ts +++ b/src/lexicon/types/app/bsky/actor/getProfiles.ts @@ -25,6 +25,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -33,10 +34,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/getSuggestions.ts b/src/lexicon/types/app/bsky/actor/getSuggestions.ts index a376212..a6d4d61 100644 --- a/src/lexicon/types/app/bsky/actor/getSuggestions.ts +++ b/src/lexicon/types/app/bsky/actor/getSuggestions.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/profile.ts b/src/lexicon/types/app/bsky/actor/profile.ts index 2d4bf52..7dbc4c1 100644 --- a/src/lexicon/types/app/bsky/actor/profile.ts +++ b/src/lexicon/types/app/bsky/actor/profile.ts @@ -5,12 +5,16 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { displayName?: string description?: string avatar?: BlobRef banner?: BlobRef + labels?: + | ComAtprotoLabelDefs.SelfLabels + | { $type: string; [k: string]: unknown } [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/actor/putPreferences.ts b/src/lexicon/types/app/bsky/actor/putPreferences.ts index ba0531c..1e5ee2d 100644 --- a/src/lexicon/types/app/bsky/actor/putPreferences.ts +++ b/src/lexicon/types/app/bsky/actor/putPreferences.ts @@ -27,10 +27,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/searchActors.ts b/src/lexicon/types/app/bsky/actor/searchActors.ts index 8c5cf57..0222f36 100644 --- a/src/lexicon/types/app/bsky/actor/searchActors.ts +++ b/src/lexicon/types/app/bsky/actor/searchActors.ts @@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server' import * as AppBskyActorDefs from './defs' export interface QueryParams { + /** DEPRECATED: use 'q' instead */ term?: string + /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */ + q?: string limit: number cursor?: string } @@ -28,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +40,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts b/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts index 7dfae72..ba0d624 100644 --- a/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +++ b/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts @@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server' import * as AppBskyActorDefs from './defs' export interface QueryParams { + /** DEPRECATED: use 'q' instead */ term?: string + /** search query prefix; not a full query string */ + q?: string limit: number } @@ -26,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -34,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/embed/images.ts b/src/lexicon/types/app/bsky/embed/images.ts index 422b036..4864fad 100644 --- a/src/lexicon/types/app/bsky/embed/images.ts +++ b/src/lexicon/types/app/bsky/embed/images.ts @@ -27,6 +27,7 @@ export function validateMain(v: unknown): ValidationResult { export interface Image { image: BlobRef alt: string + aspectRatio?: AspectRatio [k: string]: unknown } @@ -40,6 +41,25 @@ export function validateImage(v: unknown): ValidationResult { return lexicons.validate('app.bsky.embed.images#image', v) } +/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */ +export interface AspectRatio { + width: number + height: number + [k: string]: unknown +} + +export function isAspectRatio(v: unknown): v is AspectRatio { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.embed.images#aspectRatio' + ) +} + +export function validateAspectRatio(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.images#aspectRatio', v) +} + export interface View { images: ViewImage[] [k: string]: unknown @@ -59,6 +79,7 @@ export interface ViewImage { thumb: string fullsize: string alt: string + aspectRatio?: AspectRatio [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/embed/record.ts b/src/lexicon/types/app/bsky/embed/record.ts index c45049b..cea5742 100644 --- a/src/lexicon/types/app/bsky/embed/record.ts +++ b/src/lexicon/types/app/bsky/embed/record.ts @@ -7,6 +7,7 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' import * as AppBskyFeedDefs from '../feed/defs' +import * as AppBskyGraphDefs from '../graph/defs' import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' import * as AppBskyEmbedImages from './images' @@ -37,6 +38,7 @@ export interface View { | ViewNotFound | ViewBlocked | AppBskyFeedDefs.GeneratorView + | AppBskyGraphDefs.ListView | { $type: string; [k: string]: unknown } [k: string]: unknown } @@ -82,6 +84,7 @@ export function validateViewRecord(v: unknown): ValidationResult { export interface ViewNotFound { uri: string + notFound: true [k: string]: unknown } @@ -99,6 +102,8 @@ export function validateViewNotFound(v: unknown): ValidationResult { export interface ViewBlocked { uri: string + blocked: true + author: AppBskyFeedDefs.BlockedAuthor [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/feed/defs.ts b/src/lexicon/types/app/bsky/feed/defs.ts index 1272c22..08d34d8 100644 --- a/src/lexicon/types/app/bsky/feed/defs.ts +++ b/src/lexicon/types/app/bsky/feed/defs.ts @@ -12,6 +12,7 @@ import * as AppBskyEmbedRecord from '../embed/record' import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' import * as AppBskyRichtextFacet from '../richtext/facet' +import * as AppBskyGraphDefs from '../graph/defs' export interface PostView { uri: string @@ -30,6 +31,7 @@ export interface PostView { indexedAt: string viewer?: ViewerState labels?: ComAtprotoLabelDefs.Label[] + threadgate?: ThreadgateView [k: string]: unknown } @@ -135,6 +137,7 @@ export interface ThreadViewPost { | BlockedPost | { $type: string; [k: string]: unknown } )[] + viewer?: ViewerThreadState [k: string]: unknown } @@ -171,6 +174,7 @@ export function validateNotFoundPost(v: unknown): ValidationResult { export interface BlockedPost { uri: string blocked: true + author: BlockedAuthor [k: string]: unknown } @@ -186,12 +190,47 @@ export function validateBlockedPost(v: unknown): ValidationResult { return lexicons.validate('app.bsky.feed.defs#blockedPost', v) } +export interface BlockedAuthor { + did: string + viewer?: AppBskyActorDefs.ViewerState + [k: string]: unknown +} + +export function isBlockedAuthor(v: unknown): v is BlockedAuthor { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#blockedAuthor' + ) +} + +export function validateBlockedAuthor(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#blockedAuthor', v) +} + +export interface ViewerThreadState { + canReply?: boolean + [k: string]: unknown +} + +export function isViewerThreadState(v: unknown): v is ViewerThreadState { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#viewerThreadState' + ) +} + +export function validateViewerThreadState(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#viewerThreadState', v) +} + export interface GeneratorView { uri: string cid: string - did?: string + did: string creator: AppBskyActorDefs.ProfileView - displayName?: string + displayName: string description?: string descriptionFacets?: AppBskyRichtextFacet.Main[] avatar?: string @@ -214,7 +253,6 @@ export function validateGeneratorView(v: unknown): ValidationResult { } export interface GeneratorViewerState { - saved?: boolean like?: string [k: string]: unknown } @@ -265,3 +303,23 @@ export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost { export function validateSkeletonReasonRepost(v: unknown): ValidationResult { return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v) } + +export interface ThreadgateView { + uri?: string + cid?: string + record?: {} + lists?: AppBskyGraphDefs.ListViewBasic[] + [k: string]: unknown +} + +export function isThreadgateView(v: unknown): v is ThreadgateView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#threadgateView' + ) +} + +export function validateThreadgateView(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#threadgateView', v) +} diff --git a/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts b/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts index 82f1d15..d329bf2 100644 --- a/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts +++ b/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts @@ -24,6 +24,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,13 +33,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Feed { uri: string diff --git a/src/lexicon/types/app/bsky/feed/generator.ts b/src/lexicon/types/app/bsky/feed/generator.ts index c3082ff..757e74d 100644 --- a/src/lexicon/types/app/bsky/feed/generator.ts +++ b/src/lexicon/types/app/bsky/feed/generator.ts @@ -6,13 +6,17 @@ import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import * as AppBskyRichtextFacet from '../richtext/facet' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { did: string - displayName?: string + displayName: string description?: string descriptionFacets?: AppBskyRichtextFacet.Main[] avatar?: BlobRef + labels?: + | ComAtprotoLabelDefs.SelfLabels + | { $type: string; [k: string]: unknown } createdAt: string [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/feed/getActorFeeds.ts b/src/lexicon/types/app/bsky/feed/getActorFeeds.ts index e868dd3..3e930cb 100644 --- a/src/lexicon/types/app/bsky/feed/getActorFeeds.ts +++ b/src/lexicon/types/app/bsky/feed/getActorFeeds.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getActorLikes.ts b/src/lexicon/types/app/bsky/feed/getActorLikes.ts new file mode 100644 index 0000000..df2f291 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getActorLikes.ts @@ -0,0 +1,50 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + actor: string + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feed: AppBskyFeedDefs.FeedViewPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'BlockedActor' | 'BlockedByActor' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts b/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts index ca7806a..cd66ef5 100644 --- a/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts +++ b/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts @@ -13,6 +13,11 @@ export interface QueryParams { actor: string limit: number cursor?: string + filter: + | 'posts_with_replies' + | 'posts_no_replies' + | 'posts_with_media' + | (string & {}) } export type InputSchema = undefined @@ -28,6 +33,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +43,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeed.ts b/src/lexicon/types/app/bsky/feed/getFeed.ts index 850a44a..e72b101 100644 --- a/src/lexicon/types/app/bsky/feed/getFeed.ts +++ b/src/lexicon/types/app/bsky/feed/getFeed.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts b/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts index 0a2005d..fab3b30 100644 --- a/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts +++ b/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts b/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts new file mode 100644 index 0000000..d7e082f --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + feeds: string[] +} + +export type InputSchema = undefined + +export interface OutputSchema { + feeds: AppBskyFeedDefs.GeneratorView[] + [k: string]: unknown +} + +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 +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts b/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts index d19a275..1c8f349 100644 --- a/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts +++ b/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getLikes.ts b/src/lexicon/types/app/bsky/feed/getLikes.ts index 3163089..d581f5b 100644 --- a/src/lexicon/types/app/bsky/feed/getLikes.ts +++ b/src/lexicon/types/app/bsky/feed/getLikes.ts @@ -31,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -39,13 +40,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Like { indexedAt: string diff --git a/src/lexicon/types/app/bsky/feed/getListFeed.ts b/src/lexicon/types/app/bsky/feed/getListFeed.ts new file mode 100644 index 0000000..e24c3f8 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getListFeed.ts @@ -0,0 +1,50 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + list: string + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feed: AppBskyFeedDefs.FeedViewPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'UnknownList' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getPostThread.ts b/src/lexicon/types/app/bsky/feed/getPostThread.ts index 134228c..61de94b 100644 --- a/src/lexicon/types/app/bsky/feed/getPostThread.ts +++ b/src/lexicon/types/app/bsky/feed/getPostThread.ts @@ -11,7 +11,8 @@ import * as AppBskyFeedDefs from './defs' export interface QueryParams { uri: string - depth?: number + depth: number + parentHeight: number } export type InputSchema = undefined @@ -30,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -39,10 +41,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getPosts.ts b/src/lexicon/types/app/bsky/feed/getPosts.ts index 7376d43..4282f5d 100644 --- a/src/lexicon/types/app/bsky/feed/getPosts.ts +++ b/src/lexicon/types/app/bsky/feed/getPosts.ts @@ -25,6 +25,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -33,10 +34,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getRepostedBy.ts b/src/lexicon/types/app/bsky/feed/getRepostedBy.ts index ad4f7de..0b9c1a6 100644 --- a/src/lexicon/types/app/bsky/feed/getRepostedBy.ts +++ b/src/lexicon/types/app/bsky/feed/getRepostedBy.ts @@ -31,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -39,10 +40,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getSavedFeeds.ts b/src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts similarity index 80% rename from src/lexicon/types/app/bsky/feed/getSavedFeeds.ts rename to src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts index 176d44c..9b27133 100644 --- a/src/lexicon/types/app/bsky/feed/getSavedFeeds.ts +++ b/src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getTimeline.ts b/src/lexicon/types/app/bsky/feed/getTimeline.ts index 8a73397..832caf5 100644 --- a/src/lexicon/types/app/bsky/feed/getTimeline.ts +++ b/src/lexicon/types/app/bsky/feed/getTimeline.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/post.ts b/src/lexicon/types/app/bsky/feed/post.ts index f376078..93870b4 100644 --- a/src/lexicon/types/app/bsky/feed/post.ts +++ b/src/lexicon/types/app/bsky/feed/post.ts @@ -10,6 +10,7 @@ import * as AppBskyEmbedImages from '../embed/images' import * as AppBskyEmbedExternal from '../embed/external' import * as AppBskyEmbedRecord from '../embed/record' import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface Record { @@ -24,6 +25,12 @@ export interface Record { | AppBskyEmbedRecord.Main | AppBskyEmbedRecordWithMedia.Main | { $type: string; [k: string]: unknown } + langs?: string[] + labels?: + | ComAtprotoLabelDefs.SelfLabels + | { $type: string; [k: string]: unknown } + /** Additional non-inline tags describing this post. */ + tags?: string[] createdAt: string [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/feed/searchPosts.ts b/src/lexicon/types/app/bsky/feed/searchPosts.ts new file mode 100644 index 0000000..6b5fe08 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/searchPosts.ts @@ -0,0 +1,54 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */ + q: string + limit: number + /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */ + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */ + hitsTotal?: number + posts: AppBskyFeedDefs.PostView[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'BadQueryString' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/threadgate.ts b/src/lexicon/types/app/bsky/feed/threadgate.ts new file mode 100644 index 0000000..6a190d6 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/threadgate.ts @@ -0,0 +1,84 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' + +export interface Record { + post: string + allow?: ( + | MentionRule + | FollowingRule + | ListRule + | { $type: string; [k: string]: unknown } + )[] + createdAt: string + [k: string]: unknown +} + +export function isRecord(v: unknown): v is Record { + return ( + isObj(v) && + hasProp(v, '$type') && + (v.$type === 'app.bsky.feed.threadgate#main' || + v.$type === 'app.bsky.feed.threadgate') + ) +} + +export function validateRecord(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.threadgate#main', v) +} + +/** Allow replies from actors mentioned in your post. */ +export interface MentionRule { + [k: string]: unknown +} + +export function isMentionRule(v: unknown): v is MentionRule { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.threadgate#mentionRule' + ) +} + +export function validateMentionRule(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.threadgate#mentionRule', v) +} + +/** Allow replies from actors you follow. */ +export interface FollowingRule { + [k: string]: unknown +} + +export function isFollowingRule(v: unknown): v is FollowingRule { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.threadgate#followingRule' + ) +} + +export function validateFollowingRule(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.threadgate#followingRule', v) +} + +/** Allow replies from actors on a list. */ +export interface ListRule { + list: string + [k: string]: unknown +} + +export function isListRule(v: unknown): v is ListRule { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.threadgate#listRule' + ) +} + +export function validateListRule(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.threadgate#listRule', v) +} diff --git a/src/lexicon/types/app/bsky/graph/defs.ts b/src/lexicon/types/app/bsky/graph/defs.ts index cc2395a..121d9db 100644 --- a/src/lexicon/types/app/bsky/graph/defs.ts +++ b/src/lexicon/types/app/bsky/graph/defs.ts @@ -10,6 +10,7 @@ import * as AppBskyRichtextFacet from '../richtext/facet' export interface ListViewBasic { uri: string + cid: string name: string purpose: ListPurpose avatar?: string @@ -32,6 +33,7 @@ export function validateListViewBasic(v: unknown): ValidationResult { export interface ListView { uri: string + cid: string creator: AppBskyActorDefs.ProfileView name: string purpose: ListPurpose @@ -72,13 +74,19 @@ export function validateListItemView(v: unknown): ValidationResult { return lexicons.validate('app.bsky.graph.defs#listItemView', v) } -export type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {}) +export type ListPurpose = + | 'app.bsky.graph.defs#modlist' + | 'app.bsky.graph.defs#curatelist' + | (string & {}) /** A list of actors to apply an aggregate moderation action (mute/block) on */ export const MODLIST = 'app.bsky.graph.defs#modlist' +/** A list of actors used for curation purposes such as list feeds or interaction gating */ +export const CURATELIST = 'app.bsky.graph.defs#curatelist' export interface ListViewerState { muted?: boolean + blocked?: string [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/graph/getBlocks.ts b/src/lexicon/types/app/bsky/graph/getBlocks.ts index 6ac56b3..d380a14 100644 --- a/src/lexicon/types/app/bsky/graph/getBlocks.ts +++ b/src/lexicon/types/app/bsky/graph/getBlocks.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getFollowers.ts b/src/lexicon/types/app/bsky/graph/getFollowers.ts index 7262aaf..b337be5 100644 --- a/src/lexicon/types/app/bsky/graph/getFollowers.ts +++ b/src/lexicon/types/app/bsky/graph/getFollowers.ts @@ -29,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getFollows.ts b/src/lexicon/types/app/bsky/graph/getFollows.ts index 8c47e1b..71e9ca0 100644 --- a/src/lexicon/types/app/bsky/graph/getFollows.ts +++ b/src/lexicon/types/app/bsky/graph/getFollows.ts @@ -29,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getList.ts b/src/lexicon/types/app/bsky/graph/getList.ts index 31bb029..fc45dd2 100644 --- a/src/lexicon/types/app/bsky/graph/getList.ts +++ b/src/lexicon/types/app/bsky/graph/getList.ts @@ -29,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getListBlocks.ts b/src/lexicon/types/app/bsky/graph/getListBlocks.ts new file mode 100644 index 0000000..04cca70 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getListBlocks.ts @@ -0,0 +1,48 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyGraphDefs from './defs' + +export interface QueryParams { + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + lists: AppBskyGraphDefs.ListView[] + [k: string]: unknown +} + +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 +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getListMutes.ts b/src/lexicon/types/app/bsky/graph/getListMutes.ts index 981f9cd..04cca70 100644 --- a/src/lexicon/types/app/bsky/graph/getListMutes.ts +++ b/src/lexicon/types/app/bsky/graph/getListMutes.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getLists.ts b/src/lexicon/types/app/bsky/graph/getLists.ts index 9b4c062..8acf936 100644 --- a/src/lexicon/types/app/bsky/graph/getLists.ts +++ b/src/lexicon/types/app/bsky/graph/getLists.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getMutes.ts b/src/lexicon/types/app/bsky/graph/getMutes.ts index 55806ac..0034095 100644 --- a/src/lexicon/types/app/bsky/graph/getMutes.ts +++ b/src/lexicon/types/app/bsky/graph/getMutes.ts @@ -27,6 +27,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts b/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts new file mode 100644 index 0000000..a224584 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyActorDefs from '../actor/defs' + +export interface QueryParams { + actor: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + suggestions: AppBskyActorDefs.ProfileView[] + [k: string]: unknown +} + +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 +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/list.ts b/src/lexicon/types/app/bsky/graph/list.ts index 4304ca9..36a7fb1 100644 --- a/src/lexicon/types/app/bsky/graph/list.ts +++ b/src/lexicon/types/app/bsky/graph/list.ts @@ -7,6 +7,7 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' import * as AppBskyRichtextFacet from '../richtext/facet' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { purpose: AppBskyGraphDefs.ListPurpose @@ -14,6 +15,9 @@ export interface Record { description?: string descriptionFacets?: AppBskyRichtextFacet.Main[] avatar?: BlobRef + labels?: + | ComAtprotoLabelDefs.SelfLabels + | { $type: string; [k: string]: unknown } createdAt: string [k: string]: unknown } diff --git a/src/lexicon/types/app/bsky/graph/listblock.ts b/src/lexicon/types/app/bsky/graph/listblock.ts new file mode 100644 index 0000000..59f2e05 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/listblock.ts @@ -0,0 +1,26 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' + +export interface Record { + subject: string + createdAt: string + [k: string]: unknown +} + +export function isRecord(v: unknown): v is Record { + return ( + isObj(v) && + hasProp(v, '$type') && + (v.$type === 'app.bsky.graph.listblock#main' || + v.$type === 'app.bsky.graph.listblock') + ) +} + +export function validateRecord(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.graph.listblock#main', v) +} diff --git a/src/lexicon/types/app/bsky/graph/muteActor.ts b/src/lexicon/types/app/bsky/graph/muteActor.ts index fd19f66..52d1b86 100644 --- a/src/lexicon/types/app/bsky/graph/muteActor.ts +++ b/src/lexicon/types/app/bsky/graph/muteActor.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/muteActorList.ts b/src/lexicon/types/app/bsky/graph/muteActorList.ts index e099011..bf803f3 100644 --- a/src/lexicon/types/app/bsky/graph/muteActorList.ts +++ b/src/lexicon/types/app/bsky/graph/muteActorList.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/unmuteActor.ts b/src/lexicon/types/app/bsky/graph/unmuteActor.ts index fd19f66..52d1b86 100644 --- a/src/lexicon/types/app/bsky/graph/unmuteActor.ts +++ b/src/lexicon/types/app/bsky/graph/unmuteActor.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/unmuteActorList.ts b/src/lexicon/types/app/bsky/graph/unmuteActorList.ts index e099011..bf803f3 100644 --- a/src/lexicon/types/app/bsky/graph/unmuteActorList.ts +++ b/src/lexicon/types/app/bsky/graph/unmuteActorList.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/notification/getUnreadCount.ts b/src/lexicon/types/app/bsky/notification/getUnreadCount.ts index 2f49ca1..6cf3c84 100644 --- a/src/lexicon/types/app/bsky/notification/getUnreadCount.ts +++ b/src/lexicon/types/app/bsky/notification/getUnreadCount.ts @@ -24,6 +24,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,10 +33,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/notification/listNotifications.ts b/src/lexicon/types/app/bsky/notification/listNotifications.ts index 09f913a..156ba34 100644 --- a/src/lexicon/types/app/bsky/notification/listNotifications.ts +++ b/src/lexicon/types/app/bsky/notification/listNotifications.ts @@ -29,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,13 +38,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Notification { uri: string diff --git a/src/lexicon/types/app/bsky/feed/saveFeed.ts b/src/lexicon/types/app/bsky/notification/registerPush.ts similarity index 70% rename from src/lexicon/types/app/bsky/feed/saveFeed.ts rename to src/lexicon/types/app/bsky/notification/registerPush.ts index d4d61e6..9923aeb 100644 --- a/src/lexicon/types/app/bsky/feed/saveFeed.ts +++ b/src/lexicon/types/app/bsky/notification/registerPush.ts @@ -11,7 +11,10 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams {} export interface InputSchema { - feed: string + serviceDid: string + token: string + platform: 'ios' | 'android' | 'web' | (string & {}) + appId: string [k: string]: unknown } @@ -26,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/notification/updateSeen.ts b/src/lexicon/types/app/bsky/notification/updateSeen.ts index 177f1f4..136191e 100644 --- a/src/lexicon/types/app/bsky/notification/updateSeen.ts +++ b/src/lexicon/types/app/bsky/notification/updateSeen.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/richtext/facet.ts b/src/lexicon/types/app/bsky/richtext/facet.ts index a7369ee..2c5b2d7 100644 --- a/src/lexicon/types/app/bsky/richtext/facet.ts +++ b/src/lexicon/types/app/bsky/richtext/facet.ts @@ -8,7 +8,7 @@ import { CID } from 'multiformats/cid' export interface Main { index: ByteSlice - features: (Mention | Link | { $type: string; [k: string]: unknown })[] + features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[] [k: string]: unknown } @@ -61,6 +61,22 @@ export function validateLink(v: unknown): ValidationResult { return lexicons.validate('app.bsky.richtext.facet#link', v) } +/** A hashtag. */ +export interface Tag { + tag: string + [k: string]: unknown +} + +export function isTag(v: unknown): v is Tag { + return ( + isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.richtext.facet#tag' + ) +} + +export function validateTag(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.richtext.facet#tag', v) +} + /** A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings. */ export interface ByteSlice { byteStart: number diff --git a/src/lexicon/types/app/bsky/unspecced/defs.ts b/src/lexicon/types/app/bsky/unspecced/defs.ts new file mode 100644 index 0000000..59a6b38 --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/defs.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' + +export interface SkeletonSearchPost { + uri: string + [k: string]: unknown +} + +export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost' + ) +} + +export function validateSkeletonSearchPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v) +} + +export interface SkeletonSearchActor { + did: string + [k: string]: unknown +} + +export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor' + ) +} + +export function validateSkeletonSearchActor(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v) +} diff --git a/src/lexicon/types/app/bsky/unspecced/getPopular.ts b/src/lexicon/types/app/bsky/unspecced/getPopular.ts index b91dbe7..8471ed7 100644 --- a/src/lexicon/types/app/bsky/unspecced/getPopular.ts +++ b/src/lexicon/types/app/bsky/unspecced/getPopular.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.ts b/src/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.ts new file mode 100644 index 0000000..97937e9 --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.ts @@ -0,0 +1,49 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from '../feed/defs' + +export interface QueryParams { + limit: number + cursor?: string + query?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feeds: AppBskyFeedDefs.GeneratorView[] + [k: string]: unknown +} + +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 +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/unspecced/getTimelineSkeleton.ts b/src/lexicon/types/app/bsky/unspecced/getTimelineSkeleton.ts new file mode 100644 index 0000000..4ccad20 --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/getTimelineSkeleton.ts @@ -0,0 +1,49 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from '../feed/defs' + +export interface QueryParams { + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feed: AppBskyFeedDefs.SkeletonFeedPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'UnknownFeed' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts b/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts new file mode 100644 index 0000000..2cf59bf --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts @@ -0,0 +1,56 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyUnspeccedDefs from './defs' + +export interface QueryParams { + /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax */ + q: string + /** if true, acts as fast/simple 'typeahead' query */ + typeahead?: boolean + limit: number + /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */ + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */ + hitsTotal?: number + actors: AppBskyUnspeccedDefs.SkeletonSearchActor[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'BadQueryString' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts b/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts new file mode 100644 index 0000000..df990d2 --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts @@ -0,0 +1,54 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyUnspeccedDefs from './defs' + +export interface QueryParams { + /** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */ + q: string + limit: number + /** optional pagination mechanism; may not necessarily allow scrolling through entire result set */ + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + /** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */ + hitsTotal?: number + posts: AppBskyUnspeccedDefs.SkeletonSearchPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + +export interface HandlerError { + status: number + message?: string + error?: 'BadQueryString' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/defs.ts b/src/lexicon/types/com/atproto/admin/defs.ts index 38938d4..968252a 100644 --- a/src/lexicon/types/com/atproto/admin/defs.ts +++ b/src/lexicon/types/com/atproto/admin/defs.ts @@ -13,6 +13,8 @@ import * as ComAtprotoLabelDefs from '../label/defs' export interface ActionView { id: number action: ActionType + /** Indicates how long this action was meant to be in effect before automatically expiring. */ + durationInHours?: number subject: | RepoRef | ComAtprotoRepoStrongRef.Main @@ -43,7 +45,14 @@ export function validateActionView(v: unknown): ValidationResult { export interface ActionViewDetail { id: number action: ActionType - subject: RepoView | RecordView | { $type: string; [k: string]: unknown } + /** Indicates how long this action was meant to be in effect before automatically expiring. */ + durationInHours?: number + subject: + | RepoView + | RepoViewNotFound + | RecordView + | RecordViewNotFound + | { $type: string; [k: string]: unknown } subjectBlobs: BlobView[] createLabelVals?: string[] negateLabelVals?: string[] @@ -70,6 +79,8 @@ export function validateActionViewDetail(v: unknown): ValidationResult { export interface ActionViewCurrent { id: number action: ActionType + /** Indicates how long this action was meant to be in effect before automatically expiring. */ + durationInHours?: number [k: string]: unknown } @@ -124,6 +135,7 @@ export interface ReportView { id: number reasonType: ComAtprotoModerationDefs.ReasonType reason?: string + subjectRepoHandle?: string subject: | RepoRef | ComAtprotoRepoStrongRef.Main @@ -150,7 +162,12 @@ export interface ReportViewDetail { id: number reasonType: ComAtprotoModerationDefs.ReasonType reason?: string - subject: RepoView | RecordView | { $type: string; [k: string]: unknown } + subject: + | RepoView + | RepoViewNotFound + | RecordView + | RecordViewNotFound + | { $type: string; [k: string]: unknown } reportedBy: string createdAt: string resolvedByActions: ActionView[] @@ -178,6 +195,7 @@ export interface RepoView { moderation: Moderation invitedBy?: ComAtprotoServerDefs.InviteCode invitesDisabled?: boolean + inviteNote?: string [k: string]: unknown } @@ -204,6 +222,7 @@ export interface RepoViewDetail { invitedBy?: ComAtprotoServerDefs.InviteCode invites?: ComAtprotoServerDefs.InviteCode[] invitesDisabled?: boolean + inviteNote?: string [k: string]: unknown } @@ -219,6 +238,23 @@ export function validateRepoViewDetail(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) } +export interface RepoViewNotFound { + did: string + [k: string]: unknown +} + +export function isRepoViewNotFound(v: unknown): v is RepoViewNotFound { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#repoViewNotFound' + ) +} + +export function validateRepoViewNotFound(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#repoViewNotFound', v) +} + export interface RepoRef { did: string [k: string]: unknown @@ -283,6 +319,23 @@ export function validateRecordViewDetail(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v) } +export interface RecordViewNotFound { + uri: string + [k: string]: unknown +} + +export function isRecordViewNotFound(v: unknown): v is RecordViewNotFound { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#recordViewNotFound' + ) +} + +export function validateRecordViewNotFound(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#recordViewNotFound', v) +} + export interface Moderation { currentAction?: ActionViewCurrent [k: string]: unknown diff --git a/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts b/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts index fdba69e..051fabb 100644 --- a/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts +++ b/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts @@ -12,6 +12,8 @@ export interface QueryParams {} export interface InputSchema { account: string + /** Additionally add a note describing why the invites were disabled */ + note?: string [k: string]: unknown } @@ -26,10 +28,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts b/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts index 2e9d326..2b64371 100644 --- a/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts +++ b/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts @@ -27,10 +27,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts b/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts index fdba69e..4a26d30 100644 --- a/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts +++ b/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts @@ -12,6 +12,8 @@ export interface QueryParams {} export interface InputSchema { account: string + /** Additionally add a note describing why the invites were enabled */ + note?: string [k: string]: unknown } @@ -26,10 +28,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getInviteCodes.ts b/src/lexicon/types/com/atproto/admin/getInviteCodes.ts index 3e3f97a..1eb099a 100644 --- a/src/lexicon/types/com/atproto/admin/getInviteCodes.ts +++ b/src/lexicon/types/com/atproto/admin/getInviteCodes.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationAction.ts b/src/lexicon/types/com/atproto/admin/getModerationAction.ts index 35c2086..2ab52f2 100644 --- a/src/lexicon/types/com/atproto/admin/getModerationAction.ts +++ b/src/lexicon/types/com/atproto/admin/getModerationAction.ts @@ -20,6 +20,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -28,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationActions.ts b/src/lexicon/types/com/atproto/admin/getModerationActions.ts index 2eb2d76..4c29f96 100644 --- a/src/lexicon/types/com/atproto/admin/getModerationActions.ts +++ b/src/lexicon/types/com/atproto/admin/getModerationActions.ts @@ -28,6 +28,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationReport.ts b/src/lexicon/types/com/atproto/admin/getModerationReport.ts index 9794514..28d7144 100644 --- a/src/lexicon/types/com/atproto/admin/getModerationReport.ts +++ b/src/lexicon/types/com/atproto/admin/getModerationReport.ts @@ -20,6 +20,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -28,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationReports.ts b/src/lexicon/types/com/atproto/admin/getModerationReports.ts index 8fc5ac8..d50af44 100644 --- a/src/lexicon/types/com/atproto/admin/getModerationReports.ts +++ b/src/lexicon/types/com/atproto/admin/getModerationReports.ts @@ -11,6 +11,11 @@ import * as ComAtprotoAdminDefs from './defs' export interface QueryParams { subject?: string + ignoreSubjects?: string[] + /** Get all reports that were actioned by a specific moderator */ + actionedBy?: string + /** Filter reports made by one or more DIDs */ + reporters?: string[] resolved?: boolean actionType?: | 'com.atproto.admin.defs#takedown' @@ -20,6 +25,8 @@ export interface QueryParams { | (string & {}) limit: number cursor?: string + /** Reverse the order of the returned records? when true, returns reports in chronological order */ + reverse?: boolean } export type InputSchema = undefined @@ -35,6 +42,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -43,10 +51,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getRecord.ts b/src/lexicon/types/com/atproto/admin/getRecord.ts index f89ce9b..48222d9 100644 --- a/src/lexicon/types/com/atproto/admin/getRecord.ts +++ b/src/lexicon/types/com/atproto/admin/getRecord.ts @@ -21,18 +21,23 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { status: number message?: string + error?: 'RecordNotFound' } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getRepo.ts b/src/lexicon/types/com/atproto/admin/getRepo.ts index 836e6e5..19911ba 100644 --- a/src/lexicon/types/com/atproto/admin/getRepo.ts +++ b/src/lexicon/types/com/atproto/admin/getRepo.ts @@ -20,18 +20,23 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { status: number message?: string + error?: 'RepoNotFound' } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts b/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts index 912a745..e3f4d02 100644 --- a/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts +++ b/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts @@ -28,6 +28,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts b/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts index 6f2399f..17dcb50 100644 --- a/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts +++ b/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts @@ -28,6 +28,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -36,10 +37,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/searchRepos.ts b/src/lexicon/types/com/atproto/admin/searchRepos.ts index abfda14..32266fd 100644 --- a/src/lexicon/types/com/atproto/admin/searchRepos.ts +++ b/src/lexicon/types/com/atproto/admin/searchRepos.ts @@ -10,7 +10,9 @@ import { HandlerAuth } from '@atproto/xrpc-server' import * as ComAtprotoAdminDefs from './defs' export interface QueryParams { + /** DEPRECATED: use 'q' instead */ term?: string + q?: string invitedBy?: string limit: number cursor?: string @@ -29,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +40,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/unsaveFeed.ts b/src/lexicon/types/com/atproto/admin/sendEmail.ts similarity index 56% rename from src/lexicon/types/app/bsky/feed/unsaveFeed.ts rename to src/lexicon/types/com/atproto/admin/sendEmail.ts index d4d61e6..87e7cee 100644 --- a/src/lexicon/types/app/bsky/feed/unsaveFeed.ts +++ b/src/lexicon/types/com/atproto/admin/sendEmail.ts @@ -11,7 +11,14 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams {} export interface InputSchema { - feed: string + recipientDid: string + content: string + subject?: string + [k: string]: unknown +} + +export interface OutputSchema { + sent: boolean [k: string]: unknown } @@ -20,16 +27,25 @@ export interface HandlerInput { body: InputSchema } +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema + headers?: { [key: string]: string } +} + export interface HandlerError { status: number message?: string } -export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerOutput = HandlerError | HandlerSuccess +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/takeModerationAction.ts b/src/lexicon/types/com/atproto/admin/takeModerationAction.ts index 977c6ba..fbbf14d 100644 --- a/src/lexicon/types/com/atproto/admin/takeModerationAction.ts +++ b/src/lexicon/types/com/atproto/admin/takeModerationAction.ts @@ -26,6 +26,8 @@ export interface InputSchema { createLabelVals?: string[] negateLabelVals?: string[] reason: string + /** Indicates how long this action was meant to be in effect before automatically expiring. */ + durationInHours?: number createdBy: string [k: string]: unknown } @@ -40,6 +42,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -49,10 +52,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts b/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts index eb00af0..9e61402 100644 --- a/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts +++ b/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts @@ -28,10 +28,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts b/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts index b9bb76a..c378f42 100644 --- a/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts +++ b/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts @@ -27,10 +27,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/identity/resolveHandle.ts b/src/lexicon/types/com/atproto/identity/resolveHandle.ts index 132cb43..ef90e99 100644 --- a/src/lexicon/types/com/atproto/identity/resolveHandle.ts +++ b/src/lexicon/types/com/atproto/identity/resolveHandle.ts @@ -9,8 +9,8 @@ import { CID } from 'multiformats/cid' import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams { - /** The handle to resolve. If not supplied, will resolve the host's own handle. */ - handle?: string + /** The handle to resolve. */ + handle: string } export type InputSchema = undefined @@ -25,6 +25,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -33,10 +34,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/identity/updateHandle.ts b/src/lexicon/types/com/atproto/identity/updateHandle.ts index c0c3cf5..1f639c3 100644 --- a/src/lexicon/types/com/atproto/identity/updateHandle.ts +++ b/src/lexicon/types/com/atproto/identity/updateHandle.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/label/defs.ts b/src/lexicon/types/com/atproto/label/defs.ts index 17a8480..a01ad78 100644 --- a/src/lexicon/types/com/atproto/label/defs.ts +++ b/src/lexicon/types/com/atproto/label/defs.ts @@ -34,3 +34,40 @@ export function isLabel(v: unknown): v is Label { export function validateLabel(v: unknown): ValidationResult { return lexicons.validate('com.atproto.label.defs#label', v) } + +/** Metadata tags on an atproto record, published by the author within the record. */ +export interface SelfLabels { + values: SelfLabel[] + [k: string]: unknown +} + +export function isSelfLabels(v: unknown): v is SelfLabels { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.label.defs#selfLabels' + ) +} + +export function validateSelfLabels(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.label.defs#selfLabels', v) +} + +/** Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel. */ +export interface SelfLabel { + /** the short string name of the value or type of this label */ + val: string + [k: string]: unknown +} + +export function isSelfLabel(v: unknown): v is SelfLabel { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.label.defs#selfLabel' + ) +} + +export function validateSelfLabel(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.label.defs#selfLabel', v) +} diff --git a/src/lexicon/types/com/atproto/label/queryLabels.ts b/src/lexicon/types/com/atproto/label/queryLabels.ts index 1f085d2..72cf5c5 100644 --- a/src/lexicon/types/com/atproto/label/queryLabels.ts +++ b/src/lexicon/types/com/atproto/label/queryLabels.ts @@ -31,6 +31,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -39,10 +40,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/label/subscribeLabels.ts b/src/lexicon/types/com/atproto/label/subscribeLabels.ts index 758407e..9d4b444 100644 --- a/src/lexicon/types/com/atproto/label/subscribeLabels.ts +++ b/src/lexicon/types/com/atproto/label/subscribeLabels.ts @@ -20,12 +20,15 @@ export type OutputSchema = | { $type: string; [k: string]: unknown } export type HandlerError = ErrorFrame<'FutureCursor'> export type HandlerOutput = HandlerError | OutputSchema -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams req: IncomingMessage signal: AbortSignal -}) => AsyncIterable +} +export type Handler = ( + ctx: HandlerReqCtx, +) => AsyncIterable export interface Labels { seq: number diff --git a/src/lexicon/types/com/atproto/moderation/createReport.ts b/src/lexicon/types/com/atproto/moderation/createReport.ts index 73be720..96aaf4a 100644 --- a/src/lexicon/types/com/atproto/moderation/createReport.ts +++ b/src/lexicon/types/com/atproto/moderation/createReport.ts @@ -44,6 +44,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -52,10 +53,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/moderation/defs.ts b/src/lexicon/types/com/atproto/moderation/defs.ts index 9ab6e60..8169722 100644 --- a/src/lexicon/types/com/atproto/moderation/defs.ts +++ b/src/lexicon/types/com/atproto/moderation/defs.ts @@ -21,7 +21,7 @@ export const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam' export const REASONVIOLATION = 'com.atproto.moderation.defs#reasonViolation' /** Misleading identity, affiliation, or content */ export const REASONMISLEADING = 'com.atproto.moderation.defs#reasonMisleading' -/** Unwanted or mis-labeled sexual content */ +/** Unwanted or mislabeled sexual content */ export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual' /** Rude, harassing, explicit, or otherwise unwelcoming behavior */ export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude' diff --git a/src/lexicon/types/com/atproto/repo/applyWrites.ts b/src/lexicon/types/com/atproto/repo/applyWrites.ts index 6fba024..53f2972 100644 --- a/src/lexicon/types/com/atproto/repo/applyWrites.ts +++ b/src/lexicon/types/com/atproto/repo/applyWrites.ts @@ -32,13 +32,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput /** Create a new record. */ export interface Create { diff --git a/src/lexicon/types/com/atproto/repo/createRecord.ts b/src/lexicon/types/com/atproto/repo/createRecord.ts index 6c19d53..e069f8c 100644 --- a/src/lexicon/types/com/atproto/repo/createRecord.ts +++ b/src/lexicon/types/com/atproto/repo/createRecord.ts @@ -40,6 +40,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -49,10 +50,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/deleteRecord.ts b/src/lexicon/types/com/atproto/repo/deleteRecord.ts index 016547e..5ee016c 100644 --- a/src/lexicon/types/com/atproto/repo/deleteRecord.ts +++ b/src/lexicon/types/com/atproto/repo/deleteRecord.ts @@ -36,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/describeRepo.ts b/src/lexicon/types/com/atproto/repo/describeRepo.ts index d035bba..7b8a2b9 100644 --- a/src/lexicon/types/com/atproto/repo/describeRepo.ts +++ b/src/lexicon/types/com/atproto/repo/describeRepo.ts @@ -29,6 +29,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/getRecord.ts b/src/lexicon/types/com/atproto/repo/getRecord.ts index fe81fbc..35c9b4b 100644 --- a/src/lexicon/types/com/atproto/repo/getRecord.ts +++ b/src/lexicon/types/com/atproto/repo/getRecord.ts @@ -33,6 +33,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -41,10 +42,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/listRecords.ts b/src/lexicon/types/com/atproto/repo/listRecords.ts index 81e2ddc..e58d971 100644 --- a/src/lexicon/types/com/atproto/repo/listRecords.ts +++ b/src/lexicon/types/com/atproto/repo/listRecords.ts @@ -37,6 +37,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -45,13 +46,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Record { uri: string diff --git a/src/lexicon/types/com/atproto/repo/putRecord.ts b/src/lexicon/types/com/atproto/repo/putRecord.ts index 13a0672..364eb59 100644 --- a/src/lexicon/types/com/atproto/repo/putRecord.ts +++ b/src/lexicon/types/com/atproto/repo/putRecord.ts @@ -42,6 +42,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -51,10 +52,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/rebaseRepo.ts b/src/lexicon/types/com/atproto/repo/rebaseRepo.ts deleted file mode 100644 index b3dfe32..0000000 --- a/src/lexicon/types/com/atproto/repo/rebaseRepo.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import express from 'express' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { lexicons } from '../../../../lexicons' -import { isObj, hasProp } from '../../../../util' -import { CID } from 'multiformats/cid' -import { HandlerAuth } from '@atproto/xrpc-server' - -export interface QueryParams {} - -export interface InputSchema { - /** The handle or DID of the repo. */ - repo: string - /** Compare and swap with the previous commit by cid. */ - swapCommit?: string - [k: string]: unknown -} - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerError { - status: number - message?: string - error?: 'InvalidSwap' -} - -export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/uploadBlob.ts b/src/lexicon/types/com/atproto/repo/uploadBlob.ts index c4c1358..ad6002d 100644 --- a/src/lexicon/types/com/atproto/repo/uploadBlob.ts +++ b/src/lexicon/types/com/atproto/repo/uploadBlob.ts @@ -26,6 +26,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -34,10 +35,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createAccount.ts b/src/lexicon/types/com/atproto/server/createAccount.ts index 4e212bf..c67e744 100644 --- a/src/lexicon/types/com/atproto/server/createAccount.ts +++ b/src/lexicon/types/com/atproto/server/createAccount.ts @@ -36,6 +36,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -52,10 +53,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createAppPassword.ts b/src/lexicon/types/com/atproto/server/createAppPassword.ts index 65673ff..8e4a0a5 100644 --- a/src/lexicon/types/com/atproto/server/createAppPassword.ts +++ b/src/lexicon/types/com/atproto/server/createAppPassword.ts @@ -25,6 +25,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -34,13 +35,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface AppPassword { name: string diff --git a/src/lexicon/types/com/atproto/server/createInviteCode.ts b/src/lexicon/types/com/atproto/server/createInviteCode.ts index f95b098..acfac56 100644 --- a/src/lexicon/types/com/atproto/server/createInviteCode.ts +++ b/src/lexicon/types/com/atproto/server/createInviteCode.ts @@ -29,6 +29,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +38,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createInviteCodes.ts b/src/lexicon/types/com/atproto/server/createInviteCodes.ts index 1f975d5..5887d77 100644 --- a/src/lexicon/types/com/atproto/server/createInviteCodes.ts +++ b/src/lexicon/types/com/atproto/server/createInviteCodes.ts @@ -30,6 +30,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -38,13 +39,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface AccountCodes { account: string diff --git a/src/lexicon/types/com/atproto/server/createSession.ts b/src/lexicon/types/com/atproto/server/createSession.ts index 0c5d35d..b836551 100644 --- a/src/lexicon/types/com/atproto/server/createSession.ts +++ b/src/lexicon/types/com/atproto/server/createSession.ts @@ -34,6 +34,7 @@ export interface HandlerInput { export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -43,10 +44,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/deleteAccount.ts b/src/lexicon/types/com/atproto/server/deleteAccount.ts index 6fde5f1..37ddbba 100644 --- a/src/lexicon/types/com/atproto/server/deleteAccount.ts +++ b/src/lexicon/types/com/atproto/server/deleteAccount.ts @@ -29,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/deleteSession.ts b/src/lexicon/types/com/atproto/server/deleteSession.ts index 909c2be..e424487 100644 --- a/src/lexicon/types/com/atproto/server/deleteSession.ts +++ b/src/lexicon/types/com/atproto/server/deleteSession.ts @@ -19,10 +19,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/describeServer.ts b/src/lexicon/types/com/atproto/server/describeServer.ts index fd2c79e..bc73d54 100644 --- a/src/lexicon/types/com/atproto/server/describeServer.ts +++ b/src/lexicon/types/com/atproto/server/describeServer.ts @@ -24,6 +24,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,13 +33,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Links { privacyPolicy?: string diff --git a/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts b/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts index d5c3e17..e387a5e 100644 --- a/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts +++ b/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts @@ -26,6 +26,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -35,10 +36,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/getSession.ts b/src/lexicon/types/com/atproto/server/getSession.ts index e610c44..388fb5e 100644 --- a/src/lexicon/types/com/atproto/server/getSession.ts +++ b/src/lexicon/types/com/atproto/server/getSession.ts @@ -24,6 +24,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,10 +33,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/listAppPasswords.ts b/src/lexicon/types/com/atproto/server/listAppPasswords.ts index 012239b..ebd74da 100644 --- a/src/lexicon/types/com/atproto/server/listAppPasswords.ts +++ b/src/lexicon/types/com/atproto/server/listAppPasswords.ts @@ -22,6 +22,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -31,13 +32,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface AppPassword { name: string diff --git a/src/lexicon/types/com/atproto/server/refreshSession.ts b/src/lexicon/types/com/atproto/server/refreshSession.ts index 1dfc878..e47bf09 100644 --- a/src/lexicon/types/com/atproto/server/refreshSession.ts +++ b/src/lexicon/types/com/atproto/server/refreshSession.ts @@ -25,6 +25,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -34,10 +35,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/requestAccountDelete.ts b/src/lexicon/types/com/atproto/server/requestAccountDelete.ts index 909c2be..e424487 100644 --- a/src/lexicon/types/com/atproto/server/requestAccountDelete.ts +++ b/src/lexicon/types/com/atproto/server/requestAccountDelete.ts @@ -19,10 +19,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/requestPasswordReset.ts b/src/lexicon/types/com/atproto/server/requestPasswordReset.ts index d1973cd..47fb4bb 100644 --- a/src/lexicon/types/com/atproto/server/requestPasswordReset.ts +++ b/src/lexicon/types/com/atproto/server/requestPasswordReset.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/resetPassword.ts b/src/lexicon/types/com/atproto/server/resetPassword.ts index 5e01482..9e6ece3 100644 --- a/src/lexicon/types/com/atproto/server/resetPassword.ts +++ b/src/lexicon/types/com/atproto/server/resetPassword.ts @@ -28,10 +28,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/revokeAppPassword.ts b/src/lexicon/types/com/atproto/server/revokeAppPassword.ts index e6bdcd0..4627f68 100644 --- a/src/lexicon/types/com/atproto/server/revokeAppPassword.ts +++ b/src/lexicon/types/com/atproto/server/revokeAppPassword.ts @@ -26,10 +26,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getBlob.ts b/src/lexicon/types/com/atproto/sync/getBlob.ts index a9cf2e9..6075090 100644 --- a/src/lexicon/types/com/atproto/sync/getBlob.ts +++ b/src/lexicon/types/com/atproto/sync/getBlob.ts @@ -22,6 +22,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: '*/*' body: Uint8Array | stream.Readable + headers?: { [key: string]: string } } export interface HandlerError { @@ -30,10 +31,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getBlocks.ts b/src/lexicon/types/com/atproto/sync/getBlocks.ts index 89cd475..e73410e 100644 --- a/src/lexicon/types/com/atproto/sync/getBlocks.ts +++ b/src/lexicon/types/com/atproto/sync/getBlocks.ts @@ -21,6 +21,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/vnd.ipld.car' body: Uint8Array | stream.Readable + headers?: { [key: string]: string } } export interface HandlerError { @@ -29,10 +30,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getCheckout.ts b/src/lexicon/types/com/atproto/sync/getCheckout.ts index c714a20..63a657e 100644 --- a/src/lexicon/types/com/atproto/sync/getCheckout.ts +++ b/src/lexicon/types/com/atproto/sync/getCheckout.ts @@ -12,8 +12,6 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams { /** The DID of the repo. */ did: string - /** The commit to get the checkout from. Defaults to current HEAD. */ - commit?: string } export type InputSchema = undefined @@ -22,6 +20,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/vnd.ipld.car' body: Uint8Array | stream.Readable + headers?: { [key: string]: string } } export interface HandlerError { @@ -30,10 +29,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getHead.ts b/src/lexicon/types/com/atproto/sync/getHead.ts index 83abb1b..586ae1a 100644 --- a/src/lexicon/types/com/atproto/sync/getHead.ts +++ b/src/lexicon/types/com/atproto/sync/getHead.ts @@ -25,18 +25,23 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { status: number message?: string + error?: 'HeadNotFound' } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getCommitPath.ts b/src/lexicon/types/com/atproto/sync/getLatestCommit.ts similarity index 75% rename from src/lexicon/types/com/atproto/sync/getCommitPath.ts rename to src/lexicon/types/com/atproto/sync/getLatestCommit.ts index 1b7d0ab..9b91e87 100644 --- a/src/lexicon/types/com/atproto/sync/getCommitPath.ts +++ b/src/lexicon/types/com/atproto/sync/getLatestCommit.ts @@ -11,16 +11,13 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams { /** The DID of the repo. */ did: string - /** The most recent commit */ - latest?: string - /** The earliest commit to start from */ - earliest?: string } export type InputSchema = undefined export interface OutputSchema { - commits: string[] + cid: string + rev: string [k: string]: unknown } @@ -29,18 +26,23 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { status: number message?: string + error?: 'RepoNotFound' } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getRecord.ts b/src/lexicon/types/com/atproto/sync/getRecord.ts index 4921e33..297f0ac 100644 --- a/src/lexicon/types/com/atproto/sync/getRecord.ts +++ b/src/lexicon/types/com/atproto/sync/getRecord.ts @@ -24,6 +24,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/vnd.ipld.car' body: Uint8Array | stream.Readable + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,10 +33,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getRepo.ts b/src/lexicon/types/com/atproto/sync/getRepo.ts index 0999f9b..495d31a 100644 --- a/src/lexicon/types/com/atproto/sync/getRepo.ts +++ b/src/lexicon/types/com/atproto/sync/getRepo.ts @@ -12,10 +12,8 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams { /** The DID of the repo. */ did: string - /** The earliest commit in the commit range (not inclusive) */ - earliest?: string - /** The latest commit in the commit range (inclusive) */ - latest?: string + /** The revision of the repo to catch up from. */ + since?: string } export type InputSchema = undefined @@ -24,6 +22,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/vnd.ipld.car' body: Uint8Array | stream.Readable + headers?: { [key: string]: string } } export interface HandlerError { @@ -32,10 +31,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/listBlobs.ts b/src/lexicon/types/com/atproto/sync/listBlobs.ts index 78182d9..936b08a 100644 --- a/src/lexicon/types/com/atproto/sync/listBlobs.ts +++ b/src/lexicon/types/com/atproto/sync/listBlobs.ts @@ -11,15 +11,16 @@ import { HandlerAuth } from '@atproto/xrpc-server' export interface QueryParams { /** The DID of the repo. */ did: string - /** The most recent commit */ - latest?: string - /** The earliest commit to start from */ - earliest?: string + /** Optional revision of the repo to list blobs since */ + since?: string + limit: number + cursor?: string } export type InputSchema = undefined export interface OutputSchema { + cursor?: string cids: string[] [k: string]: unknown } @@ -29,6 +30,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -37,10 +39,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/listRepos.ts b/src/lexicon/types/com/atproto/sync/listRepos.ts index fcd7394..afbc9df 100644 --- a/src/lexicon/types/com/atproto/sync/listRepos.ts +++ b/src/lexicon/types/com/atproto/sync/listRepos.ts @@ -26,6 +26,7 @@ export type HandlerInput = undefined export interface HandlerSuccess { encoding: 'application/json' body: OutputSchema + headers?: { [key: string]: string } } export interface HandlerError { @@ -34,13 +35,16 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | HandlerSuccess -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput export interface Repo { did: string diff --git a/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts b/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts index 8cd27fd..3d310c1 100644 --- a/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts +++ b/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts @@ -8,13 +8,18 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth } from '@atproto/xrpc-server' -export interface QueryParams { +export interface QueryParams {} + +export interface InputSchema { /** Hostname of the service that is notifying of update. */ hostname: string + [k: string]: unknown } -export type InputSchema = undefined -export type HandlerInput = undefined +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} export interface HandlerError { status: number @@ -22,10 +27,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/requestCrawl.ts b/src/lexicon/types/com/atproto/sync/requestCrawl.ts index 4ae875d..87ef20d 100644 --- a/src/lexicon/types/com/atproto/sync/requestCrawl.ts +++ b/src/lexicon/types/com/atproto/sync/requestCrawl.ts @@ -8,13 +8,18 @@ import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' import { HandlerAuth } from '@atproto/xrpc-server' -export interface QueryParams { +export interface QueryParams {} + +export interface InputSchema { /** Hostname of the service that is requesting to be crawled. */ hostname: string + [k: string]: unknown } -export type InputSchema = undefined -export type HandlerInput = undefined +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} export interface HandlerError { status: number @@ -22,10 +27,13 @@ export interface HandlerError { } export type HandlerOutput = HandlerError | void -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams input: HandlerInput req: express.Request res: express.Response -}) => Promise | HandlerOutput +} +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/subscribeRepos.ts b/src/lexicon/types/com/atproto/sync/subscribeRepos.ts index 591347c..ae9cf01 100644 --- a/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +++ b/src/lexicon/types/com/atproto/sync/subscribeRepos.ts @@ -20,14 +20,17 @@ export type OutputSchema = | Tombstone | Info | { $type: string; [k: string]: unknown } -export type HandlerError = ErrorFrame<'FutureCursor'> +export type HandlerError = ErrorFrame<'FutureCursor' | 'ConsumerTooSlow'> export type HandlerOutput = HandlerError | OutputSchema -export type Handler = (ctx: { +export type HandlerReqCtx = { auth: HA params: QueryParams req: IncomingMessage signal: AbortSignal -}) => AsyncIterable +} +export type Handler = ( + ctx: HandlerReqCtx, +) => AsyncIterable export interface Commit { seq: number @@ -35,7 +38,11 @@ export interface Commit { tooBig: boolean repo: string commit: CID - prev: CID | null + prev?: CID | null + /** The rev of the emitted commit */ + rev: string + /** The rev of the last emitted commit from this repo */ + since: string | null /** CAR file containing relevant blocks */ blocks: Uint8Array ops: RepoOp[] @@ -133,6 +140,7 @@ export function validateInfo(v: unknown): ValidationResult { return lexicons.validate('com.atproto.sync.subscribeRepos#info', v) } +/** A repo operation, ie a write of a single record. For creates and updates, cid is the record's CID as of this operation. For deletes, it's null. */ export interface RepoOp { action: 'create' | 'update' | 'delete' | (string & {}) path: string diff --git a/src/methods/describe-generator.ts b/src/methods/describe-generator.ts index cbd87a8..70d7e82 100644 --- a/src/methods/describe-generator.ts +++ b/src/methods/describe-generator.ts @@ -1,7 +1,7 @@ import { Server } from '../lexicon' import { AppContext } from '../config' import algos from '../algos' -import { AtUri } from '@atproto/uri' +import { AtUri } from '@atproto/syntax' export default function (server: Server, ctx: AppContext) { server.app.bsky.feed.describeFeedGenerator(async () => { diff --git a/src/methods/feed-generation.ts b/src/methods/feed-generation.ts index 0e114ec..0f4989e 100644 --- a/src/methods/feed-generation.ts +++ b/src/methods/feed-generation.ts @@ -3,7 +3,7 @@ import { Server } from '../lexicon' import { AppContext } from '../config' import algos from '../algos' import { validateAuth } from '../auth' -import { AtUri } from '@atproto/uri' +import { AtUri } from '@atproto/syntax' export default function (server: Server, ctx: AppContext) { server.app.bsky.feed.getFeedSkeleton(async ({ params, req }) => { diff --git a/src/server.ts b/src/server.ts index ddbd2d2..c696749 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,7 +1,7 @@ import http from 'http' import events from 'events' import express from 'express' -import { DidResolver, MemoryCache } from '@atproto/did-resolver' +import { DidResolver, MemoryCache } from '@atproto/identity' import { createServer } from './lexicon' import feedGeneration from './methods/feed-generation' import describeGenerator from './methods/describe-generator' @@ -35,10 +35,10 @@ export class FeedGenerator { const firehose = new FirehoseSubscription(db, cfg.subscriptionEndpoint) const didCache = new MemoryCache() - const didResolver = new DidResolver( - { plcUrl: 'https://plc.directory' }, + const didResolver = new DidResolver({ + plcUrl: 'https://plc.directory', didCache, - ) + }) const server = createServer({ validateResponse: true, diff --git a/yarn.lock b/yarn.lock index 32c0bde..bb48a32 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,130 +2,120 @@ # yarn lockfile v1 -"@atproto/api@^0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.3.7.tgz#5cc4b0ccc5c6690eb0e5a3ae138a84ce20697e2f" - integrity sha512-JHN3rHNGro4AaJWU64hsmpTUzd2+FbfMBiDkqyBmoKtj972ueBJeH8tz6WdnPcsIRfCj1kRthKFj2yJwgt6aSQ== +"@atproto/api@^0.6.20": + version "0.6.20" + resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.6.20.tgz#3a7eda60d73a5d5b6938e2dd016c24a7ba180c83" + integrity sha512-+peoKgkaxbglXQg9qEZcZIvyWm39yj0+syV3TBDrz5cWK4OIsdOyYBg2iISy+jvB5RzEUMe2WvOojP6Nq34mOg== dependencies: - "@atproto/common-web" "*" - "@atproto/uri" "*" - "@atproto/xrpc" "*" + "@atproto/common-web" "^0.2.1" + "@atproto/lexicon" "^0.2.2" + "@atproto/syntax" "^0.1.2" + "@atproto/xrpc" "^0.3.2" + multiformats "^9.9.0" tlds "^1.234.0" typed-emitter "^2.1.0" -"@atproto/common-web@*": - version "0.1.0" - resolved "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.1.0.tgz" - integrity sha512-qD6xF60hvH+cP++fk/mt+0S9cxs94KsK+rNWypNlgnlp7r9By4ltXwtDSR/DNTA8mwDeularUno4VbTd2IWIzA== +"@atproto/common-web@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@atproto/common-web/-/common-web-0.2.1.tgz#97412cb241321fc6c56a2b8c0b2416b3240caf50" + integrity sha512-5AoDKkKz7JhXSiicjhPihA/MJMlSuTQ9Aed9fflPuoTuT6C3aXbxaUZEcqqipSwlCfGpOzPmJmWJjMWWsYr2ew== dependencies: - multiformats "^9.6.4" + graphemer "^1.4.0" + multiformats "^9.9.0" uint8arrays "3.0.0" - zod "^3.14.2" + zod "^3.21.4" -"@atproto/common@*": - version "0.2.0" - resolved "https://registry.npmjs.org/@atproto/common/-/common-0.2.0.tgz" - integrity sha512-PVYSC30pyonz2MOxuBLk27uGdwyZQ42gJfCA/NE9jLeuenVDmZnVrK5WqJ7eGg+F88rZj7NcGfRsZdP0GMykEQ== +"@atproto/common@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.3.1.tgz#ee131c170bdb564ed4f9692db0a80ada825220c7" + integrity sha512-+YC+RG87K3Iu1oR8I6lLzeN3tH2vpkxC4MwfNFIjDiHR9N7bEma2kn1B+yvU1JoMBXc56dV91yyeWqzg6L6eGg== dependencies: - "@atproto/common-web" "*" + "@atproto/common-web" "^0.2.1" "@ipld/dag-cbor" "^7.0.3" cbor-x "^1.5.1" - multiformats "^9.6.4" - pino "^8.6.1" + iso-datestring-validator "^2.2.2" + multiformats "^9.9.0" + pino "^8.15.0" + zod "3.21.4" -"@atproto/crypto@*": - version "0.1.1" - resolved "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.1.1.tgz" - integrity sha512-/7Ntn55dRZPtCnOd6dVo1IvZzpVut6YTAkZ8iFry9JW29l7ZeNkJd+NTnmWRz3aGQody10jngb4SNxQNi/f3+A== +"@atproto/crypto@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@atproto/crypto/-/crypto-0.2.2.tgz#9832dda885512a36401d24f95990489f521593ef" + integrity sha512-yepwM6pLPw/bT7Nl0nfDw251yVDpuhc0llOgD8YdCapUAH7pIn4dBcMgXiA9UzQaHA7OC9ByO5IdGPrMN/DmZw== dependencies: - "@noble/secp256k1" "^1.7.0" - big-integer "^1.6.51" - multiformats "^9.6.4" - one-webcrypto "^1.0.3" + "@noble/curves" "^1.1.0" + "@noble/hashes" "^1.3.1" uint8arrays "3.0.0" -"@atproto/did-resolver@*", "@atproto/did-resolver@^0.1.0": - version "0.1.0" - resolved "https://registry.npmjs.org/@atproto/did-resolver/-/did-resolver-0.1.0.tgz" - integrity sha512-ztljyMMCqXvJSi/Qqa2zEQFvOm1AUUR7Bybr3cM1BCddbhW46gk6/g8BgdZeDt2sMBdye37qTctR9O/FjhigvQ== +"@atproto/identity@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@atproto/identity/-/identity-0.2.1.tgz#8203ba53a25c3300d1aec0c28eb10a106919b410" + integrity sha512-daLEYCSOrEaXpsoSAZ1G5mlDs3qT9ZHTFIBip14yHUWB0gVb+/KI9lU+DGSo+RGPlzYF+A5Y+Nni4j3IRVVlSA== dependencies: - "@atproto/common-web" "*" - "@atproto/crypto" "*" + "@atproto/common-web" "^0.2.1" + "@atproto/crypto" "^0.2.2" axios "^0.27.2" - zod "^3.14.2" + zod "^3.21.4" -"@atproto/identifier@*": - version "0.1.0" - resolved "https://registry.npmjs.org/@atproto/identifier/-/identifier-0.1.0.tgz" - integrity sha512-3LV7+4E6S0k8Rru7NBkyDF6Zf6NHVUXVS9d4l9fiXWMC49ghZMjq0vPmz80xjG1rRuFdJFbpRf4ApFciGxLIyQ== +"@atproto/lexicon@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.2.2.tgz#938a39482ff41c6a908f4ad43274adba595f3643" + integrity sha512-CvmjaSDavHMOJTuNYE8VjYhL7TVxBYV8QSWh2jHCpzfmj02DvVD9UBIfnoVv67POJkEtWXddjoV9beaIbaq/Xg== dependencies: - "@atproto/common-web" "*" - -"@atproto/lexicon@*", "@atproto/lexicon@^0.1.0": - version "0.1.0" - resolved "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.1.0.tgz" - integrity sha512-Iy+gV9w42xLhrZrmcbZh7VFoHjXuzWvecGHIfz44owNjjv7aE/d2P5BbOX/XicSkmQ8Qkpg0BqwYDD1XBVS+DQ== - dependencies: - "@atproto/common-web" "*" - "@atproto/identifier" "*" - "@atproto/nsid" "*" - "@atproto/uri" "*" + "@atproto/common-web" "^0.2.1" + "@atproto/syntax" "^0.1.2" iso-datestring-validator "^2.2.2" - multiformats "^9.6.4" - zod "^3.14.2" + multiformats "^9.9.0" + zod "^3.21.4" -"@atproto/nsid@*": - version "0.0.1" - resolved "https://registry.npmjs.org/@atproto/nsid/-/nsid-0.0.1.tgz" - integrity sha512-t5M6/CzWBVYoBbIvfKDpqPj/+ZmyoK9ydZSStcTXosJ27XXwOPhz0VDUGKK2SM9G5Y7TPes8S5KTAU0UdVYFCw== - -"@atproto/repo@^0.1.0": - version "0.1.0" - resolved "https://registry.npmjs.org/@atproto/repo/-/repo-0.1.0.tgz" - integrity sha512-O4qs5WfSjEFvUtpOTB4n9cLcK6YP/w/ly6Qxc3S8IFevLGYX58NPPr5zlg3dxs64uLKbWWjzhQM7JAqO44MEKw== +"@atproto/repo@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@atproto/repo/-/repo-0.3.2.tgz#46cd9f8a16b82de7fda6760e611999a9d42f5545" + integrity sha512-J8RD168I3+IpkOU4M4+OBL2uX4HtBD+AYntZ7yjL8i4qHyhZU3PTERQNz908sH3hgQXGU1ueeNJOqhgXbLFD8w== dependencies: - "@atproto/common" "*" - "@atproto/crypto" "*" - "@atproto/did-resolver" "*" - "@atproto/lexicon" "*" - "@atproto/nsid" "*" + "@atproto/common" "^0.3.1" + "@atproto/common-web" "^0.2.1" + "@atproto/crypto" "^0.2.2" + "@atproto/identity" "^0.2.1" + "@atproto/lexicon" "^0.2.2" + "@atproto/syntax" "^0.1.2" "@ipld/car" "^3.2.3" "@ipld/dag-cbor" "^7.0.0" - multiformats "^9.6.4" + multiformats "^9.9.0" uint8arrays "3.0.0" - zod "^3.14.2" + zod "^3.21.4" -"@atproto/uri@*", "@atproto/uri@^0.0.2": - version "0.0.2" - resolved "https://registry.npmjs.org/@atproto/uri/-/uri-0.0.2.tgz" - integrity sha512-/6otLZF7BLpT9suSdHuXLbL12nINcWPsLmcOI+dctqovWUjH+XIRVNXDQgBYSrPVetxMiknuEwWelmnA33AEXg== +"@atproto/syntax@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@atproto/syntax/-/syntax-0.1.2.tgz#417366d36b53ecf29d9d1f6e35179b1f3feef95b" + integrity sha512-n6VSuccMGouwftCvZBq9WNwI0qYCMOH/lTHSV+/dT232lX7pIrqisOlErUSBoOJ49B1Wxy1DjeeBS26ap9SsGQ== dependencies: - "@atproto/identifier" "*" - "@atproto/nsid" "*" + "@atproto/common-web" "^0.2.1" -"@atproto/xrpc-server@^0.2.0": - version "0.2.0" - resolved "https://registry.npmjs.org/@atproto/xrpc-server/-/xrpc-server-0.2.0.tgz" - integrity sha512-sCJuVUIb1tDIlKCFwHPRHbAgEy0HYGlQ7XhpNqMRKXECh8Z+DRICEne3gLDVaXhyNaC/N7OjHcsyuofDDbuGFQ== +"@atproto/xrpc-server@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@atproto/xrpc-server/-/xrpc-server-0.3.2.tgz#85bc901991c3de896d463c0cd1d396ab1c772387" + integrity sha512-aracV1+1t88AU+zN/RTmZGvvjlMiNIooLotz23FvD4qoiUSx6KxrTwttHZdw5ZJE14XTDR1D9brpyvdCJHsKNA== dependencies: - "@atproto/common" "*" - "@atproto/crypto" "*" - "@atproto/lexicon" "*" + "@atproto/common" "^0.3.1" + "@atproto/crypto" "^0.2.2" + "@atproto/lexicon" "^0.2.2" cbor-x "^1.5.1" express "^4.17.2" http-errors "^2.0.0" mime-types "^2.1.35" + rate-limiter-flexible "^2.4.1" uint8arrays "3.0.0" ws "^8.12.0" - zod "^3.14.2" + zod "^3.21.4" -"@atproto/xrpc@*": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@atproto/xrpc/-/xrpc-0.1.0.tgz#798569095538ac060475ae51f1b4c071ff8776d6" - integrity sha512-LhBeZkQwPezjEtricGYnG62udFglOqlnmMSS0KyWgEAPi4KMp4H2F4jNoXcf5NPtZ9S4N4hJaErHX4PJYv2lfA== +"@atproto/xrpc@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@atproto/xrpc/-/xrpc-0.3.2.tgz#432a364be4b3bf8660a088a07dadecac10209763" + integrity sha512-D9jGjcFnEMHuGQ56v6+78uX3RiytKLrA5ITLq6shy0Qj6Zvt5MqV+/cTFuNPKrNCrnWOtHFeRQwMqyGhNS9qZQ== dependencies: - "@atproto/lexicon" "*" - zod "^3.14.2" + "@atproto/lexicon" "^0.2.2" + zod "^3.21.4" "@cbor-extract/cbor-extract-darwin-arm64@2.1.1": version "2.1.1" @@ -199,10 +189,17 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@noble/secp256k1@^1.7.0": - version "1.7.1" - resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== +"@noble/curves@^1.1.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2", "@noble/hashes@^1.3.1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== "@tsconfig/node10@^1.0.7": version "1.0.9" @@ -368,11 +365,6 @@ better-sqlite3@^8.3.0: bindings "^1.5.0" prebuild-install "^7.1.0" -big-integer@^1.6.51: - version "1.6.51" - resolved "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz" - integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== - bindings@^1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" @@ -700,6 +692,11 @@ github-from-package@0.0.0: resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" @@ -829,7 +826,7 @@ ms@2.1.3: resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multiformats@^9.4.2, multiformats@^9.5.4, multiformats@^9.6.4, multiformats@^9.9.0: +multiformats@^9.4.2, multiformats@^9.5.4, multiformats@^9.9.0: version "9.9.0" resolved "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz" integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== @@ -880,11 +877,6 @@ once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -one-webcrypto@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/one-webcrypto/-/one-webcrypto-1.0.3.tgz" - integrity sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q== - parseurl@~1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" @@ -895,10 +887,10 @@ path-to-regexp@0.1.7: resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== -pino-abstract-transport@v1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz" - integrity sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA== +pino-abstract-transport@v1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz#083d98f966262164504afb989bccd05f665937a8" + integrity sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA== dependencies: readable-stream "^4.0.0" split2 "^4.0.0" @@ -908,15 +900,15 @@ pino-std-serializers@^6.0.0: resolved "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.1.tgz" integrity sha512-wHuWB+CvSVb2XqXM0W/WOYUkVSPbiJb9S5fNB7TBhd8s892Xq910bRxwHtC4l71hgztObTjXL6ZheZXFjhDrDQ== -pino@^8.6.1: - version "8.14.1" - resolved "https://registry.npmjs.org/pino/-/pino-8.14.1.tgz" - integrity sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw== +pino@^8.15.0: + version "8.15.1" + resolved "https://registry.yarnpkg.com/pino/-/pino-8.15.1.tgz#04b815ff7aa4e46b1bbab88d8010aaa2b17eaba4" + integrity sha512-Cp4QzUQrvWCRJaQ8Lzv0mJzXVk4z2jlq8JNKMGaixC2Pz5L4l2p95TkuRvYbrEbe85NQsDKrAd4zalf7Ml6WiA== dependencies: atomic-sleep "^1.0.0" fast-redact "^3.1.1" on-exit-leak-free "^2.1.0" - pino-abstract-transport v1.0.0 + pino-abstract-transport v1.1.0 pino-std-serializers "^6.0.0" process-warning "^2.0.0" quick-format-unescaped "^4.0.3" @@ -986,6 +978,11 @@ range-parser@~1.2.1: resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== +rate-limiter-flexible@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/rate-limiter-flexible/-/rate-limiter-flexible-2.4.2.tgz#2a219cc473f015142fd8fb599371223d730decbd" + integrity sha512-rMATGGOdO1suFyf/mI5LYhts71g1sbdhmd6YvdiXO2gJnd42Tt6QS4JUKJKSWVVkMtBacm6l40FR7Trjo6Iruw== + raw-body@2.5.1: version "2.5.1" resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz" @@ -1291,7 +1288,12 @@ yn@3.1.1: resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== -zod@^3.14.2: +zod@3.21.4: version "3.21.4" - resolved "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== + +zod@^3.21.4: + version "3.22.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b" + integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==