···1616import searchActors from "./so/sprk/actor/searchActors.ts";
1717import getRecord from "./com/atproto/repo/getRecord.ts";
1818import resolveHandle from "./com/atproto/identity/resolveHandle.ts";
1919-import getStories from "./so/sprk/feed/getStories.ts";
2020-import getStoriesTimeline from "./so/sprk/feed/getStoriesTimeline.ts";
1919+import getStories from "./so/sprk/story/getStories.ts";
2020+import getStoriesTimeline from "./so/sprk/story/getTimeline.ts";
2121import getProfiles from "./so/sprk/actor/getProfiles.ts";
2222import searchPosts from "./so/sprk/feed/searchPosts.ts";
2323import getActorAudios from "./so/sprk/sound/getActorAudios.ts";
+6-22
api/so/sprk/feed/getAuthorFeed.ts
···33import { AppContext } from "../../../../context.ts";
44import { DataPlane } from "../../../../data-plane/index.ts";
55import { Actor } from "../../../../hydration/actor.ts";
66-import { FeedItem, Post } from "../../../../hydration/feed.ts";
66+import { FeedItem } from "../../../../hydration/feed.ts";
77import {
88 HydrateCtx,
99 HydrationState,
···130130}): Skeleton => {
131131 const { ctx, skeleton, hydration } = inputs;
132132 const relationship = hydration.profileViewers?.get(skeleton.actor.did);
133133- if (
134134- relationship &&
135135- (relationship.blocking)
136136- ) {
133133+ if (relationship && relationship.blocking) {
137134 throw new InvalidRequestError(
138135 `Requester has blocked actor: ${skeleton.actor.did}`,
139136 "BlockedActor",
140137 );
141138 }
142142- if (
143143- relationship &&
144144- (relationship.blockedBy)
145145- ) {
139139+ if (relationship && relationship.blockedBy) {
146140 throw new InvalidRequestError(
147141 `Requester is blocked by actor: ${skeleton.actor.did}`,
148142 "BlockedByActor",
···233227 loop.add(uri);
234228 }
235229 // cache through the result
236236- const result = this._ok(uri, loop);
230230+ const result = this._ok(uri);
237231 this.cache.set(uri, result);
238232 return result;
239233 }
240234241241- private _ok(uri: string, loop: Set<string>): boolean {
235235+ private _ok(uri: string): boolean {
242236 // must be in the feed to be in a self-thread
243237 if (!this.feedUris.has(uri)) {
244238 return false;
···248242 if (!post) {
249243 return false;
250244 }
251251- // root posts (no parent) are trivial case of self-thread
252252- const parentUri = getParentUri(post);
253253- if (parentUri === null) {
254254- return true;
255255- }
256256- // recurse w/ cache: this post is in a self-thread if its parent is.
257257- return this.ok(parentUri, loop);
245245+ return true;
258246 }
259247}
260260-261261-function getParentUri(post: Post) {
262262- return post.record.reply?.parent.uri ?? null;
263263-}
···55import { is$typed as _is$typed } from "../../../../util.ts";
6677const is$typed = _is$typed, validate = _validate;
88-const id = "so.sprk.embed.defs";
88+const id = "so.sprk.media.defs";
991010/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */
1111export interface AspectRatio {
1212- $type?: "so.sprk.embed.defs#aspectRatio";
1212+ $type?: "so.sprk.media.defs#aspectRatio";
1313 width: number;
1414 height: number;
1515}
-79
lex/types/so/sprk/embed/images.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import { BlobRef } from "@atp/lexicon";
55-import { validate as _validate } from "../../../../lexicons.ts";
66-import { is$typed as _is$typed } from "../../../../util.ts";
77-import type * as SoSprkEmbedDefs from "./defs.ts";
88-99-const is$typed = _is$typed, validate = _validate;
1010-const id = "so.sprk.embed.images";
1111-1212-export interface Main {
1313- $type?: "so.sprk.embed.images";
1414- images: (Image)[];
1515-}
1616-1717-const hashMain = "main";
1818-1919-export function isMain<V>(v: V) {
2020- return is$typed(v, id, hashMain);
2121-}
2222-2323-export function validateMain<V>(v: V) {
2424- return validate<Main & V>(v, id, hashMain);
2525-}
2626-2727-export interface Image {
2828- $type?: "so.sprk.embed.images#image";
2929- image: BlobRef;
3030- /** Alt text description of the image, for accessibility. */
3131- alt: string;
3232- aspectRatio?: SoSprkEmbedDefs.AspectRatio;
3333-}
3434-3535-const hashImage = "image";
3636-3737-export function isImage<V>(v: V) {
3838- return is$typed(v, id, hashImage);
3939-}
4040-4141-export function validateImage<V>(v: V) {
4242- return validate<Image & V>(v, id, hashImage);
4343-}
4444-4545-export interface View {
4646- $type?: "so.sprk.embed.images#view";
4747- images: (ViewImage)[];
4848-}
4949-5050-const hashView = "view";
5151-5252-export function isView<V>(v: V) {
5353- return is$typed(v, id, hashView);
5454-}
5555-5656-export function validateView<V>(v: V) {
5757- return validate<View & V>(v, id, hashView);
5858-}
5959-6060-export interface ViewImage {
6161- $type?: "so.sprk.embed.images#viewImage";
6262- /** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. */
6363- thumb: string;
6464- /** 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. */
6565- fullsize: string;
6666- /** Alt text description of the image, for accessibility. */
6767- alt: string;
6868- aspectRatio?: SoSprkEmbedDefs.AspectRatio;
6969-}
7070-7171-const hashViewImage = "viewImage";
7272-7373-export function isViewImage<V>(v: V) {
7474- return is$typed(v, id, hashViewImage);
7575-}
7676-7777-export function validateViewImage<V>(v: V) {
7878- return validate<ViewImage & V>(v, id, hashViewImage);
7979-}
···11/**
22 * GENERATED CODE - DO NOT MODIFY
33 */
44-import type * as SoSprkFeedDefs from "./defs.ts";
44+import type * as SoSprkStoryDefs from "./defs.ts";
5566export type QueryParams = {
77 /** List of story AT-URIs to return hydrated views for. */
···1010export type InputSchema = undefined;
11111212export interface OutputSchema {
1313- stories: (SoSprkFeedDefs.StoryView)[];
1313+ stories: (SoSprkStoryDefs.StoryView)[];
1414}
15151616export type HandlerInput = void;
-30
lex/types/so/sprk/feed/getStoriesTimeline.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkFeedDefs from "./defs.ts";
55-66-export type QueryParams = {
77- limit: number;
88- cursor?: string;
99-};
1010-export type InputSchema = undefined;
1111-1212-export interface OutputSchema {
1313- cursor?: string;
1414- storiesByAuthor: (SoSprkFeedDefs.StoriesByAuthor)[];
1515-}
1616-1717-export type HandlerInput = void;
1818-1919-export interface HandlerSuccess {
2020- encoding: "application/json";
2121- body: OutputSchema;
2222- headers?: { [key: string]: string };
2323-}
2424-2525-export interface HandlerError {
2626- status: number;
2727- message?: string;
2828-}
2929-3030-export type HandlerOutput = HandlerError | HandlerSuccess;
-49
lex/types/so/sprk/feed/music.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import { BlobRef } from "@atp/lexicon";
55-import { validate as _validate } from "../../../../lexicons.ts";
66-import { is$typed as _is$typed } from "../../../../util.ts";
77-import { type $Typed } from "../../../../util.ts";
88-import type * as SoSprkRichtextFacet from "../richtext/facet.ts";
99-import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
1010-1111-const is$typed = _is$typed, validate = _validate;
1212-const id = "so.sprk.feed.music";
1313-1414-export interface Record {
1515- $type: "so.sprk.feed.music";
1616- sound: BlobRef;
1717- /** The music's title. */
1818- title: string;
1919- releaseDate: string;
2020- /** The music's album name. */
2121- album?: string;
2222- /** The music's record label. */
2323- recordLabel?: string;
2424- /** Image to be displayed in music's page. AKA, 'cover image' */
2525- cover?: BlobRef;
2626- /** The music's author. */
2727- author: string;
2828- /** The music's description. */
2929- text?: string;
3030- copyright?: (string)[];
3131- /** Annotations of text (mentions, URLs, hashtags, etc) */
3232- facets?: (SoSprkRichtextFacet.Main)[];
3333- labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
3434- /** The music's Hashtags */
3535- tags?: (string)[];
3636- /** Client-declared timestamp when this post was originally created. */
3737- createdAt: string;
3838- [k: string]: unknown;
3939-}
4040-4141-const hashRecord = "main";
4242-4343-export function isRecord<V>(v: V) {
4444- return is$typed(v, id, hashRecord);
4545-}
4646-4747-export function validateRecord<V>(v: V) {
4848- return validate<Record & V>(v, id, hashRecord, true);
4949-}
+16-18
lex/types/so/sprk/feed/post.ts
···44import { validate as _validate } from "../../../../lexicons.ts";
55import { is$typed as _is$typed } from "../../../../util.ts";
66import { type $Typed } from "../../../../util.ts";
77-import type * as SoSprkRichtextFacet from "../richtext/facet.ts";
88-import type * as SoSprkEmbedImages from "../embed/images.ts";
99-import type * as SoSprkEmbedVideo from "../embed/video.ts";
77+import type * as SoSprkMediaImages from "../media/images.ts";
88+import type * as SoSprkMediaVideo from "../media/video.ts";
109import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
1110import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
1111+import type * as SoSprkRichtextFacet from "../richtext/facet.ts";
12121313const is$typed = _is$typed, validate = _validate;
1414const id = "so.sprk.feed.post";
15151616export interface Record {
1717 $type: "so.sprk.feed.post";
1818- /** The post description. */
1919- text?: string;
2020- /** Annotations of text (mentions, URLs, hashtags, etc) */
2121- facets?: (SoSprkRichtextFacet.Main)[];
2222- reply?: ReplyRef;
2323- embed?: $Typed<SoSprkEmbedImages.Main> | $Typed<SoSprkEmbedVideo.Main> | {
1818+ caption?: CaptionRef;
1919+ media: $Typed<SoSprkMediaImages.Main> | $Typed<SoSprkMediaVideo.Main> | {
2420 $type: string;
2521 };
2622 sound?: ComAtprotoRepoStrongRef.Main;
···4440 return validate<Record & V>(v, id, hashRecord, true);
4541}
46424747-export interface ReplyRef {
4848- $type?: "so.sprk.feed.post#replyRef";
4949- root: ComAtprotoRepoStrongRef.Main;
5050- parent: ComAtprotoRepoStrongRef.Main;
4343+export interface CaptionRef {
4444+ $type?: "so.sprk.feed.post#captionRef";
4545+ /** The post description. */
4646+ text?: string;
4747+ /** Annotations of text (mentions, URLs, hashtags, etc) */
4848+ facets?: (SoSprkRichtextFacet.Main)[];
5149}
52505353-const hashReplyRef = "replyRef";
5151+const hashCaptionRef = "captionRef";
54525555-export function isReplyRef<V>(v: V) {
5656- return is$typed(v, id, hashReplyRef);
5353+export function isCaptionRef<V>(v: V) {
5454+ return is$typed(v, id, hashCaptionRef);
5755}
58565959-export function validateReplyRef<V>(v: V) {
6060- return validate<ReplyRef & V>(v, id, hashReplyRef);
5757+export function validateCaptionRef<V>(v: V) {
5858+ return validate<CaptionRef & V>(v, id, hashCaptionRef);
6159}
+55
lex/types/so/sprk/feed/reply.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 $Typed } from "../../../../util.ts";
77+import type * as SoSprkRichtextFacet from "../richtext/facet.ts";
88+import type * as SoSprkMediaImage from "../media/image.ts";
99+import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
1010+import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
1111+1212+const is$typed = _is$typed, validate = _validate;
1313+const id = "so.sprk.feed.reply";
1414+1515+export interface Record {
1616+ $type: "so.sprk.feed.reply";
1717+ /** The reply text. */
1818+ text?: string;
1919+ /** Annotations of text (mentions, URLs, hashtags, etc) */
2020+ facets?: (SoSprkRichtextFacet.Main)[];
2121+ reply: ReplyRef;
2222+ media?: $Typed<SoSprkMediaImage.Main> | { $type: string };
2323+ /** Indicates human language of post primary text content. */
2424+ langs?: (string)[];
2525+ labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
2626+ /** Client-declared timestamp when this post was originally created. */
2727+ createdAt: string;
2828+ [k: string]: unknown;
2929+}
3030+3131+const hashRecord = "main";
3232+3333+export function isRecord<V>(v: V) {
3434+ return is$typed(v, id, hashRecord);
3535+}
3636+3737+export function validateRecord<V>(v: V) {
3838+ return validate<Record & V>(v, id, hashRecord, true);
3939+}
4040+4141+export interface ReplyRef {
4242+ $type?: "so.sprk.feed.reply#replyRef";
4343+ root: ComAtprotoRepoStrongRef.Main;
4444+ parent: ComAtprotoRepoStrongRef.Main;
4545+}
4646+4747+const hashReplyRef = "replyRef";
4848+4949+export function isReplyRef<V>(v: V) {
5050+ return is$typed(v, id, hashReplyRef);
5151+}
5252+5353+export function validateReplyRef<V>(v: V) {
5454+ return validate<ReplyRef & V>(v, id, hashReplyRef);
5555+}
···44import { validate as _validate } from "../../../../lexicons.ts";
55import { is$typed as _is$typed } from "../../../../util.ts";
66import { type $Typed } from "../../../../util.ts";
77-import type * as SoSprkEmbedImages from "../embed/images.ts";
88-import type * as SoSprkEmbedVideo from "../embed/video.ts";
77+import type * as SoSprkMediaImage from "../media/image.ts";
88+import type * as SoSprkMediaVideo from "../media/video.ts";
99import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
1010import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
11111212const is$typed = _is$typed, validate = _validate;
1313-const id = "so.sprk.feed.story";
1313+const id = "so.sprk.story.post";
14141515export interface Record {
1616- $type: "so.sprk.feed.story";
1717- media: $Typed<SoSprkEmbedImages.Main> | $Typed<SoSprkEmbedVideo.Main> | {
1616+ $type: "so.sprk.story.post";
1717+ media: $Typed<SoSprkMediaImage.Main> | $Typed<SoSprkMediaVideo.Main> | {
1818 $type: string;
1919 };
2020 sound?: ComAtprotoRepoStrongRef.Main;
2121 labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
2222- /** Additional hashtags, in addition to any included in story text and facets. */
2323- tags?: (string)[];
2422 /** Client-declared timestamp when this story was originally created. */
2523 createdAt: string;
2624 [k: string]: unknown;
+4-23
lex/types/so/sprk/feed/threadgate.ts
···1313 /** Reference (AT-URI) to the post record. */
1414 post: string;
1515 /** 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. */
1616- allow?: (
1717- | $Typed<MentionRule>
1818- | $Typed<FollowerRule>
1919- | $Typed<FollowingRule>
2020- | $Typed<ListRule>
2121- | { $type: string }
2222- )[];
1616+ allow?:
1717+ ($Typed<MentionRule> | $Typed<FollowerRule> | $Typed<FollowingRule> | {
1818+ $type: string;
1919+ })[];
2320 createdAt: string;
2421 /** List of hidden reply URIs. */
2522 hiddenReplies?: (string)[];
···8077export function validateFollowingRule<V>(v: V) {
8178 return validate<FollowingRule & V>(v, id, hashFollowingRule);
8279}
8383-8484-/** Allow replies from actors on a list. */
8585-export interface ListRule {
8686- $type?: "so.sprk.feed.threadgate#listRule";
8787- list: string;
8888-}
8989-9090-const hashListRule = "listRule";
9191-9292-export function isListRule<V>(v: V) {
9393- return is$typed(v, id, hashListRule);
9494-}
9595-9696-export function validateListRule<V>(v: V) {
9797- return validate<ListRule & V>(v, id, hashListRule);
9898-}
-146
lex/types/so/sprk/graph/defs.ts
···33 */
44import { validate as _validate } from "../../../../lexicons.ts";
55import { is$typed as _is$typed } from "../../../../util.ts";
66-import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
77-import type * as SoSprkActorDefs from "../actor/defs.ts";
88-import type * as SoSprkRichtextFacet from "../richtext/facet.ts";
99-import type * as SoSprkFeedDefs from "../feed/defs.ts";
106117const is$typed = _is$typed, validate = _validate;
128const id = "so.sprk.graph.defs";
1313-1414-export interface ListViewBasic {
1515- $type?: "so.sprk.graph.defs#listViewBasic";
1616- uri: string;
1717- cid: string;
1818- name: string;
1919- purpose: ListPurpose;
2020- avatar?: string;
2121- listItemCount?: number;
2222- labels?: (ComAtprotoLabelDefs.Label)[];
2323- viewer?: ListViewerState;
2424- indexedAt?: string;
2525-}
2626-2727-const hashListViewBasic = "listViewBasic";
2828-2929-export function isListViewBasic<V>(v: V) {
3030- return is$typed(v, id, hashListViewBasic);
3131-}
3232-3333-export function validateListViewBasic<V>(v: V) {
3434- return validate<ListViewBasic & V>(v, id, hashListViewBasic);
3535-}
3636-3737-export interface ListView {
3838- $type?: "so.sprk.graph.defs#listView";
3939- uri: string;
4040- cid: string;
4141- creator: SoSprkActorDefs.ProfileView;
4242- name: string;
4343- purpose: ListPurpose;
4444- description?: string;
4545- descriptionFacets?: (SoSprkRichtextFacet.Main)[];
4646- avatar?: string;
4747- listItemCount?: number;
4848- labels?: (ComAtprotoLabelDefs.Label)[];
4949- viewer?: ListViewerState;
5050- indexedAt: string;
5151-}
5252-5353-const hashListView = "listView";
5454-5555-export function isListView<V>(v: V) {
5656- return is$typed(v, id, hashListView);
5757-}
5858-5959-export function validateListView<V>(v: V) {
6060- return validate<ListView & V>(v, id, hashListView);
6161-}
6262-6363-export interface ListItemView {
6464- $type?: "so.sprk.graph.defs#listItemView";
6565- uri: string;
6666- subject: SoSprkActorDefs.ProfileView;
6767-}
6868-6969-const hashListItemView = "listItemView";
7070-7171-export function isListItemView<V>(v: V) {
7272- return is$typed(v, id, hashListItemView);
7373-}
7474-7575-export function validateListItemView<V>(v: V) {
7676- return validate<ListItemView & V>(v, id, hashListItemView);
7777-}
7878-7979-export interface StarterPackView {
8080- $type?: "so.sprk.graph.defs#starterPackView";
8181- uri: string;
8282- cid: string;
8383- record: { [_ in string]: unknown };
8484- creator: SoSprkActorDefs.ProfileViewBasic;
8585- list?: ListViewBasic;
8686- listItemsSample?: (ListItemView)[];
8787- feeds?: (SoSprkFeedDefs.GeneratorView)[];
8888- joinedWeekCount?: number;
8989- joinedAllTimeCount?: number;
9090- labels?: (ComAtprotoLabelDefs.Label)[];
9191- indexedAt: string;
9292-}
9393-9494-const hashStarterPackView = "starterPackView";
9595-9696-export function isStarterPackView<V>(v: V) {
9797- return is$typed(v, id, hashStarterPackView);
9898-}
9999-100100-export function validateStarterPackView<V>(v: V) {
101101- return validate<StarterPackView & V>(v, id, hashStarterPackView);
102102-}
103103-104104-export interface StarterPackViewBasic {
105105- $type?: "so.sprk.graph.defs#starterPackViewBasic";
106106- uri: string;
107107- cid: string;
108108- record: { [_ in string]: unknown };
109109- creator: SoSprkActorDefs.ProfileViewBasic;
110110- listItemCount?: number;
111111- joinedWeekCount?: number;
112112- joinedAllTimeCount?: number;
113113- labels?: (ComAtprotoLabelDefs.Label)[];
114114- indexedAt: string;
115115-}
116116-117117-const hashStarterPackViewBasic = "starterPackViewBasic";
118118-119119-export function isStarterPackViewBasic<V>(v: V) {
120120- return is$typed(v, id, hashStarterPackViewBasic);
121121-}
122122-123123-export function validateStarterPackViewBasic<V>(v: V) {
124124- return validate<StarterPackViewBasic & V>(v, id, hashStarterPackViewBasic);
125125-}
126126-127127-export type ListPurpose =
128128- | "so.sprk.graph.defs#modlist"
129129- | "so.sprk.graph.defs#curatelist"
130130- | "so.sprk.graph.defs#referencelist"
131131- | (string & globalThis.Record<PropertyKey, never>);
132132-133133-/** A list of actors to apply an aggregate moderation action (mute/block) on. */
134134-export const MODLIST = `${id}#modlist`;
135135-/** A list of actors used for curation purposes such as list feeds or interaction gating. */
136136-export const CURATELIST = `${id}#curatelist`;
137137-/** A list of actors used for only for reference purposes such as within a starter pack. */
138138-export const REFERENCELIST = `${id}#referencelist`;
139139-140140-export interface ListViewerState {
141141- $type?: "so.sprk.graph.defs#listViewerState";
142142- muted?: boolean;
143143- blocked?: string;
144144-}
145145-146146-const hashListViewerState = "listViewerState";
147147-148148-export function isListViewerState<V>(v: V) {
149149- return is$typed(v, id, hashListViewerState);
150150-}
151151-152152-export function validateListViewerState<V>(v: V) {
153153- return validate<ListViewerState & V>(v, id, hashListViewerState);
154154-}
155915610/** indicates that a handle or DID could not be resolved */
15711export interface NotFoundActor {
-31
lex/types/so/sprk/graph/getActorStarterPacks.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkGraphDefs from "./defs.ts";
55-66-export type QueryParams = {
77- actor: string;
88- limit: number;
99- cursor?: string;
1010-};
1111-export type InputSchema = undefined;
1212-1313-export interface OutputSchema {
1414- cursor?: string;
1515- starterPacks: (SoSprkGraphDefs.StarterPackViewBasic)[];
1616-}
1717-1818-export type HandlerInput = void;
1919-2020-export interface HandlerSuccess {
2121- encoding: "application/json";
2222- body: OutputSchema;
2323- headers?: { [key: string]: string };
2424-}
2525-2626-export interface HandlerError {
2727- status: number;
2828- message?: string;
2929-}
3030-3131-export type HandlerOutput = HandlerError | HandlerSuccess;
-33
lex/types/so/sprk/graph/getList.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkGraphDefs from "./defs.ts";
55-66-export type QueryParams = {
77- /** Reference (AT-URI) of the list record to hydrate. */
88- list: string;
99- limit: number;
1010- cursor?: string;
1111-};
1212-export type InputSchema = undefined;
1313-1414-export interface OutputSchema {
1515- cursor?: string;
1616- list: SoSprkGraphDefs.ListView;
1717- items: (SoSprkGraphDefs.ListItemView)[];
1818-}
1919-2020-export type HandlerInput = void;
2121-2222-export interface HandlerSuccess {
2323- encoding: "application/json";
2424- body: OutputSchema;
2525- headers?: { [key: string]: string };
2626-}
2727-2828-export interface HandlerError {
2929- status: number;
3030- message?: string;
3131-}
3232-3333-export type HandlerOutput = HandlerError | HandlerSuccess;
-30
lex/types/so/sprk/graph/getListBlocks.ts
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkGraphDefs from "./defs.ts";
55-66-export type QueryParams = {
77- limit: number;
88- cursor?: string;
99-};
1010-export type InputSchema = undefined;
1111-1212-export interface OutputSchema {
1313- cursor?: string;
1414- lists: (SoSprkGraphDefs.ListView)[];
1515-}
1616-1717-export type HandlerInput = void;
1818-1919-export interface HandlerSuccess {
2020- encoding: "application/json";
2121- body: OutputSchema;
2222- headers?: { [key: string]: string };
2323-}
2424-2525-export interface HandlerError {
2626- status: number;
2727- message?: string;
2828-}
2929-3030-export type HandlerOutput = HandlerError | HandlerSuccess;
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { BlobRef } from "@atp/lexicon";
55+import { validate as _validate } from "../../../../lexicons.ts";
66+import { is$typed as _is$typed } from "../../../../util.ts";
77+import type * as SoSprkMediaDefs from "./defs.ts";
88+99+const is$typed = _is$typed, validate = _validate;
1010+const id = "so.sprk.media.image";
1111+1212+export interface Main {
1313+ $type?: "so.sprk.media.image";
1414+ image: BlobRef;
1515+ /** Alt text description of the image, for accessibility. */
1616+ alt: string;
1717+ aspectRatio?: SoSprkMediaDefs.AspectRatio;
1818+}
1919+2020+const hashMain = "main";
2121+2222+export function isMain<V>(v: V) {
2323+ return is$typed(v, id, hashMain);
2424+}
2525+2626+export function validateMain<V>(v: V) {
2727+ return validate<Main & V>(v, id, hashMain);
2828+}
2929+3030+export interface View {
3131+ $type?: "so.sprk.media.image#view";
3232+ /** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. */
3333+ thumb: string;
3434+ /** 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. */
3535+ fullsize: string;
3636+ /** Alt text description of the image, for accessibility. */
3737+ alt: string;
3838+ aspectRatio?: SoSprkMediaDefs.AspectRatio;
3939+}
4040+4141+const hashView = "view";
4242+4343+export function isView<V>(v: V) {
4444+ return is$typed(v, id, hashView);
4545+}
4646+4747+export function validateView<V>(v: V) {
4848+ return validate<View & V>(v, id, hashView);
4949+}
+39
lex/types/so/sprk/media/images.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 SoSprkMediaImage from "./image.ts";
77+88+const is$typed = _is$typed, validate = _validate;
99+const id = "so.sprk.media.images";
1010+1111+export interface Main {
1212+ $type?: "so.sprk.media.images";
1313+ images: (SoSprkMediaImage.Main)[];
1414+}
1515+1616+const hashMain = "main";
1717+1818+export function isMain<V>(v: V) {
1919+ return is$typed(v, id, hashMain);
2020+}
2121+2222+export function validateMain<V>(v: V) {
2323+ return validate<Main & V>(v, id, hashMain);
2424+}
2525+2626+export interface View {
2727+ $type?: "so.sprk.media.images#view";
2828+ images: (SoSprkMediaImage.View)[];
2929+}
3030+3131+const hashView = "view";
3232+3333+export function isView<V>(v: V) {
3434+ return is$typed(v, id, hashView);
3535+}
3636+3737+export function validateView<V>(v: V) {
3838+ return validate<View & V>(v, id, hashView);
3939+}
+75
lex/types/so/sprk/story/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 $Typed } from "../../../../util.ts";
77+import type * as SoSprkActorDefs from "../actor/defs.ts";
88+import type * as SoSprkMediaImage from "../media/image.ts";
99+import type * as SoSprkMediaVideo from "../media/video.ts";
1010+1111+const is$typed = _is$typed, validate = _validate;
1212+const id = "so.sprk.story.defs";
1313+1414+export interface StoryView {
1515+ $type?: "so.sprk.story.defs#storyView";
1616+ uri: string;
1717+ cid: string;
1818+ author: SoSprkActorDefs.ProfileViewBasic;
1919+ record: { [_ in string]: unknown };
2020+ media?: $Typed<SoSprkMediaImage.View> | $Typed<SoSprkMediaVideo.View> | {
2121+ $type: string;
2222+ };
2323+ indexedAt: string;
2424+}
2525+2626+const hashStoryView = "storyView";
2727+2828+export function isStoryView<V>(v: V) {
2929+ return is$typed(v, id, hashStoryView);
3030+}
3131+3232+export function validateStoryView<V>(v: V) {
3333+ return validate<StoryView & V>(v, id, hashStoryView);
3434+}
3535+3636+export interface StoriesByAuthor {
3737+ $type?: "so.sprk.story.defs#storiesByAuthor";
3838+ author: SoSprkActorDefs.ProfileViewBasic;
3939+ stories: (StoryView)[];
4040+}
4141+4242+const hashStoriesByAuthor = "storiesByAuthor";
4343+4444+export function isStoriesByAuthor<V>(v: V) {
4545+ return is$typed(v, id, hashStoriesByAuthor);
4646+}
4747+4848+export function validateStoriesByAuthor<V>(v: V) {
4949+ return validate<StoriesByAuthor & V>(v, id, hashStoriesByAuthor);
5050+}
5151+5252+export interface Interaction {
5353+ $type?: "so.sprk.story.defs#interaction";
5454+ item?: string;
5555+ event?:
5656+ | "so.sprk.feed.defs#clickthroughItem"
5757+ | "so.sprk.feed.defs#clickthroughAuthor"
5858+ | "so.sprk.feed.defs#clickthroughReposter"
5959+ | "so.sprk.feed.defs#clickthroughEmbed"
6060+ | "so.sprk.feed.defs#interactionSeen"
6161+ | "so.sprk.feed.defs#interactionLike"
6262+ | "so.sprk.feed.defs#interactionRepost"
6363+ | "so.sprk.feed.defs#interactionShare"
6464+ | (string & globalThis.Record<PropertyKey, never>);
6565+}
6666+6767+const hashInteraction = "interaction";
6868+6969+export function isInteraction<V>(v: V) {
7070+ return is$typed(v, id, hashInteraction);
7171+}
7272+7373+export function validateInteraction<V>(v: V) {
7474+ return validate<Interaction & V>(v, id, hashInteraction);
7575+}
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkUnspeccedDefs from "./defs.ts";
55-66-export type QueryParams = {
77- /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
88- viewer?: string;
99- limit: number;
1010- cursor?: string;
1111- /** DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer. */
1212- relativeToDid?: string;
1313-};
1414-export type InputSchema = undefined;
1515-1616-export interface OutputSchema {
1717- cursor?: string;
1818- actors: (SoSprkUnspeccedDefs.SkeletonSearchActor)[];
1919- /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
2020- relativeToDid?: string;
2121- /** Snowflake for this recommendation, use when submitting recommendation events. */
2222- recId?: number;
2323-}
2424-2525-export type HandlerInput = void;
2626-2727-export interface HandlerSuccess {
2828- encoding: "application/json";
2929- body: OutputSchema;
3030- headers?: { [key: string]: string };
3131-}
3232-3333-export interface HandlerError {
3434- status: number;
3535- message?: string;
3636-}
3737-3838-export type HandlerOutput = HandlerError | HandlerSuccess;
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkUnspeccedDefs from "./defs.ts";
55-66-export type QueryParams = {
77- /** 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. */
88- q: string;
99- /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
1010- viewer?: string;
1111- /** If true, acts as fast/simple 'typeahead' query. */
1212- typeahead?: boolean;
1313- limit: number;
1414- /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
1515- cursor?: string;
1616-};
1717-export type InputSchema = undefined;
1818-1919-export interface OutputSchema {
2020- cursor?: string;
2121- /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
2222- hitsTotal?: number;
2323- actors: (SoSprkUnspeccedDefs.SkeletonSearchActor)[];
2424-}
2525-2626-export type HandlerInput = void;
2727-2828-export interface HandlerSuccess {
2929- encoding: "application/json";
3030- body: OutputSchema;
3131- headers?: { [key: string]: string };
3232-}
3333-3434-export interface HandlerError {
3535- status: number;
3636- message?: string;
3737- error?: "BadQueryString";
3838-}
3939-4040-export type HandlerOutput = HandlerError | HandlerSuccess;
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkUnspeccedDefs from "./defs.ts";
55-66-export type QueryParams = {
77- /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
88- q: string;
99- /** Specifies the ranking order of results. */
1010- sort: "top" | "latest" | (string & globalThis.Record<PropertyKey, never>);
1111- /** 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). */
1212- since?: string;
1313- /** 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). */
1414- until?: string;
1515- /** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. */
1616- mentions?: string;
1717- /** Filter to posts by the given account. Handles are resolved to DID before query-time. */
1818- author?: string;
1919- /** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. */
2020- lang?: string;
2121- /** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. */
2222- domain?: string;
2323- /** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. */
2424- url?: string;
2525- /** 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. */
2626- tag?: string[];
2727- /** DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. */
2828- viewer?: string;
2929- limit: number;
3030- /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
3131- cursor?: string;
3232-};
3333-export type InputSchema = undefined;
3434-3535-export interface OutputSchema {
3636- cursor?: string;
3737- /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
3838- hitsTotal?: number;
3939- posts: (SoSprkUnspeccedDefs.SkeletonSearchPost)[];
4040-}
4141-4242-export type HandlerInput = void;
4343-4444-export interface HandlerSuccess {
4545- encoding: "application/json";
4646- body: OutputSchema;
4747- headers?: { [key: string]: string };
4848-}
4949-5050-export interface HandlerError {
5151- status: number;
5252- message?: string;
5353- error?: "BadQueryString";
5454-}
5555-5656-export type HandlerOutput = HandlerError | HandlerSuccess;
···11-/**
22- * GENERATED CODE - DO NOT MODIFY
33- */
44-import type * as SoSprkUnspeccedDefs from "./defs.ts";
55-66-export type QueryParams = {
77- /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
88- q: string;
99- /** DID of the account making the request (not included for public/unauthenticated queries). */
1010- viewer?: string;
1111- limit: number;
1212- /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
1313- cursor?: string;
1414-};
1515-export type InputSchema = undefined;
1616-1717-export interface OutputSchema {
1818- cursor?: string;
1919- /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
2020- hitsTotal?: number;
2121- starterPacks: (SoSprkUnspeccedDefs.SkeletonSearchStarterPack)[];
2222-}
2323-2424-export type HandlerInput = void;
2525-2626-export interface HandlerSuccess {
2727- encoding: "application/json";
2828- body: OutputSchema;
2929- headers?: { [key: string]: string };
3030-}
3131-3232-export interface HandlerError {
3333- status: number;
3434- message?: string;
3535- error?: "BadQueryString";
3636-}
3737-3838-export type HandlerOutput = HandlerError | HandlerSuccess;
···11-{
22- "lexicon": 1,
33- "id": "so.sprk.unspecced.searchPostsSkeleton",
44- "defs": {
55- "main": {
66- "type": "query",
77- "description": "Backend Posts search, returns only skeleton",
88- "parameters": {
99- "type": "params",
1010- "required": ["q"],
1111- "properties": {
1212- "q": {
1313- "type": "string",
1414- "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."
1515- },
1616- "sort": {
1717- "type": "string",
1818- "knownValues": ["top", "latest"],
1919- "default": "latest",
2020- "description": "Specifies the ranking order of results."
2121- },
2222- "since": {
2323- "type": "string",
2424- "description": "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)."
2525- },
2626- "until": {
2727- "type": "string",
2828- "description": "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)."
2929- },
3030- "mentions": {
3131- "type": "string",
3232- "format": "at-identifier",
3333- "description": "Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions."
3434- },
3535- "author": {
3636- "type": "string",
3737- "format": "at-identifier",
3838- "description": "Filter to posts by the given account. Handles are resolved to DID before query-time."
3939- },
4040- "lang": {
4141- "type": "string",
4242- "format": "language",
4343- "description": "Filter to posts in the given language. Expected to be based on post language field, though server may override language detection."
4444- },
4545- "domain": {
4646- "type": "string",
4747- "description": "Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization."
4848- },
4949- "url": {
5050- "type": "string",
5151- "format": "uri",
5252- "description": "Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching."
5353- },
5454- "tag": {
5555- "type": "array",
5656- "items": {
5757- "type": "string",
5858- "maxLength": 640,
5959- "maxGraphemes": 64
6060- },
6161- "description": "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."
6262- },
6363- "viewer": {
6464- "type": "string",
6565- "format": "did",
6666- "description": "DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries."
6767- },
6868- "limit": {
6969- "type": "integer",
7070- "minimum": 1,
7171- "maximum": 100,
7272- "default": 25
7373- },
7474- "cursor": {
7575- "type": "string",
7676- "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set."
7777- }
7878- }
7979- },
8080- "output": {
8181- "encoding": "application/json",
8282- "schema": {
8383- "type": "object",
8484- "required": ["posts"],
8585- "properties": {
8686- "cursor": { "type": "string" },
8787- "hitsTotal": {
8888- "type": "integer",
8989- "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."
9090- },
9191- "posts": {
9292- "type": "array",
9393- "items": {
9494- "type": "ref",
9595- "ref": "so.sprk.unspecced.defs#skeletonSearchPost"
9696- }
9797- }
9898- }
9999- }
100100- },
101101- "errors": [{ "name": "BadQueryString" }]
102102- }
103103- }
104104-}
···11import {
22- Main as ImagesEmbed,
33- View as ImagesEmbedView,
44-} from "../lex/types/so/sprk/embed/images.ts";
22+ Main as ImagesMedia,
33+ View as ImagesMediaView,
44+} from "../lex/types/so/sprk/media/images.ts";
55import {
66- Main as VideoEmbed,
77- View as VideoEmbedView,
88-} from "../lex/types/so/sprk/embed/video.ts";
66+ Main as VideoMedia,
77+ View as VideoMediaView,
88+} from "../lex/types/so/sprk/media/video.ts";
99import {
1010 BlockedPost,
1111 GeneratorView,
1212 NotFoundPost,
1313 PostView,
1414+ ReplyView,
1415} from "../lex/types/so/sprk/feed/defs.ts";
1516import { LabelerView } from "../lex/types/app/bsky/labeler/defs.ts";
16171717-export type {
1818- Main as ImagesEmbed,
1919- View as ImagesEmbedView,
2020-} from "../lex/types/so/sprk/embed/images.ts";
2121-export { isMain as isImagesEmbed } from "../lex/types/so/sprk/embed/images.ts";
2222-export type {
2323- Main as VideoEmbed,
2424- View as VideoEmbedView,
2525-} from "../lex/types/so/sprk/embed/video.ts";
2626-export { isMain as isVideoEmbed } from "../lex/types/so/sprk/embed/video.ts";
1818+export {
1919+ isMain as isImagesMedia,
2020+ type Main as ImagesMedia,
2121+ type View as ImagesMediaView,
2222+} from "../lex/types/so/sprk/media/images.ts";
2323+export {
2424+ isMain as isVideoMedia,
2525+ type Main as VideoMedia,
2626+ type View as VideoMediaView,
2727+} from "../lex/types/so/sprk/media/video.ts";
2728export type {
2829 BlockedPost,
2930 GeneratorView,
···3132 PostView,
3233} from "../lex/types/so/sprk/feed/defs.ts";
33343434-export type Embed =
3535- | ImagesEmbed
3636- | VideoEmbed;
3535+export type Media =
3636+ | ImagesMedia
3737+ | VideoMedia;
37383838-export type EmbedView =
3939- | ImagesEmbedView
4040- | VideoEmbedView;
3939+export type MediaView =
4040+ | ImagesMediaView
4141+ | VideoMediaView;
41424242-export type MaybePostView = PostView | NotFoundPost | BlockedPost;
4343+export type MaybePostView = PostView | ReplyView | NotFoundPost | BlockedPost;
43444444-export type RecordEmbedViewInternal =
4545+export type RecordMediaViewInternal =
4546 | GeneratorView
4647 | LabelerView;