From a00745d63b4291e32fc62e2ea00d51fbd86a86a2 Mon Sep 17 00:00:00 2001 From: dholms Date: Mon, 11 Mar 2024 19:13:03 -0500 Subject: [PATCH] codegen --- lexicons/tools/ozone/communication/defs.json | 2 +- lexicons/tools/ozone/moderation/defs.json | 10 +- packages/api/src/client/index.ts | 174 -- packages/api/src/client/lexicons.ts | 1738 ++--------------- .../admin/createCommunicationTemplate.ts | 43 - .../client/types/com/atproto/admin/defs.ts | 697 ------- .../admin/deleteCommunicationTemplate.ts | 32 - .../com/atproto/admin/emitModerationEvent.ts | 62 - .../com/atproto/admin/getModerationEvent.ts | 32 - .../types/com/atproto/admin/getRecord.ts | 40 - .../client/types/com/atproto/admin/getRepo.ts | 39 - .../admin/listCommunicationTemplates.ts | 34 - .../atproto/admin/queryModerationEvents.ts | 63 - .../atproto/admin/queryModerationStatuses.ts | 64 - .../types/com/atproto/admin/searchRepos.ts | 41 - .../admin/updateCommunicationTemplate.ts | 46 - packages/bsky/src/lexicon/index.ts | 138 -- packages/bsky/src/lexicon/lexicons.ts | 1738 ++--------------- .../admin/createCommunicationTemplate.ts | 54 - .../lexicon/types/com/atproto/admin/defs.ts | 697 ------- .../admin/deleteCommunicationTemplate.ts | 38 - .../com/atproto/admin/emitModerationEvent.ts | 67 - .../com/atproto/admin/getModerationEvent.ts | 41 - .../types/com/atproto/admin/getRecord.ts | 43 - .../types/com/atproto/admin/getRepo.ts | 42 - .../admin/listCommunicationTemplates.ts | 44 - .../atproto/admin/queryModerationEvents.ts | 73 - .../atproto/admin/queryModerationStatuses.ts | 74 - .../types/com/atproto/admin/searchRepos.ts | 51 - .../admin/updateCommunicationTemplate.ts | 57 - packages/ozone/src/lexicon/index.ts | 138 -- packages/ozone/src/lexicon/lexicons.ts | 1738 ++--------------- .../admin/createCommunicationTemplate.ts | 54 - .../lexicon/types/com/atproto/admin/defs.ts | 697 ------- .../admin/deleteCommunicationTemplate.ts | 38 - .../com/atproto/admin/emitModerationEvent.ts | 67 - .../com/atproto/admin/getModerationEvent.ts | 41 - .../types/com/atproto/admin/getRecord.ts | 43 - .../types/com/atproto/admin/getRepo.ts | 42 - .../admin/listCommunicationTemplates.ts | 44 - .../atproto/admin/queryModerationEvents.ts | 73 - .../atproto/admin/queryModerationStatuses.ts | 74 - .../types/com/atproto/admin/searchRepos.ts | 51 - .../admin/updateCommunicationTemplate.ts | 57 - packages/pds/src/lexicon/index.ts | 138 -- packages/pds/src/lexicon/lexicons.ts | 1738 ++--------------- .../admin/createCommunicationTemplate.ts | 54 - .../lexicon/types/com/atproto/admin/defs.ts | 697 ------- .../admin/deleteCommunicationTemplate.ts | 38 - .../com/atproto/admin/emitModerationEvent.ts | 67 - .../com/atproto/admin/getModerationEvent.ts | 41 - .../types/com/atproto/admin/getRecord.ts | 43 - .../types/com/atproto/admin/getRepo.ts | 42 - .../admin/listCommunicationTemplates.ts | 44 - .../atproto/admin/queryModerationEvents.ts | 73 - .../atproto/admin/queryModerationStatuses.ts | 74 - .../types/com/atproto/admin/searchRepos.ts | 51 - .../admin/updateCommunicationTemplate.ts | 57 - 58 files changed, 549 insertions(+), 12039 deletions(-) delete mode 100644 packages/api/src/client/types/com/atproto/admin/createCommunicationTemplate.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/deleteCommunicationTemplate.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/emitModerationEvent.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/getModerationEvent.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/getRecord.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/getRepo.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/listCommunicationTemplates.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/queryModerationEvents.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/queryModerationStatuses.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/searchRepos.ts delete mode 100644 packages/api/src/client/types/com/atproto/admin/updateCommunicationTemplate.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/getModerationEvent.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/getRecord.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/getRepo.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/searchRepos.ts delete mode 100644 packages/bsky/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/getModerationEvent.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/getRecord.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/getRepo.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/searchRepos.ts delete mode 100644 packages/ozone/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/getModerationEvent.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/getRecord.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/getRepo.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/searchRepos.ts delete mode 100644 packages/pds/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts diff --git a/lexicons/tools/ozone/communication/defs.json b/lexicons/tools/ozone/communication/defs.json index 9ce11044fe3..89d28bdf690 100644 --- a/lexicons/tools/ozone/communication/defs.json +++ b/lexicons/tools/ozone/communication/defs.json @@ -35,4 +35,4 @@ } } } -} \ No newline at end of file +} diff --git a/lexicons/tools/ozone/moderation/defs.json b/lexicons/tools/ozone/moderation/defs.json index f38abc0bf05..e8420d2bd32 100644 --- a/lexicons/tools/ozone/moderation/defs.json +++ b/lexicons/tools/ozone/moderation/defs.json @@ -31,7 +31,10 @@ }, "subject": { "type": "union", - "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ] }, "subjectBlobCids": { "type": "array", "items": { "type": "string" } }, "createdBy": { "type": "string", "format": "did" }, @@ -91,7 +94,10 @@ "id": { "type": "integer" }, "subject": { "type": "union", - "refs": ["com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef"] + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ] }, "subjectBlobCids": { "type": "array", diff --git a/packages/api/src/client/index.ts b/packages/api/src/client/index.ts index 0db3e20e4f9..02201560f58 100644 --- a/packages/api/src/client/index.ts +++ b/packages/api/src/client/index.ts @@ -7,30 +7,19 @@ import { } from '@atproto/xrpc' import { schemas } from './lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminCreateCommunicationTemplate from './types/com/atproto/admin/createCommunicationTemplate' import * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs' import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -import * as ComAtprotoAdminDeleteCommunicationTemplate from './types/com/atproto/admin/deleteCommunicationTemplate' import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -import * as ComAtprotoAdminEmitModerationEvent from './types/com/atproto/admin/emitModerationEvent' import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -import * as ComAtprotoAdminGetModerationEvent from './types/com/atproto/admin/getModerationEvent' -import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' -import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -import * as ComAtprotoAdminListCommunicationTemplates from './types/com/atproto/admin/listCommunicationTemplates' -import * as ComAtprotoAdminQueryModerationEvents from './types/com/atproto/admin/queryModerationEvents' -import * as ComAtprotoAdminQueryModerationStatuses from './types/com/atproto/admin/queryModerationStatuses' -import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -import * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate' import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' @@ -164,30 +153,19 @@ import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecce import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export * as ComAtprotoAdminCreateCommunicationTemplate from './types/com/atproto/admin/createCommunicationTemplate' export * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs' export * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -export * as ComAtprotoAdminDeleteCommunicationTemplate from './types/com/atproto/admin/deleteCommunicationTemplate' export * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' export * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -export * as ComAtprotoAdminEmitModerationEvent from './types/com/atproto/admin/emitModerationEvent' export * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' export * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' export * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' export * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -export * as ComAtprotoAdminGetModerationEvent from './types/com/atproto/admin/getModerationEvent' -export * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' -export * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' export * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -export * as ComAtprotoAdminListCommunicationTemplates from './types/com/atproto/admin/listCommunicationTemplates' -export * as ComAtprotoAdminQueryModerationEvents from './types/com/atproto/admin/queryModerationEvents' -export * as ComAtprotoAdminQueryModerationStatuses from './types/com/atproto/admin/queryModerationStatuses' -export * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' export * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' export * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -export * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate' export * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' export * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' export * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' @@ -321,12 +299,6 @@ export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecce export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export const COM_ATPROTO_ADMIN = { - DefsReviewOpen: 'com.atproto.admin.defs#reviewOpen', - DefsReviewEscalated: 'com.atproto.admin.defs#reviewEscalated', - DefsReviewClosed: 'com.atproto.admin.defs#reviewClosed', - DefsReviewNone: 'com.atproto.admin.defs#reviewNone', -} export const COM_ATPROTO_MODERATION = { DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', @@ -412,22 +384,6 @@ export class ComAtprotoAdminNS { this._service = service } - createCommunicationTemplate( - data?: ComAtprotoAdminCreateCommunicationTemplate.InputSchema, - opts?: ComAtprotoAdminCreateCommunicationTemplate.CallOptions, - ): Promise { - return this._service.xrpc - .call( - 'com.atproto.admin.createCommunicationTemplate', - opts?.qp, - data, - opts, - ) - .catch((e) => { - throw ComAtprotoAdminCreateCommunicationTemplate.toKnownErr(e) - }) - } - deleteAccount( data?: ComAtprotoAdminDeleteAccount.InputSchema, opts?: ComAtprotoAdminDeleteAccount.CallOptions, @@ -439,22 +395,6 @@ export class ComAtprotoAdminNS { }) } - deleteCommunicationTemplate( - data?: ComAtprotoAdminDeleteCommunicationTemplate.InputSchema, - opts?: ComAtprotoAdminDeleteCommunicationTemplate.CallOptions, - ): Promise { - return this._service.xrpc - .call( - 'com.atproto.admin.deleteCommunicationTemplate', - opts?.qp, - data, - opts, - ) - .catch((e) => { - throw ComAtprotoAdminDeleteCommunicationTemplate.toKnownErr(e) - }) - } - disableAccountInvites( data?: ComAtprotoAdminDisableAccountInvites.InputSchema, opts?: ComAtprotoAdminDisableAccountInvites.CallOptions, @@ -477,17 +417,6 @@ export class ComAtprotoAdminNS { }) } - emitModerationEvent( - data?: ComAtprotoAdminEmitModerationEvent.InputSchema, - opts?: ComAtprotoAdminEmitModerationEvent.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.emitModerationEvent', opts?.qp, data, opts) - .catch((e) => { - throw ComAtprotoAdminEmitModerationEvent.toKnownErr(e) - }) - } - enableAccountInvites( data?: ComAtprotoAdminEnableAccountInvites.InputSchema, opts?: ComAtprotoAdminEnableAccountInvites.CallOptions, @@ -532,39 +461,6 @@ export class ComAtprotoAdminNS { }) } - getModerationEvent( - params?: ComAtprotoAdminGetModerationEvent.QueryParams, - opts?: ComAtprotoAdminGetModerationEvent.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.getModerationEvent', params, undefined, opts) - .catch((e) => { - throw ComAtprotoAdminGetModerationEvent.toKnownErr(e) - }) - } - - getRecord( - params?: ComAtprotoAdminGetRecord.QueryParams, - opts?: ComAtprotoAdminGetRecord.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.getRecord', params, undefined, opts) - .catch((e) => { - throw ComAtprotoAdminGetRecord.toKnownErr(e) - }) - } - - getRepo( - params?: ComAtprotoAdminGetRepo.QueryParams, - opts?: ComAtprotoAdminGetRepo.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.getRepo', params, undefined, opts) - .catch((e) => { - throw ComAtprotoAdminGetRepo.toKnownErr(e) - }) - } - getSubjectStatus( params?: ComAtprotoAdminGetSubjectStatus.QueryParams, opts?: ComAtprotoAdminGetSubjectStatus.CallOptions, @@ -576,60 +472,6 @@ export class ComAtprotoAdminNS { }) } - listCommunicationTemplates( - params?: ComAtprotoAdminListCommunicationTemplates.QueryParams, - opts?: ComAtprotoAdminListCommunicationTemplates.CallOptions, - ): Promise { - return this._service.xrpc - .call( - 'com.atproto.admin.listCommunicationTemplates', - params, - undefined, - opts, - ) - .catch((e) => { - throw ComAtprotoAdminListCommunicationTemplates.toKnownErr(e) - }) - } - - queryModerationEvents( - params?: ComAtprotoAdminQueryModerationEvents.QueryParams, - opts?: ComAtprotoAdminQueryModerationEvents.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.queryModerationEvents', params, undefined, opts) - .catch((e) => { - throw ComAtprotoAdminQueryModerationEvents.toKnownErr(e) - }) - } - - queryModerationStatuses( - params?: ComAtprotoAdminQueryModerationStatuses.QueryParams, - opts?: ComAtprotoAdminQueryModerationStatuses.CallOptions, - ): Promise { - return this._service.xrpc - .call( - 'com.atproto.admin.queryModerationStatuses', - params, - undefined, - opts, - ) - .catch((e) => { - throw ComAtprotoAdminQueryModerationStatuses.toKnownErr(e) - }) - } - - searchRepos( - params?: ComAtprotoAdminSearchRepos.QueryParams, - opts?: ComAtprotoAdminSearchRepos.CallOptions, - ): Promise { - return this._service.xrpc - .call('com.atproto.admin.searchRepos', params, undefined, opts) - .catch((e) => { - throw ComAtprotoAdminSearchRepos.toKnownErr(e) - }) - } - sendEmail( data?: ComAtprotoAdminSendEmail.InputSchema, opts?: ComAtprotoAdminSendEmail.CallOptions, @@ -674,22 +516,6 @@ export class ComAtprotoAdminNS { }) } - updateCommunicationTemplate( - data?: ComAtprotoAdminUpdateCommunicationTemplate.InputSchema, - opts?: ComAtprotoAdminUpdateCommunicationTemplate.CallOptions, - ): Promise { - return this._service.xrpc - .call( - 'com.atproto.admin.updateCommunicationTemplate', - opts?.qp, - data, - opts, - ) - .catch((e) => { - throw ComAtprotoAdminUpdateCommunicationTemplate.toKnownErr(e) - }) - } - updateSubjectStatus( data?: ComAtprotoAdminUpdateSubjectStatus.InputSchema, opts?: ComAtprotoAdminUpdateSubjectStatus.CallOptions, diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 635e9e19e60..6603408a87f 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -4,51 +4,6 @@ import { LexiconDoc, Lexicons } from '@atproto/lexicon' export const schemaDict = { - ComAtprotoAdminCreateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.createCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to create a new, re-usable communication (email for now) template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject', 'contentMarkdown', 'name'], - properties: { - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - createdBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is creating the template.', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminDefs: { lexicon: 1, id: 'com.atproto.admin.defs', @@ -65,1184 +20,128 @@ export const schemaDict = { }, }, }, - modEventView: { + accountView: { type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobCids', - 'createdBy', - 'createdAt', - ], + required: ['did', 'handle', 'indexedAt'], properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - }, - }, - createdBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - creatorHandle: { + handle: { type: 'string', + format: 'handle', }, - subjectHandle: { + email: { type: 'string', }, - }, - }, - modEventViewDetail: { - type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobs', - 'createdBy', - 'createdAt', - ], - properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - 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: { + relatedRecords: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', + type: 'unknown', }, }, - createdBy: { - type: 'string', - format: 'did', - }, - createdAt: { + indexedAt: { type: 'string', format: 'datetime', }, - }, - }, - reportView: { - type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActionIds', - ], - properties: { - id: { - type: 'integer', - }, - reasonType: { + invitedBy: { type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - subjectRepoHandle: { - type: 'string', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - reportedBy: { - type: 'string', - format: 'did', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActionIds: { - type: 'array', - items: { - type: 'integer', - }, - }, - }, - }, - subjectStatusView: { - type: 'object', - required: ['id', 'subject', 'createdAt', 'updatedAt', 'reviewState'], - properties: { - id: { - type: 'integer', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], + ref: 'lex:com.atproto.server.defs#inviteCode', }, - subjectBlobCids: { + invites: { type: 'array', items: { - type: 'string', - format: 'cid', + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, - subjectRepoHandle: { - type: 'string', - }, - updatedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the last update was made to the moderation status of the subject', - }, - createdAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing the first moderation status impacting event was emitted on the subject', - }, - reviewState: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectReviewState', - }, - comment: { - type: 'string', - description: 'Sticky comment on the subject.', - }, - muteUntil: { - type: 'string', - format: 'datetime', - }, - lastReviewedBy: { - type: 'string', - format: 'did', - }, - lastReviewedAt: { - type: 'string', - format: 'datetime', - }, - lastReportedAt: { - type: 'string', - format: 'datetime', - }, - lastAppealedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the author of the subject appealed a moderation action', - }, - takendown: { - type: 'boolean', - }, - appealed: { + invitesDisabled: { type: 'boolean', - description: - 'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.', }, - suspendUntil: { + emailConfirmedAt: { type: 'string', format: 'datetime', }, - tags: { - type: 'array', - items: { - type: 'string', - }, + inviteNote: { + type: 'string', }, }, }, - reportViewDetail: { + repoRef: { type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActions', - ], + required: ['did'], properties: { - id: { - type: 'integer', - }, - reasonType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - 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', - ], - }, - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - reportedBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActions: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, }, }, - repoView: { + repoBlobRef: { type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], + required: ['did', 'cid'], properties: { did: { type: 'string', format: 'did', }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { + cid: { type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invitesDisabled: { - type: 'boolean', + format: 'cid', }, - inviteNote: { + recordUri: { type: 'string', + format: 'at-uri', }, }, }, - repoViewDetail: { - type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - inviteNote: { - type: 'string', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - accountView: { - type: 'object', - required: ['did', 'handle', 'indexedAt'], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - inviteNote: { - type: 'string', - }, - }, - }, - repoViewNotFound: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoRef: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoBlobRef: { - type: 'object', - required: ['did', 'cid'], - properties: { - did: { - type: 'string', - format: 'did', - }, - cid: { - type: 'string', - format: 'cid', - }, - recordUri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - recordView: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobCids', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewDetail: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobs', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobs: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', - }, - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewNotFound: { - type: 'object', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - moderation: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - moderationDetail: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - blobView: { - type: 'object', - required: ['cid', 'mimeType', 'size', 'createdAt'], - properties: { - cid: { - type: 'string', - format: 'cid', - }, - mimeType: { - type: 'string', - }, - size: { - type: 'integer', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - details: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#imageDetails', - 'lex:com.atproto.admin.defs#videoDetails', - ], - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - }, - }, - imageDetails: { - type: 'object', - required: ['width', 'height'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - }, - }, - videoDetails: { - type: 'object', - required: ['width', 'height', 'length'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - length: { - type: 'integer', - }, - }, - }, - subjectReviewState: { - type: 'string', - knownValues: [ - 'lex:com.atproto.admin.defs#reviewOpen', - 'lex:com.atproto.admin.defs#reviewEscalated', - 'lex:com.atproto.admin.defs#reviewClosed', - 'lex:com.atproto.admin.defs#reviewNone', - ], - }, - reviewOpen: { - type: 'token', - description: - 'Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator', - }, - reviewEscalated: { - type: 'token', - description: - 'Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator', - }, - reviewClosed: { - type: 'token', - description: - 'Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator', - }, - reviewNone: { - type: 'token', - description: - 'Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it', - }, - modEventTakedown: { - type: 'object', - description: 'Take down a subject permanently or temporarily', - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: - 'Indicates how long the takedown should be in effect before automatically expiring.', - }, - }, - }, - modEventReverseTakedown: { - type: 'object', - description: 'Revert take down action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventResolveAppeal: { - type: 'object', - description: 'Resolve appeal on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe resolution.', - }, - }, - }, - modEventComment: { - type: 'object', - description: 'Add a comment to a subject', - required: ['comment'], - properties: { - comment: { - type: 'string', - }, - sticky: { - type: 'boolean', - description: 'Make the comment persistent on the subject', - }, - }, - }, - modEventReport: { - type: 'object', - description: 'Report a subject', - required: ['reportType'], - properties: { - comment: { - type: 'string', - }, - reportType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - }, - }, - modEventLabel: { - type: 'object', - description: 'Apply/Negate labels on a subject', - required: ['createLabelVals', 'negateLabelVals'], - properties: { - comment: { - type: 'string', - }, - createLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - negateLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - modEventAcknowledge: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventEscalate: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventMute: { - type: 'object', - description: 'Mute incoming reports on a subject', - required: ['durationInHours'], - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: 'Indicates how long the subject should remain muted.', - }, - }, - }, - modEventUnmute: { - type: 'object', - description: 'Unmute action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventEmail: { - type: 'object', - description: 'Keep a log of outgoing email to a user', - required: ['subjectLine'], - properties: { - subjectLine: { - type: 'string', - description: 'The subject line of the email sent to the user.', - }, - content: { - type: 'string', - description: 'The content of the email sent to the user.', - }, - comment: { - type: 'string', - description: 'Additional comment about the outgoing comm.', - }, - }, - }, - modEventTag: { - type: 'object', - description: 'Add/Remove a tag on a subject', - required: ['add', 'remove'], - properties: { - add: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be added to the subject. If already exists, won't be duplicated.", - }, - remove: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", - }, - comment: { - type: 'string', - description: 'Additional comment about added/removed tags.', - }, - }, - }, - communicationTemplateView: { - type: 'object', - required: [ - 'id', - 'name', - 'contentMarkdown', - 'disabled', - 'lastUpdatedBy', - 'createdAt', - 'updatedAt', - ], - properties: { - id: { - type: 'string', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - subject: { - type: 'string', - description: - 'Content of the template, can contain markdown and variable placeholders.', - }, - contentMarkdown: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - disabled: { - type: 'boolean', - }, - lastUpdatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who last updated the template.', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - updatedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteAccount: { - lexicon: 1, - id: 'com.atproto.admin.deleteAccount', - defs: { - main: { - type: 'procedure', - description: 'Delete a user account as an administrator.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.deleteCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: 'Delete a communication template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableAccountInvites: { - lexicon: 1, - id: 'com.atproto.admin.disableAccountInvites', - defs: { - main: { - type: 'procedure', - description: - 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['account'], - properties: { - account: { - type: 'string', - format: 'did', - }, - note: { - type: 'string', - description: 'Optional reason for disabled invites.', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableInviteCodes: { - lexicon: 1, - id: 'com.atproto.admin.disableInviteCodes', - defs: { - main: { - type: 'procedure', - description: - 'Disable some set of codes and/or all codes associated with a set of users.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - properties: { - codes: { - type: 'array', - items: { - type: 'string', - }, - }, - accounts: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminEmitModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.emitModerationEvent', - defs: { - main: { - type: 'procedure', - description: 'Take a moderation action on an actor.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['event', 'subject', 'createdBy'], - properties: { - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventUnmute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventTag', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - createdBy: { - type: 'string', - format: 'did', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, - errors: [ - { - name: 'SubjectHasAction', - }, - ], - }, }, }, - ComAtprotoAdminEnableAccountInvites: { + ComAtprotoAdminDeleteAccount: { lexicon: 1, - id: 'com.atproto.admin.enableAccountInvites', + id: 'com.atproto.admin.deleteAccount', defs: { main: { type: 'procedure', - description: "Re-enable an account's ability to receive invite codes.", + description: 'Delete a user account as an administrator.', input: { encoding: 'application/json', schema: { type: 'object', - required: ['account'], + required: ['did'], properties: { - account: { + did: { type: 'string', format: 'did', }, - note: { - type: 'string', - description: 'Optional reason for enabled invites.', - }, }, }, }, }, }, }, - ComAtprotoAdminGetAccountInfo: { + ComAtprotoAdminDisableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.getAccountInfo', + id: 'com.atproto.admin.disableAccountInvites', defs: { main: { - type: 'query', - description: 'Get details about an account.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', + input: { encoding: 'application/json', schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, - }, - }, - }, - }, - ComAtprotoAdminGetAccountInfos: { - lexicon: 1, - id: 'com.atproto.admin.getAccountInfos', - defs: { - main: { - type: 'query', - description: 'Get details about some accounts.', - parameters: { - type: 'params', - required: ['dids'], - properties: { - dids: { - type: 'array', - items: { + type: 'object', + required: ['account'], + properties: { + account: { type: 'string', format: 'did', }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['infos'], - properties: { - infos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, + note: { + type: 'string', + description: 'Optional reason for disabled invites.', }, }, }, @@ -1250,190 +149,30 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminGetInviteCodes: { + ComAtprotoAdminDisableInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.getInviteCodes', + id: 'com.atproto.admin.disableInviteCodes', defs: { main: { - type: 'query', - description: 'Get an admin view of invite codes.', - parameters: { - type: 'params', - properties: { - sort: { - type: 'string', - knownValues: ['recent', 'usage'], - default: 'recent', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 500, - default: 100, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable some set of codes and/or all codes associated with a set of users.', + input: { encoding: 'application/json', schema: { type: 'object', - required: ['codes'], properties: { - cursor: { - type: 'string', - }, codes: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', + type: 'string', }, }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminGetModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.getModerationEvent', - defs: { - main: { - type: 'query', - description: 'Get details about a moderation event.', - parameters: { - type: 'params', - required: ['id'], - properties: { - id: { - type: 'integer', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventViewDetail', - }, - }, - }, - }, - }, - ComAtprotoAdminGetRecord: { - lexicon: 1, - id: 'com.atproto.admin.getRecord', - defs: { - main: { - type: 'query', - description: 'Get details about a record.', - parameters: { - type: 'params', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#recordViewDetail', - }, - }, - errors: [ - { - name: 'RecordNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetRepo: { - lexicon: 1, - id: 'com.atproto.admin.getRepo', - defs: { - main: { - type: 'query', - description: 'Get details about a repository.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoViewDetail', - }, - }, - errors: [ - { - name: 'RepoNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetSubjectStatus: { - lexicon: 1, - id: 'com.atproto.admin.getSubjectStatus', - defs: { - main: { - type: 'query', - description: - 'Get the service-specific admin status of a subject (account, record, or blob).', - parameters: { - type: 'params', - properties: { - did: { - type: 'string', - format: 'did', - }, - uri: { - type: 'string', - format: 'at-uri', - }, - blob: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject'], - properties: { - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - 'lex:com.atproto.admin.defs#repoBlobRef', - ], - }, - takedown: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#statusAttr', + accounts: { + type: 'array', + items: { + type: 'string', + }, }, }, }, @@ -1441,25 +180,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminListCommunicationTemplates: { + ComAtprotoAdminEnableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.listCommunicationTemplates', + id: 'com.atproto.admin.enableAccountInvites', defs: { main: { - type: 'query', - description: 'Get list of all communication templates.', - output: { + type: 'procedure', + description: "Re-enable an account's ability to receive invite codes.", + input: { encoding: 'application/json', schema: { type: 'object', - required: ['communicationTemplates'], + required: ['account'], properties: { - communicationTemplates: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, + account: { + type: 'string', + format: 'did', + }, + note: { + type: 'string', + description: 'Optional reason for enabled invites.', }, }, }, @@ -1467,127 +207,64 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationEvents: { + ComAtprotoAdminGetAccountInfo: { lexicon: 1, - id: 'com.atproto.admin.queryModerationEvents', + id: 'com.atproto.admin.getAccountInfo', defs: { main: { type: 'query', - description: 'List moderation events related to a subject.', + description: 'Get details about an account.', parameters: { type: 'params', + required: ['did'], properties: { - types: { - type: 'array', - items: { - type: 'string', - }, - description: - 'The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned.', - }, - createdBy: { + did: { type: 'string', format: 'did', }, - sortDirection: { - type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - description: - 'Sort direction for the events. Defaults to descending order of created at timestamp.', - }, - createdAfter: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created after a given timestamp', - }, - createdBefore: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created before a given timestamp', - }, - subject: { - type: 'string', - format: 'uri', - }, - includeAllUserRecords: { - type: 'boolean', - default: false, - description: - 'If true, events on all record types (posts, lists, profile etc.) owned by the did are returned', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - hasComment: { - type: 'boolean', - description: 'If true, only events with comments are returned', - }, - comment: { - type: 'string', - description: - 'If specified, only events with comments containing the keyword are returned', - }, - addedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were added are returned', - }, - removedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were removed are returned', - }, - addedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were added are returned', - }, - removedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were removed are returned', - }, - reportTypes: { + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#accountView', + }, + }, + }, + }, + }, + ComAtprotoAdminGetAccountInfos: { + lexicon: 1, + id: 'com.atproto.admin.getAccountInfos', + defs: { + main: { + type: 'query', + description: 'Get details about some accounts.', + parameters: { + type: 'params', + required: ['dids'], + properties: { + dids: { type: 'array', items: { type: 'string', + format: 'did', }, }, - cursor: { - type: 'string', - }, }, }, output: { encoding: 'application/json', schema: { type: 'object', - required: ['events'], + required: ['infos'], properties: { - cursor: { - type: 'string', - }, - events: { + infos: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', + ref: 'lex:com.atproto.admin.defs#accountView', }, }, }, @@ -1596,101 +273,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationStatuses: { + ComAtprotoAdminGetInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.queryModerationStatuses', + id: 'com.atproto.admin.getInviteCodes', defs: { main: { type: 'query', - description: 'View moderation statuses of subjects (record or repo).', + description: 'Get an admin view of invite codes.', parameters: { type: 'params', properties: { - subject: { - type: 'string', - format: 'uri', - }, - comment: { - type: 'string', - description: 'Search subjects by keyword from comments', - }, - reportedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported after a given timestamp', - }, - reportedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported before a given timestamp', - }, - reviewedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed after a given timestamp', - }, - reviewedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed before a given timestamp', - }, - includeMuted: { - type: 'boolean', - description: - "By default, we don't include muted subjects in the results. Set this to true to include them.", - }, - reviewState: { - type: 'string', - description: 'Specify when fetching subjects in a certain state', - }, - ignoreSubjects: { - type: 'array', - items: { - type: 'string', - format: 'uri', - }, - }, - lastReviewedBy: { - type: 'string', - format: 'did', - description: - 'Get all subject statuses that were reviewed by a specific moderator', - }, - sortField: { - type: 'string', - default: 'lastReportedAt', - enum: ['lastReviewedAt', 'lastReportedAt'], - }, - sortDirection: { + sort: { type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - }, - takendown: { - type: 'boolean', - description: 'Get subjects that were taken down', - }, - appealed: { - type: 'boolean', - description: 'Get subjects in unresolved appealed status', + knownValues: ['recent', 'usage'], + default: 'recent', }, limit: { type: 'integer', minimum: 1, - maximum: 100, - default: 50, - }, - tags: { - type: 'array', - items: { - type: 'string', - }, - }, - excludeTags: { - type: 'array', - items: { - type: 'string', - }, + maximum: 500, + default: 100, }, cursor: { type: 'string', @@ -1701,16 +303,16 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['subjectStatuses'], + required: ['codes'], properties: { cursor: { type: 'string', }, - subjectStatuses: { + codes: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, }, @@ -1719,31 +321,28 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminSearchRepos: { + ComAtprotoAdminGetSubjectStatus: { lexicon: 1, - id: 'com.atproto.admin.searchRepos', + id: 'com.atproto.admin.getSubjectStatus', defs: { main: { type: 'query', - description: 'Find repositories based on a search term.', + description: + 'Get the service-specific admin status of a subject (account, record, or blob).', parameters: { type: 'params', properties: { - term: { + did: { type: 'string', - description: "DEPRECATED: use 'q' instead", + format: 'did', }, - q: { + uri: { type: 'string', + format: 'at-uri', }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { + blob: { type: 'string', + format: 'cid', }, }, }, @@ -1751,17 +350,19 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['repos'], + required: ['subject'], properties: { - cursor: { - type: 'string', + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + 'lex:com.atproto.admin.defs#repoBlobRef', + ], }, - repos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, + takedown: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#statusAttr', }, }, }, @@ -1900,58 +501,6 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminUpdateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.updateCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - description: 'ID of the template to be updated.', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - updatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is updating the template.', - }, - disabled: { - type: 'boolean', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminUpdateSubjectStatus: { lexicon: 1, id: 'com.atproto.admin.updateSubjectStatus', @@ -9189,38 +7738,21 @@ export const schemaDict = { export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { - ComAtprotoAdminCreateCommunicationTemplate: - 'com.atproto.admin.createCommunicationTemplate', ComAtprotoAdminDefs: 'com.atproto.admin.defs', ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount', - ComAtprotoAdminDeleteCommunicationTemplate: - 'com.atproto.admin.deleteCommunicationTemplate', ComAtprotoAdminDisableAccountInvites: 'com.atproto.admin.disableAccountInvites', ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes', - ComAtprotoAdminEmitModerationEvent: 'com.atproto.admin.emitModerationEvent', ComAtprotoAdminEnableAccountInvites: 'com.atproto.admin.enableAccountInvites', ComAtprotoAdminGetAccountInfo: 'com.atproto.admin.getAccountInfo', ComAtprotoAdminGetAccountInfos: 'com.atproto.admin.getAccountInfos', ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes', - ComAtprotoAdminGetModerationEvent: 'com.atproto.admin.getModerationEvent', - ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord', - ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo', ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus', - ComAtprotoAdminListCommunicationTemplates: - 'com.atproto.admin.listCommunicationTemplates', - ComAtprotoAdminQueryModerationEvents: - 'com.atproto.admin.queryModerationEvents', - ComAtprotoAdminQueryModerationStatuses: - 'com.atproto.admin.queryModerationStatuses', - ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail', ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', ComAtprotoAdminUpdateAccountPassword: 'com.atproto.admin.updateAccountPassword', - ComAtprotoAdminUpdateCommunicationTemplate: - 'com.atproto.admin.updateCommunicationTemplate', ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus', ComAtprotoIdentityGetRecommendedDidCredentials: 'com.atproto.identity.getRecommendedDidCredentials', diff --git a/packages/api/src/client/types/com/atproto/admin/createCommunicationTemplate.ts b/packages/api/src/client/types/com/atproto/admin/createCommunicationTemplate.ts deleted file mode 100644 index 2efe4c22e1e..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/createCommunicationTemplate.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** Name of the template. */ - name: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown: string - /** Subject of the message, used in emails. */ - subject: string - /** DID of the user who is creating the template. */ - createdBy?: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface CallOptions { - headers?: Headers - qp?: QueryParams - encoding: 'application/json' -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/defs.ts b/packages/api/src/client/types/com/atproto/admin/defs.ts index af94ecceaff..b732f2b05d8 100644 --- a/packages/api/src/client/types/com/atproto/admin/defs.ts +++ b/packages/api/src/client/types/com/atproto/admin/defs.ts @@ -5,10 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { isObj, hasProp } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' -import * as ComAtprotoModerationDefs from '../moderation/defs' import * as ComAtprotoServerDefs from '../server/defs' -import * as ComAtprotoLabelDefs from '../label/defs' export interface StatusAttr { applied: boolean @@ -28,232 +25,6 @@ export function validateStatusAttr(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#statusAttr', v) } -export interface ModEventView { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids: string[] - createdBy: string - createdAt: string - creatorHandle?: string - subjectHandle?: string - [k: string]: unknown -} - -export function isModEventView(v: unknown): v is ModEventView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventView' - ) -} - -export function validateModEventView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventView', v) -} - -export interface ModEventViewDetail { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectBlobs: BlobView[] - createdBy: string - createdAt: string - [k: string]: unknown -} - -export function isModEventViewDetail(v: unknown): v is ModEventViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventViewDetail' - ) -} - -export function validateModEventViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventViewDetail', v) -} - -export interface ReportView { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subjectRepoHandle?: string - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - reportedBy: string - createdAt: string - resolvedByActionIds: number[] - [k: string]: unknown -} - -export function isReportView(v: unknown): v is ReportView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportView' - ) -} - -export function validateReportView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportView', v) -} - -export interface SubjectStatusView { - id: number - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - subjectRepoHandle?: string - /** Timestamp referencing when the last update was made to the moderation status of the subject */ - updatedAt: string - /** Timestamp referencing the first moderation status impacting event was emitted on the subject */ - createdAt: string - reviewState: SubjectReviewState - /** Sticky comment on the subject. */ - comment?: string - muteUntil?: string - lastReviewedBy?: string - lastReviewedAt?: string - lastReportedAt?: string - /** Timestamp referencing when the author of the subject appealed a moderation action */ - lastAppealedAt?: string - takendown?: boolean - /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */ - appealed?: boolean - suspendUntil?: string - tags?: string[] - [k: string]: unknown -} - -export function isSubjectStatusView(v: unknown): v is SubjectStatusView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#subjectStatusView' - ) -} - -export function validateSubjectStatusView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#subjectStatusView', v) -} - -export interface ReportViewDetail { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectStatus?: SubjectStatusView - reportedBy: string - createdAt: string - resolvedByActions: ModEventView[] - [k: string]: unknown -} - -export function isReportViewDetail(v: unknown): v is ReportViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportViewDetail' - ) -} - -export function validateReportViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v) -} - -export interface RepoView { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: Moderation - invitedBy?: ComAtprotoServerDefs.InviteCode - invitesDisabled?: boolean - inviteNote?: string - [k: string]: unknown -} - -export function isRepoView(v: unknown): v is RepoView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoView' - ) -} - -export function validateRepoView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoView', v) -} - -export interface RepoViewDetail { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: ModerationDetail - labels?: ComAtprotoLabelDefs.Label[] - invitedBy?: ComAtprotoServerDefs.InviteCode - invites?: ComAtprotoServerDefs.InviteCode[] - invitesDisabled?: boolean - inviteNote?: string - emailConfirmedAt?: string - [k: string]: unknown -} - -export function isRepoViewDetail(v: unknown): v is RepoViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoViewDetail' - ) -} - -export function validateRepoViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) -} - export interface AccountView { did: string handle: string @@ -280,23 +51,6 @@ export function validateAccountView(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#accountView', 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 @@ -332,454 +86,3 @@ export function isRepoBlobRef(v: unknown): v is RepoBlobRef { export function validateRepoBlobRef(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) } - -export interface RecordView { - uri: string - cid: string - value: {} - blobCids: string[] - indexedAt: string - moderation: Moderation - repo: RepoView - [k: string]: unknown -} - -export function isRecordView(v: unknown): v is RecordView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordView' - ) -} - -export function validateRecordView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#recordView', v) -} - -export interface RecordViewDetail { - uri: string - cid: string - value: {} - blobs: BlobView[] - labels?: ComAtprotoLabelDefs.Label[] - indexedAt: string - moderation: ModerationDetail - repo: RepoView - [k: string]: unknown -} - -export function isRecordViewDetail(v: unknown): v is RecordViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordViewDetail' - ) -} - -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 { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModeration(v: unknown): v is Moderation { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderation' - ) -} - -export function validateModeration(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderation', v) -} - -export interface ModerationDetail { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModerationDetail(v: unknown): v is ModerationDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderationDetail' - ) -} - -export function validateModerationDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderationDetail', v) -} - -export interface BlobView { - cid: string - mimeType: string - size: number - createdAt: string - details?: - | ImageDetails - | VideoDetails - | { $type: string; [k: string]: unknown } - moderation?: Moderation - [k: string]: unknown -} - -export function isBlobView(v: unknown): v is BlobView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#blobView' - ) -} - -export function validateBlobView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#blobView', v) -} - -export interface ImageDetails { - width: number - height: number - [k: string]: unknown -} - -export function isImageDetails(v: unknown): v is ImageDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#imageDetails' - ) -} - -export function validateImageDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#imageDetails', v) -} - -export interface VideoDetails { - width: number - height: number - length: number - [k: string]: unknown -} - -export function isVideoDetails(v: unknown): v is VideoDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#videoDetails' - ) -} - -export function validateVideoDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#videoDetails', v) -} - -export type SubjectReviewState = - | 'lex:com.atproto.admin.defs#reviewOpen' - | 'lex:com.atproto.admin.defs#reviewEscalated' - | 'lex:com.atproto.admin.defs#reviewClosed' - | 'lex:com.atproto.admin.defs#reviewNone' - | (string & {}) - -/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */ -export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen' -/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */ -export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated' -/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */ -export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed' -/** Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it */ -export const REVIEWNONE = 'com.atproto.admin.defs#reviewNone' - -/** Take down a subject permanently or temporarily */ -export interface ModEventTakedown { - comment?: string - /** Indicates how long the takedown should be in effect before automatically expiring. */ - durationInHours?: number - [k: string]: unknown -} - -export function isModEventTakedown(v: unknown): v is ModEventTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTakedown' - ) -} - -export function validateModEventTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTakedown', v) -} - -/** Revert take down action on a subject */ -export interface ModEventReverseTakedown { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventReverseTakedown( - v: unknown, -): v is ModEventReverseTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReverseTakedown' - ) -} - -export function validateModEventReverseTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v) -} - -/** Resolve appeal on a subject */ -export interface ModEventResolveAppeal { - /** Describe resolution. */ - comment?: string - [k: string]: unknown -} - -export function isModEventResolveAppeal( - v: unknown, -): v is ModEventResolveAppeal { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventResolveAppeal' - ) -} - -export function validateModEventResolveAppeal(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v) -} - -/** Add a comment to a subject */ -export interface ModEventComment { - comment: string - /** Make the comment persistent on the subject */ - sticky?: boolean - [k: string]: unknown -} - -export function isModEventComment(v: unknown): v is ModEventComment { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventComment' - ) -} - -export function validateModEventComment(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventComment', v) -} - -/** Report a subject */ -export interface ModEventReport { - comment?: string - reportType: ComAtprotoModerationDefs.ReasonType - [k: string]: unknown -} - -export function isModEventReport(v: unknown): v is ModEventReport { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReport' - ) -} - -export function validateModEventReport(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReport', v) -} - -/** Apply/Negate labels on a subject */ -export interface ModEventLabel { - comment?: string - createLabelVals: string[] - negateLabelVals: string[] - [k: string]: unknown -} - -export function isModEventLabel(v: unknown): v is ModEventLabel { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventLabel' - ) -} - -export function validateModEventLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventLabel', v) -} - -export interface ModEventAcknowledge { - comment?: string - [k: string]: unknown -} - -export function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventAcknowledge' - ) -} - -export function validateModEventAcknowledge(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventAcknowledge', v) -} - -export interface ModEventEscalate { - comment?: string - [k: string]: unknown -} - -export function isModEventEscalate(v: unknown): v is ModEventEscalate { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEscalate' - ) -} - -export function validateModEventEscalate(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEscalate', v) -} - -/** Mute incoming reports on a subject */ -export interface ModEventMute { - comment?: string - /** Indicates how long the subject should remain muted. */ - durationInHours: number - [k: string]: unknown -} - -export function isModEventMute(v: unknown): v is ModEventMute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventMute' - ) -} - -export function validateModEventMute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventMute', v) -} - -/** Unmute action on a subject */ -export interface ModEventUnmute { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventUnmute(v: unknown): v is ModEventUnmute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventUnmute' - ) -} - -export function validateModEventUnmute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventUnmute', v) -} - -/** Keep a log of outgoing email to a user */ -export interface ModEventEmail { - /** The subject line of the email sent to the user. */ - subjectLine: string - /** The content of the email sent to the user. */ - content?: string - /** Additional comment about the outgoing comm. */ - comment?: string - [k: string]: unknown -} - -export function isModEventEmail(v: unknown): v is ModEventEmail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEmail' - ) -} - -export function validateModEventEmail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEmail', v) -} - -/** Add/Remove a tag on a subject */ -export interface ModEventTag { - /** Tags to be added to the subject. If already exists, won't be duplicated. */ - add: string[] - /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */ - remove: string[] - /** Additional comment about added/removed tags. */ - comment?: string - [k: string]: unknown -} - -export function isModEventTag(v: unknown): v is ModEventTag { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTag' - ) -} - -export function validateModEventTag(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTag', v) -} - -export interface CommunicationTemplateView { - id: string - /** Name of the template. */ - name: string - /** Content of the template, can contain markdown and variable placeholders. */ - subject?: string - /** Subject of the message, used in emails. */ - contentMarkdown: string - disabled: boolean - /** DID of the user who last updated the template. */ - lastUpdatedBy: string - createdAt: string - updatedAt: string - [k: string]: unknown -} - -export function isCommunicationTemplateView( - v: unknown, -): v is CommunicationTemplateView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#communicationTemplateView' - ) -} - -export function validateCommunicationTemplateView( - v: unknown, -): ValidationResult { - return lexicons.validate( - 'com.atproto.admin.defs#communicationTemplateView', - v, - ) -} diff --git a/packages/api/src/client/types/com/atproto/admin/deleteCommunicationTemplate.ts b/packages/api/src/client/types/com/atproto/admin/deleteCommunicationTemplate.ts deleted file mode 100644 index a5c4d55fdeb..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/deleteCommunicationTemplate.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' - -export interface QueryParams {} - -export interface InputSchema { - id: string - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers - qp?: QueryParams - encoding: 'application/json' -} - -export interface Response { - success: boolean - headers: Headers -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/emitModerationEvent.ts b/packages/api/src/client/types/com/atproto/admin/emitModerationEvent.ts deleted file mode 100644 index 6e7827bdc6a..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/emitModerationEvent.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' - -export interface QueryParams {} - -export interface InputSchema { - event: - | ComAtprotoAdminDefs.ModEventTakedown - | ComAtprotoAdminDefs.ModEventAcknowledge - | ComAtprotoAdminDefs.ModEventEscalate - | ComAtprotoAdminDefs.ModEventComment - | ComAtprotoAdminDefs.ModEventLabel - | ComAtprotoAdminDefs.ModEventReport - | ComAtprotoAdminDefs.ModEventMute - | ComAtprotoAdminDefs.ModEventReverseTakedown - | ComAtprotoAdminDefs.ModEventUnmute - | ComAtprotoAdminDefs.ModEventEmail - | ComAtprotoAdminDefs.ModEventTag - | { $type: string; [k: string]: unknown } - subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - createdBy: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.ModEventView - -export interface CallOptions { - headers?: Headers - qp?: QueryParams - encoding: 'application/json' -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export class SubjectHasActionError extends XRPCError { - constructor(src: XRPCError) { - super(src.status, src.error, src.message, src.headers) - } -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - if (e.error === 'SubjectHasAction') return new SubjectHasActionError(e) - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/getModerationEvent.ts b/packages/api/src/client/types/com/atproto/admin/getModerationEvent.ts deleted file mode 100644 index 8a107172929..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/getModerationEvent.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - id: number -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/getRecord.ts b/packages/api/src/client/types/com/atproto/admin/getRecord.ts deleted file mode 100644 index 453e94c39d7..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/getRecord.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - uri: string - cid?: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export class RecordNotFoundError extends XRPCError { - constructor(src: XRPCError) { - super(src.status, src.error, src.message, src.headers) - } -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - if (e.error === 'RecordNotFound') return new RecordNotFoundError(e) - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/getRepo.ts b/packages/api/src/client/types/com/atproto/admin/getRepo.ts deleted file mode 100644 index 5391bada281..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/getRepo.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - did: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export class RepoNotFoundError extends XRPCError { - constructor(src: XRPCError) { - super(src.status, src.error, src.message, src.headers) - } -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/listCommunicationTemplates.ts b/packages/api/src/client/types/com/atproto/admin/listCommunicationTemplates.ts deleted file mode 100644 index d37e4688b2b..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/listCommunicationTemplates.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export type InputSchema = undefined - -export interface OutputSchema { - communicationTemplates: ComAtprotoAdminDefs.CommunicationTemplateView[] - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/queryModerationEvents.ts b/packages/api/src/client/types/com/atproto/admin/queryModerationEvents.ts deleted file mode 100644 index 2dd3081ef8f..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/queryModerationEvents.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned. */ - types?: string[] - createdBy?: string - /** Sort direction for the events. Defaults to descending order of created at timestamp. */ - sortDirection?: 'asc' | 'desc' - /** Retrieve events created after a given timestamp */ - createdAfter?: string - /** Retrieve events created before a given timestamp */ - createdBefore?: string - subject?: string - /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */ - includeAllUserRecords?: boolean - limit?: number - /** If true, only events with comments are returned */ - hasComment?: boolean - /** If specified, only events with comments containing the keyword are returned */ - comment?: string - /** If specified, only events where all of these labels were added are returned */ - addedLabels?: string[] - /** If specified, only events where all of these labels were removed are returned */ - removedLabels?: string[] - /** If specified, only events where all of these tags were added are returned */ - addedTags?: string[] - /** If specified, only events where all of these tags were removed are returned */ - removedTags?: string[] - reportTypes?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - events: ComAtprotoAdminDefs.ModEventView[] - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/queryModerationStatuses.ts b/packages/api/src/client/types/com/atproto/admin/queryModerationStatuses.ts deleted file mode 100644 index c16bb94fec3..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/queryModerationStatuses.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - subject?: string - /** Search subjects by keyword from comments */ - comment?: string - /** Search subjects reported after a given timestamp */ - reportedAfter?: string - /** Search subjects reported before a given timestamp */ - reportedBefore?: string - /** Search subjects reviewed after a given timestamp */ - reviewedAfter?: string - /** Search subjects reviewed before a given timestamp */ - reviewedBefore?: string - /** By default, we don't include muted subjects in the results. Set this to true to include them. */ - includeMuted?: boolean - /** Specify when fetching subjects in a certain state */ - reviewState?: string - ignoreSubjects?: string[] - /** Get all subject statuses that were reviewed by a specific moderator */ - lastReviewedBy?: string - sortField?: 'lastReviewedAt' | 'lastReportedAt' - sortDirection?: 'asc' | 'desc' - /** Get subjects that were taken down */ - takendown?: boolean - /** Get subjects in unresolved appealed status */ - appealed?: boolean - limit?: number - tags?: string[] - excludeTags?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[] - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/searchRepos.ts b/packages/api/src/client/types/com/atproto/admin/searchRepos.ts deleted file mode 100644 index 451077479b9..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/searchRepos.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** DEPRECATED: use 'q' instead */ - term?: string - q?: string - limit?: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - repos: ComAtprotoAdminDefs.RepoView[] - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/api/src/client/types/com/atproto/admin/updateCommunicationTemplate.ts b/packages/api/src/client/types/com/atproto/admin/updateCommunicationTemplate.ts deleted file mode 100644 index 49c33338c11..00000000000 --- a/packages/api/src/client/types/com/atproto/admin/updateCommunicationTemplate.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** ID of the template to be updated. */ - id: string - /** Name of the template. */ - name?: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown?: string - /** Subject of the message, used in emails. */ - subject?: string - /** DID of the user who is updating the template. */ - updatedBy?: string - disabled?: boolean - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface CallOptions { - headers?: Headers - qp?: QueryParams - encoding: 'application/json' -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/bsky/src/lexicon/index.ts b/packages/bsky/src/lexicon/index.ts index 1e0e766f1e0..d44cb9b4656 100644 --- a/packages/bsky/src/lexicon/index.ts +++ b/packages/bsky/src/lexicon/index.ts @@ -9,29 +9,18 @@ import { StreamAuthVerifier, } from '@atproto/xrpc-server' import { schemas } from './lexicons' -import * as ComAtprotoAdminCreateCommunicationTemplate from './types/com/atproto/admin/createCommunicationTemplate' import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -import * as ComAtprotoAdminDeleteCommunicationTemplate from './types/com/atproto/admin/deleteCommunicationTemplate' import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -import * as ComAtprotoAdminEmitModerationEvent from './types/com/atproto/admin/emitModerationEvent' import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -import * as ComAtprotoAdminGetModerationEvent from './types/com/atproto/admin/getModerationEvent' -import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' -import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -import * as ComAtprotoAdminListCommunicationTemplates from './types/com/atproto/admin/listCommunicationTemplates' -import * as ComAtprotoAdminQueryModerationEvents from './types/com/atproto/admin/queryModerationEvents' -import * as ComAtprotoAdminQueryModerationStatuses from './types/com/atproto/admin/queryModerationStatuses' -import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -import * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate' import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' @@ -139,12 +128,6 @@ import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecce import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export const COM_ATPROTO_ADMIN = { - DefsReviewOpen: 'com.atproto.admin.defs#reviewOpen', - DefsReviewEscalated: 'com.atproto.admin.defs#reviewEscalated', - DefsReviewClosed: 'com.atproto.admin.defs#reviewClosed', - DefsReviewNone: 'com.atproto.admin.defs#reviewNone', -} export const COM_ATPROTO_MODERATION = { DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', @@ -216,17 +199,6 @@ export class ComAtprotoAdminNS { this._server = server } - createCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminCreateCommunicationTemplate.Handler>, - ComAtprotoAdminCreateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.createCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - deleteAccount( cfg: ConfigOf< AV, @@ -238,17 +210,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - deleteCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminDeleteCommunicationTemplate.Handler>, - ComAtprotoAdminDeleteCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.deleteCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - disableAccountInvites( cfg: ConfigOf< AV, @@ -271,17 +232,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - emitModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminEmitModerationEvent.Handler>, - ComAtprotoAdminEmitModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.emitModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - enableAccountInvites( cfg: ConfigOf< AV, @@ -326,39 +276,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - getModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminGetModerationEvent.Handler>, - ComAtprotoAdminGetModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - getRecord( - 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< - AV, - ComAtprotoAdminGetRepo.Handler>, - ComAtprotoAdminGetRepo.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getRepo' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getSubjectStatus( cfg: ConfigOf< AV, @@ -370,50 +287,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - listCommunicationTemplates( - cfg: ConfigOf< - AV, - ComAtprotoAdminListCommunicationTemplates.Handler>, - ComAtprotoAdminListCommunicationTemplates.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.listCommunicationTemplates' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationEvents( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationEvents.Handler>, - ComAtprotoAdminQueryModerationEvents.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationEvents' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationStatuses( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationStatuses.Handler>, - ComAtprotoAdminQueryModerationStatuses.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationStatuses' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - searchRepos( - 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, @@ -458,17 +331,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - updateCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminUpdateCommunicationTemplate.Handler>, - ComAtprotoAdminUpdateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.updateCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - updateSubjectStatus( cfg: ConfigOf< AV, diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 635e9e19e60..6603408a87f 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -4,51 +4,6 @@ import { LexiconDoc, Lexicons } from '@atproto/lexicon' export const schemaDict = { - ComAtprotoAdminCreateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.createCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to create a new, re-usable communication (email for now) template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject', 'contentMarkdown', 'name'], - properties: { - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - createdBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is creating the template.', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminDefs: { lexicon: 1, id: 'com.atproto.admin.defs', @@ -65,1184 +20,128 @@ export const schemaDict = { }, }, }, - modEventView: { + accountView: { type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobCids', - 'createdBy', - 'createdAt', - ], + required: ['did', 'handle', 'indexedAt'], properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - }, - }, - createdBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - creatorHandle: { + handle: { type: 'string', + format: 'handle', }, - subjectHandle: { + email: { type: 'string', }, - }, - }, - modEventViewDetail: { - type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobs', - 'createdBy', - 'createdAt', - ], - properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - 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: { + relatedRecords: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', + type: 'unknown', }, }, - createdBy: { - type: 'string', - format: 'did', - }, - createdAt: { + indexedAt: { type: 'string', format: 'datetime', }, - }, - }, - reportView: { - type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActionIds', - ], - properties: { - id: { - type: 'integer', - }, - reasonType: { + invitedBy: { type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - subjectRepoHandle: { - type: 'string', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - reportedBy: { - type: 'string', - format: 'did', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActionIds: { - type: 'array', - items: { - type: 'integer', - }, - }, - }, - }, - subjectStatusView: { - type: 'object', - required: ['id', 'subject', 'createdAt', 'updatedAt', 'reviewState'], - properties: { - id: { - type: 'integer', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], + ref: 'lex:com.atproto.server.defs#inviteCode', }, - subjectBlobCids: { + invites: { type: 'array', items: { - type: 'string', - format: 'cid', + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, - subjectRepoHandle: { - type: 'string', - }, - updatedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the last update was made to the moderation status of the subject', - }, - createdAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing the first moderation status impacting event was emitted on the subject', - }, - reviewState: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectReviewState', - }, - comment: { - type: 'string', - description: 'Sticky comment on the subject.', - }, - muteUntil: { - type: 'string', - format: 'datetime', - }, - lastReviewedBy: { - type: 'string', - format: 'did', - }, - lastReviewedAt: { - type: 'string', - format: 'datetime', - }, - lastReportedAt: { - type: 'string', - format: 'datetime', - }, - lastAppealedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the author of the subject appealed a moderation action', - }, - takendown: { - type: 'boolean', - }, - appealed: { + invitesDisabled: { type: 'boolean', - description: - 'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.', }, - suspendUntil: { + emailConfirmedAt: { type: 'string', format: 'datetime', }, - tags: { - type: 'array', - items: { - type: 'string', - }, + inviteNote: { + type: 'string', }, }, }, - reportViewDetail: { + repoRef: { type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActions', - ], + required: ['did'], properties: { - id: { - type: 'integer', - }, - reasonType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - 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', - ], - }, - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - reportedBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActions: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, }, }, - repoView: { + repoBlobRef: { type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], + required: ['did', 'cid'], properties: { did: { type: 'string', format: 'did', }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { + cid: { type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invitesDisabled: { - type: 'boolean', + format: 'cid', }, - inviteNote: { + recordUri: { type: 'string', + format: 'at-uri', }, }, }, - repoViewDetail: { - type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - inviteNote: { - type: 'string', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - accountView: { - type: 'object', - required: ['did', 'handle', 'indexedAt'], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - inviteNote: { - type: 'string', - }, - }, - }, - repoViewNotFound: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoRef: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoBlobRef: { - type: 'object', - required: ['did', 'cid'], - properties: { - did: { - type: 'string', - format: 'did', - }, - cid: { - type: 'string', - format: 'cid', - }, - recordUri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - recordView: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobCids', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewDetail: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobs', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobs: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', - }, - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewNotFound: { - type: 'object', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - moderation: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - moderationDetail: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - blobView: { - type: 'object', - required: ['cid', 'mimeType', 'size', 'createdAt'], - properties: { - cid: { - type: 'string', - format: 'cid', - }, - mimeType: { - type: 'string', - }, - size: { - type: 'integer', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - details: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#imageDetails', - 'lex:com.atproto.admin.defs#videoDetails', - ], - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - }, - }, - imageDetails: { - type: 'object', - required: ['width', 'height'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - }, - }, - videoDetails: { - type: 'object', - required: ['width', 'height', 'length'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - length: { - type: 'integer', - }, - }, - }, - subjectReviewState: { - type: 'string', - knownValues: [ - 'lex:com.atproto.admin.defs#reviewOpen', - 'lex:com.atproto.admin.defs#reviewEscalated', - 'lex:com.atproto.admin.defs#reviewClosed', - 'lex:com.atproto.admin.defs#reviewNone', - ], - }, - reviewOpen: { - type: 'token', - description: - 'Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator', - }, - reviewEscalated: { - type: 'token', - description: - 'Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator', - }, - reviewClosed: { - type: 'token', - description: - 'Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator', - }, - reviewNone: { - type: 'token', - description: - 'Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it', - }, - modEventTakedown: { - type: 'object', - description: 'Take down a subject permanently or temporarily', - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: - 'Indicates how long the takedown should be in effect before automatically expiring.', - }, - }, - }, - modEventReverseTakedown: { - type: 'object', - description: 'Revert take down action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventResolveAppeal: { - type: 'object', - description: 'Resolve appeal on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe resolution.', - }, - }, - }, - modEventComment: { - type: 'object', - description: 'Add a comment to a subject', - required: ['comment'], - properties: { - comment: { - type: 'string', - }, - sticky: { - type: 'boolean', - description: 'Make the comment persistent on the subject', - }, - }, - }, - modEventReport: { - type: 'object', - description: 'Report a subject', - required: ['reportType'], - properties: { - comment: { - type: 'string', - }, - reportType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - }, - }, - modEventLabel: { - type: 'object', - description: 'Apply/Negate labels on a subject', - required: ['createLabelVals', 'negateLabelVals'], - properties: { - comment: { - type: 'string', - }, - createLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - negateLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - modEventAcknowledge: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventEscalate: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventMute: { - type: 'object', - description: 'Mute incoming reports on a subject', - required: ['durationInHours'], - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: 'Indicates how long the subject should remain muted.', - }, - }, - }, - modEventUnmute: { - type: 'object', - description: 'Unmute action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventEmail: { - type: 'object', - description: 'Keep a log of outgoing email to a user', - required: ['subjectLine'], - properties: { - subjectLine: { - type: 'string', - description: 'The subject line of the email sent to the user.', - }, - content: { - type: 'string', - description: 'The content of the email sent to the user.', - }, - comment: { - type: 'string', - description: 'Additional comment about the outgoing comm.', - }, - }, - }, - modEventTag: { - type: 'object', - description: 'Add/Remove a tag on a subject', - required: ['add', 'remove'], - properties: { - add: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be added to the subject. If already exists, won't be duplicated.", - }, - remove: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", - }, - comment: { - type: 'string', - description: 'Additional comment about added/removed tags.', - }, - }, - }, - communicationTemplateView: { - type: 'object', - required: [ - 'id', - 'name', - 'contentMarkdown', - 'disabled', - 'lastUpdatedBy', - 'createdAt', - 'updatedAt', - ], - properties: { - id: { - type: 'string', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - subject: { - type: 'string', - description: - 'Content of the template, can contain markdown and variable placeholders.', - }, - contentMarkdown: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - disabled: { - type: 'boolean', - }, - lastUpdatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who last updated the template.', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - updatedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteAccount: { - lexicon: 1, - id: 'com.atproto.admin.deleteAccount', - defs: { - main: { - type: 'procedure', - description: 'Delete a user account as an administrator.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.deleteCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: 'Delete a communication template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableAccountInvites: { - lexicon: 1, - id: 'com.atproto.admin.disableAccountInvites', - defs: { - main: { - type: 'procedure', - description: - 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['account'], - properties: { - account: { - type: 'string', - format: 'did', - }, - note: { - type: 'string', - description: 'Optional reason for disabled invites.', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableInviteCodes: { - lexicon: 1, - id: 'com.atproto.admin.disableInviteCodes', - defs: { - main: { - type: 'procedure', - description: - 'Disable some set of codes and/or all codes associated with a set of users.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - properties: { - codes: { - type: 'array', - items: { - type: 'string', - }, - }, - accounts: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminEmitModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.emitModerationEvent', - defs: { - main: { - type: 'procedure', - description: 'Take a moderation action on an actor.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['event', 'subject', 'createdBy'], - properties: { - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventUnmute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventTag', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - createdBy: { - type: 'string', - format: 'did', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, - errors: [ - { - name: 'SubjectHasAction', - }, - ], - }, }, }, - ComAtprotoAdminEnableAccountInvites: { + ComAtprotoAdminDeleteAccount: { lexicon: 1, - id: 'com.atproto.admin.enableAccountInvites', + id: 'com.atproto.admin.deleteAccount', defs: { main: { type: 'procedure', - description: "Re-enable an account's ability to receive invite codes.", + description: 'Delete a user account as an administrator.', input: { encoding: 'application/json', schema: { type: 'object', - required: ['account'], + required: ['did'], properties: { - account: { + did: { type: 'string', format: 'did', }, - note: { - type: 'string', - description: 'Optional reason for enabled invites.', - }, }, }, }, }, }, }, - ComAtprotoAdminGetAccountInfo: { + ComAtprotoAdminDisableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.getAccountInfo', + id: 'com.atproto.admin.disableAccountInvites', defs: { main: { - type: 'query', - description: 'Get details about an account.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', + input: { encoding: 'application/json', schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, - }, - }, - }, - }, - ComAtprotoAdminGetAccountInfos: { - lexicon: 1, - id: 'com.atproto.admin.getAccountInfos', - defs: { - main: { - type: 'query', - description: 'Get details about some accounts.', - parameters: { - type: 'params', - required: ['dids'], - properties: { - dids: { - type: 'array', - items: { + type: 'object', + required: ['account'], + properties: { + account: { type: 'string', format: 'did', }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['infos'], - properties: { - infos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, + note: { + type: 'string', + description: 'Optional reason for disabled invites.', }, }, }, @@ -1250,190 +149,30 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminGetInviteCodes: { + ComAtprotoAdminDisableInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.getInviteCodes', + id: 'com.atproto.admin.disableInviteCodes', defs: { main: { - type: 'query', - description: 'Get an admin view of invite codes.', - parameters: { - type: 'params', - properties: { - sort: { - type: 'string', - knownValues: ['recent', 'usage'], - default: 'recent', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 500, - default: 100, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable some set of codes and/or all codes associated with a set of users.', + input: { encoding: 'application/json', schema: { type: 'object', - required: ['codes'], properties: { - cursor: { - type: 'string', - }, codes: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', + type: 'string', }, }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminGetModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.getModerationEvent', - defs: { - main: { - type: 'query', - description: 'Get details about a moderation event.', - parameters: { - type: 'params', - required: ['id'], - properties: { - id: { - type: 'integer', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventViewDetail', - }, - }, - }, - }, - }, - ComAtprotoAdminGetRecord: { - lexicon: 1, - id: 'com.atproto.admin.getRecord', - defs: { - main: { - type: 'query', - description: 'Get details about a record.', - parameters: { - type: 'params', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#recordViewDetail', - }, - }, - errors: [ - { - name: 'RecordNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetRepo: { - lexicon: 1, - id: 'com.atproto.admin.getRepo', - defs: { - main: { - type: 'query', - description: 'Get details about a repository.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoViewDetail', - }, - }, - errors: [ - { - name: 'RepoNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetSubjectStatus: { - lexicon: 1, - id: 'com.atproto.admin.getSubjectStatus', - defs: { - main: { - type: 'query', - description: - 'Get the service-specific admin status of a subject (account, record, or blob).', - parameters: { - type: 'params', - properties: { - did: { - type: 'string', - format: 'did', - }, - uri: { - type: 'string', - format: 'at-uri', - }, - blob: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject'], - properties: { - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - 'lex:com.atproto.admin.defs#repoBlobRef', - ], - }, - takedown: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#statusAttr', + accounts: { + type: 'array', + items: { + type: 'string', + }, }, }, }, @@ -1441,25 +180,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminListCommunicationTemplates: { + ComAtprotoAdminEnableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.listCommunicationTemplates', + id: 'com.atproto.admin.enableAccountInvites', defs: { main: { - type: 'query', - description: 'Get list of all communication templates.', - output: { + type: 'procedure', + description: "Re-enable an account's ability to receive invite codes.", + input: { encoding: 'application/json', schema: { type: 'object', - required: ['communicationTemplates'], + required: ['account'], properties: { - communicationTemplates: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, + account: { + type: 'string', + format: 'did', + }, + note: { + type: 'string', + description: 'Optional reason for enabled invites.', }, }, }, @@ -1467,127 +207,64 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationEvents: { + ComAtprotoAdminGetAccountInfo: { lexicon: 1, - id: 'com.atproto.admin.queryModerationEvents', + id: 'com.atproto.admin.getAccountInfo', defs: { main: { type: 'query', - description: 'List moderation events related to a subject.', + description: 'Get details about an account.', parameters: { type: 'params', + required: ['did'], properties: { - types: { - type: 'array', - items: { - type: 'string', - }, - description: - 'The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned.', - }, - createdBy: { + did: { type: 'string', format: 'did', }, - sortDirection: { - type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - description: - 'Sort direction for the events. Defaults to descending order of created at timestamp.', - }, - createdAfter: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created after a given timestamp', - }, - createdBefore: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created before a given timestamp', - }, - subject: { - type: 'string', - format: 'uri', - }, - includeAllUserRecords: { - type: 'boolean', - default: false, - description: - 'If true, events on all record types (posts, lists, profile etc.) owned by the did are returned', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - hasComment: { - type: 'boolean', - description: 'If true, only events with comments are returned', - }, - comment: { - type: 'string', - description: - 'If specified, only events with comments containing the keyword are returned', - }, - addedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were added are returned', - }, - removedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were removed are returned', - }, - addedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were added are returned', - }, - removedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were removed are returned', - }, - reportTypes: { + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#accountView', + }, + }, + }, + }, + }, + ComAtprotoAdminGetAccountInfos: { + lexicon: 1, + id: 'com.atproto.admin.getAccountInfos', + defs: { + main: { + type: 'query', + description: 'Get details about some accounts.', + parameters: { + type: 'params', + required: ['dids'], + properties: { + dids: { type: 'array', items: { type: 'string', + format: 'did', }, }, - cursor: { - type: 'string', - }, }, }, output: { encoding: 'application/json', schema: { type: 'object', - required: ['events'], + required: ['infos'], properties: { - cursor: { - type: 'string', - }, - events: { + infos: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', + ref: 'lex:com.atproto.admin.defs#accountView', }, }, }, @@ -1596,101 +273,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationStatuses: { + ComAtprotoAdminGetInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.queryModerationStatuses', + id: 'com.atproto.admin.getInviteCodes', defs: { main: { type: 'query', - description: 'View moderation statuses of subjects (record or repo).', + description: 'Get an admin view of invite codes.', parameters: { type: 'params', properties: { - subject: { - type: 'string', - format: 'uri', - }, - comment: { - type: 'string', - description: 'Search subjects by keyword from comments', - }, - reportedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported after a given timestamp', - }, - reportedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported before a given timestamp', - }, - reviewedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed after a given timestamp', - }, - reviewedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed before a given timestamp', - }, - includeMuted: { - type: 'boolean', - description: - "By default, we don't include muted subjects in the results. Set this to true to include them.", - }, - reviewState: { - type: 'string', - description: 'Specify when fetching subjects in a certain state', - }, - ignoreSubjects: { - type: 'array', - items: { - type: 'string', - format: 'uri', - }, - }, - lastReviewedBy: { - type: 'string', - format: 'did', - description: - 'Get all subject statuses that were reviewed by a specific moderator', - }, - sortField: { - type: 'string', - default: 'lastReportedAt', - enum: ['lastReviewedAt', 'lastReportedAt'], - }, - sortDirection: { + sort: { type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - }, - takendown: { - type: 'boolean', - description: 'Get subjects that were taken down', - }, - appealed: { - type: 'boolean', - description: 'Get subjects in unresolved appealed status', + knownValues: ['recent', 'usage'], + default: 'recent', }, limit: { type: 'integer', minimum: 1, - maximum: 100, - default: 50, - }, - tags: { - type: 'array', - items: { - type: 'string', - }, - }, - excludeTags: { - type: 'array', - items: { - type: 'string', - }, + maximum: 500, + default: 100, }, cursor: { type: 'string', @@ -1701,16 +303,16 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['subjectStatuses'], + required: ['codes'], properties: { cursor: { type: 'string', }, - subjectStatuses: { + codes: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, }, @@ -1719,31 +321,28 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminSearchRepos: { + ComAtprotoAdminGetSubjectStatus: { lexicon: 1, - id: 'com.atproto.admin.searchRepos', + id: 'com.atproto.admin.getSubjectStatus', defs: { main: { type: 'query', - description: 'Find repositories based on a search term.', + description: + 'Get the service-specific admin status of a subject (account, record, or blob).', parameters: { type: 'params', properties: { - term: { + did: { type: 'string', - description: "DEPRECATED: use 'q' instead", + format: 'did', }, - q: { + uri: { type: 'string', + format: 'at-uri', }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { + blob: { type: 'string', + format: 'cid', }, }, }, @@ -1751,17 +350,19 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['repos'], + required: ['subject'], properties: { - cursor: { - type: 'string', + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + 'lex:com.atproto.admin.defs#repoBlobRef', + ], }, - repos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, + takedown: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#statusAttr', }, }, }, @@ -1900,58 +501,6 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminUpdateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.updateCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - description: 'ID of the template to be updated.', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - updatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is updating the template.', - }, - disabled: { - type: 'boolean', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminUpdateSubjectStatus: { lexicon: 1, id: 'com.atproto.admin.updateSubjectStatus', @@ -9189,38 +7738,21 @@ export const schemaDict = { export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { - ComAtprotoAdminCreateCommunicationTemplate: - 'com.atproto.admin.createCommunicationTemplate', ComAtprotoAdminDefs: 'com.atproto.admin.defs', ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount', - ComAtprotoAdminDeleteCommunicationTemplate: - 'com.atproto.admin.deleteCommunicationTemplate', ComAtprotoAdminDisableAccountInvites: 'com.atproto.admin.disableAccountInvites', ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes', - ComAtprotoAdminEmitModerationEvent: 'com.atproto.admin.emitModerationEvent', ComAtprotoAdminEnableAccountInvites: 'com.atproto.admin.enableAccountInvites', ComAtprotoAdminGetAccountInfo: 'com.atproto.admin.getAccountInfo', ComAtprotoAdminGetAccountInfos: 'com.atproto.admin.getAccountInfos', ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes', - ComAtprotoAdminGetModerationEvent: 'com.atproto.admin.getModerationEvent', - ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord', - ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo', ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus', - ComAtprotoAdminListCommunicationTemplates: - 'com.atproto.admin.listCommunicationTemplates', - ComAtprotoAdminQueryModerationEvents: - 'com.atproto.admin.queryModerationEvents', - ComAtprotoAdminQueryModerationStatuses: - 'com.atproto.admin.queryModerationStatuses', - ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail', ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', ComAtprotoAdminUpdateAccountPassword: 'com.atproto.admin.updateAccountPassword', - ComAtprotoAdminUpdateCommunicationTemplate: - 'com.atproto.admin.updateCommunicationTemplate', ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus', ComAtprotoIdentityGetRecommendedDidCredentials: 'com.atproto.identity.getRecommendedDidCredentials', diff --git a/packages/bsky/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts deleted file mode 100644 index b910b7987b4..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +++ /dev/null @@ -1,54 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** Name of the template. */ - name: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown: string - /** Subject of the message, used in emails. */ - subject: string - /** DID of the user who is creating the template. */ - createdBy?: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts index a860e6bcfa0..558b483a3b5 100644 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts +++ b/packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts @@ -5,10 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' -import * as ComAtprotoModerationDefs from '../moderation/defs' import * as ComAtprotoServerDefs from '../server/defs' -import * as ComAtprotoLabelDefs from '../label/defs' export interface StatusAttr { applied: boolean @@ -28,232 +25,6 @@ export function validateStatusAttr(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#statusAttr', v) } -export interface ModEventView { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids: string[] - createdBy: string - createdAt: string - creatorHandle?: string - subjectHandle?: string - [k: string]: unknown -} - -export function isModEventView(v: unknown): v is ModEventView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventView' - ) -} - -export function validateModEventView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventView', v) -} - -export interface ModEventViewDetail { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectBlobs: BlobView[] - createdBy: string - createdAt: string - [k: string]: unknown -} - -export function isModEventViewDetail(v: unknown): v is ModEventViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventViewDetail' - ) -} - -export function validateModEventViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventViewDetail', v) -} - -export interface ReportView { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subjectRepoHandle?: string - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - reportedBy: string - createdAt: string - resolvedByActionIds: number[] - [k: string]: unknown -} - -export function isReportView(v: unknown): v is ReportView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportView' - ) -} - -export function validateReportView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportView', v) -} - -export interface SubjectStatusView { - id: number - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - subjectRepoHandle?: string - /** Timestamp referencing when the last update was made to the moderation status of the subject */ - updatedAt: string - /** Timestamp referencing the first moderation status impacting event was emitted on the subject */ - createdAt: string - reviewState: SubjectReviewState - /** Sticky comment on the subject. */ - comment?: string - muteUntil?: string - lastReviewedBy?: string - lastReviewedAt?: string - lastReportedAt?: string - /** Timestamp referencing when the author of the subject appealed a moderation action */ - lastAppealedAt?: string - takendown?: boolean - /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */ - appealed?: boolean - suspendUntil?: string - tags?: string[] - [k: string]: unknown -} - -export function isSubjectStatusView(v: unknown): v is SubjectStatusView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#subjectStatusView' - ) -} - -export function validateSubjectStatusView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#subjectStatusView', v) -} - -export interface ReportViewDetail { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectStatus?: SubjectStatusView - reportedBy: string - createdAt: string - resolvedByActions: ModEventView[] - [k: string]: unknown -} - -export function isReportViewDetail(v: unknown): v is ReportViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportViewDetail' - ) -} - -export function validateReportViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v) -} - -export interface RepoView { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: Moderation - invitedBy?: ComAtprotoServerDefs.InviteCode - invitesDisabled?: boolean - inviteNote?: string - [k: string]: unknown -} - -export function isRepoView(v: unknown): v is RepoView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoView' - ) -} - -export function validateRepoView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoView', v) -} - -export interface RepoViewDetail { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: ModerationDetail - labels?: ComAtprotoLabelDefs.Label[] - invitedBy?: ComAtprotoServerDefs.InviteCode - invites?: ComAtprotoServerDefs.InviteCode[] - invitesDisabled?: boolean - inviteNote?: string - emailConfirmedAt?: string - [k: string]: unknown -} - -export function isRepoViewDetail(v: unknown): v is RepoViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoViewDetail' - ) -} - -export function validateRepoViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) -} - export interface AccountView { did: string handle: string @@ -280,23 +51,6 @@ export function validateAccountView(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#accountView', 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 @@ -332,454 +86,3 @@ export function isRepoBlobRef(v: unknown): v is RepoBlobRef { export function validateRepoBlobRef(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) } - -export interface RecordView { - uri: string - cid: string - value: {} - blobCids: string[] - indexedAt: string - moderation: Moderation - repo: RepoView - [k: string]: unknown -} - -export function isRecordView(v: unknown): v is RecordView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordView' - ) -} - -export function validateRecordView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#recordView', v) -} - -export interface RecordViewDetail { - uri: string - cid: string - value: {} - blobs: BlobView[] - labels?: ComAtprotoLabelDefs.Label[] - indexedAt: string - moderation: ModerationDetail - repo: RepoView - [k: string]: unknown -} - -export function isRecordViewDetail(v: unknown): v is RecordViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordViewDetail' - ) -} - -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 { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModeration(v: unknown): v is Moderation { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderation' - ) -} - -export function validateModeration(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderation', v) -} - -export interface ModerationDetail { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModerationDetail(v: unknown): v is ModerationDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderationDetail' - ) -} - -export function validateModerationDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderationDetail', v) -} - -export interface BlobView { - cid: string - mimeType: string - size: number - createdAt: string - details?: - | ImageDetails - | VideoDetails - | { $type: string; [k: string]: unknown } - moderation?: Moderation - [k: string]: unknown -} - -export function isBlobView(v: unknown): v is BlobView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#blobView' - ) -} - -export function validateBlobView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#blobView', v) -} - -export interface ImageDetails { - width: number - height: number - [k: string]: unknown -} - -export function isImageDetails(v: unknown): v is ImageDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#imageDetails' - ) -} - -export function validateImageDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#imageDetails', v) -} - -export interface VideoDetails { - width: number - height: number - length: number - [k: string]: unknown -} - -export function isVideoDetails(v: unknown): v is VideoDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#videoDetails' - ) -} - -export function validateVideoDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#videoDetails', v) -} - -export type SubjectReviewState = - | 'lex:com.atproto.admin.defs#reviewOpen' - | 'lex:com.atproto.admin.defs#reviewEscalated' - | 'lex:com.atproto.admin.defs#reviewClosed' - | 'lex:com.atproto.admin.defs#reviewNone' - | (string & {}) - -/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */ -export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen' -/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */ -export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated' -/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */ -export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed' -/** Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it */ -export const REVIEWNONE = 'com.atproto.admin.defs#reviewNone' - -/** Take down a subject permanently or temporarily */ -export interface ModEventTakedown { - comment?: string - /** Indicates how long the takedown should be in effect before automatically expiring. */ - durationInHours?: number - [k: string]: unknown -} - -export function isModEventTakedown(v: unknown): v is ModEventTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTakedown' - ) -} - -export function validateModEventTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTakedown', v) -} - -/** Revert take down action on a subject */ -export interface ModEventReverseTakedown { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventReverseTakedown( - v: unknown, -): v is ModEventReverseTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReverseTakedown' - ) -} - -export function validateModEventReverseTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v) -} - -/** Resolve appeal on a subject */ -export interface ModEventResolveAppeal { - /** Describe resolution. */ - comment?: string - [k: string]: unknown -} - -export function isModEventResolveAppeal( - v: unknown, -): v is ModEventResolveAppeal { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventResolveAppeal' - ) -} - -export function validateModEventResolveAppeal(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v) -} - -/** Add a comment to a subject */ -export interface ModEventComment { - comment: string - /** Make the comment persistent on the subject */ - sticky?: boolean - [k: string]: unknown -} - -export function isModEventComment(v: unknown): v is ModEventComment { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventComment' - ) -} - -export function validateModEventComment(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventComment', v) -} - -/** Report a subject */ -export interface ModEventReport { - comment?: string - reportType: ComAtprotoModerationDefs.ReasonType - [k: string]: unknown -} - -export function isModEventReport(v: unknown): v is ModEventReport { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReport' - ) -} - -export function validateModEventReport(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReport', v) -} - -/** Apply/Negate labels on a subject */ -export interface ModEventLabel { - comment?: string - createLabelVals: string[] - negateLabelVals: string[] - [k: string]: unknown -} - -export function isModEventLabel(v: unknown): v is ModEventLabel { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventLabel' - ) -} - -export function validateModEventLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventLabel', v) -} - -export interface ModEventAcknowledge { - comment?: string - [k: string]: unknown -} - -export function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventAcknowledge' - ) -} - -export function validateModEventAcknowledge(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventAcknowledge', v) -} - -export interface ModEventEscalate { - comment?: string - [k: string]: unknown -} - -export function isModEventEscalate(v: unknown): v is ModEventEscalate { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEscalate' - ) -} - -export function validateModEventEscalate(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEscalate', v) -} - -/** Mute incoming reports on a subject */ -export interface ModEventMute { - comment?: string - /** Indicates how long the subject should remain muted. */ - durationInHours: number - [k: string]: unknown -} - -export function isModEventMute(v: unknown): v is ModEventMute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventMute' - ) -} - -export function validateModEventMute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventMute', v) -} - -/** Unmute action on a subject */ -export interface ModEventUnmute { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventUnmute(v: unknown): v is ModEventUnmute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventUnmute' - ) -} - -export function validateModEventUnmute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventUnmute', v) -} - -/** Keep a log of outgoing email to a user */ -export interface ModEventEmail { - /** The subject line of the email sent to the user. */ - subjectLine: string - /** The content of the email sent to the user. */ - content?: string - /** Additional comment about the outgoing comm. */ - comment?: string - [k: string]: unknown -} - -export function isModEventEmail(v: unknown): v is ModEventEmail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEmail' - ) -} - -export function validateModEventEmail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEmail', v) -} - -/** Add/Remove a tag on a subject */ -export interface ModEventTag { - /** Tags to be added to the subject. If already exists, won't be duplicated. */ - add: string[] - /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */ - remove: string[] - /** Additional comment about added/removed tags. */ - comment?: string - [k: string]: unknown -} - -export function isModEventTag(v: unknown): v is ModEventTag { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTag' - ) -} - -export function validateModEventTag(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTag', v) -} - -export interface CommunicationTemplateView { - id: string - /** Name of the template. */ - name: string - /** Content of the template, can contain markdown and variable placeholders. */ - subject?: string - /** Subject of the message, used in emails. */ - contentMarkdown: string - disabled: boolean - /** DID of the user who last updated the template. */ - lastUpdatedBy: string - createdAt: string - updatedAt: string - [k: string]: unknown -} - -export function isCommunicationTemplateView( - v: unknown, -): v is CommunicationTemplateView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#communicationTemplateView' - ) -} - -export function validateCommunicationTemplateView( - v: unknown, -): ValidationResult { - return lexicons.validate( - 'com.atproto.admin.defs#communicationTemplateView', - v, - ) -} diff --git a/packages/bsky/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts deleted file mode 100644 index c5ae5cd469f..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +++ /dev/null @@ -1,38 +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, HandlerPipeThrough } from '@atproto/xrpc-server' - -export interface QueryParams {} - -export interface InputSchema { - id: string - [k: string]: unknown -} - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | void -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/packages/bsky/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts deleted file mode 100644 index 99d08c7f1b7..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +++ /dev/null @@ -1,67 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' - -export interface QueryParams {} - -export interface InputSchema { - event: - | ComAtprotoAdminDefs.ModEventTakedown - | ComAtprotoAdminDefs.ModEventAcknowledge - | ComAtprotoAdminDefs.ModEventEscalate - | ComAtprotoAdminDefs.ModEventComment - | ComAtprotoAdminDefs.ModEventLabel - | ComAtprotoAdminDefs.ModEventReport - | ComAtprotoAdminDefs.ModEventMute - | ComAtprotoAdminDefs.ModEventReverseTakedown - | ComAtprotoAdminDefs.ModEventUnmute - | ComAtprotoAdminDefs.ModEventEmail - | ComAtprotoAdminDefs.ModEventTag - | { $type: string; [k: string]: unknown } - subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - createdBy: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.ModEventView - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string - error?: 'SubjectHasAction' -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/getModerationEvent.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/getModerationEvent.ts deleted file mode 100644 index 99c8bbe20ef..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +++ /dev/null @@ -1,41 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - id: number -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail -export type HandlerInput = undefined - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput diff --git a/packages/bsky/src/lexicon/types/com/atproto/admin/getRecord.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/getRecord.ts deleted file mode 100644 index 557945e2fbd..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/getRecord.ts +++ /dev/null @@ -1,43 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - uri: string - cid?: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail -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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/getRepo.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/getRepo.ts deleted file mode 100644 index ede9fcf3ce8..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/getRepo.ts +++ /dev/null @@ -1,42 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - did: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail -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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts deleted file mode 100644 index 843c228e6f9..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +++ /dev/null @@ -1,44 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export type InputSchema = undefined - -export interface OutputSchema { - communicationTemplates: ComAtprotoAdminDefs.CommunicationTemplateView[] - [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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts deleted file mode 100644 index 9f4738578aa..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +++ /dev/null @@ -1,73 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned. */ - types?: string[] - createdBy?: string - /** Sort direction for the events. Defaults to descending order of created at timestamp. */ - sortDirection: 'asc' | 'desc' - /** Retrieve events created after a given timestamp */ - createdAfter?: string - /** Retrieve events created before a given timestamp */ - createdBefore?: string - subject?: string - /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */ - includeAllUserRecords: boolean - limit: number - /** If true, only events with comments are returned */ - hasComment?: boolean - /** If specified, only events with comments containing the keyword are returned */ - comment?: string - /** If specified, only events where all of these labels were added are returned */ - addedLabels?: string[] - /** If specified, only events where all of these labels were removed are returned */ - removedLabels?: string[] - /** If specified, only events where all of these tags were added are returned */ - addedTags?: string[] - /** If specified, only events where all of these tags were removed are returned */ - removedTags?: string[] - reportTypes?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - events: ComAtprotoAdminDefs.ModEventView[] - [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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts deleted file mode 100644 index f5031d25117..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +++ /dev/null @@ -1,74 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - subject?: string - /** Search subjects by keyword from comments */ - comment?: string - /** Search subjects reported after a given timestamp */ - reportedAfter?: string - /** Search subjects reported before a given timestamp */ - reportedBefore?: string - /** Search subjects reviewed after a given timestamp */ - reviewedAfter?: string - /** Search subjects reviewed before a given timestamp */ - reviewedBefore?: string - /** By default, we don't include muted subjects in the results. Set this to true to include them. */ - includeMuted?: boolean - /** Specify when fetching subjects in a certain state */ - reviewState?: string - ignoreSubjects?: string[] - /** Get all subject statuses that were reviewed by a specific moderator */ - lastReviewedBy?: string - sortField: 'lastReviewedAt' | 'lastReportedAt' - sortDirection: 'asc' | 'desc' - /** Get subjects that were taken down */ - takendown?: boolean - /** Get subjects in unresolved appealed status */ - appealed?: boolean - limit: number - tags?: string[] - excludeTags?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[] - [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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/searchRepos.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/searchRepos.ts deleted file mode 100644 index d1529956c17..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/searchRepos.ts +++ /dev/null @@ -1,51 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** DEPRECATED: use 'q' instead */ - term?: string - q?: string - limit: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - repos: ComAtprotoAdminDefs.RepoView[] - [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 | HandlerPipeThrough -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/packages/bsky/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts b/packages/bsky/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts deleted file mode 100644 index 73e079cfe58..00000000000 --- a/packages/bsky/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +++ /dev/null @@ -1,57 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** ID of the template to be updated. */ - id: string - /** Name of the template. */ - name?: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown?: string - /** Subject of the message, used in emails. */ - subject?: string - /** DID of the user who is updating the template. */ - updatedBy?: string - disabled?: boolean - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -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/packages/ozone/src/lexicon/index.ts b/packages/ozone/src/lexicon/index.ts index 1e0e766f1e0..d44cb9b4656 100644 --- a/packages/ozone/src/lexicon/index.ts +++ b/packages/ozone/src/lexicon/index.ts @@ -9,29 +9,18 @@ import { StreamAuthVerifier, } from '@atproto/xrpc-server' import { schemas } from './lexicons' -import * as ComAtprotoAdminCreateCommunicationTemplate from './types/com/atproto/admin/createCommunicationTemplate' import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -import * as ComAtprotoAdminDeleteCommunicationTemplate from './types/com/atproto/admin/deleteCommunicationTemplate' import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -import * as ComAtprotoAdminEmitModerationEvent from './types/com/atproto/admin/emitModerationEvent' import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -import * as ComAtprotoAdminGetModerationEvent from './types/com/atproto/admin/getModerationEvent' -import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' -import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -import * as ComAtprotoAdminListCommunicationTemplates from './types/com/atproto/admin/listCommunicationTemplates' -import * as ComAtprotoAdminQueryModerationEvents from './types/com/atproto/admin/queryModerationEvents' -import * as ComAtprotoAdminQueryModerationStatuses from './types/com/atproto/admin/queryModerationStatuses' -import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -import * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate' import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' @@ -139,12 +128,6 @@ import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecce import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export const COM_ATPROTO_ADMIN = { - DefsReviewOpen: 'com.atproto.admin.defs#reviewOpen', - DefsReviewEscalated: 'com.atproto.admin.defs#reviewEscalated', - DefsReviewClosed: 'com.atproto.admin.defs#reviewClosed', - DefsReviewNone: 'com.atproto.admin.defs#reviewNone', -} export const COM_ATPROTO_MODERATION = { DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', @@ -216,17 +199,6 @@ export class ComAtprotoAdminNS { this._server = server } - createCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminCreateCommunicationTemplate.Handler>, - ComAtprotoAdminCreateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.createCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - deleteAccount( cfg: ConfigOf< AV, @@ -238,17 +210,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - deleteCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminDeleteCommunicationTemplate.Handler>, - ComAtprotoAdminDeleteCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.deleteCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - disableAccountInvites( cfg: ConfigOf< AV, @@ -271,17 +232,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - emitModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminEmitModerationEvent.Handler>, - ComAtprotoAdminEmitModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.emitModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - enableAccountInvites( cfg: ConfigOf< AV, @@ -326,39 +276,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - getModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminGetModerationEvent.Handler>, - ComAtprotoAdminGetModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - getRecord( - 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< - AV, - ComAtprotoAdminGetRepo.Handler>, - ComAtprotoAdminGetRepo.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getRepo' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getSubjectStatus( cfg: ConfigOf< AV, @@ -370,50 +287,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - listCommunicationTemplates( - cfg: ConfigOf< - AV, - ComAtprotoAdminListCommunicationTemplates.Handler>, - ComAtprotoAdminListCommunicationTemplates.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.listCommunicationTemplates' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationEvents( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationEvents.Handler>, - ComAtprotoAdminQueryModerationEvents.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationEvents' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationStatuses( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationStatuses.Handler>, - ComAtprotoAdminQueryModerationStatuses.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationStatuses' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - searchRepos( - 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, @@ -458,17 +331,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - updateCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminUpdateCommunicationTemplate.Handler>, - ComAtprotoAdminUpdateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.updateCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - updateSubjectStatus( cfg: ConfigOf< AV, diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index 635e9e19e60..6603408a87f 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -4,51 +4,6 @@ import { LexiconDoc, Lexicons } from '@atproto/lexicon' export const schemaDict = { - ComAtprotoAdminCreateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.createCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to create a new, re-usable communication (email for now) template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject', 'contentMarkdown', 'name'], - properties: { - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - createdBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is creating the template.', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminDefs: { lexicon: 1, id: 'com.atproto.admin.defs', @@ -65,1184 +20,128 @@ export const schemaDict = { }, }, }, - modEventView: { + accountView: { type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobCids', - 'createdBy', - 'createdAt', - ], + required: ['did', 'handle', 'indexedAt'], properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - }, - }, - createdBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - creatorHandle: { + handle: { type: 'string', + format: 'handle', }, - subjectHandle: { + email: { type: 'string', }, - }, - }, - modEventViewDetail: { - type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobs', - 'createdBy', - 'createdAt', - ], - properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - 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: { + relatedRecords: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', + type: 'unknown', }, }, - createdBy: { - type: 'string', - format: 'did', - }, - createdAt: { + indexedAt: { type: 'string', format: 'datetime', }, - }, - }, - reportView: { - type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActionIds', - ], - properties: { - id: { - type: 'integer', - }, - reasonType: { + invitedBy: { type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - subjectRepoHandle: { - type: 'string', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - reportedBy: { - type: 'string', - format: 'did', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActionIds: { - type: 'array', - items: { - type: 'integer', - }, - }, - }, - }, - subjectStatusView: { - type: 'object', - required: ['id', 'subject', 'createdAt', 'updatedAt', 'reviewState'], - properties: { - id: { - type: 'integer', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], + ref: 'lex:com.atproto.server.defs#inviteCode', }, - subjectBlobCids: { + invites: { type: 'array', items: { - type: 'string', - format: 'cid', + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, - subjectRepoHandle: { - type: 'string', - }, - updatedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the last update was made to the moderation status of the subject', - }, - createdAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing the first moderation status impacting event was emitted on the subject', - }, - reviewState: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectReviewState', - }, - comment: { - type: 'string', - description: 'Sticky comment on the subject.', - }, - muteUntil: { - type: 'string', - format: 'datetime', - }, - lastReviewedBy: { - type: 'string', - format: 'did', - }, - lastReviewedAt: { - type: 'string', - format: 'datetime', - }, - lastReportedAt: { - type: 'string', - format: 'datetime', - }, - lastAppealedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the author of the subject appealed a moderation action', - }, - takendown: { - type: 'boolean', - }, - appealed: { + invitesDisabled: { type: 'boolean', - description: - 'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.', }, - suspendUntil: { + emailConfirmedAt: { type: 'string', format: 'datetime', }, - tags: { - type: 'array', - items: { - type: 'string', - }, + inviteNote: { + type: 'string', }, }, }, - reportViewDetail: { + repoRef: { type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActions', - ], + required: ['did'], properties: { - id: { - type: 'integer', - }, - reasonType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - 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', - ], - }, - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - reportedBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActions: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, }, }, - repoView: { + repoBlobRef: { type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], + required: ['did', 'cid'], properties: { did: { type: 'string', format: 'did', }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { + cid: { type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invitesDisabled: { - type: 'boolean', + format: 'cid', }, - inviteNote: { + recordUri: { type: 'string', + format: 'at-uri', }, }, }, - repoViewDetail: { - type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - inviteNote: { - type: 'string', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - accountView: { - type: 'object', - required: ['did', 'handle', 'indexedAt'], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - inviteNote: { - type: 'string', - }, - }, - }, - repoViewNotFound: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoRef: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoBlobRef: { - type: 'object', - required: ['did', 'cid'], - properties: { - did: { - type: 'string', - format: 'did', - }, - cid: { - type: 'string', - format: 'cid', - }, - recordUri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - recordView: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobCids', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewDetail: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobs', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobs: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', - }, - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewNotFound: { - type: 'object', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - moderation: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - moderationDetail: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - blobView: { - type: 'object', - required: ['cid', 'mimeType', 'size', 'createdAt'], - properties: { - cid: { - type: 'string', - format: 'cid', - }, - mimeType: { - type: 'string', - }, - size: { - type: 'integer', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - details: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#imageDetails', - 'lex:com.atproto.admin.defs#videoDetails', - ], - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - }, - }, - imageDetails: { - type: 'object', - required: ['width', 'height'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - }, - }, - videoDetails: { - type: 'object', - required: ['width', 'height', 'length'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - length: { - type: 'integer', - }, - }, - }, - subjectReviewState: { - type: 'string', - knownValues: [ - 'lex:com.atproto.admin.defs#reviewOpen', - 'lex:com.atproto.admin.defs#reviewEscalated', - 'lex:com.atproto.admin.defs#reviewClosed', - 'lex:com.atproto.admin.defs#reviewNone', - ], - }, - reviewOpen: { - type: 'token', - description: - 'Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator', - }, - reviewEscalated: { - type: 'token', - description: - 'Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator', - }, - reviewClosed: { - type: 'token', - description: - 'Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator', - }, - reviewNone: { - type: 'token', - description: - 'Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it', - }, - modEventTakedown: { - type: 'object', - description: 'Take down a subject permanently or temporarily', - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: - 'Indicates how long the takedown should be in effect before automatically expiring.', - }, - }, - }, - modEventReverseTakedown: { - type: 'object', - description: 'Revert take down action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventResolveAppeal: { - type: 'object', - description: 'Resolve appeal on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe resolution.', - }, - }, - }, - modEventComment: { - type: 'object', - description: 'Add a comment to a subject', - required: ['comment'], - properties: { - comment: { - type: 'string', - }, - sticky: { - type: 'boolean', - description: 'Make the comment persistent on the subject', - }, - }, - }, - modEventReport: { - type: 'object', - description: 'Report a subject', - required: ['reportType'], - properties: { - comment: { - type: 'string', - }, - reportType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - }, - }, - modEventLabel: { - type: 'object', - description: 'Apply/Negate labels on a subject', - required: ['createLabelVals', 'negateLabelVals'], - properties: { - comment: { - type: 'string', - }, - createLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - negateLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - modEventAcknowledge: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventEscalate: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventMute: { - type: 'object', - description: 'Mute incoming reports on a subject', - required: ['durationInHours'], - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: 'Indicates how long the subject should remain muted.', - }, - }, - }, - modEventUnmute: { - type: 'object', - description: 'Unmute action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventEmail: { - type: 'object', - description: 'Keep a log of outgoing email to a user', - required: ['subjectLine'], - properties: { - subjectLine: { - type: 'string', - description: 'The subject line of the email sent to the user.', - }, - content: { - type: 'string', - description: 'The content of the email sent to the user.', - }, - comment: { - type: 'string', - description: 'Additional comment about the outgoing comm.', - }, - }, - }, - modEventTag: { - type: 'object', - description: 'Add/Remove a tag on a subject', - required: ['add', 'remove'], - properties: { - add: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be added to the subject. If already exists, won't be duplicated.", - }, - remove: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", - }, - comment: { - type: 'string', - description: 'Additional comment about added/removed tags.', - }, - }, - }, - communicationTemplateView: { - type: 'object', - required: [ - 'id', - 'name', - 'contentMarkdown', - 'disabled', - 'lastUpdatedBy', - 'createdAt', - 'updatedAt', - ], - properties: { - id: { - type: 'string', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - subject: { - type: 'string', - description: - 'Content of the template, can contain markdown and variable placeholders.', - }, - contentMarkdown: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - disabled: { - type: 'boolean', - }, - lastUpdatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who last updated the template.', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - updatedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteAccount: { - lexicon: 1, - id: 'com.atproto.admin.deleteAccount', - defs: { - main: { - type: 'procedure', - description: 'Delete a user account as an administrator.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.deleteCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: 'Delete a communication template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableAccountInvites: { - lexicon: 1, - id: 'com.atproto.admin.disableAccountInvites', - defs: { - main: { - type: 'procedure', - description: - 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['account'], - properties: { - account: { - type: 'string', - format: 'did', - }, - note: { - type: 'string', - description: 'Optional reason for disabled invites.', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableInviteCodes: { - lexicon: 1, - id: 'com.atproto.admin.disableInviteCodes', - defs: { - main: { - type: 'procedure', - description: - 'Disable some set of codes and/or all codes associated with a set of users.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - properties: { - codes: { - type: 'array', - items: { - type: 'string', - }, - }, - accounts: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminEmitModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.emitModerationEvent', - defs: { - main: { - type: 'procedure', - description: 'Take a moderation action on an actor.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['event', 'subject', 'createdBy'], - properties: { - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventUnmute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventTag', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - createdBy: { - type: 'string', - format: 'did', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, - errors: [ - { - name: 'SubjectHasAction', - }, - ], - }, }, }, - ComAtprotoAdminEnableAccountInvites: { + ComAtprotoAdminDeleteAccount: { lexicon: 1, - id: 'com.atproto.admin.enableAccountInvites', + id: 'com.atproto.admin.deleteAccount', defs: { main: { type: 'procedure', - description: "Re-enable an account's ability to receive invite codes.", + description: 'Delete a user account as an administrator.', input: { encoding: 'application/json', schema: { type: 'object', - required: ['account'], + required: ['did'], properties: { - account: { + did: { type: 'string', format: 'did', }, - note: { - type: 'string', - description: 'Optional reason for enabled invites.', - }, }, }, }, }, }, }, - ComAtprotoAdminGetAccountInfo: { + ComAtprotoAdminDisableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.getAccountInfo', + id: 'com.atproto.admin.disableAccountInvites', defs: { main: { - type: 'query', - description: 'Get details about an account.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', + input: { encoding: 'application/json', schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, - }, - }, - }, - }, - ComAtprotoAdminGetAccountInfos: { - lexicon: 1, - id: 'com.atproto.admin.getAccountInfos', - defs: { - main: { - type: 'query', - description: 'Get details about some accounts.', - parameters: { - type: 'params', - required: ['dids'], - properties: { - dids: { - type: 'array', - items: { + type: 'object', + required: ['account'], + properties: { + account: { type: 'string', format: 'did', }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['infos'], - properties: { - infos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, + note: { + type: 'string', + description: 'Optional reason for disabled invites.', }, }, }, @@ -1250,190 +149,30 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminGetInviteCodes: { + ComAtprotoAdminDisableInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.getInviteCodes', + id: 'com.atproto.admin.disableInviteCodes', defs: { main: { - type: 'query', - description: 'Get an admin view of invite codes.', - parameters: { - type: 'params', - properties: { - sort: { - type: 'string', - knownValues: ['recent', 'usage'], - default: 'recent', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 500, - default: 100, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable some set of codes and/or all codes associated with a set of users.', + input: { encoding: 'application/json', schema: { type: 'object', - required: ['codes'], properties: { - cursor: { - type: 'string', - }, codes: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', + type: 'string', }, }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminGetModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.getModerationEvent', - defs: { - main: { - type: 'query', - description: 'Get details about a moderation event.', - parameters: { - type: 'params', - required: ['id'], - properties: { - id: { - type: 'integer', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventViewDetail', - }, - }, - }, - }, - }, - ComAtprotoAdminGetRecord: { - lexicon: 1, - id: 'com.atproto.admin.getRecord', - defs: { - main: { - type: 'query', - description: 'Get details about a record.', - parameters: { - type: 'params', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#recordViewDetail', - }, - }, - errors: [ - { - name: 'RecordNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetRepo: { - lexicon: 1, - id: 'com.atproto.admin.getRepo', - defs: { - main: { - type: 'query', - description: 'Get details about a repository.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoViewDetail', - }, - }, - errors: [ - { - name: 'RepoNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetSubjectStatus: { - lexicon: 1, - id: 'com.atproto.admin.getSubjectStatus', - defs: { - main: { - type: 'query', - description: - 'Get the service-specific admin status of a subject (account, record, or blob).', - parameters: { - type: 'params', - properties: { - did: { - type: 'string', - format: 'did', - }, - uri: { - type: 'string', - format: 'at-uri', - }, - blob: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject'], - properties: { - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - 'lex:com.atproto.admin.defs#repoBlobRef', - ], - }, - takedown: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#statusAttr', + accounts: { + type: 'array', + items: { + type: 'string', + }, }, }, }, @@ -1441,25 +180,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminListCommunicationTemplates: { + ComAtprotoAdminEnableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.listCommunicationTemplates', + id: 'com.atproto.admin.enableAccountInvites', defs: { main: { - type: 'query', - description: 'Get list of all communication templates.', - output: { + type: 'procedure', + description: "Re-enable an account's ability to receive invite codes.", + input: { encoding: 'application/json', schema: { type: 'object', - required: ['communicationTemplates'], + required: ['account'], properties: { - communicationTemplates: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, + account: { + type: 'string', + format: 'did', + }, + note: { + type: 'string', + description: 'Optional reason for enabled invites.', }, }, }, @@ -1467,127 +207,64 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationEvents: { + ComAtprotoAdminGetAccountInfo: { lexicon: 1, - id: 'com.atproto.admin.queryModerationEvents', + id: 'com.atproto.admin.getAccountInfo', defs: { main: { type: 'query', - description: 'List moderation events related to a subject.', + description: 'Get details about an account.', parameters: { type: 'params', + required: ['did'], properties: { - types: { - type: 'array', - items: { - type: 'string', - }, - description: - 'The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned.', - }, - createdBy: { + did: { type: 'string', format: 'did', }, - sortDirection: { - type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - description: - 'Sort direction for the events. Defaults to descending order of created at timestamp.', - }, - createdAfter: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created after a given timestamp', - }, - createdBefore: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created before a given timestamp', - }, - subject: { - type: 'string', - format: 'uri', - }, - includeAllUserRecords: { - type: 'boolean', - default: false, - description: - 'If true, events on all record types (posts, lists, profile etc.) owned by the did are returned', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - hasComment: { - type: 'boolean', - description: 'If true, only events with comments are returned', - }, - comment: { - type: 'string', - description: - 'If specified, only events with comments containing the keyword are returned', - }, - addedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were added are returned', - }, - removedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were removed are returned', - }, - addedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were added are returned', - }, - removedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were removed are returned', - }, - reportTypes: { + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#accountView', + }, + }, + }, + }, + }, + ComAtprotoAdminGetAccountInfos: { + lexicon: 1, + id: 'com.atproto.admin.getAccountInfos', + defs: { + main: { + type: 'query', + description: 'Get details about some accounts.', + parameters: { + type: 'params', + required: ['dids'], + properties: { + dids: { type: 'array', items: { type: 'string', + format: 'did', }, }, - cursor: { - type: 'string', - }, }, }, output: { encoding: 'application/json', schema: { type: 'object', - required: ['events'], + required: ['infos'], properties: { - cursor: { - type: 'string', - }, - events: { + infos: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', + ref: 'lex:com.atproto.admin.defs#accountView', }, }, }, @@ -1596,101 +273,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationStatuses: { + ComAtprotoAdminGetInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.queryModerationStatuses', + id: 'com.atproto.admin.getInviteCodes', defs: { main: { type: 'query', - description: 'View moderation statuses of subjects (record or repo).', + description: 'Get an admin view of invite codes.', parameters: { type: 'params', properties: { - subject: { - type: 'string', - format: 'uri', - }, - comment: { - type: 'string', - description: 'Search subjects by keyword from comments', - }, - reportedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported after a given timestamp', - }, - reportedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported before a given timestamp', - }, - reviewedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed after a given timestamp', - }, - reviewedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed before a given timestamp', - }, - includeMuted: { - type: 'boolean', - description: - "By default, we don't include muted subjects in the results. Set this to true to include them.", - }, - reviewState: { - type: 'string', - description: 'Specify when fetching subjects in a certain state', - }, - ignoreSubjects: { - type: 'array', - items: { - type: 'string', - format: 'uri', - }, - }, - lastReviewedBy: { - type: 'string', - format: 'did', - description: - 'Get all subject statuses that were reviewed by a specific moderator', - }, - sortField: { - type: 'string', - default: 'lastReportedAt', - enum: ['lastReviewedAt', 'lastReportedAt'], - }, - sortDirection: { + sort: { type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - }, - takendown: { - type: 'boolean', - description: 'Get subjects that were taken down', - }, - appealed: { - type: 'boolean', - description: 'Get subjects in unresolved appealed status', + knownValues: ['recent', 'usage'], + default: 'recent', }, limit: { type: 'integer', minimum: 1, - maximum: 100, - default: 50, - }, - tags: { - type: 'array', - items: { - type: 'string', - }, - }, - excludeTags: { - type: 'array', - items: { - type: 'string', - }, + maximum: 500, + default: 100, }, cursor: { type: 'string', @@ -1701,16 +303,16 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['subjectStatuses'], + required: ['codes'], properties: { cursor: { type: 'string', }, - subjectStatuses: { + codes: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, }, @@ -1719,31 +321,28 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminSearchRepos: { + ComAtprotoAdminGetSubjectStatus: { lexicon: 1, - id: 'com.atproto.admin.searchRepos', + id: 'com.atproto.admin.getSubjectStatus', defs: { main: { type: 'query', - description: 'Find repositories based on a search term.', + description: + 'Get the service-specific admin status of a subject (account, record, or blob).', parameters: { type: 'params', properties: { - term: { + did: { type: 'string', - description: "DEPRECATED: use 'q' instead", + format: 'did', }, - q: { + uri: { type: 'string', + format: 'at-uri', }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { + blob: { type: 'string', + format: 'cid', }, }, }, @@ -1751,17 +350,19 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['repos'], + required: ['subject'], properties: { - cursor: { - type: 'string', + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + 'lex:com.atproto.admin.defs#repoBlobRef', + ], }, - repos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, + takedown: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#statusAttr', }, }, }, @@ -1900,58 +501,6 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminUpdateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.updateCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - description: 'ID of the template to be updated.', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - updatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is updating the template.', - }, - disabled: { - type: 'boolean', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminUpdateSubjectStatus: { lexicon: 1, id: 'com.atproto.admin.updateSubjectStatus', @@ -9189,38 +7738,21 @@ export const schemaDict = { export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { - ComAtprotoAdminCreateCommunicationTemplate: - 'com.atproto.admin.createCommunicationTemplate', ComAtprotoAdminDefs: 'com.atproto.admin.defs', ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount', - ComAtprotoAdminDeleteCommunicationTemplate: - 'com.atproto.admin.deleteCommunicationTemplate', ComAtprotoAdminDisableAccountInvites: 'com.atproto.admin.disableAccountInvites', ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes', - ComAtprotoAdminEmitModerationEvent: 'com.atproto.admin.emitModerationEvent', ComAtprotoAdminEnableAccountInvites: 'com.atproto.admin.enableAccountInvites', ComAtprotoAdminGetAccountInfo: 'com.atproto.admin.getAccountInfo', ComAtprotoAdminGetAccountInfos: 'com.atproto.admin.getAccountInfos', ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes', - ComAtprotoAdminGetModerationEvent: 'com.atproto.admin.getModerationEvent', - ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord', - ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo', ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus', - ComAtprotoAdminListCommunicationTemplates: - 'com.atproto.admin.listCommunicationTemplates', - ComAtprotoAdminQueryModerationEvents: - 'com.atproto.admin.queryModerationEvents', - ComAtprotoAdminQueryModerationStatuses: - 'com.atproto.admin.queryModerationStatuses', - ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail', ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', ComAtprotoAdminUpdateAccountPassword: 'com.atproto.admin.updateAccountPassword', - ComAtprotoAdminUpdateCommunicationTemplate: - 'com.atproto.admin.updateCommunicationTemplate', ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus', ComAtprotoIdentityGetRecommendedDidCredentials: 'com.atproto.identity.getRecommendedDidCredentials', diff --git a/packages/ozone/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts deleted file mode 100644 index b910b7987b4..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +++ /dev/null @@ -1,54 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** Name of the template. */ - name: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown: string - /** Subject of the message, used in emails. */ - subject: string - /** DID of the user who is creating the template. */ - createdBy?: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/defs.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/defs.ts index a860e6bcfa0..558b483a3b5 100644 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/defs.ts +++ b/packages/ozone/src/lexicon/types/com/atproto/admin/defs.ts @@ -5,10 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' -import * as ComAtprotoModerationDefs from '../moderation/defs' import * as ComAtprotoServerDefs from '../server/defs' -import * as ComAtprotoLabelDefs from '../label/defs' export interface StatusAttr { applied: boolean @@ -28,232 +25,6 @@ export function validateStatusAttr(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#statusAttr', v) } -export interface ModEventView { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids: string[] - createdBy: string - createdAt: string - creatorHandle?: string - subjectHandle?: string - [k: string]: unknown -} - -export function isModEventView(v: unknown): v is ModEventView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventView' - ) -} - -export function validateModEventView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventView', v) -} - -export interface ModEventViewDetail { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectBlobs: BlobView[] - createdBy: string - createdAt: string - [k: string]: unknown -} - -export function isModEventViewDetail(v: unknown): v is ModEventViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventViewDetail' - ) -} - -export function validateModEventViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventViewDetail', v) -} - -export interface ReportView { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subjectRepoHandle?: string - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - reportedBy: string - createdAt: string - resolvedByActionIds: number[] - [k: string]: unknown -} - -export function isReportView(v: unknown): v is ReportView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportView' - ) -} - -export function validateReportView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportView', v) -} - -export interface SubjectStatusView { - id: number - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - subjectRepoHandle?: string - /** Timestamp referencing when the last update was made to the moderation status of the subject */ - updatedAt: string - /** Timestamp referencing the first moderation status impacting event was emitted on the subject */ - createdAt: string - reviewState: SubjectReviewState - /** Sticky comment on the subject. */ - comment?: string - muteUntil?: string - lastReviewedBy?: string - lastReviewedAt?: string - lastReportedAt?: string - /** Timestamp referencing when the author of the subject appealed a moderation action */ - lastAppealedAt?: string - takendown?: boolean - /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */ - appealed?: boolean - suspendUntil?: string - tags?: string[] - [k: string]: unknown -} - -export function isSubjectStatusView(v: unknown): v is SubjectStatusView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#subjectStatusView' - ) -} - -export function validateSubjectStatusView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#subjectStatusView', v) -} - -export interface ReportViewDetail { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectStatus?: SubjectStatusView - reportedBy: string - createdAt: string - resolvedByActions: ModEventView[] - [k: string]: unknown -} - -export function isReportViewDetail(v: unknown): v is ReportViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportViewDetail' - ) -} - -export function validateReportViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v) -} - -export interface RepoView { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: Moderation - invitedBy?: ComAtprotoServerDefs.InviteCode - invitesDisabled?: boolean - inviteNote?: string - [k: string]: unknown -} - -export function isRepoView(v: unknown): v is RepoView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoView' - ) -} - -export function validateRepoView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoView', v) -} - -export interface RepoViewDetail { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: ModerationDetail - labels?: ComAtprotoLabelDefs.Label[] - invitedBy?: ComAtprotoServerDefs.InviteCode - invites?: ComAtprotoServerDefs.InviteCode[] - invitesDisabled?: boolean - inviteNote?: string - emailConfirmedAt?: string - [k: string]: unknown -} - -export function isRepoViewDetail(v: unknown): v is RepoViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoViewDetail' - ) -} - -export function validateRepoViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) -} - export interface AccountView { did: string handle: string @@ -280,23 +51,6 @@ export function validateAccountView(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#accountView', 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 @@ -332,454 +86,3 @@ export function isRepoBlobRef(v: unknown): v is RepoBlobRef { export function validateRepoBlobRef(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) } - -export interface RecordView { - uri: string - cid: string - value: {} - blobCids: string[] - indexedAt: string - moderation: Moderation - repo: RepoView - [k: string]: unknown -} - -export function isRecordView(v: unknown): v is RecordView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordView' - ) -} - -export function validateRecordView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#recordView', v) -} - -export interface RecordViewDetail { - uri: string - cid: string - value: {} - blobs: BlobView[] - labels?: ComAtprotoLabelDefs.Label[] - indexedAt: string - moderation: ModerationDetail - repo: RepoView - [k: string]: unknown -} - -export function isRecordViewDetail(v: unknown): v is RecordViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordViewDetail' - ) -} - -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 { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModeration(v: unknown): v is Moderation { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderation' - ) -} - -export function validateModeration(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderation', v) -} - -export interface ModerationDetail { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModerationDetail(v: unknown): v is ModerationDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderationDetail' - ) -} - -export function validateModerationDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderationDetail', v) -} - -export interface BlobView { - cid: string - mimeType: string - size: number - createdAt: string - details?: - | ImageDetails - | VideoDetails - | { $type: string; [k: string]: unknown } - moderation?: Moderation - [k: string]: unknown -} - -export function isBlobView(v: unknown): v is BlobView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#blobView' - ) -} - -export function validateBlobView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#blobView', v) -} - -export interface ImageDetails { - width: number - height: number - [k: string]: unknown -} - -export function isImageDetails(v: unknown): v is ImageDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#imageDetails' - ) -} - -export function validateImageDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#imageDetails', v) -} - -export interface VideoDetails { - width: number - height: number - length: number - [k: string]: unknown -} - -export function isVideoDetails(v: unknown): v is VideoDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#videoDetails' - ) -} - -export function validateVideoDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#videoDetails', v) -} - -export type SubjectReviewState = - | 'lex:com.atproto.admin.defs#reviewOpen' - | 'lex:com.atproto.admin.defs#reviewEscalated' - | 'lex:com.atproto.admin.defs#reviewClosed' - | 'lex:com.atproto.admin.defs#reviewNone' - | (string & {}) - -/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */ -export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen' -/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */ -export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated' -/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */ -export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed' -/** Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it */ -export const REVIEWNONE = 'com.atproto.admin.defs#reviewNone' - -/** Take down a subject permanently or temporarily */ -export interface ModEventTakedown { - comment?: string - /** Indicates how long the takedown should be in effect before automatically expiring. */ - durationInHours?: number - [k: string]: unknown -} - -export function isModEventTakedown(v: unknown): v is ModEventTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTakedown' - ) -} - -export function validateModEventTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTakedown', v) -} - -/** Revert take down action on a subject */ -export interface ModEventReverseTakedown { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventReverseTakedown( - v: unknown, -): v is ModEventReverseTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReverseTakedown' - ) -} - -export function validateModEventReverseTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v) -} - -/** Resolve appeal on a subject */ -export interface ModEventResolveAppeal { - /** Describe resolution. */ - comment?: string - [k: string]: unknown -} - -export function isModEventResolveAppeal( - v: unknown, -): v is ModEventResolveAppeal { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventResolveAppeal' - ) -} - -export function validateModEventResolveAppeal(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v) -} - -/** Add a comment to a subject */ -export interface ModEventComment { - comment: string - /** Make the comment persistent on the subject */ - sticky?: boolean - [k: string]: unknown -} - -export function isModEventComment(v: unknown): v is ModEventComment { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventComment' - ) -} - -export function validateModEventComment(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventComment', v) -} - -/** Report a subject */ -export interface ModEventReport { - comment?: string - reportType: ComAtprotoModerationDefs.ReasonType - [k: string]: unknown -} - -export function isModEventReport(v: unknown): v is ModEventReport { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReport' - ) -} - -export function validateModEventReport(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReport', v) -} - -/** Apply/Negate labels on a subject */ -export interface ModEventLabel { - comment?: string - createLabelVals: string[] - negateLabelVals: string[] - [k: string]: unknown -} - -export function isModEventLabel(v: unknown): v is ModEventLabel { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventLabel' - ) -} - -export function validateModEventLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventLabel', v) -} - -export interface ModEventAcknowledge { - comment?: string - [k: string]: unknown -} - -export function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventAcknowledge' - ) -} - -export function validateModEventAcknowledge(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventAcknowledge', v) -} - -export interface ModEventEscalate { - comment?: string - [k: string]: unknown -} - -export function isModEventEscalate(v: unknown): v is ModEventEscalate { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEscalate' - ) -} - -export function validateModEventEscalate(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEscalate', v) -} - -/** Mute incoming reports on a subject */ -export interface ModEventMute { - comment?: string - /** Indicates how long the subject should remain muted. */ - durationInHours: number - [k: string]: unknown -} - -export function isModEventMute(v: unknown): v is ModEventMute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventMute' - ) -} - -export function validateModEventMute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventMute', v) -} - -/** Unmute action on a subject */ -export interface ModEventUnmute { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventUnmute(v: unknown): v is ModEventUnmute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventUnmute' - ) -} - -export function validateModEventUnmute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventUnmute', v) -} - -/** Keep a log of outgoing email to a user */ -export interface ModEventEmail { - /** The subject line of the email sent to the user. */ - subjectLine: string - /** The content of the email sent to the user. */ - content?: string - /** Additional comment about the outgoing comm. */ - comment?: string - [k: string]: unknown -} - -export function isModEventEmail(v: unknown): v is ModEventEmail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEmail' - ) -} - -export function validateModEventEmail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEmail', v) -} - -/** Add/Remove a tag on a subject */ -export interface ModEventTag { - /** Tags to be added to the subject. If already exists, won't be duplicated. */ - add: string[] - /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */ - remove: string[] - /** Additional comment about added/removed tags. */ - comment?: string - [k: string]: unknown -} - -export function isModEventTag(v: unknown): v is ModEventTag { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTag' - ) -} - -export function validateModEventTag(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTag', v) -} - -export interface CommunicationTemplateView { - id: string - /** Name of the template. */ - name: string - /** Content of the template, can contain markdown and variable placeholders. */ - subject?: string - /** Subject of the message, used in emails. */ - contentMarkdown: string - disabled: boolean - /** DID of the user who last updated the template. */ - lastUpdatedBy: string - createdAt: string - updatedAt: string - [k: string]: unknown -} - -export function isCommunicationTemplateView( - v: unknown, -): v is CommunicationTemplateView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#communicationTemplateView' - ) -} - -export function validateCommunicationTemplateView( - v: unknown, -): ValidationResult { - return lexicons.validate( - 'com.atproto.admin.defs#communicationTemplateView', - v, - ) -} diff --git a/packages/ozone/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts deleted file mode 100644 index c5ae5cd469f..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +++ /dev/null @@ -1,38 +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, HandlerPipeThrough } from '@atproto/xrpc-server' - -export interface QueryParams {} - -export interface InputSchema { - id: string - [k: string]: unknown -} - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | void -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/packages/ozone/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts deleted file mode 100644 index 99d08c7f1b7..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +++ /dev/null @@ -1,67 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' - -export interface QueryParams {} - -export interface InputSchema { - event: - | ComAtprotoAdminDefs.ModEventTakedown - | ComAtprotoAdminDefs.ModEventAcknowledge - | ComAtprotoAdminDefs.ModEventEscalate - | ComAtprotoAdminDefs.ModEventComment - | ComAtprotoAdminDefs.ModEventLabel - | ComAtprotoAdminDefs.ModEventReport - | ComAtprotoAdminDefs.ModEventMute - | ComAtprotoAdminDefs.ModEventReverseTakedown - | ComAtprotoAdminDefs.ModEventUnmute - | ComAtprotoAdminDefs.ModEventEmail - | ComAtprotoAdminDefs.ModEventTag - | { $type: string; [k: string]: unknown } - subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - createdBy: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.ModEventView - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string - error?: 'SubjectHasAction' -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/getModerationEvent.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/getModerationEvent.ts deleted file mode 100644 index 99c8bbe20ef..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +++ /dev/null @@ -1,41 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - id: number -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail -export type HandlerInput = undefined - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput diff --git a/packages/ozone/src/lexicon/types/com/atproto/admin/getRecord.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/getRecord.ts deleted file mode 100644 index 557945e2fbd..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/getRecord.ts +++ /dev/null @@ -1,43 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - uri: string - cid?: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail -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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/getRepo.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/getRepo.ts deleted file mode 100644 index ede9fcf3ce8..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/getRepo.ts +++ /dev/null @@ -1,42 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - did: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail -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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts deleted file mode 100644 index 843c228e6f9..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +++ /dev/null @@ -1,44 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export type InputSchema = undefined - -export interface OutputSchema { - communicationTemplates: ComAtprotoAdminDefs.CommunicationTemplateView[] - [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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts deleted file mode 100644 index 9f4738578aa..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +++ /dev/null @@ -1,73 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned. */ - types?: string[] - createdBy?: string - /** Sort direction for the events. Defaults to descending order of created at timestamp. */ - sortDirection: 'asc' | 'desc' - /** Retrieve events created after a given timestamp */ - createdAfter?: string - /** Retrieve events created before a given timestamp */ - createdBefore?: string - subject?: string - /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */ - includeAllUserRecords: boolean - limit: number - /** If true, only events with comments are returned */ - hasComment?: boolean - /** If specified, only events with comments containing the keyword are returned */ - comment?: string - /** If specified, only events where all of these labels were added are returned */ - addedLabels?: string[] - /** If specified, only events where all of these labels were removed are returned */ - removedLabels?: string[] - /** If specified, only events where all of these tags were added are returned */ - addedTags?: string[] - /** If specified, only events where all of these tags were removed are returned */ - removedTags?: string[] - reportTypes?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - events: ComAtprotoAdminDefs.ModEventView[] - [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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts deleted file mode 100644 index f5031d25117..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +++ /dev/null @@ -1,74 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - subject?: string - /** Search subjects by keyword from comments */ - comment?: string - /** Search subjects reported after a given timestamp */ - reportedAfter?: string - /** Search subjects reported before a given timestamp */ - reportedBefore?: string - /** Search subjects reviewed after a given timestamp */ - reviewedAfter?: string - /** Search subjects reviewed before a given timestamp */ - reviewedBefore?: string - /** By default, we don't include muted subjects in the results. Set this to true to include them. */ - includeMuted?: boolean - /** Specify when fetching subjects in a certain state */ - reviewState?: string - ignoreSubjects?: string[] - /** Get all subject statuses that were reviewed by a specific moderator */ - lastReviewedBy?: string - sortField: 'lastReviewedAt' | 'lastReportedAt' - sortDirection: 'asc' | 'desc' - /** Get subjects that were taken down */ - takendown?: boolean - /** Get subjects in unresolved appealed status */ - appealed?: boolean - limit: number - tags?: string[] - excludeTags?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[] - [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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/searchRepos.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/searchRepos.ts deleted file mode 100644 index d1529956c17..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/searchRepos.ts +++ /dev/null @@ -1,51 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** DEPRECATED: use 'q' instead */ - term?: string - q?: string - limit: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - repos: ComAtprotoAdminDefs.RepoView[] - [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 | HandlerPipeThrough -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/packages/ozone/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts b/packages/ozone/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts deleted file mode 100644 index 73e079cfe58..00000000000 --- a/packages/ozone/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +++ /dev/null @@ -1,57 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** ID of the template to be updated. */ - id: string - /** Name of the template. */ - name?: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown?: string - /** Subject of the message, used in emails. */ - subject?: string - /** DID of the user who is updating the template. */ - updatedBy?: string - disabled?: boolean - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -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/packages/pds/src/lexicon/index.ts b/packages/pds/src/lexicon/index.ts index 1e0e766f1e0..d44cb9b4656 100644 --- a/packages/pds/src/lexicon/index.ts +++ b/packages/pds/src/lexicon/index.ts @@ -9,29 +9,18 @@ import { StreamAuthVerifier, } from '@atproto/xrpc-server' import { schemas } from './lexicons' -import * as ComAtprotoAdminCreateCommunicationTemplate from './types/com/atproto/admin/createCommunicationTemplate' import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -import * as ComAtprotoAdminDeleteCommunicationTemplate from './types/com/atproto/admin/deleteCommunicationTemplate' import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -import * as ComAtprotoAdminEmitModerationEvent from './types/com/atproto/admin/emitModerationEvent' import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -import * as ComAtprotoAdminGetModerationEvent from './types/com/atproto/admin/getModerationEvent' -import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' -import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -import * as ComAtprotoAdminListCommunicationTemplates from './types/com/atproto/admin/listCommunicationTemplates' -import * as ComAtprotoAdminQueryModerationEvents from './types/com/atproto/admin/queryModerationEvents' -import * as ComAtprotoAdminQueryModerationStatuses from './types/com/atproto/admin/queryModerationStatuses' -import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -import * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate' import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' @@ -139,12 +128,6 @@ import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecce import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export const COM_ATPROTO_ADMIN = { - DefsReviewOpen: 'com.atproto.admin.defs#reviewOpen', - DefsReviewEscalated: 'com.atproto.admin.defs#reviewEscalated', - DefsReviewClosed: 'com.atproto.admin.defs#reviewClosed', - DefsReviewNone: 'com.atproto.admin.defs#reviewNone', -} export const COM_ATPROTO_MODERATION = { DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', @@ -216,17 +199,6 @@ export class ComAtprotoAdminNS { this._server = server } - createCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminCreateCommunicationTemplate.Handler>, - ComAtprotoAdminCreateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.createCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - deleteAccount( cfg: ConfigOf< AV, @@ -238,17 +210,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - deleteCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminDeleteCommunicationTemplate.Handler>, - ComAtprotoAdminDeleteCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.deleteCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - disableAccountInvites( cfg: ConfigOf< AV, @@ -271,17 +232,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - emitModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminEmitModerationEvent.Handler>, - ComAtprotoAdminEmitModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.emitModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - enableAccountInvites( cfg: ConfigOf< AV, @@ -326,39 +276,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - getModerationEvent( - cfg: ConfigOf< - AV, - ComAtprotoAdminGetModerationEvent.Handler>, - ComAtprotoAdminGetModerationEvent.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getModerationEvent' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - getRecord( - 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< - AV, - ComAtprotoAdminGetRepo.Handler>, - ComAtprotoAdminGetRepo.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.getRepo' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getSubjectStatus( cfg: ConfigOf< AV, @@ -370,50 +287,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - listCommunicationTemplates( - cfg: ConfigOf< - AV, - ComAtprotoAdminListCommunicationTemplates.Handler>, - ComAtprotoAdminListCommunicationTemplates.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.listCommunicationTemplates' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationEvents( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationEvents.Handler>, - ComAtprotoAdminQueryModerationEvents.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationEvents' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - queryModerationStatuses( - cfg: ConfigOf< - AV, - ComAtprotoAdminQueryModerationStatuses.Handler>, - ComAtprotoAdminQueryModerationStatuses.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.queryModerationStatuses' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - - searchRepos( - 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, @@ -458,17 +331,6 @@ export class ComAtprotoAdminNS { return this._server.xrpc.method(nsid, cfg) } - updateCommunicationTemplate( - cfg: ConfigOf< - AV, - ComAtprotoAdminUpdateCommunicationTemplate.Handler>, - ComAtprotoAdminUpdateCommunicationTemplate.HandlerReqCtx> - >, - ) { - const nsid = 'com.atproto.admin.updateCommunicationTemplate' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - updateSubjectStatus( cfg: ConfigOf< AV, diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 635e9e19e60..6603408a87f 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -4,51 +4,6 @@ import { LexiconDoc, Lexicons } from '@atproto/lexicon' export const schemaDict = { - ComAtprotoAdminCreateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.createCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to create a new, re-usable communication (email for now) template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject', 'contentMarkdown', 'name'], - properties: { - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - createdBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is creating the template.', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminDefs: { lexicon: 1, id: 'com.atproto.admin.defs', @@ -65,1184 +20,128 @@ export const schemaDict = { }, }, }, - modEventView: { + accountView: { type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobCids', - 'createdBy', - 'createdAt', - ], + required: ['did', 'handle', 'indexedAt'], properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - }, - }, - createdBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - creatorHandle: { + handle: { type: 'string', + format: 'handle', }, - subjectHandle: { + email: { type: 'string', }, - }, - }, - modEventViewDetail: { - type: 'object', - required: [ - 'id', - 'event', - 'subject', - 'subjectBlobs', - 'createdBy', - 'createdAt', - ], - properties: { - id: { - type: 'integer', - }, - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventResolveAppeal', - ], - }, - 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: { + relatedRecords: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', + type: 'unknown', }, }, - createdBy: { - type: 'string', - format: 'did', - }, - createdAt: { + indexedAt: { type: 'string', format: 'datetime', }, - }, - }, - reportView: { - type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActionIds', - ], - properties: { - id: { - type: 'integer', - }, - reasonType: { + invitedBy: { type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - subjectRepoHandle: { - type: 'string', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - reportedBy: { - type: 'string', - format: 'did', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActionIds: { - type: 'array', - items: { - type: 'integer', - }, - }, - }, - }, - subjectStatusView: { - type: 'object', - required: ['id', 'subject', 'createdAt', 'updatedAt', 'reviewState'], - properties: { - id: { - type: 'integer', - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], + ref: 'lex:com.atproto.server.defs#inviteCode', }, - subjectBlobCids: { + invites: { type: 'array', items: { - type: 'string', - format: 'cid', + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, - subjectRepoHandle: { - type: 'string', - }, - updatedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the last update was made to the moderation status of the subject', - }, - createdAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing the first moderation status impacting event was emitted on the subject', - }, - reviewState: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectReviewState', - }, - comment: { - type: 'string', - description: 'Sticky comment on the subject.', - }, - muteUntil: { - type: 'string', - format: 'datetime', - }, - lastReviewedBy: { - type: 'string', - format: 'did', - }, - lastReviewedAt: { - type: 'string', - format: 'datetime', - }, - lastReportedAt: { - type: 'string', - format: 'datetime', - }, - lastAppealedAt: { - type: 'string', - format: 'datetime', - description: - 'Timestamp referencing when the author of the subject appealed a moderation action', - }, - takendown: { - type: 'boolean', - }, - appealed: { + invitesDisabled: { type: 'boolean', - description: - 'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.', }, - suspendUntil: { + emailConfirmedAt: { type: 'string', format: 'datetime', }, - tags: { - type: 'array', - items: { - type: 'string', - }, + inviteNote: { + type: 'string', }, }, }, - reportViewDetail: { + repoRef: { type: 'object', - required: [ - 'id', - 'reasonType', - 'subject', - 'reportedBy', - 'createdAt', - 'resolvedByActions', - ], + required: ['did'], properties: { - id: { - type: 'integer', - }, - reasonType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - comment: { - type: 'string', - }, - 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', - ], - }, - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - reportedBy: { + did: { type: 'string', format: 'did', }, - createdAt: { - type: 'string', - format: 'datetime', - }, - resolvedByActions: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, }, }, - repoView: { + repoBlobRef: { type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], + required: ['did', 'cid'], properties: { did: { type: 'string', format: 'did', }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { + cid: { type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invitesDisabled: { - type: 'boolean', + format: 'cid', }, - inviteNote: { + recordUri: { type: 'string', + format: 'at-uri', }, }, }, - repoViewDetail: { - type: 'object', - required: [ - 'did', - 'handle', - 'relatedRecords', - 'indexedAt', - 'moderation', - ], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - inviteNote: { - type: 'string', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - accountView: { - type: 'object', - required: ['did', 'handle', 'indexedAt'], - properties: { - did: { - type: 'string', - format: 'did', - }, - handle: { - type: 'string', - format: 'handle', - }, - email: { - type: 'string', - }, - relatedRecords: { - type: 'array', - items: { - type: 'unknown', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - invitedBy: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - invites: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', - }, - }, - invitesDisabled: { - type: 'boolean', - }, - emailConfirmedAt: { - type: 'string', - format: 'datetime', - }, - inviteNote: { - type: 'string', - }, - }, - }, - repoViewNotFound: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoRef: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - repoBlobRef: { - type: 'object', - required: ['did', 'cid'], - properties: { - did: { - type: 'string', - format: 'did', - }, - cid: { - type: 'string', - format: 'cid', - }, - recordUri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - recordView: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobCids', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewDetail: { - type: 'object', - required: [ - 'uri', - 'cid', - 'value', - 'blobs', - 'indexedAt', - 'moderation', - 'repo', - ], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - value: { - type: 'unknown', - }, - blobs: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#blobView', - }, - }, - labels: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.label.defs#label', - }, - }, - indexedAt: { - type: 'string', - format: 'datetime', - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderationDetail', - }, - repo: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, - }, - }, - recordViewNotFound: { - type: 'object', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - }, - }, - moderation: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - moderationDetail: { - type: 'object', - properties: { - subjectStatus: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', - }, - }, - }, - blobView: { - type: 'object', - required: ['cid', 'mimeType', 'size', 'createdAt'], - properties: { - cid: { - type: 'string', - format: 'cid', - }, - mimeType: { - type: 'string', - }, - size: { - type: 'integer', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - details: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#imageDetails', - 'lex:com.atproto.admin.defs#videoDetails', - ], - }, - moderation: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#moderation', - }, - }, - }, - imageDetails: { - type: 'object', - required: ['width', 'height'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - }, - }, - videoDetails: { - type: 'object', - required: ['width', 'height', 'length'], - properties: { - width: { - type: 'integer', - }, - height: { - type: 'integer', - }, - length: { - type: 'integer', - }, - }, - }, - subjectReviewState: { - type: 'string', - knownValues: [ - 'lex:com.atproto.admin.defs#reviewOpen', - 'lex:com.atproto.admin.defs#reviewEscalated', - 'lex:com.atproto.admin.defs#reviewClosed', - 'lex:com.atproto.admin.defs#reviewNone', - ], - }, - reviewOpen: { - type: 'token', - description: - 'Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator', - }, - reviewEscalated: { - type: 'token', - description: - 'Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator', - }, - reviewClosed: { - type: 'token', - description: - 'Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator', - }, - reviewNone: { - type: 'token', - description: - 'Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it', - }, - modEventTakedown: { - type: 'object', - description: 'Take down a subject permanently or temporarily', - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: - 'Indicates how long the takedown should be in effect before automatically expiring.', - }, - }, - }, - modEventReverseTakedown: { - type: 'object', - description: 'Revert take down action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventResolveAppeal: { - type: 'object', - description: 'Resolve appeal on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe resolution.', - }, - }, - }, - modEventComment: { - type: 'object', - description: 'Add a comment to a subject', - required: ['comment'], - properties: { - comment: { - type: 'string', - }, - sticky: { - type: 'boolean', - description: 'Make the comment persistent on the subject', - }, - }, - }, - modEventReport: { - type: 'object', - description: 'Report a subject', - required: ['reportType'], - properties: { - comment: { - type: 'string', - }, - reportType: { - type: 'ref', - ref: 'lex:com.atproto.moderation.defs#reasonType', - }, - }, - }, - modEventLabel: { - type: 'object', - description: 'Apply/Negate labels on a subject', - required: ['createLabelVals', 'negateLabelVals'], - properties: { - comment: { - type: 'string', - }, - createLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - negateLabelVals: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - modEventAcknowledge: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventEscalate: { - type: 'object', - properties: { - comment: { - type: 'string', - }, - }, - }, - modEventMute: { - type: 'object', - description: 'Mute incoming reports on a subject', - required: ['durationInHours'], - properties: { - comment: { - type: 'string', - }, - durationInHours: { - type: 'integer', - description: 'Indicates how long the subject should remain muted.', - }, - }, - }, - modEventUnmute: { - type: 'object', - description: 'Unmute action on a subject', - properties: { - comment: { - type: 'string', - description: 'Describe reasoning behind the reversal.', - }, - }, - }, - modEventEmail: { - type: 'object', - description: 'Keep a log of outgoing email to a user', - required: ['subjectLine'], - properties: { - subjectLine: { - type: 'string', - description: 'The subject line of the email sent to the user.', - }, - content: { - type: 'string', - description: 'The content of the email sent to the user.', - }, - comment: { - type: 'string', - description: 'Additional comment about the outgoing comm.', - }, - }, - }, - modEventTag: { - type: 'object', - description: 'Add/Remove a tag on a subject', - required: ['add', 'remove'], - properties: { - add: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be added to the subject. If already exists, won't be duplicated.", - }, - remove: { - type: 'array', - items: { - type: 'string', - }, - description: - "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", - }, - comment: { - type: 'string', - description: 'Additional comment about added/removed tags.', - }, - }, - }, - communicationTemplateView: { - type: 'object', - required: [ - 'id', - 'name', - 'contentMarkdown', - 'disabled', - 'lastUpdatedBy', - 'createdAt', - 'updatedAt', - ], - properties: { - id: { - type: 'string', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - subject: { - type: 'string', - description: - 'Content of the template, can contain markdown and variable placeholders.', - }, - contentMarkdown: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - disabled: { - type: 'boolean', - }, - lastUpdatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who last updated the template.', - }, - createdAt: { - type: 'string', - format: 'datetime', - }, - updatedAt: { - type: 'string', - format: 'datetime', - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteAccount: { - lexicon: 1, - id: 'com.atproto.admin.deleteAccount', - defs: { - main: { - type: 'procedure', - description: 'Delete a user account as an administrator.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDeleteCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.deleteCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: 'Delete a communication template.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableAccountInvites: { - lexicon: 1, - id: 'com.atproto.admin.disableAccountInvites', - defs: { - main: { - type: 'procedure', - description: - 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['account'], - properties: { - account: { - type: 'string', - format: 'did', - }, - note: { - type: 'string', - description: 'Optional reason for disabled invites.', - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminDisableInviteCodes: { - lexicon: 1, - id: 'com.atproto.admin.disableInviteCodes', - defs: { - main: { - type: 'procedure', - description: - 'Disable some set of codes and/or all codes associated with a set of users.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - properties: { - codes: { - type: 'array', - items: { - type: 'string', - }, - }, - accounts: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminEmitModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.emitModerationEvent', - defs: { - main: { - type: 'procedure', - description: 'Take a moderation action on an actor.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['event', 'subject', 'createdBy'], - properties: { - event: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#modEventTakedown', - 'lex:com.atproto.admin.defs#modEventAcknowledge', - 'lex:com.atproto.admin.defs#modEventEscalate', - 'lex:com.atproto.admin.defs#modEventComment', - 'lex:com.atproto.admin.defs#modEventLabel', - 'lex:com.atproto.admin.defs#modEventReport', - 'lex:com.atproto.admin.defs#modEventMute', - 'lex:com.atproto.admin.defs#modEventReverseTakedown', - 'lex:com.atproto.admin.defs#modEventUnmute', - 'lex:com.atproto.admin.defs#modEventEmail', - 'lex:com.atproto.admin.defs#modEventTag', - ], - }, - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - ], - }, - subjectBlobCids: { - type: 'array', - items: { - type: 'string', - format: 'cid', - }, - }, - createdBy: { - type: 'string', - format: 'did', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', - }, - }, - errors: [ - { - name: 'SubjectHasAction', - }, - ], - }, }, }, - ComAtprotoAdminEnableAccountInvites: { + ComAtprotoAdminDeleteAccount: { lexicon: 1, - id: 'com.atproto.admin.enableAccountInvites', + id: 'com.atproto.admin.deleteAccount', defs: { main: { type: 'procedure', - description: "Re-enable an account's ability to receive invite codes.", + description: 'Delete a user account as an administrator.', input: { encoding: 'application/json', schema: { type: 'object', - required: ['account'], + required: ['did'], properties: { - account: { + did: { type: 'string', format: 'did', }, - note: { - type: 'string', - description: 'Optional reason for enabled invites.', - }, }, }, }, }, }, }, - ComAtprotoAdminGetAccountInfo: { + ComAtprotoAdminDisableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.getAccountInfo', + id: 'com.atproto.admin.disableAccountInvites', defs: { main: { - type: 'query', - description: 'Get details about an account.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable an account from receiving new invite codes, but does not invalidate existing codes.', + input: { encoding: 'application/json', schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, - }, - }, - }, - }, - ComAtprotoAdminGetAccountInfos: { - lexicon: 1, - id: 'com.atproto.admin.getAccountInfos', - defs: { - main: { - type: 'query', - description: 'Get details about some accounts.', - parameters: { - type: 'params', - required: ['dids'], - properties: { - dids: { - type: 'array', - items: { + type: 'object', + required: ['account'], + properties: { + account: { type: 'string', format: 'did', }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['infos'], - properties: { - infos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#accountView', - }, + note: { + type: 'string', + description: 'Optional reason for disabled invites.', }, }, }, @@ -1250,190 +149,30 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminGetInviteCodes: { + ComAtprotoAdminDisableInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.getInviteCodes', + id: 'com.atproto.admin.disableInviteCodes', defs: { main: { - type: 'query', - description: 'Get an admin view of invite codes.', - parameters: { - type: 'params', - properties: { - sort: { - type: 'string', - knownValues: ['recent', 'usage'], - default: 'recent', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 500, - default: 100, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { + type: 'procedure', + description: + 'Disable some set of codes and/or all codes associated with a set of users.', + input: { encoding: 'application/json', schema: { type: 'object', - required: ['codes'], properties: { - cursor: { - type: 'string', - }, codes: { type: 'array', items: { - type: 'ref', - ref: 'lex:com.atproto.server.defs#inviteCode', + type: 'string', }, }, - }, - }, - }, - }, - }, - }, - ComAtprotoAdminGetModerationEvent: { - lexicon: 1, - id: 'com.atproto.admin.getModerationEvent', - defs: { - main: { - type: 'query', - description: 'Get details about a moderation event.', - parameters: { - type: 'params', - required: ['id'], - properties: { - id: { - type: 'integer', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventViewDetail', - }, - }, - }, - }, - }, - ComAtprotoAdminGetRecord: { - lexicon: 1, - id: 'com.atproto.admin.getRecord', - defs: { - main: { - type: 'query', - description: 'Get details about a record.', - parameters: { - type: 'params', - required: ['uri'], - properties: { - uri: { - type: 'string', - format: 'at-uri', - }, - cid: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#recordViewDetail', - }, - }, - errors: [ - { - name: 'RecordNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetRepo: { - lexicon: 1, - id: 'com.atproto.admin.getRepo', - defs: { - main: { - type: 'query', - description: 'Get details about a repository.', - parameters: { - type: 'params', - required: ['did'], - properties: { - did: { - type: 'string', - format: 'did', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoViewDetail', - }, - }, - errors: [ - { - name: 'RepoNotFound', - }, - ], - }, - }, - }, - ComAtprotoAdminGetSubjectStatus: { - lexicon: 1, - id: 'com.atproto.admin.getSubjectStatus', - defs: { - main: { - type: 'query', - description: - 'Get the service-specific admin status of a subject (account, record, or blob).', - parameters: { - type: 'params', - properties: { - did: { - type: 'string', - format: 'did', - }, - uri: { - type: 'string', - format: 'at-uri', - }, - blob: { - type: 'string', - format: 'cid', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['subject'], - properties: { - subject: { - type: 'union', - refs: [ - 'lex:com.atproto.admin.defs#repoRef', - 'lex:com.atproto.repo.strongRef', - 'lex:com.atproto.admin.defs#repoBlobRef', - ], - }, - takedown: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#statusAttr', + accounts: { + type: 'array', + items: { + type: 'string', + }, }, }, }, @@ -1441,25 +180,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminListCommunicationTemplates: { + ComAtprotoAdminEnableAccountInvites: { lexicon: 1, - id: 'com.atproto.admin.listCommunicationTemplates', + id: 'com.atproto.admin.enableAccountInvites', defs: { main: { - type: 'query', - description: 'Get list of all communication templates.', - output: { + type: 'procedure', + description: "Re-enable an account's ability to receive invite codes.", + input: { encoding: 'application/json', schema: { type: 'object', - required: ['communicationTemplates'], + required: ['account'], properties: { - communicationTemplates: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, + account: { + type: 'string', + format: 'did', + }, + note: { + type: 'string', + description: 'Optional reason for enabled invites.', }, }, }, @@ -1467,127 +207,64 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationEvents: { + ComAtprotoAdminGetAccountInfo: { lexicon: 1, - id: 'com.atproto.admin.queryModerationEvents', + id: 'com.atproto.admin.getAccountInfo', defs: { main: { type: 'query', - description: 'List moderation events related to a subject.', + description: 'Get details about an account.', parameters: { type: 'params', + required: ['did'], properties: { - types: { - type: 'array', - items: { - type: 'string', - }, - description: - 'The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned.', - }, - createdBy: { + did: { type: 'string', format: 'did', }, - sortDirection: { - type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - description: - 'Sort direction for the events. Defaults to descending order of created at timestamp.', - }, - createdAfter: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created after a given timestamp', - }, - createdBefore: { - type: 'string', - format: 'datetime', - description: 'Retrieve events created before a given timestamp', - }, - subject: { - type: 'string', - format: 'uri', - }, - includeAllUserRecords: { - type: 'boolean', - default: false, - description: - 'If true, events on all record types (posts, lists, profile etc.) owned by the did are returned', - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - hasComment: { - type: 'boolean', - description: 'If true, only events with comments are returned', - }, - comment: { - type: 'string', - description: - 'If specified, only events with comments containing the keyword are returned', - }, - addedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were added are returned', - }, - removedLabels: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these labels were removed are returned', - }, - addedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were added are returned', - }, - removedTags: { - type: 'array', - items: { - type: 'string', - }, - description: - 'If specified, only events where all of these tags were removed are returned', - }, - reportTypes: { + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#accountView', + }, + }, + }, + }, + }, + ComAtprotoAdminGetAccountInfos: { + lexicon: 1, + id: 'com.atproto.admin.getAccountInfos', + defs: { + main: { + type: 'query', + description: 'Get details about some accounts.', + parameters: { + type: 'params', + required: ['dids'], + properties: { + dids: { type: 'array', items: { type: 'string', + format: 'did', }, }, - cursor: { - type: 'string', - }, }, }, output: { encoding: 'application/json', schema: { type: 'object', - required: ['events'], + required: ['infos'], properties: { - cursor: { - type: 'string', - }, - events: { + infos: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#modEventView', + ref: 'lex:com.atproto.admin.defs#accountView', }, }, }, @@ -1596,101 +273,26 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminQueryModerationStatuses: { + ComAtprotoAdminGetInviteCodes: { lexicon: 1, - id: 'com.atproto.admin.queryModerationStatuses', + id: 'com.atproto.admin.getInviteCodes', defs: { main: { type: 'query', - description: 'View moderation statuses of subjects (record or repo).', + description: 'Get an admin view of invite codes.', parameters: { type: 'params', properties: { - subject: { - type: 'string', - format: 'uri', - }, - comment: { - type: 'string', - description: 'Search subjects by keyword from comments', - }, - reportedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported after a given timestamp', - }, - reportedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reported before a given timestamp', - }, - reviewedAfter: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed after a given timestamp', - }, - reviewedBefore: { - type: 'string', - format: 'datetime', - description: 'Search subjects reviewed before a given timestamp', - }, - includeMuted: { - type: 'boolean', - description: - "By default, we don't include muted subjects in the results. Set this to true to include them.", - }, - reviewState: { - type: 'string', - description: 'Specify when fetching subjects in a certain state', - }, - ignoreSubjects: { - type: 'array', - items: { - type: 'string', - format: 'uri', - }, - }, - lastReviewedBy: { - type: 'string', - format: 'did', - description: - 'Get all subject statuses that were reviewed by a specific moderator', - }, - sortField: { - type: 'string', - default: 'lastReportedAt', - enum: ['lastReviewedAt', 'lastReportedAt'], - }, - sortDirection: { + sort: { type: 'string', - default: 'desc', - enum: ['asc', 'desc'], - }, - takendown: { - type: 'boolean', - description: 'Get subjects that were taken down', - }, - appealed: { - type: 'boolean', - description: 'Get subjects in unresolved appealed status', + knownValues: ['recent', 'usage'], + default: 'recent', }, limit: { type: 'integer', minimum: 1, - maximum: 100, - default: 50, - }, - tags: { - type: 'array', - items: { - type: 'string', - }, - }, - excludeTags: { - type: 'array', - items: { - type: 'string', - }, + maximum: 500, + default: 100, }, cursor: { type: 'string', @@ -1701,16 +303,16 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['subjectStatuses'], + required: ['codes'], properties: { cursor: { type: 'string', }, - subjectStatuses: { + codes: { type: 'array', items: { type: 'ref', - ref: 'lex:com.atproto.admin.defs#subjectStatusView', + ref: 'lex:com.atproto.server.defs#inviteCode', }, }, }, @@ -1719,31 +321,28 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminSearchRepos: { + ComAtprotoAdminGetSubjectStatus: { lexicon: 1, - id: 'com.atproto.admin.searchRepos', + id: 'com.atproto.admin.getSubjectStatus', defs: { main: { type: 'query', - description: 'Find repositories based on a search term.', + description: + 'Get the service-specific admin status of a subject (account, record, or blob).', parameters: { type: 'params', properties: { - term: { + did: { type: 'string', - description: "DEPRECATED: use 'q' instead", + format: 'did', }, - q: { + uri: { type: 'string', + format: 'at-uri', }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { + blob: { type: 'string', + format: 'cid', }, }, }, @@ -1751,17 +350,19 @@ export const schemaDict = { encoding: 'application/json', schema: { type: 'object', - required: ['repos'], + required: ['subject'], properties: { - cursor: { - type: 'string', + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + 'lex:com.atproto.admin.defs#repoBlobRef', + ], }, - repos: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#repoView', - }, + takedown: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#statusAttr', }, }, }, @@ -1900,58 +501,6 @@ export const schemaDict = { }, }, }, - ComAtprotoAdminUpdateCommunicationTemplate: { - lexicon: 1, - id: 'com.atproto.admin.updateCommunicationTemplate', - defs: { - main: { - type: 'procedure', - description: - 'Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.', - input: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['id'], - properties: { - id: { - type: 'string', - description: 'ID of the template to be updated.', - }, - name: { - type: 'string', - description: 'Name of the template.', - }, - contentMarkdown: { - type: 'string', - description: - 'Content of the template, markdown supported, can contain variable placeholders.', - }, - subject: { - type: 'string', - description: 'Subject of the message, used in emails.', - }, - updatedBy: { - type: 'string', - format: 'did', - description: 'DID of the user who is updating the template.', - }, - disabled: { - type: 'boolean', - }, - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'ref', - ref: 'lex:com.atproto.admin.defs#communicationTemplateView', - }, - }, - }, - }, - }, ComAtprotoAdminUpdateSubjectStatus: { lexicon: 1, id: 'com.atproto.admin.updateSubjectStatus', @@ -9189,38 +7738,21 @@ export const schemaDict = { export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) export const ids = { - ComAtprotoAdminCreateCommunicationTemplate: - 'com.atproto.admin.createCommunicationTemplate', ComAtprotoAdminDefs: 'com.atproto.admin.defs', ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount', - ComAtprotoAdminDeleteCommunicationTemplate: - 'com.atproto.admin.deleteCommunicationTemplate', ComAtprotoAdminDisableAccountInvites: 'com.atproto.admin.disableAccountInvites', ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes', - ComAtprotoAdminEmitModerationEvent: 'com.atproto.admin.emitModerationEvent', ComAtprotoAdminEnableAccountInvites: 'com.atproto.admin.enableAccountInvites', ComAtprotoAdminGetAccountInfo: 'com.atproto.admin.getAccountInfo', ComAtprotoAdminGetAccountInfos: 'com.atproto.admin.getAccountInfos', ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes', - ComAtprotoAdminGetModerationEvent: 'com.atproto.admin.getModerationEvent', - ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord', - ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo', ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus', - ComAtprotoAdminListCommunicationTemplates: - 'com.atproto.admin.listCommunicationTemplates', - ComAtprotoAdminQueryModerationEvents: - 'com.atproto.admin.queryModerationEvents', - ComAtprotoAdminQueryModerationStatuses: - 'com.atproto.admin.queryModerationStatuses', - ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail', ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', ComAtprotoAdminUpdateAccountPassword: 'com.atproto.admin.updateAccountPassword', - ComAtprotoAdminUpdateCommunicationTemplate: - 'com.atproto.admin.updateCommunicationTemplate', ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus', ComAtprotoIdentityGetRecommendedDidCredentials: 'com.atproto.identity.getRecommendedDidCredentials', diff --git a/packages/pds/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts b/packages/pds/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts deleted file mode 100644 index b910b7987b4..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +++ /dev/null @@ -1,54 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** Name of the template. */ - name: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown: string - /** Subject of the message, used in emails. */ - subject: string - /** DID of the user who is creating the template. */ - createdBy?: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/defs.ts b/packages/pds/src/lexicon/types/com/atproto/admin/defs.ts index a860e6bcfa0..558b483a3b5 100644 --- a/packages/pds/src/lexicon/types/com/atproto/admin/defs.ts +++ b/packages/pds/src/lexicon/types/com/atproto/admin/defs.ts @@ -5,10 +5,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon' import { lexicons } from '../../../../lexicons' import { isObj, hasProp } from '../../../../util' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' -import * as ComAtprotoModerationDefs from '../moderation/defs' import * as ComAtprotoServerDefs from '../server/defs' -import * as ComAtprotoLabelDefs from '../label/defs' export interface StatusAttr { applied: boolean @@ -28,232 +25,6 @@ export function validateStatusAttr(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#statusAttr', v) } -export interface ModEventView { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids: string[] - createdBy: string - createdAt: string - creatorHandle?: string - subjectHandle?: string - [k: string]: unknown -} - -export function isModEventView(v: unknown): v is ModEventView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventView' - ) -} - -export function validateModEventView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventView', v) -} - -export interface ModEventViewDetail { - id: number - event: - | ModEventTakedown - | ModEventReverseTakedown - | ModEventComment - | ModEventReport - | ModEventLabel - | ModEventAcknowledge - | ModEventEscalate - | ModEventMute - | ModEventEmail - | ModEventResolveAppeal - | { $type: string; [k: string]: unknown } - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectBlobs: BlobView[] - createdBy: string - createdAt: string - [k: string]: unknown -} - -export function isModEventViewDetail(v: unknown): v is ModEventViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventViewDetail' - ) -} - -export function validateModEventViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventViewDetail', v) -} - -export interface ReportView { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subjectRepoHandle?: string - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - reportedBy: string - createdAt: string - resolvedByActionIds: number[] - [k: string]: unknown -} - -export function isReportView(v: unknown): v is ReportView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportView' - ) -} - -export function validateReportView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportView', v) -} - -export interface SubjectStatusView { - id: number - subject: - | RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - subjectRepoHandle?: string - /** Timestamp referencing when the last update was made to the moderation status of the subject */ - updatedAt: string - /** Timestamp referencing the first moderation status impacting event was emitted on the subject */ - createdAt: string - reviewState: SubjectReviewState - /** Sticky comment on the subject. */ - comment?: string - muteUntil?: string - lastReviewedBy?: string - lastReviewedAt?: string - lastReportedAt?: string - /** Timestamp referencing when the author of the subject appealed a moderation action */ - lastAppealedAt?: string - takendown?: boolean - /** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */ - appealed?: boolean - suspendUntil?: string - tags?: string[] - [k: string]: unknown -} - -export function isSubjectStatusView(v: unknown): v is SubjectStatusView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#subjectStatusView' - ) -} - -export function validateSubjectStatusView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#subjectStatusView', v) -} - -export interface ReportViewDetail { - id: number - reasonType: ComAtprotoModerationDefs.ReasonType - comment?: string - subject: - | RepoView - | RepoViewNotFound - | RecordView - | RecordViewNotFound - | { $type: string; [k: string]: unknown } - subjectStatus?: SubjectStatusView - reportedBy: string - createdAt: string - resolvedByActions: ModEventView[] - [k: string]: unknown -} - -export function isReportViewDetail(v: unknown): v is ReportViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#reportViewDetail' - ) -} - -export function validateReportViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v) -} - -export interface RepoView { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: Moderation - invitedBy?: ComAtprotoServerDefs.InviteCode - invitesDisabled?: boolean - inviteNote?: string - [k: string]: unknown -} - -export function isRepoView(v: unknown): v is RepoView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoView' - ) -} - -export function validateRepoView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoView', v) -} - -export interface RepoViewDetail { - did: string - handle: string - email?: string - relatedRecords: {}[] - indexedAt: string - moderation: ModerationDetail - labels?: ComAtprotoLabelDefs.Label[] - invitedBy?: ComAtprotoServerDefs.InviteCode - invites?: ComAtprotoServerDefs.InviteCode[] - invitesDisabled?: boolean - inviteNote?: string - emailConfirmedAt?: string - [k: string]: unknown -} - -export function isRepoViewDetail(v: unknown): v is RepoViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoViewDetail' - ) -} - -export function validateRepoViewDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) -} - export interface AccountView { did: string handle: string @@ -280,23 +51,6 @@ export function validateAccountView(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#accountView', 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 @@ -332,454 +86,3 @@ export function isRepoBlobRef(v: unknown): v is RepoBlobRef { export function validateRepoBlobRef(v: unknown): ValidationResult { return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) } - -export interface RecordView { - uri: string - cid: string - value: {} - blobCids: string[] - indexedAt: string - moderation: Moderation - repo: RepoView - [k: string]: unknown -} - -export function isRecordView(v: unknown): v is RecordView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordView' - ) -} - -export function validateRecordView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#recordView', v) -} - -export interface RecordViewDetail { - uri: string - cid: string - value: {} - blobs: BlobView[] - labels?: ComAtprotoLabelDefs.Label[] - indexedAt: string - moderation: ModerationDetail - repo: RepoView - [k: string]: unknown -} - -export function isRecordViewDetail(v: unknown): v is RecordViewDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#recordViewDetail' - ) -} - -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 { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModeration(v: unknown): v is Moderation { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderation' - ) -} - -export function validateModeration(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderation', v) -} - -export interface ModerationDetail { - subjectStatus?: SubjectStatusView - [k: string]: unknown -} - -export function isModerationDetail(v: unknown): v is ModerationDetail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#moderationDetail' - ) -} - -export function validateModerationDetail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#moderationDetail', v) -} - -export interface BlobView { - cid: string - mimeType: string - size: number - createdAt: string - details?: - | ImageDetails - | VideoDetails - | { $type: string; [k: string]: unknown } - moderation?: Moderation - [k: string]: unknown -} - -export function isBlobView(v: unknown): v is BlobView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#blobView' - ) -} - -export function validateBlobView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#blobView', v) -} - -export interface ImageDetails { - width: number - height: number - [k: string]: unknown -} - -export function isImageDetails(v: unknown): v is ImageDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#imageDetails' - ) -} - -export function validateImageDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#imageDetails', v) -} - -export interface VideoDetails { - width: number - height: number - length: number - [k: string]: unknown -} - -export function isVideoDetails(v: unknown): v is VideoDetails { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#videoDetails' - ) -} - -export function validateVideoDetails(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#videoDetails', v) -} - -export type SubjectReviewState = - | 'lex:com.atproto.admin.defs#reviewOpen' - | 'lex:com.atproto.admin.defs#reviewEscalated' - | 'lex:com.atproto.admin.defs#reviewClosed' - | 'lex:com.atproto.admin.defs#reviewNone' - | (string & {}) - -/** Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator */ -export const REVIEWOPEN = 'com.atproto.admin.defs#reviewOpen' -/** Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator */ -export const REVIEWESCALATED = 'com.atproto.admin.defs#reviewEscalated' -/** Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator */ -export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed' -/** Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it */ -export const REVIEWNONE = 'com.atproto.admin.defs#reviewNone' - -/** Take down a subject permanently or temporarily */ -export interface ModEventTakedown { - comment?: string - /** Indicates how long the takedown should be in effect before automatically expiring. */ - durationInHours?: number - [k: string]: unknown -} - -export function isModEventTakedown(v: unknown): v is ModEventTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTakedown' - ) -} - -export function validateModEventTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTakedown', v) -} - -/** Revert take down action on a subject */ -export interface ModEventReverseTakedown { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventReverseTakedown( - v: unknown, -): v is ModEventReverseTakedown { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReverseTakedown' - ) -} - -export function validateModEventReverseTakedown(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v) -} - -/** Resolve appeal on a subject */ -export interface ModEventResolveAppeal { - /** Describe resolution. */ - comment?: string - [k: string]: unknown -} - -export function isModEventResolveAppeal( - v: unknown, -): v is ModEventResolveAppeal { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventResolveAppeal' - ) -} - -export function validateModEventResolveAppeal(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v) -} - -/** Add a comment to a subject */ -export interface ModEventComment { - comment: string - /** Make the comment persistent on the subject */ - sticky?: boolean - [k: string]: unknown -} - -export function isModEventComment(v: unknown): v is ModEventComment { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventComment' - ) -} - -export function validateModEventComment(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventComment', v) -} - -/** Report a subject */ -export interface ModEventReport { - comment?: string - reportType: ComAtprotoModerationDefs.ReasonType - [k: string]: unknown -} - -export function isModEventReport(v: unknown): v is ModEventReport { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventReport' - ) -} - -export function validateModEventReport(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventReport', v) -} - -/** Apply/Negate labels on a subject */ -export interface ModEventLabel { - comment?: string - createLabelVals: string[] - negateLabelVals: string[] - [k: string]: unknown -} - -export function isModEventLabel(v: unknown): v is ModEventLabel { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventLabel' - ) -} - -export function validateModEventLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventLabel', v) -} - -export interface ModEventAcknowledge { - comment?: string - [k: string]: unknown -} - -export function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventAcknowledge' - ) -} - -export function validateModEventAcknowledge(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventAcknowledge', v) -} - -export interface ModEventEscalate { - comment?: string - [k: string]: unknown -} - -export function isModEventEscalate(v: unknown): v is ModEventEscalate { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEscalate' - ) -} - -export function validateModEventEscalate(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEscalate', v) -} - -/** Mute incoming reports on a subject */ -export interface ModEventMute { - comment?: string - /** Indicates how long the subject should remain muted. */ - durationInHours: number - [k: string]: unknown -} - -export function isModEventMute(v: unknown): v is ModEventMute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventMute' - ) -} - -export function validateModEventMute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventMute', v) -} - -/** Unmute action on a subject */ -export interface ModEventUnmute { - /** Describe reasoning behind the reversal. */ - comment?: string - [k: string]: unknown -} - -export function isModEventUnmute(v: unknown): v is ModEventUnmute { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventUnmute' - ) -} - -export function validateModEventUnmute(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventUnmute', v) -} - -/** Keep a log of outgoing email to a user */ -export interface ModEventEmail { - /** The subject line of the email sent to the user. */ - subjectLine: string - /** The content of the email sent to the user. */ - content?: string - /** Additional comment about the outgoing comm. */ - comment?: string - [k: string]: unknown -} - -export function isModEventEmail(v: unknown): v is ModEventEmail { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventEmail' - ) -} - -export function validateModEventEmail(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventEmail', v) -} - -/** Add/Remove a tag on a subject */ -export interface ModEventTag { - /** Tags to be added to the subject. If already exists, won't be duplicated. */ - add: string[] - /** Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. */ - remove: string[] - /** Additional comment about added/removed tags. */ - comment?: string - [k: string]: unknown -} - -export function isModEventTag(v: unknown): v is ModEventTag { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#modEventTag' - ) -} - -export function validateModEventTag(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#modEventTag', v) -} - -export interface CommunicationTemplateView { - id: string - /** Name of the template. */ - name: string - /** Content of the template, can contain markdown and variable placeholders. */ - subject?: string - /** Subject of the message, used in emails. */ - contentMarkdown: string - disabled: boolean - /** DID of the user who last updated the template. */ - lastUpdatedBy: string - createdAt: string - updatedAt: string - [k: string]: unknown -} - -export function isCommunicationTemplateView( - v: unknown, -): v is CommunicationTemplateView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#communicationTemplateView' - ) -} - -export function validateCommunicationTemplateView( - v: unknown, -): ValidationResult { - return lexicons.validate( - 'com.atproto.admin.defs#communicationTemplateView', - v, - ) -} diff --git a/packages/pds/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts b/packages/pds/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts deleted file mode 100644 index c5ae5cd469f..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +++ /dev/null @@ -1,38 +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, HandlerPipeThrough } from '@atproto/xrpc-server' - -export interface QueryParams {} - -export interface InputSchema { - id: string - [k: string]: unknown -} - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | void -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/packages/pds/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts b/packages/pds/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts deleted file mode 100644 index 99d08c7f1b7..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +++ /dev/null @@ -1,67 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' - -export interface QueryParams {} - -export interface InputSchema { - event: - | ComAtprotoAdminDefs.ModEventTakedown - | ComAtprotoAdminDefs.ModEventAcknowledge - | ComAtprotoAdminDefs.ModEventEscalate - | ComAtprotoAdminDefs.ModEventComment - | ComAtprotoAdminDefs.ModEventLabel - | ComAtprotoAdminDefs.ModEventReport - | ComAtprotoAdminDefs.ModEventMute - | ComAtprotoAdminDefs.ModEventReverseTakedown - | ComAtprotoAdminDefs.ModEventUnmute - | ComAtprotoAdminDefs.ModEventEmail - | ComAtprotoAdminDefs.ModEventTag - | { $type: string; [k: string]: unknown } - subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | { $type: string; [k: string]: unknown } - subjectBlobCids?: string[] - createdBy: string - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.ModEventView - -export interface HandlerInput { - encoding: 'application/json' - body: InputSchema -} - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string - error?: 'SubjectHasAction' -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/getModerationEvent.ts b/packages/pds/src/lexicon/types/com/atproto/admin/getModerationEvent.ts deleted file mode 100644 index 99c8bbe20ef..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +++ /dev/null @@ -1,41 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - id: number -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail -export type HandlerInput = undefined - -export interface HandlerSuccess { - encoding: 'application/json' - body: OutputSchema - headers?: { [key: string]: string } -} - -export interface HandlerError { - status: number - message?: string -} - -export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput diff --git a/packages/pds/src/lexicon/types/com/atproto/admin/getRecord.ts b/packages/pds/src/lexicon/types/com/atproto/admin/getRecord.ts deleted file mode 100644 index 557945e2fbd..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/getRecord.ts +++ /dev/null @@ -1,43 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - uri: string - cid?: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail -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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/getRepo.ts b/packages/pds/src/lexicon/types/com/atproto/admin/getRepo.ts deleted file mode 100644 index ede9fcf3ce8..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/getRepo.ts +++ /dev/null @@ -1,42 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - did: string -} - -export type InputSchema = undefined -export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail -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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts b/packages/pds/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts deleted file mode 100644 index 843c228e6f9..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +++ /dev/null @@ -1,44 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export type InputSchema = undefined - -export interface OutputSchema { - communicationTemplates: ComAtprotoAdminDefs.CommunicationTemplateView[] - [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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts b/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts deleted file mode 100644 index 9f4738578aa..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +++ /dev/null @@ -1,73 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** The types of events (fully qualified string in the format of com.atproto.admin#modEvent) to filter by. If not specified, all events are returned. */ - types?: string[] - createdBy?: string - /** Sort direction for the events. Defaults to descending order of created at timestamp. */ - sortDirection: 'asc' | 'desc' - /** Retrieve events created after a given timestamp */ - createdAfter?: string - /** Retrieve events created before a given timestamp */ - createdBefore?: string - subject?: string - /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */ - includeAllUserRecords: boolean - limit: number - /** If true, only events with comments are returned */ - hasComment?: boolean - /** If specified, only events with comments containing the keyword are returned */ - comment?: string - /** If specified, only events where all of these labels were added are returned */ - addedLabels?: string[] - /** If specified, only events where all of these labels were removed are returned */ - removedLabels?: string[] - /** If specified, only events where all of these tags were added are returned */ - addedTags?: string[] - /** If specified, only events where all of these tags were removed are returned */ - removedTags?: string[] - reportTypes?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - events: ComAtprotoAdminDefs.ModEventView[] - [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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts b/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts deleted file mode 100644 index f5031d25117..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +++ /dev/null @@ -1,74 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - subject?: string - /** Search subjects by keyword from comments */ - comment?: string - /** Search subjects reported after a given timestamp */ - reportedAfter?: string - /** Search subjects reported before a given timestamp */ - reportedBefore?: string - /** Search subjects reviewed after a given timestamp */ - reviewedAfter?: string - /** Search subjects reviewed before a given timestamp */ - reviewedBefore?: string - /** By default, we don't include muted subjects in the results. Set this to true to include them. */ - includeMuted?: boolean - /** Specify when fetching subjects in a certain state */ - reviewState?: string - ignoreSubjects?: string[] - /** Get all subject statuses that were reviewed by a specific moderator */ - lastReviewedBy?: string - sortField: 'lastReviewedAt' | 'lastReportedAt' - sortDirection: 'asc' | 'desc' - /** Get subjects that were taken down */ - takendown?: boolean - /** Get subjects in unresolved appealed status */ - appealed?: boolean - limit: number - tags?: string[] - excludeTags?: string[] - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[] - [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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/searchRepos.ts b/packages/pds/src/lexicon/types/com/atproto/admin/searchRepos.ts deleted file mode 100644 index d1529956c17..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/searchRepos.ts +++ /dev/null @@ -1,51 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams { - /** DEPRECATED: use 'q' instead */ - term?: string - q?: string - limit: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - repos: ComAtprotoAdminDefs.RepoView[] - [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 | HandlerPipeThrough -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/packages/pds/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts b/packages/pds/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts deleted file mode 100644 index 73e079cfe58..00000000000 --- a/packages/pds/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +++ /dev/null @@ -1,57 +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, HandlerPipeThrough } from '@atproto/xrpc-server' -import * as ComAtprotoAdminDefs from './defs' - -export interface QueryParams {} - -export interface InputSchema { - /** ID of the template to be updated. */ - id: string - /** Name of the template. */ - name?: string - /** Content of the template, markdown supported, can contain variable placeholders. */ - contentMarkdown?: string - /** Subject of the message, used in emails. */ - subject?: string - /** DID of the user who is updating the template. */ - updatedBy?: string - disabled?: boolean - [k: string]: unknown -} - -export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView - -export interface HandlerInput { - encoding: 'application/json' - 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 | HandlerSuccess | HandlerPipeThrough -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput