···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyActorDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** DEPRECATED: use 'q' instead. */
99+ term?: string;
1010+ /** Search query prefix; not a full query string. */
1111+ q?: string;
1212+ limit?: number;
1313+};
1414+export type InputSchema = undefined;
1515+1616+export interface OutputSchema {
1717+ actors: (AppBskyActorDefs.ProfileViewBasic)[];
1818+}
1919+2020+export interface CallOptions {
2121+ signal?: AbortSignal;
2222+ headers?: HeadersMap;
2323+}
2424+2525+export interface Response {
2626+ success: boolean;
2727+ headers: HeadersMap;
2828+ data: OutputSchema;
2929+}
3030+3131+export function toKnownErr(e: any) {
3232+ return e;
3333+}
+37
lex-gen/generated/types/app/bsky/actor/status.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66+import type * as AppBskyEmbedExternal from "../embed/external.ts";
77+88+const is$typed = _is$typed, validate = _validate;
99+const id = "app.bsky.actor.status";
1010+1111+export interface Record {
1212+ $type: "app.bsky.actor.status";
1313+ /** The status for the account. */
1414+ status:
1515+ | "app.bsky.actor.status#live"
1616+ | (string & globalThis.Record<PropertyKey, never>);
1717+ embed?: $Typed<AppBskyEmbedExternal.Main> | { $type: string };
1818+ /** The duration of the status in minutes. Applications can choose to impose minimum and maximum limits. */
1919+ durationMinutes?: number;
2020+ createdAt: string;
2121+ [k: string]: unknown;
2222+}
2323+2424+const hashRecord = "main";
2525+2626+export function isRecord<V>(v: V) {
2727+ return is$typed(v, id, hashRecord);
2828+}
2929+3030+export function validateRecord<V>(v: V) {
3131+ return validate<Record & V>(v, id, hashRecord, true);
3232+}
3333+3434+export type Main = Record;
3535+3636+/** Advertises an account as currently offering live content. */
3737+export const LIVE = `${id}#live`;
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyBookmarkDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ limit?: number;
99+ cursor?: string;
1010+};
1111+export type InputSchema = undefined;
1212+1313+export interface OutputSchema {
1414+ cursor?: string;
1515+ bookmarks: (AppBskyBookmarkDefs.BookmarkView)[];
1616+}
1717+1818+export interface CallOptions {
1919+ signal?: AbortSignal;
2020+ headers?: HeadersMap;
2121+}
2222+2323+export interface Response {
2424+ success: boolean;
2525+ headers: HeadersMap;
2626+ data: OutputSchema;
2727+}
2828+2929+export function toKnownErr(e: any) {
3030+ return e;
3131+}
+25
lex-gen/generated/types/app/bsky/embed/defs.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { is$typed as _is$typed } from "../../../../util.ts";
66+77+const is$typed = _is$typed, validate = _validate;
88+const id = "app.bsky.embed.defs";
99+1010+/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */
1111+export interface AspectRatio {
1212+ $type?: "app.bsky.embed.defs#aspectRatio";
1313+ width: number;
1414+ height: number;
1515+}
1616+1717+const hashAspectRatio = "aspectRatio";
1818+1919+export function isAspectRatio<V>(v: V) {
2020+ return is$typed(v, id, hashAspectRatio);
2121+}
2222+2323+export function validateAspectRatio<V>(v: V) {
2424+ return validate<AspectRatio & V>(v, id, hashAspectRatio);
2525+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyFeedDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. */
99+ algorithm?: string;
1010+ limit?: number;
1111+ cursor?: string;
1212+};
1313+export type InputSchema = undefined;
1414+1515+export interface OutputSchema {
1616+ cursor?: string;
1717+ feed: (AppBskyFeedDefs.FeedViewPost)[];
1818+}
1919+2020+export interface CallOptions {
2121+ signal?: AbortSignal;
2222+ headers?: HeadersMap;
2323+}
2424+2525+export interface Response {
2626+ success: boolean;
2727+ headers: HeadersMap;
2828+ data: OutputSchema;
2929+}
3030+3131+export function toKnownErr(e: any) {
3232+ return e;
3333+}
+29
lex-gen/generated/types/app/bsky/feed/like.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { is$typed as _is$typed } from "../../../../util.ts";
66+import type * as ComAtprotoRepoStrongRef from "@example/lexicons";
77+88+const is$typed = _is$typed, validate = _validate;
99+const id = "app.bsky.feed.like";
1010+1111+export interface Record {
1212+ $type: "app.bsky.feed.like";
1313+ subject: ComAtprotoRepoStrongRef.Main;
1414+ createdAt: string;
1515+ via?: ComAtprotoRepoStrongRef.Main;
1616+ [k: string]: unknown;
1717+}
1818+1919+const hashRecord = "main";
2020+2121+export function isRecord<V>(v: V) {
2222+ return is$typed(v, id, hashRecord);
2323+}
2424+2525+export function validateRecord<V>(v: V) {
2626+ return validate<Record & V>(v, id, hashRecord, true);
2727+}
2828+2929+export type Main = Record;
+106
lex-gen/generated/types/app/bsky/feed/post.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66+import type * as AppBskyRichtextFacet from "../richtext/facet.ts";
77+import type * as AppBskyEmbedImages from "../embed/images.ts";
88+import type * as AppBskyEmbedVideo from "../embed/video.ts";
99+import type * as AppBskyEmbedExternal from "../embed/external.ts";
1010+import type * as AppBskyEmbedRecord from "../embed/record.ts";
1111+import type * as AppBskyEmbedRecordWithMedia from "../embed/recordWithMedia.ts";
1212+import type * as ComAtprotoLabelDefs from "@example/lexicons";
1313+import type * as ComAtprotoRepoStrongRef from "@example/lexicons";
1414+1515+const is$typed = _is$typed, validate = _validate;
1616+const id = "app.bsky.feed.post";
1717+1818+export interface Record {
1919+ $type: "app.bsky.feed.post";
2020+ /** The primary post content. May be an empty string, if there are embeds. */
2121+ text: string;
2222+ /** DEPRECATED: replaced by app.bsky.richtext.facet. */
2323+ entities?: (Entity)[];
2424+ /** Annotations of text (mentions, URLs, hashtags, etc) */
2525+ facets?: (AppBskyRichtextFacet.Main)[];
2626+ reply?: ReplyRef;
2727+ embed?:
2828+ | $Typed<AppBskyEmbedImages.Main>
2929+ | $Typed<AppBskyEmbedVideo.Main>
3030+ | $Typed<AppBskyEmbedExternal.Main>
3131+ | $Typed<AppBskyEmbedRecord.Main>
3232+ | $Typed<AppBskyEmbedRecordWithMedia.Main>
3333+ | { $type: string };
3434+ /** Indicates human language of post primary text content. */
3535+ langs?: (string)[];
3636+ labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
3737+ /** Additional hashtags, in addition to any included in post text and facets. */
3838+ tags?: (string)[];
3939+ /** Client-declared timestamp when this post was originally created. */
4040+ createdAt: string;
4141+ [k: string]: unknown;
4242+}
4343+4444+const hashRecord = "main";
4545+4646+export function isRecord<V>(v: V) {
4747+ return is$typed(v, id, hashRecord);
4848+}
4949+5050+export function validateRecord<V>(v: V) {
5151+ return validate<Record & V>(v, id, hashRecord, true);
5252+}
5353+5454+export type Main = Record;
5555+5656+export interface ReplyRef {
5757+ $type?: "app.bsky.feed.post#replyRef";
5858+ root: ComAtprotoRepoStrongRef.Main;
5959+ parent: ComAtprotoRepoStrongRef.Main;
6060+}
6161+6262+const hashReplyRef = "replyRef";
6363+6464+export function isReplyRef<V>(v: V) {
6565+ return is$typed(v, id, hashReplyRef);
6666+}
6767+6868+export function validateReplyRef<V>(v: V) {
6969+ return validate<ReplyRef & V>(v, id, hashReplyRef);
7070+}
7171+7272+/** Deprecated: use facets instead. */
7373+export interface Entity {
7474+ $type?: "app.bsky.feed.post#entity";
7575+ index: TextSlice;
7676+ /** Expected values are 'mention' and 'link'. */
7777+ type: string;
7878+ value: string;
7979+}
8080+8181+const hashEntity = "entity";
8282+8383+export function isEntity<V>(v: V) {
8484+ return is$typed(v, id, hashEntity);
8585+}
8686+8787+export function validateEntity<V>(v: V) {
8888+ return validate<Entity & V>(v, id, hashEntity);
8989+}
9090+9191+/** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. */
9292+export interface TextSlice {
9393+ $type?: "app.bsky.feed.post#textSlice";
9494+ start: number;
9595+ end: number;
9696+}
9797+9898+const hashTextSlice = "textSlice";
9999+100100+export function isTextSlice<V>(v: V) {
101101+ return is$typed(v, id, hashTextSlice);
102102+}
103103+104104+export function validateTextSlice<V>(v: V) {
105105+ return validate<TextSlice & V>(v, id, hashTextSlice);
106106+}
+47
lex-gen/generated/types/app/bsky/feed/postgate.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66+77+const is$typed = _is$typed, validate = _validate;
88+const id = "app.bsky.feed.postgate";
99+1010+export interface Record {
1111+ $type: "app.bsky.feed.postgate";
1212+ createdAt: string;
1313+ /** Reference (AT-URI) to the post record. */
1414+ post: string;
1515+ /** List of AT-URIs embedding this post that the author has detached from. */
1616+ detachedEmbeddingUris?: (string)[];
1717+ /** 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. */
1818+ embeddingRules?: ($Typed<DisableRule> | { $type: string })[];
1919+ [k: string]: unknown;
2020+}
2121+2222+const hashRecord = "main";
2323+2424+export function isRecord<V>(v: V) {
2525+ return is$typed(v, id, hashRecord);
2626+}
2727+2828+export function validateRecord<V>(v: V) {
2929+ return validate<Record & V>(v, id, hashRecord, true);
3030+}
3131+3232+export type Main = Record;
3333+3434+/** Disables embedding of this post. */
3535+export interface DisableRule {
3636+ $type?: "app.bsky.feed.postgate#disableRule";
3737+}
3838+3939+const hashDisableRule = "disableRule";
4040+4141+export function isDisableRule<V>(v: V) {
4242+ return is$typed(v, id, hashDisableRule);
4343+}
4444+4545+export function validateDisableRule<V>(v: V) {
4646+ return validate<DisableRule & V>(v, id, hashDisableRule);
4747+}
+29
lex-gen/generated/types/app/bsky/feed/repost.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { is$typed as _is$typed } from "../../../../util.ts";
66+import type * as ComAtprotoRepoStrongRef from "@example/lexicons";
77+88+const is$typed = _is$typed, validate = _validate;
99+const id = "app.bsky.feed.repost";
1010+1111+export interface Record {
1212+ $type: "app.bsky.feed.repost";
1313+ subject: ComAtprotoRepoStrongRef.Main;
1414+ createdAt: string;
1515+ via?: ComAtprotoRepoStrongRef.Main;
1616+ [k: string]: unknown;
1717+}
1818+1919+const hashRecord = "main";
2020+2121+export function isRecord<V>(v: V) {
2222+ return is$typed(v, id, hashRecord);
2323+}
2424+2525+export function validateRecord<V>(v: V) {
2626+ return validate<Record & V>(v, id, hashRecord, true);
2727+}
2828+2929+export type Main = Record;
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyFeedDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
99+ q: string;
1010+ /** Specifies the ranking order of results. */
1111+ sort?: "top" | "latest" | (string & globalThis.Record<PropertyKey, never>);
1212+ /** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). */
1313+ since?: string;
1414+ /** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). */
1515+ until?: string;
1616+ /** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. */
1717+ mentions?: string;
1818+ /** Filter to posts by the given account. Handles are resolved to DID before query-time. */
1919+ author?: string;
2020+ /** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. */
2121+ lang?: string;
2222+ /** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. */
2323+ domain?: string;
2424+ /** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. */
2525+ url?: string;
2626+ /** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. */
2727+ tag?: string[];
2828+ limit?: number;
2929+ /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
3030+ cursor?: string;
3131+};
3232+export type InputSchema = undefined;
3333+3434+export interface OutputSchema {
3535+ cursor?: string;
3636+ /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
3737+ hitsTotal?: number;
3838+ posts: (AppBskyFeedDefs.PostView)[];
3939+}
4040+4141+export interface CallOptions {
4242+ signal?: AbortSignal;
4343+ headers?: HeadersMap;
4444+}
4545+4646+export interface Response {
4747+ success: boolean;
4848+ headers: HeadersMap;
4949+ data: OutputSchema;
5050+}
5151+5252+export class BadQueryStringError extends XRPCError {
5353+ constructor(src: XRPCError) {
5454+ super(src.status, src.error, src.message, src.headers, { cause: src });
5555+ }
5656+}
5757+5858+export function toKnownErr(e: any) {
5959+ if (e instanceof XRPCError) {
6060+ if (e.error === "BadQueryString") return new BadQueryStringError(e);
6161+ }
6262+6363+ return e;
6464+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { is$typed as _is$typed } from "../../../../util.ts";
66+77+const is$typed = _is$typed, validate = _validate;
88+const id = "app.bsky.graph.verification";
99+1010+export interface Record {
1111+ $type: "app.bsky.graph.verification";
1212+ /** DID of the subject the verification applies to. */
1313+ subject: string;
1414+ /** Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. */
1515+ handle: string;
1616+ /** Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. */
1717+ displayName: string;
1818+ /** Date of when the verification was created. */
1919+ createdAt: string;
2020+ [k: string]: unknown;
2121+}
2222+2323+const hashRecord = "main";
2424+2525+export function isRecord<V>(v: V) {
2626+ return is$typed(v, id, hashRecord);
2727+}
2828+2929+export function validateRecord<V>(v: V) {
3030+ return validate<Record & V>(v, id, hashRecord, true);
3131+}
3232+3333+export type Main = Record;
+93
lex-gen/generated/types/app/bsky/labeler/defs.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { is$typed as _is$typed } from "../../../../util.ts";
66+import type * as AppBskyActorDefs from "../actor/defs.ts";
77+import type * as ComAtprotoLabelDefs from "@example/lexicons";
88+import type * as ComAtprotoModerationDefs from "@example/lexicons";
99+1010+const is$typed = _is$typed, validate = _validate;
1111+const id = "app.bsky.labeler.defs";
1212+1313+export interface LabelerView {
1414+ $type?: "app.bsky.labeler.defs#labelerView";
1515+ uri: string;
1616+ cid: string;
1717+ creator: AppBskyActorDefs.ProfileView;
1818+ likeCount?: number;
1919+ viewer?: LabelerViewerState;
2020+ indexedAt: string;
2121+ labels?: (ComAtprotoLabelDefs.Label)[];
2222+}
2323+2424+const hashLabelerView = "labelerView";
2525+2626+export function isLabelerView<V>(v: V) {
2727+ return is$typed(v, id, hashLabelerView);
2828+}
2929+3030+export function validateLabelerView<V>(v: V) {
3131+ return validate<LabelerView & V>(v, id, hashLabelerView);
3232+}
3333+3434+export interface LabelerViewDetailed {
3535+ $type?: "app.bsky.labeler.defs#labelerViewDetailed";
3636+ uri: string;
3737+ cid: string;
3838+ creator: AppBskyActorDefs.ProfileView;
3939+ policies: LabelerPolicies;
4040+ likeCount?: number;
4141+ viewer?: LabelerViewerState;
4242+ indexedAt: string;
4343+ labels?: (ComAtprotoLabelDefs.Label)[];
4444+ /** The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. */
4545+ reasonTypes?: (ComAtprotoModerationDefs.ReasonType)[];
4646+ /** The set of subject types (account, record, etc) this service accepts reports on. */
4747+ subjectTypes?: (ComAtprotoModerationDefs.SubjectType)[];
4848+ /** Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. */
4949+ subjectCollections?: (string)[];
5050+}
5151+5252+const hashLabelerViewDetailed = "labelerViewDetailed";
5353+5454+export function isLabelerViewDetailed<V>(v: V) {
5555+ return is$typed(v, id, hashLabelerViewDetailed);
5656+}
5757+5858+export function validateLabelerViewDetailed<V>(v: V) {
5959+ return validate<LabelerViewDetailed & V>(v, id, hashLabelerViewDetailed);
6060+}
6161+6262+export interface LabelerViewerState {
6363+ $type?: "app.bsky.labeler.defs#labelerViewerState";
6464+ like?: string;
6565+}
6666+6767+const hashLabelerViewerState = "labelerViewerState";
6868+6969+export function isLabelerViewerState<V>(v: V) {
7070+ return is$typed(v, id, hashLabelerViewerState);
7171+}
7272+7373+export function validateLabelerViewerState<V>(v: V) {
7474+ return validate<LabelerViewerState & V>(v, id, hashLabelerViewerState);
7575+}
7676+7777+export interface LabelerPolicies {
7878+ $type?: "app.bsky.labeler.defs#labelerPolicies";
7979+ /** The label values which this labeler publishes. May include global or custom labels. */
8080+ labelValues: (ComAtprotoLabelDefs.LabelValue)[];
8181+ /** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. */
8282+ labelValueDefinitions?: (ComAtprotoLabelDefs.LabelValueDefinition)[];
8383+}
8484+8585+const hashLabelerPolicies = "labelerPolicies";
8686+8787+export function isLabelerPolicies<V>(v: V) {
8888+ return is$typed(v, id, hashLabelerPolicies);
8989+}
9090+9191+export function validateLabelerPolicies<V>(v: V) {
9292+ return validate<LabelerPolicies & V>(v, id, hashLabelerPolicies);
9393+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66+import type * as AppBskyLabelerDefs from "./defs.ts";
77+import type * as ComAtprotoLabelDefs from "@example/lexicons";
88+import type * as ComAtprotoModerationDefs from "@example/lexicons";
99+1010+const is$typed = _is$typed, validate = _validate;
1111+const id = "app.bsky.labeler.service";
1212+1313+export interface Record {
1414+ $type: "app.bsky.labeler.service";
1515+ policies: AppBskyLabelerDefs.LabelerPolicies;
1616+ labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
1717+ createdAt: string;
1818+ /** The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. */
1919+ reasonTypes?: (ComAtprotoModerationDefs.ReasonType)[];
2020+ /** The set of subject types (account, record, etc) this service accepts reports on. */
2121+ subjectTypes?: (ComAtprotoModerationDefs.SubjectType)[];
2222+ /** Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. */
2323+ subjectCollections?: (string)[];
2424+ [k: string]: unknown;
2525+}
2626+2727+const hashRecord = "main";
2828+2929+export function isRecord<V>(v: V) {
3030+ return is$typed(v, id, hashRecord);
3131+}
3232+3333+export function validateRecord<V>(v: V) {
3434+ return validate<Record & V>(v, id, hashRecord, true);
3535+}
3636+3737+export type Main = Record;
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { validate as _validate } from "../../../../lexicons.ts";
55+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66+77+const is$typed = _is$typed, validate = _validate;
88+const id = "app.bsky.richtext.facet";
99+1010+/** Annotation of a sub-string within rich text. */
1111+export interface Main {
1212+ $type?: "app.bsky.richtext.facet";
1313+ index: ByteSlice;
1414+ features:
1515+ ($Typed<Mention> | $Typed<Link> | $Typed<Tag> | { $type: string })[];
1616+}
1717+1818+const hashMain = "main";
1919+2020+export function isMain<V>(v: V) {
2121+ return is$typed(v, id, hashMain);
2222+}
2323+2424+export function validateMain<V>(v: V) {
2525+ return validate<Main & V>(v, id, hashMain);
2626+}
2727+2828+/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */
2929+export interface Mention {
3030+ $type?: "app.bsky.richtext.facet#mention";
3131+ did: string;
3232+}
3333+3434+const hashMention = "mention";
3535+3636+export function isMention<V>(v: V) {
3737+ return is$typed(v, id, hashMention);
3838+}
3939+4040+export function validateMention<V>(v: V) {
4141+ return validate<Mention & V>(v, id, hashMention);
4242+}
4343+4444+/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */
4545+export interface Link {
4646+ $type?: "app.bsky.richtext.facet#link";
4747+ uri: string;
4848+}
4949+5050+const hashLink = "link";
5151+5252+export function isLink<V>(v: V) {
5353+ return is$typed(v, id, hashLink);
5454+}
5555+5656+export function validateLink<V>(v: V) {
5757+ return validate<Link & V>(v, id, hashLink);
5858+}
5959+6060+/** 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'). */
6161+export interface Tag {
6262+ $type?: "app.bsky.richtext.facet#tag";
6363+ tag: string;
6464+}
6565+6666+const hashTag = "tag";
6767+6868+export function isTag<V>(v: V) {
6969+ return is$typed(v, id, hashTag);
7070+}
7171+7272+export function validateTag<V>(v: V) {
7373+ return validate<Tag & V>(v, id, hashTag);
7474+}
7575+7676+/** 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. */
7777+export interface ByteSlice {
7878+ $type?: "app.bsky.richtext.facet#byteSlice";
7979+ byteStart: number;
8080+ byteEnd: number;
8181+}
8282+8383+const hashByteSlice = "byteSlice";
8484+8585+export function isByteSlice<V>(v: V) {
8686+ return is$typed(v, id, hashByteSlice);
8787+}
8888+8989+export function validateByteSlice<V>(v: V) {
9090+ return validate<ByteSlice & V>(v, id, hashByteSlice);
9191+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import { validate as _validate } from "../../../../lexicons.ts";
66+import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
77+import type * as AppBskyFeedDefs from "../feed/defs.ts";
88+import type * as AppBskyUnspeccedDefs from "./defs.ts";
99+1010+const is$typed = _is$typed, validate = _validate;
1111+const id = "app.bsky.unspecced.getPostThreadV2";
1212+1313+export type QueryParams = {
1414+ /** Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post. */
1515+ anchor: string;
1616+ /** Whether to include parents above the anchor. */
1717+ above?: boolean;
1818+ /** How many levels of replies to include below the anchor. */
1919+ below?: number;
2020+ /** Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated). */
2121+ branchingFactor?: number;
2222+ /** Sorting for the thread replies. */
2323+ sort?:
2424+ | "newest"
2525+ | "oldest"
2626+ | "top"
2727+ | (string & globalThis.Record<PropertyKey, never>);
2828+};
2929+export type InputSchema = undefined;
3030+3131+export interface OutputSchema {
3232+ /** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
3333+ thread: (ThreadItem)[];
3434+ threadgate?: AppBskyFeedDefs.ThreadgateView;
3535+ /** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
3636+ hasOtherReplies: boolean;
3737+}
3838+3939+export interface CallOptions {
4040+ signal?: AbortSignal;
4141+ headers?: HeadersMap;
4242+}
4343+4444+export interface Response {
4545+ success: boolean;
4646+ headers: HeadersMap;
4747+ data: OutputSchema;
4848+}
4949+5050+export function toKnownErr(e: any) {
5151+ return e;
5252+}
5353+5454+export interface ThreadItem {
5555+ $type?: "app.bsky.unspecced.getPostThreadV2#threadItem";
5656+ uri: string;
5757+ /** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
5858+ depth: number;
5959+ value:
6060+ | $Typed<AppBskyUnspeccedDefs.ThreadItemPost>
6161+ | $Typed<AppBskyUnspeccedDefs.ThreadItemNoUnauthenticated>
6262+ | $Typed<AppBskyUnspeccedDefs.ThreadItemNotFound>
6363+ | $Typed<AppBskyUnspeccedDefs.ThreadItemBlocked>
6464+ | { $type: string };
6565+}
6666+6767+const hashThreadItem = "threadItem";
6868+6969+export function isThreadItem<V>(v: V) {
7070+ return is$typed(v, id, hashThreadItem);
7171+}
7272+7373+export function validateThreadItem<V>(v: V) {
7474+ return validate<ThreadItem & V>(v, id, hashThreadItem);
7575+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyUnspeccedDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
99+ viewer?: string;
1010+ limit?: number;
1111+ cursor?: string;
1212+ /** DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer. */
1313+ relativeToDid?: string;
1414+};
1515+export type InputSchema = undefined;
1616+1717+export interface OutputSchema {
1818+ cursor?: string;
1919+ actors: (AppBskyUnspeccedDefs.SkeletonSearchActor)[];
2020+ /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
2121+ relativeToDid?: string;
2222+ /** Snowflake for this recommendation, use when submitting recommendation events. */
2323+ recId?: number;
2424+}
2525+2626+export interface CallOptions {
2727+ signal?: AbortSignal;
2828+ headers?: HeadersMap;
2929+}
3030+3131+export interface Response {
3232+ success: boolean;
3333+ headers: HeadersMap;
3434+ data: OutputSchema;
3535+}
3636+3737+export function toKnownErr(e: any) {
3838+ return e;
3939+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyUnspeccedDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax. */
99+ q: string;
1010+ /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
1111+ viewer?: string;
1212+ /** If true, acts as fast/simple 'typeahead' query. */
1313+ typeahead?: boolean;
1414+ limit?: number;
1515+ /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
1616+ cursor?: string;
1717+};
1818+export type InputSchema = undefined;
1919+2020+export interface OutputSchema {
2121+ cursor?: string;
2222+ /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
2323+ hitsTotal?: number;
2424+ actors: (AppBskyUnspeccedDefs.SkeletonSearchActor)[];
2525+}
2626+2727+export interface CallOptions {
2828+ signal?: AbortSignal;
2929+ headers?: HeadersMap;
3030+}
3131+3232+export interface Response {
3333+ success: boolean;
3434+ headers: HeadersMap;
3535+ data: OutputSchema;
3636+}
3737+3838+export class BadQueryStringError extends XRPCError {
3939+ constructor(src: XRPCError) {
4040+ super(src.status, src.error, src.message, src.headers, { cause: src });
4141+ }
4242+}
4343+4444+export function toKnownErr(e: any) {
4545+ if (e instanceof XRPCError) {
4646+ if (e.error === "BadQueryString") return new BadQueryStringError(e);
4747+ }
4848+4949+ return e;
5050+}
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { HeadersMap, XRPCError } from "@atp/xrpc";
55+import type * as AppBskyUnspeccedDefs from "./defs.ts";
66+77+export type QueryParams = {
88+ /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
99+ q: string;
1010+ /** Specifies the ranking order of results. */
1111+ sort?: "top" | "latest" | (string & globalThis.Record<PropertyKey, never>);
1212+ /** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). */
1313+ since?: string;
1414+ /** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). */
1515+ until?: string;
1616+ /** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. */
1717+ mentions?: string;
1818+ /** Filter to posts by the given account. Handles are resolved to DID before query-time. */
1919+ author?: string;
2020+ /** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. */
2121+ lang?: string;
2222+ /** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. */
2323+ domain?: string;
2424+ /** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. */
2525+ url?: string;
2626+ /** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. */
2727+ tag?: string[];
2828+ /** DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. */
2929+ viewer?: string;
3030+ limit?: number;
3131+ /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
3232+ cursor?: string;
3333+};
3434+export type InputSchema = undefined;
3535+3636+export interface OutputSchema {
3737+ cursor?: string;
3838+ /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
3939+ hitsTotal?: number;
4040+ posts: (AppBskyUnspeccedDefs.SkeletonSearchPost)[];
4141+}
4242+4343+export interface CallOptions {
4444+ signal?: AbortSignal;
4545+ headers?: HeadersMap;
4646+}
4747+4848+export interface Response {
4949+ success: boolean;
5050+ headers: HeadersMap;
5151+ data: OutputSchema;
5252+}
5353+5454+export class BadQueryStringError extends XRPCError {
5555+ constructor(src: XRPCError) {
5656+ super(src.status, src.error, src.message, src.headers, { cause: src });
5757+ }
5858+}
5959+6060+export function toKnownErr(e: any) {
6161+ if (e instanceof XRPCError) {
6262+ if (e.error === "BadQueryString") return new BadQueryStringError(e);
6363+ }
6464+6565+ return e;
6666+}