diff --git a/.env b/.env new file mode 100644 index 0000000..f82c019 --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +JETSTREAM_URL="wss://jetstream2.us-east.bsky.network" +SPACEDUST_URL="wss://spacedust.microcosm.blue" +CONSTELLATION_URL="https://constellation.microcosm.blue" +SLINGSHOT_URL="https://slingshot.microcosm.blue" + +SERVICE_DID="did:web:local3768forumtest.whey.party" +SERVICE_ENDPOINT="https://local3768forumtest.whey.party" +SERVER_PORT="3768" \ No newline at end of file diff --git a/deno.json b/deno.json index 5d13b04..9e1cd94 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "tasks": { - "dev": "deno run --watch -A main.ts" + "dev": "deno run --watch -A --env-file main.ts" }, "imports": { "@std/assert": "jsr:@std/assert@1" diff --git a/deno.lock b/deno.lock index ee22df5..0de52c1 100644 --- a/deno.lock +++ b/deno.lock @@ -24,7 +24,9 @@ "npm:did-jwt@*": "8.0.17", "npm:did-resolver@*": "4.1.0", "npm:express@*": "5.1.0", + "npm:ky@*": "1.8.1", "npm:multiformats@*": "13.4.0", + "npm:quick-lru@*": "7.0.1", "npm:web-did-resolver@*": "2.0.30" }, "jsr": { @@ -733,6 +735,9 @@ "iso-datestring-validator@2.2.2": { "integrity": "sha512-yLEMkBbLZTlVQqOnQ4FiMujR6T4DEcCb1xizmvXS+OxuhwcbtynoosRzdMA69zZCShCNAbi+gJ71FxZBBXx1SA==" }, + "ky@1.8.1": { + "integrity": "sha512-7Bp3TpsE+L+TARSnnDpk3xg8Idi8RwSLdj6CMbNWoOARIrGrbuLGusV0dYwbZOm4bB3jHNxSw8Wk/ByDqJEnDw==" + }, "math-intrinsics@1.1.0": { "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" }, @@ -893,6 +898,9 @@ "quick-format-unescaped@4.0.4": { "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" }, + "quick-lru@7.0.1": { + "integrity": "sha512-kLjThirJMkWKutUKbZ8ViqFc09tDQhlbQo2MNuVeLWbRauqYP96Sm6nzlQ24F0HFjUNZ4i9+AgldJ9H6DZXi7g==" + }, "range-parser@1.2.1": { "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, diff --git a/indexclient/index.ts b/indexclient/index.ts new file mode 100644 index 0000000..a594071 --- /dev/null +++ b/indexclient/index.ts @@ -0,0 +1,579 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { + XrpcClient, + type FetchHandler, + type FetchHandlerOptions, +} from '@atproto/xrpc' +import { schemas } from './lexicons.js' +import { CID } from 'multiformats/cid' +import { type OmitKey, type Un$Typed } from './util.js' +import * as AppBskyActorDefs from './types/app/bsky/actor/defs.js' +import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile.js' +import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles.js' +import * as AppBskyEmbedDefs from './types/app/bsky/embed/defs.js' +import * as AppBskyEmbedExternal from './types/app/bsky/embed/external.js' +import * as AppBskyEmbedImages from './types/app/bsky/embed/images.js' +import * as AppBskyEmbedRecord from './types/app/bsky/embed/record.js' +import * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia.js' +import * as AppBskyEmbedVideo from './types/app/bsky/embed/video.js' +import * as AppBskyFeedDefs from './types/app/bsky/feed/defs.js' +import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.js' +import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator.js' +import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators.js' +import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js' +import * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate.js' +import * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate.js' +import * as AppBskyGraphDefs from './types/app/bsky/graph/defs.js' +import * as AppBskyNotificationDefs from './types/app/bsky/notification/defs.js' +import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js' +import * as ComAtprotoLabelDefs from './types/com/atproto/label/defs.js' +import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef.js' +import * as PartyWheyAppBskyActorDefs from './types/party/whey/app/bsky/actor/defs.js' +import * as PartyWheyAppBskyFeedDefs from './types/party/whey/app/bsky/feed/defs.js' +import * as PartyWheyAppBskyFeedGetActorLikesPartial from './types/party/whey/app/bsky/feed/getActorLikesPartial.js' +import * as PartyWheyAppBskyFeedGetAuthorFeedPartial from './types/party/whey/app/bsky/feed/getAuthorFeedPartial.js' +import * as PartyWheyAppBskyFeedGetLikesPartial from './types/party/whey/app/bsky/feed/getLikesPartial.js' +import * as PartyWheyAppBskyFeedGetListFeedPartial from './types/party/whey/app/bsky/feed/getListFeedPartial.js' +import * as PartyWheyAppBskyFeedGetPostThreadPartial from './types/party/whey/app/bsky/feed/getPostThreadPartial.js' +import * as PartyWheyAppBskyFeedGetQuotesPartial from './types/party/whey/app/bsky/feed/getQuotesPartial.js' +import * as PartyWheyAppBskyFeedGetRepostedByPartial from './types/party/whey/app/bsky/feed/getRepostedByPartial.js' + +export * as AppBskyActorDefs from './types/app/bsky/actor/defs.js' +export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile.js' +export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles.js' +export * as AppBskyEmbedDefs from './types/app/bsky/embed/defs.js' +export * as AppBskyEmbedExternal from './types/app/bsky/embed/external.js' +export * as AppBskyEmbedImages from './types/app/bsky/embed/images.js' +export * as AppBskyEmbedRecord from './types/app/bsky/embed/record.js' +export * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia.js' +export * as AppBskyEmbedVideo from './types/app/bsky/embed/video.js' +export * as AppBskyFeedDefs from './types/app/bsky/feed/defs.js' +export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.js' +export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator.js' +export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators.js' +export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js' +export * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate.js' +export * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate.js' +export * as AppBskyGraphDefs from './types/app/bsky/graph/defs.js' +export * as AppBskyNotificationDefs from './types/app/bsky/notification/defs.js' +export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js' +export * as ComAtprotoLabelDefs from './types/com/atproto/label/defs.js' +export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef.js' +export * as PartyWheyAppBskyActorDefs from './types/party/whey/app/bsky/actor/defs.js' +export * as PartyWheyAppBskyFeedDefs from './types/party/whey/app/bsky/feed/defs.js' +export * as PartyWheyAppBskyFeedGetActorLikesPartial from './types/party/whey/app/bsky/feed/getActorLikesPartial.js' +export * as PartyWheyAppBskyFeedGetAuthorFeedPartial from './types/party/whey/app/bsky/feed/getAuthorFeedPartial.js' +export * as PartyWheyAppBskyFeedGetLikesPartial from './types/party/whey/app/bsky/feed/getLikesPartial.js' +export * as PartyWheyAppBskyFeedGetListFeedPartial from './types/party/whey/app/bsky/feed/getListFeedPartial.js' +export * as PartyWheyAppBskyFeedGetPostThreadPartial from './types/party/whey/app/bsky/feed/getPostThreadPartial.js' +export * as PartyWheyAppBskyFeedGetQuotesPartial from './types/party/whey/app/bsky/feed/getQuotesPartial.js' +export * as PartyWheyAppBskyFeedGetRepostedByPartial from './types/party/whey/app/bsky/feed/getRepostedByPartial.js' + +export const APP_BSKY_FEED = { + DefsRequestLess: 'app.bsky.feed.defs#requestLess', + DefsRequestMore: 'app.bsky.feed.defs#requestMore', + DefsClickthroughItem: 'app.bsky.feed.defs#clickthroughItem', + DefsClickthroughAuthor: 'app.bsky.feed.defs#clickthroughAuthor', + DefsClickthroughReposter: 'app.bsky.feed.defs#clickthroughReposter', + DefsClickthroughEmbed: 'app.bsky.feed.defs#clickthroughEmbed', + DefsContentModeUnspecified: 'app.bsky.feed.defs#contentModeUnspecified', + DefsContentModeVideo: 'app.bsky.feed.defs#contentModeVideo', + DefsInteractionSeen: 'app.bsky.feed.defs#interactionSeen', + DefsInteractionLike: 'app.bsky.feed.defs#interactionLike', + DefsInteractionRepost: 'app.bsky.feed.defs#interactionRepost', + DefsInteractionReply: 'app.bsky.feed.defs#interactionReply', + DefsInteractionQuote: 'app.bsky.feed.defs#interactionQuote', + DefsInteractionShare: 'app.bsky.feed.defs#interactionShare', +} +export const APP_BSKY_GRAPH = { + DefsModlist: 'app.bsky.graph.defs#modlist', + DefsCuratelist: 'app.bsky.graph.defs#curatelist', + DefsReferencelist: 'app.bsky.graph.defs#referencelist', +} + +export class AtpBaseClient extends XrpcClient { + app: AppNS + com: ComNS + party: PartyNS + + constructor(options: FetchHandler | FetchHandlerOptions) { + super(options, schemas) + this.app = new AppNS(this) + this.com = new ComNS(this) + this.party = new PartyNS(this) + } + + /** @deprecated use `this` instead */ + get xrpc(): XrpcClient { + return this + } +} + +export class AppNS { + _client: XrpcClient + bsky: AppBskyNS + + constructor(client: XrpcClient) { + this._client = client + this.bsky = new AppBskyNS(client) + } +} + +export class AppBskyNS { + _client: XrpcClient + actor: AppBskyActorNS + embed: AppBskyEmbedNS + feed: AppBskyFeedNS + richtext: AppBskyRichtextNS + + constructor(client: XrpcClient) { + this._client = client + this.actor = new AppBskyActorNS(client) + this.embed = new AppBskyEmbedNS(client) + this.feed = new AppBskyFeedNS(client) + this.richtext = new AppBskyRichtextNS(client) + } +} + +export class AppBskyActorNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } + + getProfile( + params?: AppBskyActorGetProfile.QueryParams, + opts?: AppBskyActorGetProfile.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.actor.getProfile', + params, + undefined, + opts, + ) + } + + getProfiles( + params?: AppBskyActorGetProfiles.QueryParams, + opts?: AppBskyActorGetProfiles.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.actor.getProfiles', + params, + undefined, + opts, + ) + } +} + +export class AppBskyEmbedNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } +} + +export class AppBskyFeedNS { + _client: XrpcClient + postgate: AppBskyFeedPostgateRecord + threadgate: AppBskyFeedThreadgateRecord + + constructor(client: XrpcClient) { + this._client = client + this.postgate = new AppBskyFeedPostgateRecord(client) + this.threadgate = new AppBskyFeedThreadgateRecord(client) + } + + getActorFeeds( + params?: AppBskyFeedGetActorFeeds.QueryParams, + opts?: AppBskyFeedGetActorFeeds.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.feed.getActorFeeds', + params, + undefined, + opts, + ) + } + + getFeedGenerator( + params?: AppBskyFeedGetFeedGenerator.QueryParams, + opts?: AppBskyFeedGetFeedGenerator.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.feed.getFeedGenerator', + params, + undefined, + opts, + ) + } + + getFeedGenerators( + params?: AppBskyFeedGetFeedGenerators.QueryParams, + opts?: AppBskyFeedGetFeedGenerators.CallOptions, + ): Promise { + return this._client.call( + 'app.bsky.feed.getFeedGenerators', + params, + undefined, + opts, + ) + } + + getPosts( + params?: AppBskyFeedGetPosts.QueryParams, + opts?: AppBskyFeedGetPosts.CallOptions, + ): Promise { + return this._client.call('app.bsky.feed.getPosts', params, undefined, opts) + } +} + +export class AppBskyFeedPostgateRecord { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } + + async list( + params: OmitKey, + ): Promise<{ + cursor?: string + records: { uri: string; value: AppBskyFeedPostgate.Record }[] + }> { + const res = await this._client.call('com.atproto.repo.listRecords', { + collection: 'app.bsky.feed.postgate', + ...params, + }) + return res.data + } + + async get( + params: OmitKey, + ): Promise<{ uri: string; cid: string; value: AppBskyFeedPostgate.Record }> { + const res = await this._client.call('com.atproto.repo.getRecord', { + collection: 'app.bsky.feed.postgate', + ...params, + }) + return res.data + } + + async create( + params: OmitKey< + ComAtprotoRepoCreateRecord.InputSchema, + 'collection' | 'record' + >, + record: Un$Typed, + headers?: Record, + ): Promise<{ uri: string; cid: string }> { + const collection = 'app.bsky.feed.postgate' + const res = await this._client.call( + 'com.atproto.repo.createRecord', + undefined, + { collection, ...params, record: { ...record, $type: collection } }, + { encoding: 'application/json', headers }, + ) + return res.data + } + + async put( + params: OmitKey< + ComAtprotoRepoPutRecord.InputSchema, + 'collection' | 'record' + >, + record: Un$Typed, + headers?: Record, + ): Promise<{ uri: string; cid: string }> { + const collection = 'app.bsky.feed.postgate' + const res = await this._client.call( + 'com.atproto.repo.putRecord', + undefined, + { collection, ...params, record: { ...record, $type: collection } }, + { encoding: 'application/json', headers }, + ) + return res.data + } + + async delete( + params: OmitKey, + headers?: Record, + ): Promise { + await this._client.call( + 'com.atproto.repo.deleteRecord', + undefined, + { collection: 'app.bsky.feed.postgate', ...params }, + { headers }, + ) + } +} + +export class AppBskyFeedThreadgateRecord { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } + + async list( + params: OmitKey, + ): Promise<{ + cursor?: string + records: { uri: string; value: AppBskyFeedThreadgate.Record }[] + }> { + const res = await this._client.call('com.atproto.repo.listRecords', { + collection: 'app.bsky.feed.threadgate', + ...params, + }) + return res.data + } + + async get( + params: OmitKey, + ): Promise<{ + uri: string + cid: string + value: AppBskyFeedThreadgate.Record + }> { + const res = await this._client.call('com.atproto.repo.getRecord', { + collection: 'app.bsky.feed.threadgate', + ...params, + }) + return res.data + } + + async create( + params: OmitKey< + ComAtprotoRepoCreateRecord.InputSchema, + 'collection' | 'record' + >, + record: Un$Typed, + headers?: Record, + ): Promise<{ uri: string; cid: string }> { + const collection = 'app.bsky.feed.threadgate' + const res = await this._client.call( + 'com.atproto.repo.createRecord', + undefined, + { collection, ...params, record: { ...record, $type: collection } }, + { encoding: 'application/json', headers }, + ) + return res.data + } + + async put( + params: OmitKey< + ComAtprotoRepoPutRecord.InputSchema, + 'collection' | 'record' + >, + record: Un$Typed, + headers?: Record, + ): Promise<{ uri: string; cid: string }> { + const collection = 'app.bsky.feed.threadgate' + const res = await this._client.call( + 'com.atproto.repo.putRecord', + undefined, + { collection, ...params, record: { ...record, $type: collection } }, + { encoding: 'application/json', headers }, + ) + return res.data + } + + async delete( + params: OmitKey, + headers?: Record, + ): Promise { + await this._client.call( + 'com.atproto.repo.deleteRecord', + undefined, + { collection: 'app.bsky.feed.threadgate', ...params }, + { headers }, + ) + } +} + +export class AppBskyRichtextNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } +} + +export class ComNS { + _client: XrpcClient + atproto: ComAtprotoNS + + constructor(client: XrpcClient) { + this._client = client + this.atproto = new ComAtprotoNS(client) + } +} + +export class ComAtprotoNS { + _client: XrpcClient + repo: ComAtprotoRepoNS + + constructor(client: XrpcClient) { + this._client = client + this.repo = new ComAtprotoRepoNS(client) + } +} + +export class ComAtprotoRepoNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } +} + +export class PartyNS { + _client: XrpcClient + whey: PartyWheyNS + + constructor(client: XrpcClient) { + this._client = client + this.whey = new PartyWheyNS(client) + } +} + +export class PartyWheyNS { + _client: XrpcClient + app: PartyWheyAppNS + + constructor(client: XrpcClient) { + this._client = client + this.app = new PartyWheyAppNS(client) + } +} + +export class PartyWheyAppNS { + _client: XrpcClient + bsky: PartyWheyAppBskyNS + + constructor(client: XrpcClient) { + this._client = client + this.bsky = new PartyWheyAppBskyNS(client) + } +} + +export class PartyWheyAppBskyNS { + _client: XrpcClient + feed: PartyWheyAppBskyFeedNS + + constructor(client: XrpcClient) { + this._client = client + this.feed = new PartyWheyAppBskyFeedNS(client) + } +} + +export class PartyWheyAppBskyFeedNS { + _client: XrpcClient + + constructor(client: XrpcClient) { + this._client = client + } + + getActorLikesPartial( + params?: PartyWheyAppBskyFeedGetActorLikesPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetActorLikesPartial.CallOptions, + ): Promise { + return this._client + .call( + 'party.whey.app.bsky.feed.getActorLikesPartial', + params, + undefined, + opts, + ) + .catch((e) => { + throw PartyWheyAppBskyFeedGetActorLikesPartial.toKnownErr(e) + }) + } + + getAuthorFeedPartial( + params?: PartyWheyAppBskyFeedGetAuthorFeedPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetAuthorFeedPartial.CallOptions, + ): Promise { + return this._client + .call( + 'party.whey.app.bsky.feed.getAuthorFeedPartial', + params, + undefined, + opts, + ) + .catch((e) => { + throw PartyWheyAppBskyFeedGetAuthorFeedPartial.toKnownErr(e) + }) + } + + getLikesPartial( + params?: PartyWheyAppBskyFeedGetLikesPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetLikesPartial.CallOptions, + ): Promise { + return this._client.call( + 'party.whey.app.bsky.feed.getLikesPartial', + params, + undefined, + opts, + ) + } + + getListFeedPartial( + params?: PartyWheyAppBskyFeedGetListFeedPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetListFeedPartial.CallOptions, + ): Promise { + return this._client + .call( + 'party.whey.app.bsky.feed.getListFeedPartial', + params, + undefined, + opts, + ) + .catch((e) => { + throw PartyWheyAppBskyFeedGetListFeedPartial.toKnownErr(e) + }) + } + + getPostThreadPartial( + params?: PartyWheyAppBskyFeedGetPostThreadPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetPostThreadPartial.CallOptions, + ): Promise { + return this._client + .call( + 'party.whey.app.bsky.feed.getPostThreadPartial', + params, + undefined, + opts, + ) + .catch((e) => { + throw PartyWheyAppBskyFeedGetPostThreadPartial.toKnownErr(e) + }) + } + + getQuotesPartial( + params?: PartyWheyAppBskyFeedGetQuotesPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetQuotesPartial.CallOptions, + ): Promise { + return this._client.call( + 'party.whey.app.bsky.feed.getQuotesPartial', + params, + undefined, + opts, + ) + } + + getRepostedByPartial( + params?: PartyWheyAppBskyFeedGetRepostedByPartial.QueryParams, + opts?: PartyWheyAppBskyFeedGetRepostedByPartial.CallOptions, + ): Promise { + return this._client.call( + 'party.whey.app.bsky.feed.getRepostedByPartial', + params, + undefined, + opts, + ) + } +} diff --git a/indexclient/lexicons.ts b/indexclient/lexicons.ts new file mode 100644 index 0000000..5134969 --- /dev/null +++ b/indexclient/lexicons.ts @@ -0,0 +1,3566 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { + type LexiconDoc, + Lexicons, + ValidationError, + type ValidationResult, +} from '@atproto/lexicon' +import { type $Typed, is$typed, maybe$typed } from './util.js' + +export const schemaDict = { + AppBskyActorDefs: { + lexicon: 1, + id: 'app.bsky.actor.defs', + defs: { + profileViewBasic: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + avatar: { + type: 'string', + format: 'uri', + }, + associated: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileAssociated', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + verification: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#verificationState', + }, + status: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#statusView', + }, + }, + }, + profileView: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + maxGraphemes: 256, + maxLength: 2560, + }, + avatar: { + type: 'string', + format: 'uri', + }, + associated: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileAssociated', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + verification: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#verificationState', + }, + status: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#statusView', + }, + }, + }, + profileViewDetailed: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + maxGraphemes: 256, + maxLength: 2560, + }, + avatar: { + type: 'string', + format: 'uri', + }, + banner: { + type: 'string', + format: 'uri', + }, + followersCount: { + type: 'integer', + }, + followsCount: { + type: 'integer', + }, + postsCount: { + type: 'integer', + }, + associated: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileAssociated', + }, + joinedViaStarterPack: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#starterPackViewBasic', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + pinnedPost: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + verification: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#verificationState', + }, + status: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#statusView', + }, + }, + }, + profileAssociated: { + type: 'object', + properties: { + lists: { + type: 'integer', + }, + feedgens: { + type: 'integer', + }, + starterPacks: { + type: 'integer', + }, + labeler: { + type: 'boolean', + }, + chat: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileAssociatedChat', + }, + activitySubscription: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileAssociatedActivitySubscription', + }, + }, + }, + profileAssociatedChat: { + type: 'object', + required: ['allowIncoming'], + properties: { + allowIncoming: { + type: 'string', + knownValues: ['all', 'none', 'following'], + }, + }, + }, + profileAssociatedActivitySubscription: { + type: 'object', + required: ['allowSubscriptions'], + properties: { + allowSubscriptions: { + type: 'string', + knownValues: ['followers', 'mutuals', 'none'], + }, + }, + }, + viewerState: { + type: 'object', + description: + "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", + properties: { + muted: { + type: 'boolean', + }, + mutedByList: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewBasic', + }, + blockedBy: { + type: 'boolean', + }, + blocking: { + type: 'string', + format: 'at-uri', + }, + blockingByList: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewBasic', + }, + following: { + type: 'string', + format: 'at-uri', + }, + followedBy: { + type: 'string', + format: 'at-uri', + }, + knownFollowers: { + description: + 'This property is present only in selected cases, as an optimization.', + type: 'ref', + ref: 'lex:app.bsky.actor.defs#knownFollowers', + }, + activitySubscription: { + description: + 'This property is present only in selected cases, as an optimization.', + type: 'ref', + ref: 'lex:app.bsky.notification.defs#activitySubscription', + }, + }, + }, + knownFollowers: { + type: 'object', + description: "The subject's followers whom you also follow", + required: ['count', 'followers'], + properties: { + count: { + type: 'integer', + }, + followers: { + type: 'array', + minLength: 0, + maxLength: 5, + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + }, + }, + }, + verificationState: { + type: 'object', + description: + 'Represents the verification information about the user this object is attached to.', + required: ['verifications', 'verifiedStatus', 'trustedVerifierStatus'], + properties: { + verifications: { + type: 'array', + description: + 'All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#verificationView', + }, + }, + verifiedStatus: { + type: 'string', + description: "The user's status as a verified account.", + knownValues: ['valid', 'invalid', 'none'], + }, + trustedVerifierStatus: { + type: 'string', + description: "The user's status as a trusted verifier.", + knownValues: ['valid', 'invalid', 'none'], + }, + }, + }, + verificationView: { + type: 'object', + description: 'An individual verification for an associated subject.', + required: ['issuer', 'uri', 'isValid', 'createdAt'], + properties: { + issuer: { + type: 'string', + description: 'The user who issued this verification.', + format: 'did', + }, + uri: { + type: 'string', + description: 'The AT-URI of the verification record.', + format: 'at-uri', + }, + isValid: { + type: 'boolean', + description: + 'True if the verification passes validation, otherwise false.', + }, + createdAt: { + type: 'string', + description: 'Timestamp when the verification was created.', + format: 'datetime', + }, + }, + }, + preferences: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.actor.defs#adultContentPref', + 'lex:app.bsky.actor.defs#contentLabelPref', + 'lex:app.bsky.actor.defs#savedFeedsPref', + 'lex:app.bsky.actor.defs#savedFeedsPrefV2', + 'lex:app.bsky.actor.defs#personalDetailsPref', + 'lex:app.bsky.actor.defs#feedViewPref', + 'lex:app.bsky.actor.defs#threadViewPref', + 'lex:app.bsky.actor.defs#interestsPref', + 'lex:app.bsky.actor.defs#mutedWordsPref', + 'lex:app.bsky.actor.defs#hiddenPostsPref', + 'lex:app.bsky.actor.defs#bskyAppStatePref', + 'lex:app.bsky.actor.defs#labelersPref', + 'lex:app.bsky.actor.defs#postInteractionSettingsPref', + 'lex:app.bsky.actor.defs#verificationPrefs', + ], + }, + }, + adultContentPref: { + type: 'object', + required: ['enabled'], + properties: { + enabled: { + type: 'boolean', + default: false, + }, + }, + }, + contentLabelPref: { + type: 'object', + required: ['label', 'visibility'], + properties: { + labelerDid: { + type: 'string', + description: + 'Which labeler does this preference apply to? If undefined, applies globally.', + format: 'did', + }, + label: { + type: 'string', + }, + visibility: { + type: 'string', + knownValues: ['ignore', 'show', 'warn', 'hide'], + }, + }, + }, + savedFeed: { + type: 'object', + required: ['id', 'type', 'value', 'pinned'], + properties: { + id: { + type: 'string', + }, + type: { + type: 'string', + knownValues: ['feed', 'list', 'timeline'], + }, + value: { + type: 'string', + }, + pinned: { + type: 'boolean', + }, + }, + }, + savedFeedsPrefV2: { + type: 'object', + required: ['items'], + properties: { + items: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#savedFeed', + }, + }, + }, + }, + savedFeedsPref: { + type: 'object', + required: ['pinned', 'saved'], + properties: { + pinned: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + saved: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + timelineIndex: { + type: 'integer', + }, + }, + }, + personalDetailsPref: { + type: 'object', + properties: { + birthDate: { + type: 'string', + format: 'datetime', + description: 'The birth date of account owner.', + }, + }, + }, + feedViewPref: { + type: 'object', + required: ['feed'], + properties: { + feed: { + type: 'string', + description: + 'The URI of the feed, or an identifier which describes the feed.', + }, + hideReplies: { + type: 'boolean', + description: 'Hide replies in the feed.', + }, + hideRepliesByUnfollowed: { + type: 'boolean', + description: + 'Hide replies in the feed if they are not by followed users.', + default: true, + }, + hideRepliesByLikeCount: { + type: 'integer', + description: + 'Hide replies in the feed if they do not have this number of likes.', + }, + hideReposts: { + type: 'boolean', + description: 'Hide reposts in the feed.', + }, + hideQuotePosts: { + type: 'boolean', + description: 'Hide quote posts in the feed.', + }, + }, + }, + threadViewPref: { + type: 'object', + properties: { + sort: { + type: 'string', + description: 'Sorting mode for threads.', + knownValues: [ + 'oldest', + 'newest', + 'most-likes', + 'random', + 'hotness', + ], + }, + prioritizeFollowedUsers: { + type: 'boolean', + description: 'Show followed users at the top of all replies.', + }, + }, + }, + interestsPref: { + type: 'object', + required: ['tags'], + properties: { + tags: { + type: 'array', + maxLength: 100, + items: { + type: 'string', + maxLength: 640, + maxGraphemes: 64, + }, + description: + "A list of tags which describe the account owner's interests gathered during onboarding.", + }, + }, + }, + mutedWordTarget: { + type: 'string', + knownValues: ['content', 'tag'], + maxLength: 640, + maxGraphemes: 64, + }, + mutedWord: { + type: 'object', + description: 'A word that the account owner has muted.', + required: ['value', 'targets'], + properties: { + id: { + type: 'string', + }, + value: { + type: 'string', + description: 'The muted word itself.', + maxLength: 10000, + maxGraphemes: 1000, + }, + targets: { + type: 'array', + description: 'The intended targets of the muted word.', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#mutedWordTarget', + }, + }, + actorTarget: { + type: 'string', + description: + 'Groups of users to apply the muted word to. If undefined, applies to all users.', + knownValues: ['all', 'exclude-following'], + default: 'all', + }, + expiresAt: { + type: 'string', + format: 'datetime', + description: + 'The date and time at which the muted word will expire and no longer be applied.', + }, + }, + }, + mutedWordsPref: { + type: 'object', + required: ['items'], + properties: { + items: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#mutedWord', + }, + description: 'A list of words the account owner has muted.', + }, + }, + }, + hiddenPostsPref: { + type: 'object', + required: ['items'], + properties: { + items: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + description: + 'A list of URIs of posts the account owner has hidden.', + }, + }, + }, + labelersPref: { + type: 'object', + required: ['labelers'], + properties: { + labelers: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#labelerPrefItem', + }, + }, + }, + }, + labelerPrefItem: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + bskyAppStatePref: { + description: + "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.", + type: 'object', + properties: { + activeProgressGuide: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#bskyAppProgressGuide', + }, + queuedNudges: { + description: + 'An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.', + type: 'array', + maxLength: 1000, + items: { + type: 'string', + maxLength: 100, + }, + }, + nuxs: { + description: 'Storage for NUXs the user has encountered.', + type: 'array', + maxLength: 100, + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#nux', + }, + }, + }, + }, + bskyAppProgressGuide: { + description: + 'If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.', + type: 'object', + required: ['guide'], + properties: { + guide: { + type: 'string', + maxLength: 100, + }, + }, + }, + nux: { + type: 'object', + description: 'A new user experiences (NUX) storage object', + required: ['id', 'completed'], + properties: { + id: { + type: 'string', + maxLength: 100, + }, + completed: { + type: 'boolean', + default: false, + }, + data: { + description: + 'Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.', + type: 'string', + maxLength: 3000, + maxGraphemes: 300, + }, + expiresAt: { + type: 'string', + format: 'datetime', + description: + 'The date and time at which the NUX will expire and should be considered completed.', + }, + }, + }, + verificationPrefs: { + type: 'object', + description: 'Preferences for how verified accounts appear in the app.', + required: [], + properties: { + hideBadges: { + description: + 'Hide the blue check badges for verified accounts and trusted verifiers.', + type: 'boolean', + default: false, + }, + }, + }, + postInteractionSettingsPref: { + type: 'object', + description: + 'Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.', + required: [], + properties: { + threadgateAllowRules: { + description: + 'Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.', + type: 'array', + maxLength: 5, + items: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.threadgate#mentionRule', + 'lex:app.bsky.feed.threadgate#followerRule', + 'lex:app.bsky.feed.threadgate#followingRule', + 'lex:app.bsky.feed.threadgate#listRule', + ], + }, + }, + postgateEmbeddingRules: { + description: + 'Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.', + type: 'array', + maxLength: 5, + items: { + type: 'union', + refs: ['lex:app.bsky.feed.postgate#disableRule'], + }, + }, + }, + }, + statusView: { + type: 'object', + required: ['status', 'record'], + properties: { + status: { + type: 'string', + description: 'The status for the account.', + knownValues: ['app.bsky.actor.status#live'], + }, + record: { + type: 'unknown', + }, + embed: { + type: 'union', + description: 'An optional embed associated with the status.', + refs: ['lex:app.bsky.embed.external#view'], + }, + expiresAt: { + type: 'string', + description: + 'The date when this status will expire. The application might choose to no longer return the status after expiration.', + format: 'datetime', + }, + isActive: { + type: 'boolean', + description: + 'True if the status is not expired, false if it is expired. Only present if expiration was set.', + }, + }, + }, + }, + }, + AppBskyActorGetProfile: { + lexicon: 1, + id: 'app.bsky.actor.getProfile', + defs: { + main: { + type: 'query', + description: + 'Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + description: 'Handle or DID of account to fetch profile of.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewDetailed', + }, + }, + }, + }, + }, + AppBskyActorGetProfiles: { + lexicon: 1, + id: 'app.bsky.actor.getProfiles', + defs: { + main: { + type: 'query', + description: 'Get detailed profile views of multiple actors.', + parameters: { + type: 'params', + required: ['actors'], + properties: { + actors: { + type: 'array', + items: { + type: 'string', + format: 'at-identifier', + }, + maxLength: 25, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['profiles'], + properties: { + profiles: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewDetailed', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyEmbedDefs: { + lexicon: 1, + id: 'app.bsky.embed.defs', + defs: { + aspectRatio: { + type: 'object', + description: + 'width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.', + required: ['width', 'height'], + properties: { + width: { + type: 'integer', + minimum: 1, + }, + height: { + type: 'integer', + minimum: 1, + }, + }, + }, + }, + }, + AppBskyEmbedExternal: { + lexicon: 1, + id: 'app.bsky.embed.external', + defs: { + main: { + type: 'object', + description: + "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).", + required: ['external'], + properties: { + external: { + type: 'ref', + ref: 'lex:app.bsky.embed.external#external', + }, + }, + }, + external: { + type: 'object', + required: ['uri', 'title', 'description'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + title: { + type: 'string', + }, + description: { + type: 'string', + }, + thumb: { + type: 'blob', + accept: ['image/*'], + maxSize: 1000000, + }, + }, + }, + view: { + type: 'object', + required: ['external'], + properties: { + external: { + type: 'ref', + ref: 'lex:app.bsky.embed.external#viewExternal', + }, + }, + }, + viewExternal: { + type: 'object', + required: ['uri', 'title', 'description'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + title: { + type: 'string', + }, + description: { + type: 'string', + }, + thumb: { + type: 'string', + format: 'uri', + }, + }, + }, + }, + }, + AppBskyEmbedImages: { + lexicon: 1, + id: 'app.bsky.embed.images', + description: 'A set of images embedded in a Bluesky record (eg, a post).', + defs: { + main: { + type: 'object', + required: ['images'], + properties: { + images: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#image', + }, + maxLength: 4, + }, + }, + }, + image: { + type: 'object', + required: ['image', 'alt'], + properties: { + image: { + type: 'blob', + accept: ['image/*'], + maxSize: 1000000, + }, + alt: { + type: 'string', + description: + 'Alt text description of the image, for accessibility.', + }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.defs#aspectRatio', + }, + }, + }, + view: { + type: 'object', + required: ['images'], + properties: { + images: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#viewImage', + }, + maxLength: 4, + }, + }, + }, + viewImage: { + type: 'object', + required: ['thumb', 'fullsize', 'alt'], + properties: { + thumb: { + type: 'string', + format: 'uri', + description: + 'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.', + }, + fullsize: { + type: 'string', + format: 'uri', + description: + 'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.', + }, + alt: { + type: 'string', + description: + 'Alt text description of the image, for accessibility.', + }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.defs#aspectRatio', + }, + }, + }, + }, + }, + AppBskyEmbedRecord: { + lexicon: 1, + id: 'app.bsky.embed.record', + description: + 'A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.', + defs: { + main: { + type: 'object', + required: ['record'], + properties: { + record: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + }, + }, + view: { + type: 'object', + required: ['record'], + properties: { + record: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.record#viewRecord', + 'lex:app.bsky.embed.record#viewNotFound', + 'lex:app.bsky.embed.record#viewBlocked', + 'lex:app.bsky.embed.record#viewDetached', + 'lex:app.bsky.feed.defs#generatorView', + 'lex:app.bsky.graph.defs#listView', + 'lex:app.bsky.labeler.defs#labelerView', + 'lex:app.bsky.graph.defs#starterPackViewBasic', + ], + }, + }, + }, + viewRecord: { + type: 'object', + required: ['uri', 'cid', 'author', 'value', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + value: { + type: 'unknown', + description: 'The record data itself.', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + replyCount: { + type: 'integer', + }, + repostCount: { + type: 'integer', + }, + likeCount: { + type: 'integer', + }, + quoteCount: { + type: 'integer', + }, + embeds: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.video#view', + 'lex:app.bsky.embed.external#view', + 'lex:app.bsky.embed.record#view', + 'lex:app.bsky.embed.recordWithMedia#view', + ], + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + viewNotFound: { + type: 'object', + required: ['uri', 'notFound'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + notFound: { + type: 'boolean', + const: true, + }, + }, + }, + viewBlocked: { + type: 'object', + required: ['uri', 'blocked', 'author'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + blocked: { + type: 'boolean', + const: true, + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#blockedAuthor', + }, + }, + }, + viewDetached: { + type: 'object', + required: ['uri', 'detached'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + detached: { + type: 'boolean', + const: true, + }, + }, + }, + }, + }, + AppBskyEmbedRecordWithMedia: { + lexicon: 1, + id: 'app.bsky.embed.recordWithMedia', + description: + 'A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.', + defs: { + main: { + type: 'object', + required: ['record', 'media'], + properties: { + record: { + type: 'ref', + ref: 'lex:app.bsky.embed.record', + }, + media: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images', + 'lex:app.bsky.embed.video', + 'lex:app.bsky.embed.external', + ], + }, + }, + }, + view: { + type: 'object', + required: ['record', 'media'], + properties: { + record: { + type: 'ref', + ref: 'lex:app.bsky.embed.record#view', + }, + media: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.video#view', + 'lex:app.bsky.embed.external#view', + ], + }, + }, + }, + }, + }, + AppBskyEmbedVideo: { + lexicon: 1, + id: 'app.bsky.embed.video', + description: 'A video embedded in a Bluesky record (eg, a post).', + defs: { + main: { + type: 'object', + required: ['video'], + properties: { + video: { + type: 'blob', + description: + 'The mp4 video file. May be up to 100mb, formerly limited to 50mb.', + accept: ['video/mp4'], + maxSize: 100000000, + }, + captions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.embed.video#caption', + }, + maxLength: 20, + }, + alt: { + type: 'string', + description: + 'Alt text description of the video, for accessibility.', + maxGraphemes: 1000, + maxLength: 10000, + }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.defs#aspectRatio', + }, + }, + }, + caption: { + type: 'object', + required: ['lang', 'file'], + properties: { + lang: { + type: 'string', + format: 'language', + }, + file: { + type: 'blob', + accept: ['text/vtt'], + maxSize: 20000, + }, + }, + }, + view: { + type: 'object', + required: ['cid', 'playlist'], + properties: { + cid: { + type: 'string', + format: 'cid', + }, + playlist: { + type: 'string', + format: 'uri', + }, + thumbnail: { + type: 'string', + format: 'uri', + }, + alt: { + type: 'string', + maxGraphemes: 1000, + maxLength: 10000, + }, + aspectRatio: { + type: 'ref', + ref: 'lex:app.bsky.embed.defs#aspectRatio', + }, + }, + }, + }, + }, + AppBskyFeedDefs: { + lexicon: 1, + id: 'app.bsky.feed.defs', + defs: { + postView: { + type: 'object', + required: ['uri', 'cid', 'author', 'record', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + record: { + type: 'unknown', + }, + embed: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.video#view', + 'lex:app.bsky.embed.external#view', + 'lex:app.bsky.embed.record#view', + 'lex:app.bsky.embed.recordWithMedia#view', + ], + }, + replyCount: { + type: 'integer', + }, + repostCount: { + type: 'integer', + }, + likeCount: { + type: 'integer', + }, + quoteCount: { + type: 'integer', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + threadgate: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#threadgateView', + }, + }, + }, + viewerState: { + type: 'object', + description: + "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", + properties: { + repost: { + type: 'string', + format: 'at-uri', + }, + like: { + type: 'string', + format: 'at-uri', + }, + threadMuted: { + type: 'boolean', + }, + replyDisabled: { + type: 'boolean', + }, + embeddingDisabled: { + type: 'boolean', + }, + pinned: { + type: 'boolean', + }, + }, + }, + threadContext: { + type: 'object', + description: + 'Metadata about this post within the context of the thread it is in.', + properties: { + rootAuthorLike: { + type: 'string', + format: 'at-uri', + }, + }, + }, + feedViewPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + reply: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#replyRef', + }, + reason: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#reasonRepost', + 'lex:app.bsky.feed.defs#reasonPin', + ], + }, + feedContext: { + type: 'string', + description: + 'Context provided by feed generator that may be passed back alongside interactions.', + maxLength: 2000, + }, + reqId: { + type: 'string', + description: + 'Unique identifier per request that may be passed back alongside interactions.', + maxLength: 100, + }, + }, + }, + replyRef: { + type: 'object', + required: ['root', 'parent'], + properties: { + root: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + parent: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + grandparentAuthor: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + description: + 'When parent is a reply to another post, this is the author of that post.', + }, + }, + }, + reasonRepost: { + type: 'object', + required: ['by', 'indexedAt'], + properties: { + by: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + reasonPin: { + type: 'object', + properties: {}, + }, + threadViewPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + parent: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + replies: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + }, + threadContext: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#threadContext', + }, + }, + }, + notFoundPost: { + type: 'object', + required: ['uri', 'notFound'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + notFound: { + type: 'boolean', + const: true, + }, + }, + }, + blockedPost: { + type: 'object', + required: ['uri', 'blocked', 'author'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + blocked: { + type: 'boolean', + const: true, + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#blockedAuthor', + }, + }, + }, + blockedAuthor: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + }, + }, + generatorView: { + type: 'object', + required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + did: { + type: 'string', + format: 'did', + }, + creator: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + displayName: { + type: 'string', + }, + description: { + type: 'string', + maxGraphemes: 300, + maxLength: 3000, + }, + descriptionFacets: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.richtext.facet', + }, + }, + avatar: { + type: 'string', + format: 'uri', + }, + likeCount: { + type: 'integer', + minimum: 0, + }, + acceptsInteractions: { + type: 'boolean', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorViewerState', + }, + contentMode: { + type: 'string', + knownValues: [ + 'app.bsky.feed.defs#contentModeUnspecified', + 'app.bsky.feed.defs#contentModeVideo', + ], + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + generatorViewerState: { + type: 'object', + properties: { + like: { + type: 'string', + format: 'at-uri', + }, + }, + }, + skeletonFeedPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'string', + format: 'at-uri', + }, + reason: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#skeletonReasonRepost', + 'lex:app.bsky.feed.defs#skeletonReasonPin', + ], + }, + feedContext: { + type: 'string', + description: + 'Context that will be passed through to client and may be passed to feed generator back alongside interactions.', + maxLength: 2000, + }, + }, + }, + skeletonReasonRepost: { + type: 'object', + required: ['repost'], + properties: { + repost: { + type: 'string', + format: 'at-uri', + }, + }, + }, + skeletonReasonPin: { + type: 'object', + properties: {}, + }, + threadgateView: { + type: 'object', + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + record: { + type: 'unknown', + }, + lists: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewBasic', + }, + }, + }, + }, + interaction: { + type: 'object', + properties: { + item: { + type: 'string', + format: 'at-uri', + }, + event: { + type: 'string', + knownValues: [ + 'app.bsky.feed.defs#requestLess', + 'app.bsky.feed.defs#requestMore', + 'app.bsky.feed.defs#clickthroughItem', + 'app.bsky.feed.defs#clickthroughAuthor', + 'app.bsky.feed.defs#clickthroughReposter', + 'app.bsky.feed.defs#clickthroughEmbed', + 'app.bsky.feed.defs#interactionSeen', + 'app.bsky.feed.defs#interactionLike', + 'app.bsky.feed.defs#interactionRepost', + 'app.bsky.feed.defs#interactionReply', + 'app.bsky.feed.defs#interactionQuote', + 'app.bsky.feed.defs#interactionShare', + ], + }, + feedContext: { + type: 'string', + description: + 'Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.', + maxLength: 2000, + }, + reqId: { + type: 'string', + description: + 'Unique identifier per request that may be passed back alongside interactions.', + maxLength: 100, + }, + }, + }, + requestLess: { + type: 'token', + description: + 'Request that less content like the given feed item be shown in the feed', + }, + requestMore: { + type: 'token', + description: + 'Request that more content like the given feed item be shown in the feed', + }, + clickthroughItem: { + type: 'token', + description: 'User clicked through to the feed item', + }, + clickthroughAuthor: { + type: 'token', + description: 'User clicked through to the author of the feed item', + }, + clickthroughReposter: { + type: 'token', + description: 'User clicked through to the reposter of the feed item', + }, + clickthroughEmbed: { + type: 'token', + description: + 'User clicked through to the embedded content of the feed item', + }, + contentModeUnspecified: { + type: 'token', + description: 'Declares the feed generator returns any types of posts.', + }, + contentModeVideo: { + type: 'token', + description: + 'Declares the feed generator returns posts containing app.bsky.embed.video embeds.', + }, + interactionSeen: { + type: 'token', + description: 'Feed item was seen by user', + }, + interactionLike: { + type: 'token', + description: 'User liked the feed item', + }, + interactionRepost: { + type: 'token', + description: 'User reposted the feed item', + }, + interactionReply: { + type: 'token', + description: 'User replied to the feed item', + }, + interactionQuote: { + type: 'token', + description: 'User quoted the feed item', + }, + interactionShare: { + type: 'token', + description: 'User shared the feed item', + }, + }, + }, + AppBskyFeedGetActorFeeds: { + lexicon: 1, + id: 'app.bsky.feed.getActorFeeds', + defs: { + main: { + type: 'query', + description: + "Get a list of feeds (feed generator records) created by the actor (in the actor's repo).", + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feeds'], + properties: { + cursor: { + type: 'string', + }, + feeds: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetFeedGenerator: { + lexicon: 1, + id: 'app.bsky.feed.getFeedGenerator', + defs: { + main: { + type: 'query', + description: + 'Get information about a feed generator. Implemented by AppView.', + parameters: { + type: 'params', + required: ['feed'], + properties: { + feed: { + type: 'string', + format: 'at-uri', + description: 'AT-URI of the feed generator record.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['view', 'isOnline', 'isValid'], + properties: { + view: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + isOnline: { + type: 'boolean', + description: + 'Indicates whether the feed generator service has been online recently, or else seems to be inactive.', + }, + isValid: { + type: 'boolean', + description: + 'Indicates whether the feed generator service is compatible with the record declaration.', + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetFeedGenerators: { + lexicon: 1, + id: 'app.bsky.feed.getFeedGenerators', + defs: { + main: { + type: 'query', + description: 'Get information about a list of feed generators.', + parameters: { + type: 'params', + required: ['feeds'], + properties: { + feeds: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feeds'], + properties: { + feeds: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetPosts: { + lexicon: 1, + id: 'app.bsky.feed.getPosts', + defs: { + main: { + type: 'query', + description: + "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.", + parameters: { + type: 'params', + required: ['uris'], + properties: { + uris: { + type: 'array', + description: 'List of post AT-URIs to return hydrated views for.', + items: { + type: 'string', + format: 'at-uri', + }, + maxLength: 25, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['posts'], + properties: { + posts: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedPostgate: { + lexicon: 1, + id: 'app.bsky.feed.postgate', + defs: { + main: { + type: 'record', + key: 'tid', + description: + 'Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.', + record: { + type: 'object', + required: ['post', 'createdAt'], + properties: { + createdAt: { + type: 'string', + format: 'datetime', + }, + post: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) to the post record.', + }, + detachedEmbeddingUris: { + type: 'array', + maxLength: 50, + items: { + type: 'string', + format: 'at-uri', + }, + description: + 'List of AT-URIs embedding this post that the author has detached from.', + }, + embeddingRules: { + description: + 'List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.', + type: 'array', + maxLength: 5, + items: { + type: 'union', + refs: ['lex:app.bsky.feed.postgate#disableRule'], + }, + }, + }, + }, + }, + disableRule: { + type: 'object', + description: 'Disables embedding of this post.', + properties: {}, + }, + }, + }, + AppBskyFeedThreadgate: { + lexicon: 1, + id: 'app.bsky.feed.threadgate', + defs: { + main: { + type: 'record', + key: 'tid', + description: + "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.", + record: { + type: 'object', + required: ['post', 'createdAt'], + properties: { + post: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) to the post record.', + }, + allow: { + description: + 'List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.', + type: 'array', + maxLength: 5, + items: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.threadgate#mentionRule', + 'lex:app.bsky.feed.threadgate#followerRule', + 'lex:app.bsky.feed.threadgate#followingRule', + 'lex:app.bsky.feed.threadgate#listRule', + ], + }, + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + hiddenReplies: { + type: 'array', + maxLength: 50, + items: { + type: 'string', + format: 'at-uri', + }, + description: 'List of hidden reply URIs.', + }, + }, + }, + }, + mentionRule: { + type: 'object', + description: 'Allow replies from actors mentioned in your post.', + properties: {}, + }, + followerRule: { + type: 'object', + description: 'Allow replies from actors who follow you.', + properties: {}, + }, + followingRule: { + type: 'object', + description: 'Allow replies from actors you follow.', + properties: {}, + }, + listRule: { + type: 'object', + description: 'Allow replies from actors on a list.', + required: ['list'], + properties: { + list: { + type: 'string', + format: 'at-uri', + }, + }, + }, + }, + }, + AppBskyGraphDefs: { + lexicon: 1, + id: 'app.bsky.graph.defs', + defs: { + listViewBasic: { + type: 'object', + required: ['uri', 'cid', 'name', 'purpose'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + name: { + type: 'string', + maxLength: 64, + minLength: 1, + }, + purpose: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listPurpose', + }, + avatar: { + type: 'string', + format: 'uri', + }, + listItemCount: { + type: 'integer', + minimum: 0, + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewerState', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + listView: { + type: 'object', + required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + creator: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + name: { + type: 'string', + maxLength: 64, + minLength: 1, + }, + purpose: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listPurpose', + }, + description: { + type: 'string', + maxGraphemes: 300, + maxLength: 3000, + }, + descriptionFacets: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.richtext.facet', + }, + }, + avatar: { + type: 'string', + format: 'uri', + }, + listItemCount: { + type: 'integer', + minimum: 0, + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewerState', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + listItemView: { + type: 'object', + required: ['uri', 'subject'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + subject: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + starterPackView: { + type: 'object', + required: ['uri', 'cid', 'record', 'creator', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + record: { + type: 'unknown', + }, + creator: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + list: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listViewBasic', + }, + listItemsSample: { + type: 'array', + maxLength: 12, + items: { + type: 'ref', + ref: 'lex:app.bsky.graph.defs#listItemView', + }, + }, + feeds: { + type: 'array', + maxLength: 3, + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#generatorView', + }, + }, + joinedWeekCount: { + type: 'integer', + minimum: 0, + }, + joinedAllTimeCount: { + type: 'integer', + minimum: 0, + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + starterPackViewBasic: { + type: 'object', + required: ['uri', 'cid', 'record', 'creator', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + record: { + type: 'unknown', + }, + creator: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + listItemCount: { + type: 'integer', + minimum: 0, + }, + joinedWeekCount: { + type: 'integer', + minimum: 0, + }, + joinedAllTimeCount: { + type: 'integer', + minimum: 0, + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + listPurpose: { + type: 'string', + knownValues: [ + 'app.bsky.graph.defs#modlist', + 'app.bsky.graph.defs#curatelist', + 'app.bsky.graph.defs#referencelist', + ], + }, + modlist: { + type: 'token', + description: + 'A list of actors to apply an aggregate moderation action (mute/block) on.', + }, + curatelist: { + type: 'token', + description: + 'A list of actors used for curation purposes such as list feeds or interaction gating.', + }, + referencelist: { + type: 'token', + description: + 'A list of actors used for only for reference purposes such as within a starter pack.', + }, + listViewerState: { + type: 'object', + properties: { + muted: { + type: 'boolean', + }, + blocked: { + type: 'string', + format: 'at-uri', + }, + }, + }, + notFoundActor: { + type: 'object', + description: 'indicates that a handle or DID could not be resolved', + required: ['actor', 'notFound'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + notFound: { + type: 'boolean', + const: true, + }, + }, + }, + relationship: { + type: 'object', + description: + 'lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + following: { + type: 'string', + format: 'at-uri', + description: + 'if the actor follows this DID, this is the AT-URI of the follow record', + }, + followedBy: { + type: 'string', + format: 'at-uri', + description: + 'if the actor is followed by this DID, contains the AT-URI of the follow record', + }, + }, + }, + }, + }, + AppBskyNotificationDefs: { + lexicon: 1, + id: 'app.bsky.notification.defs', + defs: { + recordDeleted: { + type: 'object', + properties: {}, + }, + chatPreference: { + type: 'object', + required: ['include', 'push'], + properties: { + include: { + type: 'string', + knownValues: ['all', 'accepted'], + }, + push: { + type: 'boolean', + }, + }, + }, + filterablePreference: { + type: 'object', + required: ['include', 'list', 'push'], + properties: { + include: { + type: 'string', + knownValues: ['all', 'follows'], + }, + list: { + type: 'boolean', + }, + push: { + type: 'boolean', + }, + }, + }, + preference: { + type: 'object', + required: ['list', 'push'], + properties: { + list: { + type: 'boolean', + }, + push: { + type: 'boolean', + }, + }, + }, + preferences: { + type: 'object', + required: [ + 'chat', + 'follow', + 'like', + 'likeViaRepost', + 'mention', + 'quote', + 'reply', + 'repost', + 'repostViaRepost', + 'starterpackJoined', + 'subscribedPost', + 'unverified', + 'verified', + ], + properties: { + chat: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#chatPreference', + }, + follow: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + like: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + likeViaRepost: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + mention: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + quote: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + reply: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + repost: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + repostViaRepost: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#filterablePreference', + }, + starterpackJoined: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#preference', + }, + subscribedPost: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#preference', + }, + unverified: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#preference', + }, + verified: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#preference', + }, + }, + }, + activitySubscription: { + type: 'object', + required: ['post', 'reply'], + properties: { + post: { + type: 'boolean', + }, + reply: { + type: 'boolean', + }, + }, + }, + subjectActivitySubscription: { + description: + 'Object used to store activity subscription data in stash.', + type: 'object', + required: ['subject', 'activitySubscription'], + properties: { + subject: { + type: 'string', + format: 'did', + }, + activitySubscription: { + type: 'ref', + ref: 'lex:app.bsky.notification.defs#activitySubscription', + }, + }, + }, + }, + }, + AppBskyRichtextFacet: { + lexicon: 1, + id: 'app.bsky.richtext.facet', + defs: { + main: { + type: 'object', + description: 'Annotation of a sub-string within rich text.', + required: ['index', 'features'], + properties: { + index: { + type: 'ref', + ref: 'lex:app.bsky.richtext.facet#byteSlice', + }, + features: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.richtext.facet#mention', + 'lex:app.bsky.richtext.facet#link', + 'lex:app.bsky.richtext.facet#tag', + ], + }, + }, + }, + }, + mention: { + type: 'object', + description: + "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.", + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + link: { + type: 'object', + description: + 'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + }, + }, + tag: { + type: 'object', + description: + "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').", + required: ['tag'], + properties: { + tag: { + type: 'string', + maxLength: 640, + maxGraphemes: 64, + }, + }, + }, + byteSlice: { + type: 'object', + description: + 'Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.', + required: ['byteStart', 'byteEnd'], + properties: { + byteStart: { + type: 'integer', + minimum: 0, + }, + byteEnd: { + type: 'integer', + minimum: 0, + }, + }, + }, + }, + }, + ComAtprotoLabelDefs: { + lexicon: 1, + id: 'com.atproto.label.defs', + defs: { + label: { + type: 'object', + description: + 'Metadata tag on an atproto resource (eg, repo or record).', + required: ['src', 'uri', 'val', 'cts'], + properties: { + ver: { + type: 'integer', + description: 'The AT Protocol version of the label object.', + }, + src: { + type: 'string', + format: 'did', + description: 'DID of the actor who created this label.', + }, + uri: { + type: 'string', + format: 'uri', + description: + 'AT URI of the record, repository (account), or other resource that this label applies to.', + }, + cid: { + type: 'string', + format: 'cid', + description: + "Optionally, CID specifying the specific version of 'uri' resource this label applies to.", + }, + val: { + type: 'string', + maxLength: 128, + description: + 'The short string name of the value or type of this label.', + }, + neg: { + type: 'boolean', + description: + 'If true, this is a negation label, overwriting a previous label.', + }, + cts: { + type: 'string', + format: 'datetime', + description: 'Timestamp when this label was created.', + }, + exp: { + type: 'string', + format: 'datetime', + description: + 'Timestamp at which this label expires (no longer applies).', + }, + sig: { + type: 'bytes', + description: 'Signature of dag-cbor encoded label.', + }, + }, + }, + selfLabels: { + type: 'object', + description: + 'Metadata tags on an atproto record, published by the author within the record.', + required: ['values'], + properties: { + values: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#selfLabel', + }, + maxLength: 10, + }, + }, + }, + selfLabel: { + type: 'object', + description: + 'Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.', + required: ['val'], + properties: { + val: { + type: 'string', + maxLength: 128, + description: + 'The short string name of the value or type of this label.', + }, + }, + }, + labelValueDefinition: { + type: 'object', + description: + 'Declares a label value and its expected interpretations and behaviors.', + required: ['identifier', 'severity', 'blurs', 'locales'], + properties: { + identifier: { + type: 'string', + description: + "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", + maxLength: 100, + maxGraphemes: 100, + }, + severity: { + type: 'string', + description: + "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", + knownValues: ['inform', 'alert', 'none'], + }, + blurs: { + type: 'string', + description: + "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.", + knownValues: ['content', 'media', 'none'], + }, + defaultSetting: { + type: 'string', + description: 'The default setting for this label.', + knownValues: ['ignore', 'warn', 'hide'], + default: 'warn', + }, + adultOnly: { + type: 'boolean', + description: + 'Does the user need to have adult content enabled in order to configure this label?', + }, + locales: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings', + }, + }, + }, + }, + labelValueDefinitionStrings: { + type: 'object', + description: + 'Strings which describe the label in the UI, localized into a specific language.', + required: ['lang', 'name', 'description'], + properties: { + lang: { + type: 'string', + description: + 'The code of the language these strings are written in.', + format: 'language', + }, + name: { + type: 'string', + description: 'A short human-readable name for the label.', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + description: + 'A longer description of what the label means and why it might be applied.', + maxGraphemes: 10000, + maxLength: 100000, + }, + }, + }, + labelValue: { + type: 'string', + knownValues: [ + '!hide', + '!no-promote', + '!warn', + '!no-unauthenticated', + 'dmca-violation', + 'doxxing', + 'porn', + 'sexual', + 'nudity', + 'nsfl', + 'gore', + ], + }, + }, + }, + ComAtprotoRepoStrongRef: { + lexicon: 1, + id: 'com.atproto.repo.strongRef', + description: 'A URI with a content-hash fingerprint.', + defs: { + main: { + type: 'object', + required: ['uri', 'cid'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + PartyWheyAppBskyActorDefs: { + lexicon: 1, + id: 'party.whey.app.bsky.actor.defs', + defs: { + profileViewBasicRef: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + profileViewRef: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + profileViewDetailedRef: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + }, + PartyWheyAppBskyFeedDefs: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.defs', + defs: { + postViewRef: { + type: 'object', + description: 'A pointer to a app.bsky.feed.defs#postView', + required: ['uri', 'cid'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + feedViewPostRef: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#postView', + 'lex:party.whey.app.bsky.feed.defs#postViewRef', + ], + }, + reply: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#replyRef', + 'lex:party.whey.app.bsky.feed.defs#replyRef', + ], + }, + reason: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#reasonRepost', + 'lex:app.bsky.feed.defs#reasonPin', + ], + }, + feedContext: { + type: 'string', + description: + 'Context provided by feed generator that may be passed back alongside interactions.', + maxLength: 2000, + }, + reqId: { + type: 'string', + description: + 'Unique identifier per request that may be passed back alongside interactions.', + maxLength: 100, + }, + }, + }, + replyRef: { + type: 'object', + required: ['root', 'parent'], + properties: { + root: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#postViewRef', + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + parent: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#postViewRef', + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + grandparentAuthor: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.actor.defs#profileViewBasicRef', + 'lex:app.bsky.actor.defs#profileViewBasic', + ], + description: + 'When parent is a reply to another post, this is the author of that post.', + }, + }, + }, + threadViewPostRef: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#postViewRef', + 'lex:app.bsky.feed.defs#postView', + ], + }, + parent: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#threadViewPostRef', + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + replies: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#threadViewPostRef', + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + }, + threadContext: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#threadContext', + }, + }, + }, + }, + }, + PartyWheyAppBskyFeedGetActorLikesPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getActorLikesPartial', + defs: { + main: { + type: 'query', + description: + 'Get a list of posts liked by an actor. May require auth, (if so, actor must be the requesting account).', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#feedViewPostRef', + 'lex:app.bsky.feed.defs#feedViewPost', + ], + }, + }, + }, + }, + }, + errors: [ + { + name: 'BlockedActor', + }, + { + name: 'BlockedByActor', + }, + ], + }, + }, + }, + PartyWheyAppBskyFeedGetAuthorFeedPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getAuthorFeedPartial', + defs: { + main: { + type: 'query', + description: + "Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.", + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + filter: { + type: 'string', + description: + 'Combinations of post/repost types to include in response.', + knownValues: [ + 'posts_with_replies', + 'posts_no_replies', + 'posts_with_media', + 'posts_and_author_threads', + 'posts_with_video', + ], + default: 'posts_with_replies', + }, + includePins: { + type: 'boolean', + default: false, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#feedViewPostRef', + 'lex:app.bsky.feed.defs#feedViewPost', + ], + }, + }, + }, + }, + }, + errors: [ + { + name: 'BlockedActor', + }, + { + name: 'BlockedByActor', + }, + ], + }, + }, + }, + PartyWheyAppBskyFeedGetLikesPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getLikesPartial', + defs: { + main: { + type: 'query', + description: + 'Get like records which reference a subject (by AT-URI and CID).', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + description: 'AT-URI of the subject (eg, a post record).', + }, + cid: { + type: 'string', + format: 'cid', + description: + 'CID of the subject record (aka, specific version of record), to filter likes.', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'likes'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + cursor: { + type: 'string', + }, + likes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:party.whey.app.bsky.feed.getLikesPartial#like', + }, + }, + }, + }, + }, + }, + like: { + type: 'object', + required: ['indexedAt', 'createdAt', 'actor'], + properties: { + indexedAt: { + type: 'string', + format: 'datetime', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + actor: { + type: 'ref', + ref: 'lex:party.whey.app.bsky.actor.defs#profileViewRef', + }, + }, + }, + }, + }, + PartyWheyAppBskyFeedGetListFeedPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getListFeedPartial', + defs: { + main: { + type: 'query', + description: + 'Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.', + parameters: { + type: 'params', + required: ['list'], + properties: { + list: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) to the list record.', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:party.whey.app.bsky.feed.defs#feedViewPostRef', + }, + }, + }, + }, + }, + errors: [ + { + name: 'UnknownList', + }, + ], + }, + }, + }, + PartyWheyAppBskyFeedGetPostThreadPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getPostThreadPartial', + defs: { + main: { + type: 'query', + description: + 'Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) to post record.', + }, + depth: { + type: 'integer', + description: + 'How many levels of reply depth should be included in response.', + default: 6, + minimum: 0, + maximum: 1000, + }, + parentHeight: { + type: 'integer', + description: + 'How many levels of parent (and grandparent, etc) post to include.', + default: 80, + minimum: 0, + maximum: 1000, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['thread'], + properties: { + thread: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#threadViewPostRef', + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + threadgate: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#threadgateView', + }, + }, + }, + }, + errors: [ + { + name: 'NotFound', + }, + ], + }, + }, + }, + PartyWheyAppBskyFeedGetQuotesPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getQuotesPartial', + defs: { + main: { + type: 'query', + description: 'Get a list of quotes for a given post.', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) of post record', + }, + cid: { + type: 'string', + format: 'cid', + description: + 'If supplied, filters to quotes of specific version (by CID) of the post record.', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'posts'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + cursor: { + type: 'string', + }, + posts: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.feed.defs#postViewRef', + 'lex:app.bsky.feed.defs#postView', + ], + }, + }, + }, + }, + }, + }, + }, + }, + PartyWheyAppBskyFeedGetRepostedByPartial: { + lexicon: 1, + id: 'party.whey.app.bsky.feed.getRepostedByPartial', + defs: { + main: { + type: 'query', + description: 'Get a list of reposts for a given post.', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + description: 'Reference (AT-URI) of post record', + }, + cid: { + type: 'string', + format: 'cid', + description: + 'If supplied, filters to reposts of specific version (by CID) of the post record.', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'repostedBy'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + cursor: { + type: 'string', + }, + repostedBy: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:party.whey.app.bsky.actor.defs#profileViewRef', + 'lex:app.bsky.actor.defs#profileView', + ], + }, + }, + }, + }, + }, + }, + }, + }, +} as const satisfies Record +export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] +export const lexicons: Lexicons = new Lexicons(schemas) + +export function validate( + v: unknown, + id: string, + hash: string, + requiredType: true, +): ValidationResult +export function validate( + v: unknown, + id: string, + hash: string, + requiredType?: false, +): ValidationResult +export function validate( + v: unknown, + id: string, + hash: string, + requiredType?: boolean, +): ValidationResult { + return (requiredType ? is$typed : maybe$typed)(v, id, hash) + ? lexicons.validate(`${id}#${hash}`, v) + : { + success: false, + error: new ValidationError( + `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, + ), + } +} + +export const ids = { + AppBskyActorDefs: 'app.bsky.actor.defs', + AppBskyActorGetProfile: 'app.bsky.actor.getProfile', + AppBskyActorGetProfiles: 'app.bsky.actor.getProfiles', + AppBskyEmbedDefs: 'app.bsky.embed.defs', + AppBskyEmbedExternal: 'app.bsky.embed.external', + AppBskyEmbedImages: 'app.bsky.embed.images', + AppBskyEmbedRecord: 'app.bsky.embed.record', + AppBskyEmbedRecordWithMedia: 'app.bsky.embed.recordWithMedia', + AppBskyEmbedVideo: 'app.bsky.embed.video', + AppBskyFeedDefs: 'app.bsky.feed.defs', + AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds', + AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator', + AppBskyFeedGetFeedGenerators: 'app.bsky.feed.getFeedGenerators', + AppBskyFeedGetPosts: 'app.bsky.feed.getPosts', + AppBskyFeedPostgate: 'app.bsky.feed.postgate', + AppBskyFeedThreadgate: 'app.bsky.feed.threadgate', + AppBskyGraphDefs: 'app.bsky.graph.defs', + AppBskyNotificationDefs: 'app.bsky.notification.defs', + AppBskyRichtextFacet: 'app.bsky.richtext.facet', + ComAtprotoLabelDefs: 'com.atproto.label.defs', + ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', + PartyWheyAppBskyActorDefs: 'party.whey.app.bsky.actor.defs', + PartyWheyAppBskyFeedDefs: 'party.whey.app.bsky.feed.defs', + PartyWheyAppBskyFeedGetActorLikesPartial: + 'party.whey.app.bsky.feed.getActorLikesPartial', + PartyWheyAppBskyFeedGetAuthorFeedPartial: + 'party.whey.app.bsky.feed.getAuthorFeedPartial', + PartyWheyAppBskyFeedGetLikesPartial: + 'party.whey.app.bsky.feed.getLikesPartial', + PartyWheyAppBskyFeedGetListFeedPartial: + 'party.whey.app.bsky.feed.getListFeedPartial', + PartyWheyAppBskyFeedGetPostThreadPartial: + 'party.whey.app.bsky.feed.getPostThreadPartial', + PartyWheyAppBskyFeedGetQuotesPartial: + 'party.whey.app.bsky.feed.getQuotesPartial', + PartyWheyAppBskyFeedGetRepostedByPartial: + 'party.whey.app.bsky.feed.getRepostedByPartial', +} as const diff --git a/indexclient/types/app/bsky/actor/defs.ts b/indexclient/types/app/bsky/actor/defs.ts new file mode 100644 index 0000000..3caf907 --- /dev/null +++ b/indexclient/types/app/bsky/actor/defs.ts @@ -0,0 +1,643 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' +import type * as AppBskyNotificationDefs from '../notification/defs.js' +import type * as AppBskyFeedThreadgate from '../feed/threadgate.js' +import type * as AppBskyFeedPostgate from '../feed/postgate.js' +import type * as AppBskyEmbedExternal from '../embed/external.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.defs' + +export interface ProfileViewBasic { + $type?: 'app.bsky.actor.defs#profileViewBasic' + did: string + handle: string + displayName?: string + avatar?: string + associated?: ProfileAssociated + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + createdAt?: string + verification?: VerificationState + status?: StatusView +} + +const hashProfileViewBasic = 'profileViewBasic' + +export function isProfileViewBasic(v: V) { + return is$typed(v, id, hashProfileViewBasic) +} + +export function validateProfileViewBasic(v: V) { + return validate(v, id, hashProfileViewBasic) +} + +export interface ProfileView { + $type?: 'app.bsky.actor.defs#profileView' + did: string + handle: string + displayName?: string + description?: string + avatar?: string + associated?: ProfileAssociated + indexedAt?: string + createdAt?: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + verification?: VerificationState + status?: StatusView +} + +const hashProfileView = 'profileView' + +export function isProfileView(v: V) { + return is$typed(v, id, hashProfileView) +} + +export function validateProfileView(v: V) { + return validate(v, id, hashProfileView) +} + +export interface ProfileViewDetailed { + $type?: 'app.bsky.actor.defs#profileViewDetailed' + did: string + handle: string + displayName?: string + description?: string + avatar?: string + banner?: string + followersCount?: number + followsCount?: number + postsCount?: number + associated?: ProfileAssociated + joinedViaStarterPack?: AppBskyGraphDefs.StarterPackViewBasic + indexedAt?: string + createdAt?: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + pinnedPost?: ComAtprotoRepoStrongRef.Main + verification?: VerificationState + status?: StatusView +} + +const hashProfileViewDetailed = 'profileViewDetailed' + +export function isProfileViewDetailed(v: V) { + return is$typed(v, id, hashProfileViewDetailed) +} + +export function validateProfileViewDetailed(v: V) { + return validate(v, id, hashProfileViewDetailed) +} + +export interface ProfileAssociated { + $type?: 'app.bsky.actor.defs#profileAssociated' + lists?: number + feedgens?: number + starterPacks?: number + labeler?: boolean + chat?: ProfileAssociatedChat + activitySubscription?: ProfileAssociatedActivitySubscription +} + +const hashProfileAssociated = 'profileAssociated' + +export function isProfileAssociated(v: V) { + return is$typed(v, id, hashProfileAssociated) +} + +export function validateProfileAssociated(v: V) { + return validate(v, id, hashProfileAssociated) +} + +export interface ProfileAssociatedChat { + $type?: 'app.bsky.actor.defs#profileAssociatedChat' + allowIncoming: 'all' | 'none' | 'following' | (string & {}) +} + +const hashProfileAssociatedChat = 'profileAssociatedChat' + +export function isProfileAssociatedChat(v: V) { + return is$typed(v, id, hashProfileAssociatedChat) +} + +export function validateProfileAssociatedChat(v: V) { + return validate(v, id, hashProfileAssociatedChat) +} + +export interface ProfileAssociatedActivitySubscription { + $type?: 'app.bsky.actor.defs#profileAssociatedActivitySubscription' + allowSubscriptions: 'followers' | 'mutuals' | 'none' | (string & {}) +} + +const hashProfileAssociatedActivitySubscription = + 'profileAssociatedActivitySubscription' + +export function isProfileAssociatedActivitySubscription(v: V) { + return is$typed(v, id, hashProfileAssociatedActivitySubscription) +} + +export function validateProfileAssociatedActivitySubscription(v: V) { + return validate( + v, + id, + hashProfileAssociatedActivitySubscription, + ) +} + +/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */ +export interface ViewerState { + $type?: 'app.bsky.actor.defs#viewerState' + muted?: boolean + mutedByList?: AppBskyGraphDefs.ListViewBasic + blockedBy?: boolean + blocking?: string + blockingByList?: AppBskyGraphDefs.ListViewBasic + following?: string + followedBy?: string + knownFollowers?: KnownFollowers + activitySubscription?: AppBskyNotificationDefs.ActivitySubscription +} + +const hashViewerState = 'viewerState' + +export function isViewerState(v: V) { + return is$typed(v, id, hashViewerState) +} + +export function validateViewerState(v: V) { + return validate(v, id, hashViewerState) +} + +/** The subject's followers whom you also follow */ +export interface KnownFollowers { + $type?: 'app.bsky.actor.defs#knownFollowers' + count: number + followers: ProfileViewBasic[] +} + +const hashKnownFollowers = 'knownFollowers' + +export function isKnownFollowers(v: V) { + return is$typed(v, id, hashKnownFollowers) +} + +export function validateKnownFollowers(v: V) { + return validate(v, id, hashKnownFollowers) +} + +/** Represents the verification information about the user this object is attached to. */ +export interface VerificationState { + $type?: 'app.bsky.actor.defs#verificationState' + /** All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. */ + verifications: VerificationView[] + /** The user's status as a verified account. */ + verifiedStatus: 'valid' | 'invalid' | 'none' | (string & {}) + /** The user's status as a trusted verifier. */ + trustedVerifierStatus: 'valid' | 'invalid' | 'none' | (string & {}) +} + +const hashVerificationState = 'verificationState' + +export function isVerificationState(v: V) { + return is$typed(v, id, hashVerificationState) +} + +export function validateVerificationState(v: V) { + return validate(v, id, hashVerificationState) +} + +/** An individual verification for an associated subject. */ +export interface VerificationView { + $type?: 'app.bsky.actor.defs#verificationView' + /** The user who issued this verification. */ + issuer: string + /** The AT-URI of the verification record. */ + uri: string + /** True if the verification passes validation, otherwise false. */ + isValid: boolean + /** Timestamp when the verification was created. */ + createdAt: string +} + +const hashVerificationView = 'verificationView' + +export function isVerificationView(v: V) { + return is$typed(v, id, hashVerificationView) +} + +export function validateVerificationView(v: V) { + return validate(v, id, hashVerificationView) +} + +export type Preferences = ( + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } +)[] + +export interface AdultContentPref { + $type?: 'app.bsky.actor.defs#adultContentPref' + enabled: boolean +} + +const hashAdultContentPref = 'adultContentPref' + +export function isAdultContentPref(v: V) { + return is$typed(v, id, hashAdultContentPref) +} + +export function validateAdultContentPref(v: V) { + return validate(v, id, hashAdultContentPref) +} + +export interface ContentLabelPref { + $type?: 'app.bsky.actor.defs#contentLabelPref' + /** Which labeler does this preference apply to? If undefined, applies globally. */ + labelerDid?: string + label: string + visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {}) +} + +const hashContentLabelPref = 'contentLabelPref' + +export function isContentLabelPref(v: V) { + return is$typed(v, id, hashContentLabelPref) +} + +export function validateContentLabelPref(v: V) { + return validate(v, id, hashContentLabelPref) +} + +export interface SavedFeed { + $type?: 'app.bsky.actor.defs#savedFeed' + id: string + type: 'feed' | 'list' | 'timeline' | (string & {}) + value: string + pinned: boolean +} + +const hashSavedFeed = 'savedFeed' + +export function isSavedFeed(v: V) { + return is$typed(v, id, hashSavedFeed) +} + +export function validateSavedFeed(v: V) { + return validate(v, id, hashSavedFeed) +} + +export interface SavedFeedsPrefV2 { + $type?: 'app.bsky.actor.defs#savedFeedsPrefV2' + items: SavedFeed[] +} + +const hashSavedFeedsPrefV2 = 'savedFeedsPrefV2' + +export function isSavedFeedsPrefV2(v: V) { + return is$typed(v, id, hashSavedFeedsPrefV2) +} + +export function validateSavedFeedsPrefV2(v: V) { + return validate(v, id, hashSavedFeedsPrefV2) +} + +export interface SavedFeedsPref { + $type?: 'app.bsky.actor.defs#savedFeedsPref' + pinned: string[] + saved: string[] + timelineIndex?: number +} + +const hashSavedFeedsPref = 'savedFeedsPref' + +export function isSavedFeedsPref(v: V) { + return is$typed(v, id, hashSavedFeedsPref) +} + +export function validateSavedFeedsPref(v: V) { + return validate(v, id, hashSavedFeedsPref) +} + +export interface PersonalDetailsPref { + $type?: 'app.bsky.actor.defs#personalDetailsPref' + /** The birth date of account owner. */ + birthDate?: string +} + +const hashPersonalDetailsPref = 'personalDetailsPref' + +export function isPersonalDetailsPref(v: V) { + return is$typed(v, id, hashPersonalDetailsPref) +} + +export function validatePersonalDetailsPref(v: V) { + return validate(v, id, hashPersonalDetailsPref) +} + +export interface FeedViewPref { + $type?: 'app.bsky.actor.defs#feedViewPref' + /** The URI of the feed, or an identifier which describes the feed. */ + feed: string + /** Hide replies in the feed. */ + hideReplies?: boolean + /** Hide replies in the feed if they are not by followed users. */ + hideRepliesByUnfollowed: boolean + /** Hide replies in the feed if they do not have this number of likes. */ + hideRepliesByLikeCount?: number + /** Hide reposts in the feed. */ + hideReposts?: boolean + /** Hide quote posts in the feed. */ + hideQuotePosts?: boolean +} + +const hashFeedViewPref = 'feedViewPref' + +export function isFeedViewPref(v: V) { + return is$typed(v, id, hashFeedViewPref) +} + +export function validateFeedViewPref(v: V) { + return validate(v, id, hashFeedViewPref) +} + +export interface ThreadViewPref { + $type?: 'app.bsky.actor.defs#threadViewPref' + /** Sorting mode for threads. */ + sort?: + | 'oldest' + | 'newest' + | 'most-likes' + | 'random' + | 'hotness' + | (string & {}) + /** Show followed users at the top of all replies. */ + prioritizeFollowedUsers?: boolean +} + +const hashThreadViewPref = 'threadViewPref' + +export function isThreadViewPref(v: V) { + return is$typed(v, id, hashThreadViewPref) +} + +export function validateThreadViewPref(v: V) { + return validate(v, id, hashThreadViewPref) +} + +export interface InterestsPref { + $type?: 'app.bsky.actor.defs#interestsPref' + /** A list of tags which describe the account owner's interests gathered during onboarding. */ + tags: string[] +} + +const hashInterestsPref = 'interestsPref' + +export function isInterestsPref(v: V) { + return is$typed(v, id, hashInterestsPref) +} + +export function validateInterestsPref(v: V) { + return validate(v, id, hashInterestsPref) +} + +export type MutedWordTarget = 'content' | 'tag' | (string & {}) + +/** A word that the account owner has muted. */ +export interface MutedWord { + $type?: 'app.bsky.actor.defs#mutedWord' + id?: string + /** The muted word itself. */ + value: string + /** The intended targets of the muted word. */ + targets: MutedWordTarget[] + /** Groups of users to apply the muted word to. If undefined, applies to all users. */ + actorTarget: 'all' | 'exclude-following' | (string & {}) + /** The date and time at which the muted word will expire and no longer be applied. */ + expiresAt?: string +} + +const hashMutedWord = 'mutedWord' + +export function isMutedWord(v: V) { + return is$typed(v, id, hashMutedWord) +} + +export function validateMutedWord(v: V) { + return validate(v, id, hashMutedWord) +} + +export interface MutedWordsPref { + $type?: 'app.bsky.actor.defs#mutedWordsPref' + /** A list of words the account owner has muted. */ + items: MutedWord[] +} + +const hashMutedWordsPref = 'mutedWordsPref' + +export function isMutedWordsPref(v: V) { + return is$typed(v, id, hashMutedWordsPref) +} + +export function validateMutedWordsPref(v: V) { + return validate(v, id, hashMutedWordsPref) +} + +export interface HiddenPostsPref { + $type?: 'app.bsky.actor.defs#hiddenPostsPref' + /** A list of URIs of posts the account owner has hidden. */ + items: string[] +} + +const hashHiddenPostsPref = 'hiddenPostsPref' + +export function isHiddenPostsPref(v: V) { + return is$typed(v, id, hashHiddenPostsPref) +} + +export function validateHiddenPostsPref(v: V) { + return validate(v, id, hashHiddenPostsPref) +} + +export interface LabelersPref { + $type?: 'app.bsky.actor.defs#labelersPref' + labelers: LabelerPrefItem[] +} + +const hashLabelersPref = 'labelersPref' + +export function isLabelersPref(v: V) { + return is$typed(v, id, hashLabelersPref) +} + +export function validateLabelersPref(v: V) { + return validate(v, id, hashLabelersPref) +} + +export interface LabelerPrefItem { + $type?: 'app.bsky.actor.defs#labelerPrefItem' + did: string +} + +const hashLabelerPrefItem = 'labelerPrefItem' + +export function isLabelerPrefItem(v: V) { + return is$typed(v, id, hashLabelerPrefItem) +} + +export function validateLabelerPrefItem(v: V) { + return validate(v, id, hashLabelerPrefItem) +} + +/** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */ +export interface BskyAppStatePref { + $type?: 'app.bsky.actor.defs#bskyAppStatePref' + activeProgressGuide?: BskyAppProgressGuide + /** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. */ + queuedNudges?: string[] + /** Storage for NUXs the user has encountered. */ + nuxs?: Nux[] +} + +const hashBskyAppStatePref = 'bskyAppStatePref' + +export function isBskyAppStatePref(v: V) { + return is$typed(v, id, hashBskyAppStatePref) +} + +export function validateBskyAppStatePref(v: V) { + return validate(v, id, hashBskyAppStatePref) +} + +/** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */ +export interface BskyAppProgressGuide { + $type?: 'app.bsky.actor.defs#bskyAppProgressGuide' + guide: string +} + +const hashBskyAppProgressGuide = 'bskyAppProgressGuide' + +export function isBskyAppProgressGuide(v: V) { + return is$typed(v, id, hashBskyAppProgressGuide) +} + +export function validateBskyAppProgressGuide(v: V) { + return validate(v, id, hashBskyAppProgressGuide) +} + +/** A new user experiences (NUX) storage object */ +export interface Nux { + $type?: 'app.bsky.actor.defs#nux' + id: string + completed: boolean + /** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. */ + data?: string + /** The date and time at which the NUX will expire and should be considered completed. */ + expiresAt?: string +} + +const hashNux = 'nux' + +export function isNux(v: V) { + return is$typed(v, id, hashNux) +} + +export function validateNux(v: V) { + return validate(v, id, hashNux) +} + +/** Preferences for how verified accounts appear in the app. */ +export interface VerificationPrefs { + $type?: 'app.bsky.actor.defs#verificationPrefs' + /** Hide the blue check badges for verified accounts and trusted verifiers. */ + hideBadges: boolean +} + +const hashVerificationPrefs = 'verificationPrefs' + +export function isVerificationPrefs(v: V) { + return is$typed(v, id, hashVerificationPrefs) +} + +export function validateVerificationPrefs(v: V) { + return validate(v, id, hashVerificationPrefs) +} + +/** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. */ +export interface PostInteractionSettingsPref { + $type?: 'app.bsky.actor.defs#postInteractionSettingsPref' + /** Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. */ + threadgateAllowRules?: ( + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } + )[] + /** Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */ + postgateEmbeddingRules?: ( + | $Typed + | { $type: string } + )[] +} + +const hashPostInteractionSettingsPref = 'postInteractionSettingsPref' + +export function isPostInteractionSettingsPref(v: V) { + return is$typed(v, id, hashPostInteractionSettingsPref) +} + +export function validatePostInteractionSettingsPref(v: V) { + return validate( + v, + id, + hashPostInteractionSettingsPref, + ) +} + +export interface StatusView { + $type?: 'app.bsky.actor.defs#statusView' + /** The status for the account. */ + status: 'app.bsky.actor.status#live' | (string & {}) + record: { [_ in string]: unknown } + embed?: $Typed | { $type: string } + /** The date when this status will expire. The application might choose to no longer return the status after expiration. */ + expiresAt?: string + /** True if the status is not expired, false if it is expired. Only present if expiration was set. */ + isActive?: boolean +} + +const hashStatusView = 'statusView' + +export function isStatusView(v: V) { + return is$typed(v, id, hashStatusView) +} + +export function validateStatusView(v: V) { + return validate(v, id, hashStatusView) +} diff --git a/indexclient/types/app/bsky/actor/getProfile.ts b/indexclient/types/app/bsky/actor/getProfile.ts new file mode 100644 index 0000000..7c165ed --- /dev/null +++ b/indexclient/types/app/bsky/actor/getProfile.ts @@ -0,0 +1,39 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getProfile' + +export type QueryParams = { + /** Handle or DID of account to fetch profile of. */ + actor: string +} +export type InputSchema = undefined +export type OutputSchema = AppBskyActorDefs.ProfileViewDetailed + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/actor/getProfiles.ts b/indexclient/types/app/bsky/actor/getProfiles.ts new file mode 100644 index 0000000..93f5525 --- /dev/null +++ b/indexclient/types/app/bsky/actor/getProfiles.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getProfiles' + +export type QueryParams = { + actors: string[] +} +export type InputSchema = undefined + +export interface OutputSchema { + profiles: AppBskyActorDefs.ProfileViewDetailed[] +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/embed/defs.ts b/indexclient/types/app/bsky/embed/defs.ts new file mode 100644 index 0000000..e7a4c54 --- /dev/null +++ b/indexclient/types/app/bsky/embed/defs.ts @@ -0,0 +1,32 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.defs' + +/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */ +export interface AspectRatio { + $type?: 'app.bsky.embed.defs#aspectRatio' + width: number + height: number +} + +const hashAspectRatio = 'aspectRatio' + +export function isAspectRatio(v: V) { + return is$typed(v, id, hashAspectRatio) +} + +export function validateAspectRatio(v: V) { + return validate(v, id, hashAspectRatio) +} diff --git a/indexclient/types/app/bsky/embed/external.ts b/indexclient/types/app/bsky/embed/external.ts new file mode 100644 index 0000000..d29485c --- /dev/null +++ b/indexclient/types/app/bsky/embed/external.ts @@ -0,0 +1,82 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.external' + +/** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ +export interface Main { + $type?: 'app.bsky.embed.external' + external: External +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +export interface External { + $type?: 'app.bsky.embed.external#external' + uri: string + title: string + description: string + thumb?: BlobRef +} + +const hashExternal = 'external' + +export function isExternal(v: V) { + return is$typed(v, id, hashExternal) +} + +export function validateExternal(v: V) { + return validate(v, id, hashExternal) +} + +export interface View { + $type?: 'app.bsky.embed.external#view' + external: ViewExternal +} + +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) +} + +export function validateView(v: V) { + return validate(v, id, hashView) +} + +export interface ViewExternal { + $type?: 'app.bsky.embed.external#viewExternal' + uri: string + title: string + description: string + thumb?: string +} + +const hashViewExternal = 'viewExternal' + +export function isViewExternal(v: V) { + return is$typed(v, id, hashViewExternal) +} + +export function validateViewExternal(v: V) { + return validate(v, id, hashViewExternal) +} diff --git a/indexclient/types/app/bsky/embed/images.ts b/indexclient/types/app/bsky/embed/images.ts new file mode 100644 index 0000000..bb44800 --- /dev/null +++ b/indexclient/types/app/bsky/embed/images.ts @@ -0,0 +1,85 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyEmbedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.images' + +export interface Main { + $type?: 'app.bsky.embed.images' + images: Image[] +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +export interface Image { + $type?: 'app.bsky.embed.images#image' + image: BlobRef + /** Alt text description of the image, for accessibility. */ + alt: string + aspectRatio?: AppBskyEmbedDefs.AspectRatio +} + +const hashImage = 'image' + +export function isImage(v: V) { + return is$typed(v, id, hashImage) +} + +export function validateImage(v: V) { + return validate(v, id, hashImage) +} + +export interface View { + $type?: 'app.bsky.embed.images#view' + images: ViewImage[] +} + +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) +} + +export function validateView(v: V) { + return validate(v, id, hashView) +} + +export interface ViewImage { + $type?: 'app.bsky.embed.images#viewImage' + /** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. */ + thumb: string + /** Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. */ + fullsize: string + /** Alt text description of the image, for accessibility. */ + alt: string + aspectRatio?: AppBskyEmbedDefs.AspectRatio +} + +const hashViewImage = 'viewImage' + +export function isViewImage(v: V) { + return is$typed(v, id, hashViewImage) +} + +export function validateViewImage(v: V) { + return validate(v, id, hashViewImage) +} diff --git a/indexclient/types/app/bsky/embed/record.ts b/indexclient/types/app/bsky/embed/record.ts new file mode 100644 index 0000000..b0d2049 --- /dev/null +++ b/indexclient/types/app/bsky/embed/record.ts @@ -0,0 +1,146 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' +import type * as AppBskyFeedDefs from '../feed/defs.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' +import type * as AppBskyLabelerDefs from '../labeler/defs.js' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyEmbedImages from './images.js' +import type * as AppBskyEmbedVideo from './video.js' +import type * as AppBskyEmbedExternal from './external.js' +import type * as AppBskyEmbedRecordWithMedia from './recordWithMedia.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.record' + +export interface Main { + $type?: 'app.bsky.embed.record' + record: ComAtprotoRepoStrongRef.Main +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +export interface View { + $type?: 'app.bsky.embed.record#view' + record: + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } +} + +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) +} + +export function validateView(v: V) { + return validate(v, id, hashView) +} + +export interface ViewRecord { + $type?: 'app.bsky.embed.record#viewRecord' + uri: string + cid: string + author: AppBskyActorDefs.ProfileViewBasic + /** The record data itself. */ + value: { [_ in string]: unknown } + labels?: ComAtprotoLabelDefs.Label[] + replyCount?: number + repostCount?: number + likeCount?: number + quoteCount?: number + embeds?: ( + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } + )[] + indexedAt: string +} + +const hashViewRecord = 'viewRecord' + +export function isViewRecord(v: V) { + return is$typed(v, id, hashViewRecord) +} + +export function validateViewRecord(v: V) { + return validate(v, id, hashViewRecord) +} + +export interface ViewNotFound { + $type?: 'app.bsky.embed.record#viewNotFound' + uri: string + notFound: true +} + +const hashViewNotFound = 'viewNotFound' + +export function isViewNotFound(v: V) { + return is$typed(v, id, hashViewNotFound) +} + +export function validateViewNotFound(v: V) { + return validate(v, id, hashViewNotFound) +} + +export interface ViewBlocked { + $type?: 'app.bsky.embed.record#viewBlocked' + uri: string + blocked: true + author: AppBskyFeedDefs.BlockedAuthor +} + +const hashViewBlocked = 'viewBlocked' + +export function isViewBlocked(v: V) { + return is$typed(v, id, hashViewBlocked) +} + +export function validateViewBlocked(v: V) { + return validate(v, id, hashViewBlocked) +} + +export interface ViewDetached { + $type?: 'app.bsky.embed.record#viewDetached' + uri: string + detached: true +} + +const hashViewDetached = 'viewDetached' + +export function isViewDetached(v: V) { + return is$typed(v, id, hashViewDetached) +} + +export function validateViewDetached(v: V) { + return validate(v, id, hashViewDetached) +} diff --git a/indexclient/types/app/bsky/embed/recordWithMedia.ts b/indexclient/types/app/bsky/embed/recordWithMedia.ts new file mode 100644 index 0000000..995b829 --- /dev/null +++ b/indexclient/types/app/bsky/embed/recordWithMedia.ts @@ -0,0 +1,59 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyEmbedRecord from './record.js' +import type * as AppBskyEmbedImages from './images.js' +import type * as AppBskyEmbedVideo from './video.js' +import type * as AppBskyEmbedExternal from './external.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.recordWithMedia' + +export interface Main { + $type?: 'app.bsky.embed.recordWithMedia' + record: AppBskyEmbedRecord.Main + media: + | $Typed + | $Typed + | $Typed + | { $type: string } +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +export interface View { + $type?: 'app.bsky.embed.recordWithMedia#view' + record: AppBskyEmbedRecord.View + media: + | $Typed + | $Typed + | $Typed + | { $type: string } +} + +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) +} + +export function validateView(v: V) { + return validate(v, id, hashView) +} diff --git a/indexclient/types/app/bsky/embed/video.ts b/indexclient/types/app/bsky/embed/video.ts new file mode 100644 index 0000000..9d5f5da --- /dev/null +++ b/indexclient/types/app/bsky/embed/video.ts @@ -0,0 +1,71 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyEmbedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.video' + +export interface Main { + $type?: 'app.bsky.embed.video' + /** The mp4 video file. May be up to 100mb, formerly limited to 50mb. */ + video: BlobRef + captions?: Caption[] + /** Alt text description of the video, for accessibility. */ + alt?: string + aspectRatio?: AppBskyEmbedDefs.AspectRatio +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +export interface Caption { + $type?: 'app.bsky.embed.video#caption' + lang: string + file: BlobRef +} + +const hashCaption = 'caption' + +export function isCaption(v: V) { + return is$typed(v, id, hashCaption) +} + +export function validateCaption(v: V) { + return validate(v, id, hashCaption) +} + +export interface View { + $type?: 'app.bsky.embed.video#view' + cid: string + playlist: string + thumbnail?: string + alt?: string + aspectRatio?: AppBskyEmbedDefs.AspectRatio +} + +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) +} + +export function validateView(v: V) { + return validate(v, id, hashView) +} diff --git a/indexclient/types/app/bsky/feed/defs.ts b/indexclient/types/app/bsky/feed/defs.ts new file mode 100644 index 0000000..a6af23a --- /dev/null +++ b/indexclient/types/app/bsky/feed/defs.ts @@ -0,0 +1,424 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as AppBskyEmbedImages from '../embed/images.js' +import type * as AppBskyEmbedVideo from '../embed/video.js' +import type * as AppBskyEmbedExternal from '../embed/external.js' +import type * as AppBskyEmbedRecord from '../embed/record.js' +import type * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.defs' + +export interface PostView { + $type?: 'app.bsky.feed.defs#postView' + uri: string + cid: string + author: AppBskyActorDefs.ProfileViewBasic + record: { [_ in string]: unknown } + embed?: + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } + replyCount?: number + repostCount?: number + likeCount?: number + quoteCount?: number + indexedAt: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + threadgate?: ThreadgateView +} + +const hashPostView = 'postView' + +export function isPostView(v: V) { + return is$typed(v, id, hashPostView) +} + +export function validatePostView(v: V) { + return validate(v, id, hashPostView) +} + +/** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. */ +export interface ViewerState { + $type?: 'app.bsky.feed.defs#viewerState' + repost?: string + like?: string + threadMuted?: boolean + replyDisabled?: boolean + embeddingDisabled?: boolean + pinned?: boolean +} + +const hashViewerState = 'viewerState' + +export function isViewerState(v: V) { + return is$typed(v, id, hashViewerState) +} + +export function validateViewerState(v: V) { + return validate(v, id, hashViewerState) +} + +/** Metadata about this post within the context of the thread it is in. */ +export interface ThreadContext { + $type?: 'app.bsky.feed.defs#threadContext' + rootAuthorLike?: string +} + +const hashThreadContext = 'threadContext' + +export function isThreadContext(v: V) { + return is$typed(v, id, hashThreadContext) +} + +export function validateThreadContext(v: V) { + return validate(v, id, hashThreadContext) +} + +export interface FeedViewPost { + $type?: 'app.bsky.feed.defs#feedViewPost' + post: PostView + reply?: ReplyRef + reason?: $Typed | $Typed | { $type: string } + /** Context provided by feed generator that may be passed back alongside interactions. */ + feedContext?: string + /** Unique identifier per request that may be passed back alongside interactions. */ + reqId?: string +} + +const hashFeedViewPost = 'feedViewPost' + +export function isFeedViewPost(v: V) { + return is$typed(v, id, hashFeedViewPost) +} + +export function validateFeedViewPost(v: V) { + return validate(v, id, hashFeedViewPost) +} + +export interface ReplyRef { + $type?: 'app.bsky.feed.defs#replyRef' + root: + | $Typed + | $Typed + | $Typed + | { $type: string } + parent: + | $Typed + | $Typed + | $Typed + | { $type: string } + grandparentAuthor?: AppBskyActorDefs.ProfileViewBasic +} + +const hashReplyRef = 'replyRef' + +export function isReplyRef(v: V) { + return is$typed(v, id, hashReplyRef) +} + +export function validateReplyRef(v: V) { + return validate(v, id, hashReplyRef) +} + +export interface ReasonRepost { + $type?: 'app.bsky.feed.defs#reasonRepost' + by: AppBskyActorDefs.ProfileViewBasic + uri?: string + cid?: string + indexedAt: string +} + +const hashReasonRepost = 'reasonRepost' + +export function isReasonRepost(v: V) { + return is$typed(v, id, hashReasonRepost) +} + +export function validateReasonRepost(v: V) { + return validate(v, id, hashReasonRepost) +} + +export interface ReasonPin { + $type?: 'app.bsky.feed.defs#reasonPin' +} + +const hashReasonPin = 'reasonPin' + +export function isReasonPin(v: V) { + return is$typed(v, id, hashReasonPin) +} + +export function validateReasonPin(v: V) { + return validate(v, id, hashReasonPin) +} + +export interface ThreadViewPost { + $type?: 'app.bsky.feed.defs#threadViewPost' + post: PostView + parent?: + | $Typed + | $Typed + | $Typed + | { $type: string } + replies?: ( + | $Typed + | $Typed + | $Typed + | { $type: string } + )[] + threadContext?: ThreadContext +} + +const hashThreadViewPost = 'threadViewPost' + +export function isThreadViewPost(v: V) { + return is$typed(v, id, hashThreadViewPost) +} + +export function validateThreadViewPost(v: V) { + return validate(v, id, hashThreadViewPost) +} + +export interface NotFoundPost { + $type?: 'app.bsky.feed.defs#notFoundPost' + uri: string + notFound: true +} + +const hashNotFoundPost = 'notFoundPost' + +export function isNotFoundPost(v: V) { + return is$typed(v, id, hashNotFoundPost) +} + +export function validateNotFoundPost(v: V) { + return validate(v, id, hashNotFoundPost) +} + +export interface BlockedPost { + $type?: 'app.bsky.feed.defs#blockedPost' + uri: string + blocked: true + author: BlockedAuthor +} + +const hashBlockedPost = 'blockedPost' + +export function isBlockedPost(v: V) { + return is$typed(v, id, hashBlockedPost) +} + +export function validateBlockedPost(v: V) { + return validate(v, id, hashBlockedPost) +} + +export interface BlockedAuthor { + $type?: 'app.bsky.feed.defs#blockedAuthor' + did: string + viewer?: AppBskyActorDefs.ViewerState +} + +const hashBlockedAuthor = 'blockedAuthor' + +export function isBlockedAuthor(v: V) { + return is$typed(v, id, hashBlockedAuthor) +} + +export function validateBlockedAuthor(v: V) { + return validate(v, id, hashBlockedAuthor) +} + +export interface GeneratorView { + $type?: 'app.bsky.feed.defs#generatorView' + uri: string + cid: string + did: string + creator: AppBskyActorDefs.ProfileView + displayName: string + description?: string + descriptionFacets?: AppBskyRichtextFacet.Main[] + avatar?: string + likeCount?: number + acceptsInteractions?: boolean + labels?: ComAtprotoLabelDefs.Label[] + viewer?: GeneratorViewerState + contentMode?: + | 'app.bsky.feed.defs#contentModeUnspecified' + | 'app.bsky.feed.defs#contentModeVideo' + | (string & {}) + indexedAt: string +} + +const hashGeneratorView = 'generatorView' + +export function isGeneratorView(v: V) { + return is$typed(v, id, hashGeneratorView) +} + +export function validateGeneratorView(v: V) { + return validate(v, id, hashGeneratorView) +} + +export interface GeneratorViewerState { + $type?: 'app.bsky.feed.defs#generatorViewerState' + like?: string +} + +const hashGeneratorViewerState = 'generatorViewerState' + +export function isGeneratorViewerState(v: V) { + return is$typed(v, id, hashGeneratorViewerState) +} + +export function validateGeneratorViewerState(v: V) { + return validate(v, id, hashGeneratorViewerState) +} + +export interface SkeletonFeedPost { + $type?: 'app.bsky.feed.defs#skeletonFeedPost' + post: string + reason?: + | $Typed + | $Typed + | { $type: string } + /** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */ + feedContext?: string +} + +const hashSkeletonFeedPost = 'skeletonFeedPost' + +export function isSkeletonFeedPost(v: V) { + return is$typed(v, id, hashSkeletonFeedPost) +} + +export function validateSkeletonFeedPost(v: V) { + return validate(v, id, hashSkeletonFeedPost) +} + +export interface SkeletonReasonRepost { + $type?: 'app.bsky.feed.defs#skeletonReasonRepost' + repost: string +} + +const hashSkeletonReasonRepost = 'skeletonReasonRepost' + +export function isSkeletonReasonRepost(v: V) { + return is$typed(v, id, hashSkeletonReasonRepost) +} + +export function validateSkeletonReasonRepost(v: V) { + return validate(v, id, hashSkeletonReasonRepost) +} + +export interface SkeletonReasonPin { + $type?: 'app.bsky.feed.defs#skeletonReasonPin' +} + +const hashSkeletonReasonPin = 'skeletonReasonPin' + +export function isSkeletonReasonPin(v: V) { + return is$typed(v, id, hashSkeletonReasonPin) +} + +export function validateSkeletonReasonPin(v: V) { + return validate(v, id, hashSkeletonReasonPin) +} + +export interface ThreadgateView { + $type?: 'app.bsky.feed.defs#threadgateView' + uri?: string + cid?: string + record?: { [_ in string]: unknown } + lists?: AppBskyGraphDefs.ListViewBasic[] +} + +const hashThreadgateView = 'threadgateView' + +export function isThreadgateView(v: V) { + return is$typed(v, id, hashThreadgateView) +} + +export function validateThreadgateView(v: V) { + return validate(v, id, hashThreadgateView) +} + +export interface Interaction { + $type?: 'app.bsky.feed.defs#interaction' + item?: string + event?: + | 'app.bsky.feed.defs#requestLess' + | 'app.bsky.feed.defs#requestMore' + | 'app.bsky.feed.defs#clickthroughItem' + | 'app.bsky.feed.defs#clickthroughAuthor' + | 'app.bsky.feed.defs#clickthroughReposter' + | 'app.bsky.feed.defs#clickthroughEmbed' + | 'app.bsky.feed.defs#interactionSeen' + | 'app.bsky.feed.defs#interactionLike' + | 'app.bsky.feed.defs#interactionRepost' + | 'app.bsky.feed.defs#interactionReply' + | 'app.bsky.feed.defs#interactionQuote' + | 'app.bsky.feed.defs#interactionShare' + | (string & {}) + /** Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. */ + feedContext?: string + /** Unique identifier per request that may be passed back alongside interactions. */ + reqId?: string +} + +const hashInteraction = 'interaction' + +export function isInteraction(v: V) { + return is$typed(v, id, hashInteraction) +} + +export function validateInteraction(v: V) { + return validate(v, id, hashInteraction) +} + +/** Request that less content like the given feed item be shown in the feed */ +export const REQUESTLESS = `${id}#requestLess` +/** Request that more content like the given feed item be shown in the feed */ +export const REQUESTMORE = `${id}#requestMore` +/** User clicked through to the feed item */ +export const CLICKTHROUGHITEM = `${id}#clickthroughItem` +/** User clicked through to the author of the feed item */ +export const CLICKTHROUGHAUTHOR = `${id}#clickthroughAuthor` +/** User clicked through to the reposter of the feed item */ +export const CLICKTHROUGHREPOSTER = `${id}#clickthroughReposter` +/** User clicked through to the embedded content of the feed item */ +export const CLICKTHROUGHEMBED = `${id}#clickthroughEmbed` +/** Declares the feed generator returns any types of posts. */ +export const CONTENTMODEUNSPECIFIED = `${id}#contentModeUnspecified` +/** Declares the feed generator returns posts containing app.bsky.embed.video embeds. */ +export const CONTENTMODEVIDEO = `${id}#contentModeVideo` +/** Feed item was seen by user */ +export const INTERACTIONSEEN = `${id}#interactionSeen` +/** User liked the feed item */ +export const INTERACTIONLIKE = `${id}#interactionLike` +/** User reposted the feed item */ +export const INTERACTIONREPOST = `${id}#interactionRepost` +/** User replied to the feed item */ +export const INTERACTIONREPLY = `${id}#interactionReply` +/** User quoted the feed item */ +export const INTERACTIONQUOTE = `${id}#interactionQuote` +/** User shared the feed item */ +export const INTERACTIONSHARE = `${id}#interactionShare` diff --git a/indexclient/types/app/bsky/feed/getActorFeeds.ts b/indexclient/types/app/bsky/feed/getActorFeeds.ts new file mode 100644 index 0000000..c106765 --- /dev/null +++ b/indexclient/types/app/bsky/feed/getActorFeeds.ts @@ -0,0 +1,44 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getActorFeeds' + +export type QueryParams = { + actor: string + limit?: number + cursor?: string +} +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feeds: AppBskyFeedDefs.GeneratorView[] +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/feed/getFeedGenerator.ts b/indexclient/types/app/bsky/feed/getFeedGenerator.ts new file mode 100644 index 0000000..504c61a --- /dev/null +++ b/indexclient/types/app/bsky/feed/getFeedGenerator.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeedGenerator' + +export type QueryParams = { + /** AT-URI of the feed generator record. */ + feed: string +} +export type InputSchema = undefined + +export interface OutputSchema { + view: AppBskyFeedDefs.GeneratorView + /** Indicates whether the feed generator service has been online recently, or else seems to be inactive. */ + isOnline: boolean + /** Indicates whether the feed generator service is compatible with the record declaration. */ + isValid: boolean +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/feed/getFeedGenerators.ts b/indexclient/types/app/bsky/feed/getFeedGenerators.ts new file mode 100644 index 0000000..2e047ee --- /dev/null +++ b/indexclient/types/app/bsky/feed/getFeedGenerators.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeedGenerators' + +export type QueryParams = { + feeds: string[] +} +export type InputSchema = undefined + +export interface OutputSchema { + feeds: AppBskyFeedDefs.GeneratorView[] +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/feed/getPosts.ts b/indexclient/types/app/bsky/feed/getPosts.ts new file mode 100644 index 0000000..b143d8d --- /dev/null +++ b/indexclient/types/app/bsky/feed/getPosts.ts @@ -0,0 +1,42 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { HeadersMap, XRPCError } from '@atproto/xrpc' +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getPosts' + +export type QueryParams = { + /** List of post AT-URIs to return hydrated views for. */ + uris: string[] +} +export type InputSchema = undefined + +export interface OutputSchema { + posts: AppBskyFeedDefs.PostView[] +} + +export interface CallOptions { + signal?: AbortSignal + headers?: HeadersMap +} + +export interface Response { + success: boolean + headers: HeadersMap + data: OutputSchema +} + +export function toKnownErr(e: any) { + return e +} diff --git a/indexclient/types/app/bsky/feed/postgate.ts b/indexclient/types/app/bsky/feed/postgate.ts new file mode 100644 index 0000000..a0a87fd --- /dev/null +++ b/indexclient/types/app/bsky/feed/postgate.ts @@ -0,0 +1,52 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.postgate' + +export interface Record { + $type: 'app.bsky.feed.postgate' + createdAt: string + /** Reference (AT-URI) to the post record. */ + post: string + /** List of AT-URIs embedding this post that the author has detached from. */ + detachedEmbeddingUris?: string[] + /** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */ + embeddingRules?: ($Typed | { $type: string })[] + [k: string]: unknown +} + +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) +} + +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) +} + +/** Disables embedding of this post. */ +export interface DisableRule { + $type?: 'app.bsky.feed.postgate#disableRule' +} + +const hashDisableRule = 'disableRule' + +export function isDisableRule(v: V) { + return is$typed(v, id, hashDisableRule) +} + +export function validateDisableRule(v: V) { + return validate(v, id, hashDisableRule) +} diff --git a/indexclient/types/app/bsky/feed/threadgate.ts b/indexclient/types/app/bsky/feed/threadgate.ts new file mode 100644 index 0000000..fae33fd --- /dev/null +++ b/indexclient/types/app/bsky/feed/threadgate.ts @@ -0,0 +1,104 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.threadgate' + +export interface Record { + $type: 'app.bsky.feed.threadgate' + /** Reference (AT-URI) to the post record. */ + post: string + /** List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply. */ + allow?: ( + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } + )[] + createdAt: string + /** List of hidden reply URIs. */ + hiddenReplies?: string[] + [k: string]: unknown +} + +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) +} + +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) +} + +/** Allow replies from actors mentioned in your post. */ +export interface MentionRule { + $type?: 'app.bsky.feed.threadgate#mentionRule' +} + +const hashMentionRule = 'mentionRule' + +export function isMentionRule(v: V) { + return is$typed(v, id, hashMentionRule) +} + +export function validateMentionRule(v: V) { + return validate(v, id, hashMentionRule) +} + +/** Allow replies from actors who follow you. */ +export interface FollowerRule { + $type?: 'app.bsky.feed.threadgate#followerRule' +} + +const hashFollowerRule = 'followerRule' + +export function isFollowerRule(v: V) { + return is$typed(v, id, hashFollowerRule) +} + +export function validateFollowerRule(v: V) { + return validate(v, id, hashFollowerRule) +} + +/** Allow replies from actors you follow. */ +export interface FollowingRule { + $type?: 'app.bsky.feed.threadgate#followingRule' +} + +const hashFollowingRule = 'followingRule' + +export function isFollowingRule(v: V) { + return is$typed(v, id, hashFollowingRule) +} + +export function validateFollowingRule(v: V) { + return validate(v, id, hashFollowingRule) +} + +/** Allow replies from actors on a list. */ +export interface ListRule { + $type?: 'app.bsky.feed.threadgate#listRule' + list: string +} + +const hashListRule = 'listRule' + +export function isListRule(v: V) { + return is$typed(v, id, hashListRule) +} + +export function validateListRule(v: V) { + return validate(v, id, hashListRule) +} diff --git a/indexclient/types/app/bsky/graph/defs.ts b/indexclient/types/app/bsky/graph/defs.ts new file mode 100644 index 0000000..c477bfd --- /dev/null +++ b/indexclient/types/app/bsky/graph/defs.ts @@ -0,0 +1,198 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as AppBskyFeedDefs from '../feed/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.defs' + +export interface ListViewBasic { + $type?: 'app.bsky.graph.defs#listViewBasic' + uri: string + cid: string + name: string + purpose: ListPurpose + avatar?: string + listItemCount?: number + labels?: ComAtprotoLabelDefs.Label[] + viewer?: ListViewerState + indexedAt?: string +} + +const hashListViewBasic = 'listViewBasic' + +export function isListViewBasic(v: V) { + return is$typed(v, id, hashListViewBasic) +} + +export function validateListViewBasic(v: V) { + return validate(v, id, hashListViewBasic) +} + +export interface ListView { + $type?: 'app.bsky.graph.defs#listView' + uri: string + cid: string + creator: AppBskyActorDefs.ProfileView + name: string + purpose: ListPurpose + description?: string + descriptionFacets?: AppBskyRichtextFacet.Main[] + avatar?: string + listItemCount?: number + labels?: ComAtprotoLabelDefs.Label[] + viewer?: ListViewerState + indexedAt: string +} + +const hashListView = 'listView' + +export function isListView(v: V) { + return is$typed(v, id, hashListView) +} + +export function validateListView(v: V) { + return validate(v, id, hashListView) +} + +export interface ListItemView { + $type?: 'app.bsky.graph.defs#listItemView' + uri: string + subject: AppBskyActorDefs.ProfileView +} + +const hashListItemView = 'listItemView' + +export function isListItemView(v: V) { + return is$typed(v, id, hashListItemView) +} + +export function validateListItemView(v: V) { + return validate(v, id, hashListItemView) +} + +export interface StarterPackView { + $type?: 'app.bsky.graph.defs#starterPackView' + uri: string + cid: string + record: { [_ in string]: unknown } + creator: AppBskyActorDefs.ProfileViewBasic + list?: ListViewBasic + listItemsSample?: ListItemView[] + feeds?: AppBskyFeedDefs.GeneratorView[] + joinedWeekCount?: number + joinedAllTimeCount?: number + labels?: ComAtprotoLabelDefs.Label[] + indexedAt: string +} + +const hashStarterPackView = 'starterPackView' + +export function isStarterPackView(v: V) { + return is$typed(v, id, hashStarterPackView) +} + +export function validateStarterPackView(v: V) { + return validate(v, id, hashStarterPackView) +} + +export interface StarterPackViewBasic { + $type?: 'app.bsky.graph.defs#starterPackViewBasic' + uri: string + cid: string + record: { [_ in string]: unknown } + creator: AppBskyActorDefs.ProfileViewBasic + listItemCount?: number + joinedWeekCount?: number + joinedAllTimeCount?: number + labels?: ComAtprotoLabelDefs.Label[] + indexedAt: string +} + +const hashStarterPackViewBasic = 'starterPackViewBasic' + +export function isStarterPackViewBasic(v: V) { + return is$typed(v, id, hashStarterPackViewBasic) +} + +export function validateStarterPackViewBasic(v: V) { + return validate(v, id, hashStarterPackViewBasic) +} + +export type ListPurpose = + | 'app.bsky.graph.defs#modlist' + | 'app.bsky.graph.defs#curatelist' + | 'app.bsky.graph.defs#referencelist' + | (string & {}) + +/** A list of actors to apply an aggregate moderation action (mute/block) on. */ +export const MODLIST = `${id}#modlist` +/** A list of actors used for curation purposes such as list feeds or interaction gating. */ +export const CURATELIST = `${id}#curatelist` +/** A list of actors used for only for reference purposes such as within a starter pack. */ +export const REFERENCELIST = `${id}#referencelist` + +export interface ListViewerState { + $type?: 'app.bsky.graph.defs#listViewerState' + muted?: boolean + blocked?: string +} + +const hashListViewerState = 'listViewerState' + +export function isListViewerState(v: V) { + return is$typed(v, id, hashListViewerState) +} + +export function validateListViewerState(v: V) { + return validate(v, id, hashListViewerState) +} + +/** indicates that a handle or DID could not be resolved */ +export interface NotFoundActor { + $type?: 'app.bsky.graph.defs#notFoundActor' + actor: string + notFound: true +} + +const hashNotFoundActor = 'notFoundActor' + +export function isNotFoundActor(v: V) { + return is$typed(v, id, hashNotFoundActor) +} + +export function validateNotFoundActor(v: V) { + return validate(v, id, hashNotFoundActor) +} + +/** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */ +export interface Relationship { + $type?: 'app.bsky.graph.defs#relationship' + did: string + /** if the actor follows this DID, this is the AT-URI of the follow record */ + following?: string + /** if the actor is followed by this DID, contains the AT-URI of the follow record */ + followedBy?: string +} + +const hashRelationship = 'relationship' + +export function isRelationship(v: V) { + return is$typed(v, id, hashRelationship) +} + +export function validateRelationship(v: V) { + return validate(v, id, hashRelationship) +} diff --git a/indexclient/types/app/bsky/notification/defs.ts b/indexclient/types/app/bsky/notification/defs.ts new file mode 100644 index 0000000..7ff0a82 --- /dev/null +++ b/indexclient/types/app/bsky/notification/defs.ts @@ -0,0 +1,142 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.defs' + +export interface RecordDeleted { + $type?: 'app.bsky.notification.defs#recordDeleted' +} + +const hashRecordDeleted = 'recordDeleted' + +export function isRecordDeleted(v: V) { + return is$typed(v, id, hashRecordDeleted) +} + +export function validateRecordDeleted(v: V) { + return validate(v, id, hashRecordDeleted) +} + +export interface ChatPreference { + $type?: 'app.bsky.notification.defs#chatPreference' + include: 'all' | 'accepted' | (string & {}) + push: boolean +} + +const hashChatPreference = 'chatPreference' + +export function isChatPreference(v: V) { + return is$typed(v, id, hashChatPreference) +} + +export function validateChatPreference(v: V) { + return validate(v, id, hashChatPreference) +} + +export interface FilterablePreference { + $type?: 'app.bsky.notification.defs#filterablePreference' + include: 'all' | 'follows' | (string & {}) + list: boolean + push: boolean +} + +const hashFilterablePreference = 'filterablePreference' + +export function isFilterablePreference(v: V) { + return is$typed(v, id, hashFilterablePreference) +} + +export function validateFilterablePreference(v: V) { + return validate(v, id, hashFilterablePreference) +} + +export interface Preference { + $type?: 'app.bsky.notification.defs#preference' + list: boolean + push: boolean +} + +const hashPreference = 'preference' + +export function isPreference(v: V) { + return is$typed(v, id, hashPreference) +} + +export function validatePreference(v: V) { + return validate(v, id, hashPreference) +} + +export interface Preferences { + $type?: 'app.bsky.notification.defs#preferences' + chat: ChatPreference + follow: FilterablePreference + like: FilterablePreference + likeViaRepost: FilterablePreference + mention: FilterablePreference + quote: FilterablePreference + reply: FilterablePreference + repost: FilterablePreference + repostViaRepost: FilterablePreference + starterpackJoined: Preference + subscribedPost: Preference + unverified: Preference + verified: Preference +} + +const hashPreferences = 'preferences' + +export function isPreferences(v: V) { + return is$typed(v, id, hashPreferences) +} + +export function validatePreferences(v: V) { + return validate(v, id, hashPreferences) +} + +export interface ActivitySubscription { + $type?: 'app.bsky.notification.defs#activitySubscription' + post: boolean + reply: boolean +} + +const hashActivitySubscription = 'activitySubscription' + +export function isActivitySubscription(v: V) { + return is$typed(v, id, hashActivitySubscription) +} + +export function validateActivitySubscription(v: V) { + return validate(v, id, hashActivitySubscription) +} + +/** Object used to store activity subscription data in stash. */ +export interface SubjectActivitySubscription { + $type?: 'app.bsky.notification.defs#subjectActivitySubscription' + subject: string + activitySubscription: ActivitySubscription +} + +const hashSubjectActivitySubscription = 'subjectActivitySubscription' + +export function isSubjectActivitySubscription(v: V) { + return is$typed(v, id, hashSubjectActivitySubscription) +} + +export function validateSubjectActivitySubscription(v: V) { + return validate( + v, + id, + hashSubjectActivitySubscription, + ) +} diff --git a/indexclient/types/app/bsky/richtext/facet.ts b/indexclient/types/app/bsky/richtext/facet.ts new file mode 100644 index 0000000..c9dba90 --- /dev/null +++ b/indexclient/types/app/bsky/richtext/facet.ts @@ -0,0 +1,97 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.richtext.facet' + +/** Annotation of a sub-string within rich text. */ +export interface Main { + $type?: 'app.bsky.richtext.facet' + index: ByteSlice + features: ($Typed | $Typed | $Typed | { $type: string })[] +} + +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) +} + +export function validateMain(v: V) { + return validate
(v, id, hashMain) +} + +/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ +export interface Mention { + $type?: 'app.bsky.richtext.facet#mention' + did: string +} + +const hashMention = 'mention' + +export function isMention(v: V) { + return is$typed(v, id, hashMention) +} + +export function validateMention(v: V) { + return validate(v, id, hashMention) +} + +/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ +export interface Link { + $type?: 'app.bsky.richtext.facet#link' + uri: string +} + +const hashLink = 'link' + +export function isLink(v: V) { + return is$typed(v, id, hashLink) +} + +export function validateLink(v: V) { + return validate(v, id, hashLink) +} + +/** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ +export interface Tag { + $type?: 'app.bsky.richtext.facet#tag' + tag: string +} + +const hashTag = 'tag' + +export function isTag(v: V) { + return is$typed(v, id, hashTag) +} + +export function validateTag(v: V) { + return validate(v, id, hashTag) +} + +/** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ +export interface ByteSlice { + $type?: 'app.bsky.richtext.facet#byteSlice' + byteStart: number + byteEnd: number +} + +const hashByteSlice = 'byteSlice' + +export function isByteSlice(v: V) { + return is$typed(v, id, hashByteSlice) +} + +export function validateByteSlice(v: V) { + return validate(v, id, hashByteSlice) +} diff --git a/indexclient/types/com/atproto/label/defs.ts b/indexclient/types/com/atproto/label/defs.ts new file mode 100644 index 0000000..3f2d846 --- /dev/null +++ b/indexclient/types/com/atproto/label/defs.ts @@ -0,0 +1,146 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { type ValidationResult, BlobRef } from '@atproto/lexicon' +import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { + type $Typed, + is$typed as _is$typed, + type OmitKey, +} from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.label.defs' + +/** Metadata tag on an atproto resource (eg, repo or record). */ +export interface Label { + $type?: 'com.atproto.label.defs#label' + /** The AT Protocol version of the label object. */ + ver?: number + /** DID of the actor who created this label. */ + src: string + /** AT URI of the record, repository (account), or other resource that this label applies to. */ + uri: string + /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */ + cid?: string + /** The short string name of the value or type of this label. */ + val: string + /** If true, this is a negation label, overwriting a previous label. */ + neg?: boolean + /** Timestamp when this label was created. */ + cts: string + /** Timestamp at which this label expires (no longer applies). */ + exp?: string + /** Signature of dag-cbor encoded label. */ + sig?: Uint8Array +} + +const hashLabel = 'label' + +export function isLabel(v: V) { + return is$typed(v, id, hashLabel) +} + +export function validateLabel(v: V) { + return validate