···11+{
22+ "$type": "com.atproto.lexicon.schema",
33+ "id": "place.stream.richtext.facet",
44+ "lexicon": 1,
55+ "defs": {
66+ "main": {
77+ "type": "object",
88+ "description": "Annotation of a sub-string within rich text.",
99+ "required": ["index", "features"],
1010+ "properties": {
1111+ "index": { "type": "ref", "ref": "app.bsky.richtext.facet#byteSlice" },
1212+ "features": {
1313+ "type": "array",
1414+ "items": {
1515+ "type": "union",
1616+ "refs": [
1717+ "app.bsky.richtext.facet#mention",
1818+ "app.bsky.richtext.facet#link",
1919+ "#emote",
2020+ "#emoteView"
2121+ ]
2222+ }
2323+ }
2424+ }
2525+ },
2626+ "emote": {
2727+ "type": "object",
2828+ "required": ["name", "ref"],
2929+ "properties": {
3030+ "name": {
3131+ "type": "string",
3232+ "maxLength": 100,
3333+ "maxGraphemes": 50,
3434+ "description": "Short name of the emote, e.g. 'dan'. Used as fallback text and for display before the ref resolves."
3535+ },
3636+ "ref": {
3737+ "type": "ref",
3838+ "ref": "com.atproto.repo.strongRef",
3939+ "description": "Strong reference to the place.stream.emote.item record."
4040+ }
4141+ }
4242+ },
4343+ "emoteView": {
4444+ "type": "object",
4545+ "description": "Hydrated version of a #emote",
4646+ "required": ["name", "record"],
4747+ "properties": {
4848+ "name": {
4949+ "type": "string",
5050+ "maxLength": 100,
5151+ "maxGraphemes": 50,
5252+ "description": "Short name of the emote, e.g. 'dan'. Used as fallback text and for display before the ref resolves."
5353+ },
5454+ "record": {
5555+ "type": "ref",
5656+ "ref": "place.stream.emote.defs#emoteView"
5757+ }
5858+ }
5959+ }
6060+ }
6161+}
+7
utils/lexicons/index.ts
···11+export * as PlaceStreamBadgeDefs from "./types/place/stream/badge/defs.ts";
22+export * as PlaceStreamChatDefs from "./types/place/stream/chat/defs.ts";
33+export * as PlaceStreamChatMessage from "./types/place/stream/chat/message.ts";
44+export * as PlaceStreamChatPinnedRecord from "./types/place/stream/chat/pinnedRecord.ts";
55+export * as PlaceStreamChatProfile from "./types/place/stream/chat/profile.ts";
66+export * as PlaceStreamEmoteDefs from "./types/place/stream/emote/defs.ts";
77+export * as PlaceStreamRichtextFacet from "./types/place/stream/richtext/facet.ts";
+56
utils/lexicons/types/place/stream/badge/defs.ts
···11+import type {} from "@atcute/lexicons";
22+import * as v from "@atcute/lexicons/validations";
33+44+const _badgeViewSchema = /*#__PURE__*/ v.object({
55+ $type: /*#__PURE__*/ v.optional(
66+ /*#__PURE__*/ v.literal("place.stream.badge.defs#badgeView"),
77+ ),
88+ badgeType: /*#__PURE__*/ v.string<
99+ | "place.stream.badge.defs#bot"
1010+ | "place.stream.badge.defs#mod"
1111+ | "place.stream.badge.defs#streamer"
1212+ | (string & {})
1313+ >(),
1414+ /**
1515+ * DID of the badge issuer.
1616+ */
1717+ issuer: /*#__PURE__*/ v.didString(),
1818+ /**
1919+ * DID of the badge recipient.
2020+ */
2121+ recipient: /*#__PURE__*/ v.didString(),
2222+ /**
2323+ * TODO: Cryptographic signature of the badge (of a place.stream.key).
2424+ */
2525+ signature: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
2626+});
2727+const _botSchema = /*#__PURE__*/ v.literal("place.stream.badge.defs#bot");
2828+const _modSchema = /*#__PURE__*/ v.literal("place.stream.badge.defs#mod");
2929+const _streamerSchema = /*#__PURE__*/ v.literal(
3030+ "place.stream.badge.defs#streamer",
3131+);
3232+const _vipSchema = /*#__PURE__*/ v.literal("place.stream.badge.defs#vip");
3333+3434+type badgeView$schematype = typeof _badgeViewSchema;
3535+type bot$schematype = typeof _botSchema;
3636+type mod$schematype = typeof _modSchema;
3737+type streamer$schematype = typeof _streamerSchema;
3838+type vip$schematype = typeof _vipSchema;
3939+4040+export interface badgeViewSchema extends badgeView$schematype {}
4141+export interface botSchema extends bot$schematype {}
4242+export interface modSchema extends mod$schematype {}
4343+export interface streamerSchema extends streamer$schematype {}
4444+export interface vipSchema extends vip$schematype {}
4545+4646+export const badgeViewSchema = _badgeViewSchema as badgeViewSchema;
4747+export const botSchema = _botSchema as botSchema;
4848+export const modSchema = _modSchema as modSchema;
4949+export const streamerSchema = _streamerSchema as streamerSchema;
5050+export const vipSchema = _vipSchema as vipSchema;
5151+5252+export interface BadgeView extends v.InferInput<typeof badgeViewSchema> {}
5353+export type Bot = v.InferInput<typeof botSchema>;
5454+export type Mod = v.InferInput<typeof modSchema>;
5555+export type Streamer = v.InferInput<typeof streamerSchema>;
5656+export type Vip = v.InferInput<typeof vipSchema>;
+75
utils/lexicons/types/place/stream/chat/defs.ts
···11+import type {} from "@atcute/lexicons";
22+import * as v from "@atcute/lexicons/validations";
33+import * as AppBskyActorDefs from "@atcute/bluesky/types/app/actor/defs";
44+import * as PlaceStreamBadgeDefs from "../badge/defs.ts";
55+import * as PlaceStreamChatPinnedRecord from "./pinnedRecord.ts";
66+import * as PlaceStreamChatProfile from "./profile.ts";
77+88+const _messageViewSchema = /*#__PURE__*/ v.object({
99+ $type: /*#__PURE__*/ v.optional(
1010+ /*#__PURE__*/ v.literal("place.stream.chat.defs#messageView"),
1111+ ),
1212+ get author() {
1313+ return AppBskyActorDefs.profileViewBasicSchema;
1414+ },
1515+ /**
1616+ * Up to 3 badge tokens to display with the message. First badge is server-controlled, remaining badges are user-settable. Tokens are looked up in badges.json for display info.
1717+ * @maxLength 3
1818+ */
1919+ get badges() {
2020+ return /*#__PURE__*/ v.optional(
2121+ /*#__PURE__*/ v.constrain(
2222+ /*#__PURE__*/ v.array(PlaceStreamBadgeDefs.badgeViewSchema),
2323+ [/*#__PURE__*/ v.arrayLength(0, 3)],
2424+ ),
2525+ );
2626+ },
2727+ get chatProfile() {
2828+ return /*#__PURE__*/ v.optional(PlaceStreamChatProfile.mainSchema);
2929+ },
3030+ cid: /*#__PURE__*/ v.cidString(),
3131+ /**
3232+ * If true, this message has been deleted or labeled and should be cleared from the cache
3333+ */
3434+ deleted: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()),
3535+ indexedAt: /*#__PURE__*/ v.datetimeString(),
3636+ record: /*#__PURE__*/ v.unknown(),
3737+ get replyTo() {
3838+ return /*#__PURE__*/ v.optional(
3939+ /*#__PURE__*/ v.variant([messageViewSchema]),
4040+ );
4141+ },
4242+ uri: /*#__PURE__*/ v.resourceUriString(),
4343+});
4444+const _pinnedRecordViewSchema = /*#__PURE__*/ v.object({
4545+ $type: /*#__PURE__*/ v.optional(
4646+ /*#__PURE__*/ v.literal("place.stream.chat.defs#pinnedRecordView"),
4747+ ),
4848+ cid: /*#__PURE__*/ v.cidString(),
4949+ indexedAt: /*#__PURE__*/ v.datetimeString(),
5050+ get message() {
5151+ return /*#__PURE__*/ v.optional(messageViewSchema);
5252+ },
5353+ get pinnedBy() {
5454+ return /*#__PURE__*/ v.optional(PlaceStreamChatProfile.mainSchema);
5555+ },
5656+ get record() {
5757+ return PlaceStreamChatPinnedRecord.mainSchema;
5858+ },
5959+ uri: /*#__PURE__*/ v.resourceUriString(),
6060+});
6161+6262+type messageView$schematype = typeof _messageViewSchema;
6363+type pinnedRecordView$schematype = typeof _pinnedRecordViewSchema;
6464+6565+export interface messageViewSchema extends messageView$schematype {}
6666+export interface pinnedRecordViewSchema extends pinnedRecordView$schematype {}
6767+6868+export const messageViewSchema = _messageViewSchema as messageViewSchema;
6969+export const pinnedRecordViewSchema =
7070+ _pinnedRecordViewSchema as pinnedRecordViewSchema;
7171+7272+export interface MessageView extends v.InferInput<typeof messageViewSchema> {}
7373+export interface PinnedRecordView extends v.InferInput<
7474+ typeof pinnedRecordViewSchema
7575+> {}
+69
utils/lexicons/types/place/stream/chat/message.ts
···11+import type {} from "@atcute/lexicons";
22+import * as v from "@atcute/lexicons/validations";
33+import type {} from "@atcute/lexicons/ambient";
44+import * as ComAtprotoRepoStrongRef from "@atcute/atproto/types/repo/strongRef";
55+import * as PlaceStreamRichtextFacet from "../richtext/facet.ts";
66+77+const _mainSchema = /*#__PURE__*/ v.record(
88+ /*#__PURE__*/ v.tidString(),
99+ /*#__PURE__*/ v.object({
1010+ $type: /*#__PURE__*/ v.literal("place.stream.chat.message"),
1111+ /**
1212+ * Client-declared timestamp when this message was originally created.
1313+ */
1414+ createdAt: /*#__PURE__*/ v.datetimeString(),
1515+ /**
1616+ * Annotations of text (mentions, URLs, etc)
1717+ */
1818+ get facets() {
1919+ return /*#__PURE__*/ v.optional(
2020+ /*#__PURE__*/ v.array(PlaceStreamRichtextFacet.mainSchema),
2121+ );
2222+ },
2323+ get reply() {
2424+ return /*#__PURE__*/ v.optional(replyRefSchema);
2525+ },
2626+ /**
2727+ * The DID of the streamer whose chat this is.
2828+ */
2929+ streamer: /*#__PURE__*/ v.didString(),
3030+ /**
3131+ * The primary message content. May be an empty string, if there are embeds.
3232+ * @maxLength 3000
3333+ * @maxGraphemes 300
3434+ */
3535+ text: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
3636+ /*#__PURE__*/ v.stringLength(0, 3000),
3737+ /*#__PURE__*/ v.stringGraphemes(0, 300),
3838+ ]),
3939+ }),
4040+);
4141+const _replyRefSchema = /*#__PURE__*/ v.object({
4242+ $type: /*#__PURE__*/ v.optional(
4343+ /*#__PURE__*/ v.literal("place.stream.chat.message#replyRef"),
4444+ ),
4545+ get parent() {
4646+ return ComAtprotoRepoStrongRef.mainSchema;
4747+ },
4848+ get root() {
4949+ return ComAtprotoRepoStrongRef.mainSchema;
5050+ },
5151+});
5252+5353+type main$schematype = typeof _mainSchema;
5454+type replyRef$schematype = typeof _replyRefSchema;
5555+5656+export interface mainSchema extends main$schematype {}
5757+export interface replyRefSchema extends replyRef$schematype {}
5858+5959+export const mainSchema = _mainSchema as mainSchema;
6060+export const replyRefSchema = _replyRefSchema as replyRefSchema;
6161+6262+export interface Main extends v.InferInput<typeof mainSchema> {}
6363+export interface ReplyRef extends v.InferInput<typeof replyRefSchema> {}
6464+6565+declare module "@atcute/lexicons/ambient" {
6666+ interface Records {
6767+ "place.stream.chat.message": mainSchema;
6868+ }
6969+}