···55import { type $Typed, is$typed as _is$typed } from "../../../../util.ts";
66import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
77import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
88-import type * as SoSprkFeedThreadgate from "../feed/threadgate.ts";
98109const is$typed = _is$typed, validate = _validate;
1110const id = "so.sprk.actor.defs";
···173172 | $Typed<MutedWordsPref>
174173 | $Typed<HiddenPostsPref>
175174 | $Typed<LabelersPref>
176176- | $Typed<PostInteractionSettingsPref>
177175 | { $type: string }
178176)[];
179177···406404export function validateLabelerPrefItem<V>(v: V) {
407405 return validate<LabelerPrefItem & V>(v, id, hashLabelerPrefItem);
408406}
409409-410410-/** 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. */
411411-export interface PostInteractionSettingsPref {
412412- $type?: "so.sprk.actor.defs#postInteractionSettingsPref";
413413- /** 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. */
414414- threadgateAllowRules?: (
415415- | $Typed<SoSprkFeedThreadgate.MentionRule>
416416- | $Typed<SoSprkFeedThreadgate.FollowerRule>
417417- | $Typed<SoSprkFeedThreadgate.FollowingRule>
418418- | { $type: string }
419419- )[];
420420-}
421421-422422-const hashPostInteractionSettingsPref = "postInteractionSettingsPref";
423423-424424-export function isPostInteractionSettingsPref<V>(v: V) {
425425- return is$typed(v, id, hashPostInteractionSettingsPref);
426426-}
427427-428428-export function validatePostInteractionSettingsPref<V>(v: V) {
429429- return validate<PostInteractionSettingsPref & V>(
430430- v,
431431- id,
432432- hashPostInteractionSettingsPref,
433433- );
434434-}
+73
lex/types/so/sprk/embed/defs.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 SoSprkEmbedMention from "./mention.ts";
77+import type * as SoSprkEmbedPost from "./post.ts";
88+99+const is$typed = _is$typed, validate = _validate;
1010+const id = "so.sprk.embed.defs";
1111+1212+export type Embeds =
1313+ ($Typed<SoSprkEmbedMention.Main> | $Typed<SoSprkEmbedPost.Main> | {
1414+ $type: string;
1515+ })[];
1616+export type Views =
1717+ ($Typed<SoSprkEmbedMention.View> | $Typed<SoSprkEmbedPost.View> | {
1818+ $type: string;
1919+ })[];
2020+2121+/** Placement and layer metadata for an embed on a media canvas. */
2222+export interface Placement {
2323+ $type?: "so.sprk.embed.defs#placement";
2424+ frame: Frame;
2525+ mediaRef?: MediaRef;
2626+ zIndex?: number;
2727+ rotation?: number;
2828+}
2929+3030+const hashPlacement = "placement";
3131+3232+export function isPlacement<V>(v: V) {
3333+ return is$typed(v, id, hashPlacement);
3434+}
3535+3636+export function validatePlacement<V>(v: V) {
3737+ return validate<Placement & V>(v, id, hashPlacement);
3838+}
3939+4040+/** Bounding box in 10,000-based normalized coordinates relative to media canvas dimensions. */
4141+export interface Frame {
4242+ $type?: "so.sprk.embed.defs#frame";
4343+ x: number;
4444+ y: number;
4545+ w: number;
4646+ h: number;
4747+}
4848+4949+const hashFrame = "frame";
5050+5151+export function isFrame<V>(v: V) {
5252+ return is$typed(v, id, hashFrame);
5353+}
5454+5555+export function validateFrame<V>(v: V) {
5656+ return validate<Frame & V>(v, id, hashFrame);
5757+}
5858+5959+/** Optional media locator for records containing multiple media items. */
6060+export interface MediaRef {
6161+ $type?: "so.sprk.embed.defs#mediaRef";
6262+ index: number;
6363+}
6464+6565+const hashMediaRef = "mediaRef";
6666+6767+export function isMediaRef<V>(v: V) {
6868+ return is$typed(v, id, hashMediaRef);
6969+}
7070+7171+export function validateMediaRef<V>(v: V) {
7272+ return validate<MediaRef & V>(v, id, hashMediaRef);
7373+}
+43
lex/types/so/sprk/embed/mention.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 SoSprkEmbedDefs from "./defs.ts";
77+import type * as SoSprkActorDefs from "../actor/defs.ts";
88+99+const is$typed = _is$typed, validate = _validate;
1010+const id = "so.sprk.embed.mention";
1111+1212+export interface Main {
1313+ $type?: "so.sprk.embed.mention";
1414+ placement: SoSprkEmbedDefs.Placement;
1515+ did: 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+export interface View {
2929+ $type?: "so.sprk.embed.mention#view";
3030+ placement: SoSprkEmbedDefs.Placement;
3131+ did: string;
3232+ actor?: SoSprkActorDefs.ProfileViewBasic;
3333+}
3434+3535+const hashView = "view";
3636+3737+export function isView<V>(v: V) {
3838+ return is$typed(v, id, hashView);
3939+}
4040+4141+export function validateView<V>(v: V) {
4242+ return validate<View & V>(v, id, hashView);
4343+}
+47
lex/types/so/sprk/embed/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 SoSprkEmbedDefs from "./defs.ts";
77+import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
88+import type * as SoSprkFeedDefs from "../feed/defs.ts";
99+1010+const is$typed = _is$typed, validate = _validate;
1111+const id = "so.sprk.embed.post";
1212+1313+export interface Main {
1414+ $type?: "so.sprk.embed.post";
1515+ placement: SoSprkEmbedDefs.Placement;
1616+ post: ComAtprotoRepoStrongRef.Main;
1717+}
1818+1919+const hashMain = "main";
2020+2121+export function isMain<V>(v: V) {
2222+ return is$typed(v, id, hashMain);
2323+}
2424+2525+export function validateMain<V>(v: V) {
2626+ return validate<Main & V>(v, id, hashMain);
2727+}
2828+2929+export interface View {
3030+ $type?: "so.sprk.embed.post#view";
3131+ placement: SoSprkEmbedDefs.Placement;
3232+ post:
3333+ | $Typed<SoSprkFeedDefs.PostView>
3434+ | $Typed<SoSprkFeedDefs.NotFoundPost>
3535+ | $Typed<SoSprkFeedDefs.BlockedPost>
3636+ | { $type: string };
3737+}
3838+3939+const hashView = "view";
4040+4141+export function isView<V>(v: V) {
4242+ return is$typed(v, id, hashView);
4343+}
4444+4545+export function validateView<V>(v: V) {
4646+ return validate<View & V>(v, id, hashView);
4747+}
-47
lex/types/so/sprk/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 = "so.sprk.feed.postgate";
99-1010-export interface Record {
1111- $type: "so.sprk.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?: "so.sprk.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-}
+2
lex/types/so/sprk/story/defs.ts
···66import type * as SoSprkActorDefs from "../actor/defs.ts";
77import type * as SoSprkMediaImage from "../media/image.ts";
88import type * as SoSprkMediaVideo from "../media/video.ts";
99+import type * as SoSprkEmbedDefs from "../embed/defs.ts";
9101011const is$typed = _is$typed, validate = _validate;
1112const id = "so.sprk.story.defs";
···1920 media?: $Typed<SoSprkMediaImage.View> | $Typed<SoSprkMediaVideo.View> | {
2021 $type: string;
2122 };
2323+ embeds?: SoSprkEmbedDefs.Views;
2224 indexedAt: string;
2325}
2426
+2
lex/types/so/sprk/story/post.ts
···66import type * as SoSprkMediaImage from "../media/image.ts";
77import type * as SoSprkMediaVideo from "../media/video.ts";
88import type * as ComAtprotoRepoStrongRef from "../../../com/atproto/repo/strongRef.ts";
99+import type * as SoSprkEmbedDefs from "../embed/defs.ts";
910import type * as ComAtprotoLabelDefs from "../../../com/atproto/label/defs.ts";
10111112const is$typed = _is$typed, validate = _validate;
···1718 $type: string;
1819 };
1920 sound?: ComAtprotoRepoStrongRef.Main;
2121+ embeds?: SoSprkEmbedDefs.Embeds;
2022 labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string };
2123 /** Client-declared timestamp when this story was originally created. */
2224 createdAt: string;
+1-22
lexicons/so/sprk/actor/defs.json
···173173 "#interestsPref",
174174 "#mutedWordsPref",
175175 "#hiddenPostsPref",
176176- "#labelersPref",
177177- "#postInteractionSettingsPref"
176176+ "#labelersPref"
178177 ]
179178 }
180179 },
···373372 "did": {
374373 "type": "string",
375374 "format": "did"
376376- }
377377- }
378378- },
379379- "postInteractionSettingsPref": {
380380- "type": "object",
381381- "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.",
382382- "required": [],
383383- "properties": {
384384- "threadgateAllowRules": {
385385- "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.",
386386- "type": "array",
387387- "maxLength": 5,
388388- "items": {
389389- "type": "union",
390390- "refs": [
391391- "so.sprk.feed.threadgate#mentionRule",
392392- "so.sprk.feed.threadgate#followerRule",
393393- "so.sprk.feed.threadgate#followingRule"
394394- ]
395395- }
396375 }
397376 }
398377 }
···11-{
22- "lexicon": 1,
33- "id": "so.sprk.feed.postgate",
44- "defs": {
55- "main": {
66- "type": "record",
77- "key": "tid",
88- "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.",
99- "record": {
1010- "type": "object",
1111- "required": ["post", "createdAt"],
1212- "properties": {
1313- "createdAt": { "type": "string", "format": "datetime" },
1414- "post": {
1515- "type": "string",
1616- "format": "at-uri",
1717- "description": "Reference (AT-URI) to the post record."
1818- },
1919- "detachedEmbeddingUris": {
2020- "type": "array",
2121- "maxLength": 50,
2222- "items": {
2323- "type": "string",
2424- "format": "at-uri"
2525- },
2626- "description": "List of AT-URIs embedding this post that the author has detached from."
2727- },
2828- "embeddingRules": {
2929- "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.",
3030- "type": "array",
3131- "maxLength": 5,
3232- "items": {
3333- "type": "union",
3434- "refs": ["#disableRule"]
3535- }
3636- }
3737- }
3838- }
3939- },
4040- "disableRule": {
4141- "type": "object",
4242- "description": "Disables embedding of this post.",
4343- "properties": {}
4444- }
4545- }
4646-}