/* * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. */ import { l } from "@atproto/lex"; import * as RepoStrongRef from "../../com/atproto/repo/strongRef.defs.js"; import * as StreamDefs from "./defs.defs.js"; import * as ActorDefs from "../../app/bsky/actor/defs.defs.js"; import * as ChatProfile from "./chat/profile.defs.js"; import * as ChatDefs from "./chat/defs.defs.js"; const $nsid = "place.stream.livestream"; export { $nsid }; /** Record announcing a livestream is happening */ type Main = { $type: "place.stream.livestream"; /** * The title of the livestream, as it will be announced to followers. */ "title":string; /** * The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream. */ "url"?:l.UriString; /** * Client-declared timestamp when this livestream started. */ "createdAt":l.DatetimeString; /** * Client-declared timestamp when this livestream was last seen by the Streamplace station. */ "lastSeenAt"?:l.DatetimeString; /** * Client-declared timestamp when this livestream ended. Ended livestreams are not supposed to start up again. */ "endedAt"?:l.DatetimeString; /** * Time in seconds after which this livestream should be automatically ended if idle. Zero means no timeout. */ "idleTimeoutSeconds"?:number; /** * The post that announced this livestream. */ "post"?:RepoStrongRef.Main; /** * The source of the livestream, if available, in a User Agent format: ` / ` e.g. Streamplace/0.7.5 iOS */ "agent"?:string; /** * The primary URL where this livestream can be viewed, if available. */ "canonicalUrl"?:l.UriString;"thumb"?:l.BlobRef;"notificationSettings"?:NotificationSettings; /** * The game or activity being streamed. */ "activity"?:l.$Typed | l.$Typed | l.Unknown$TypedObject; /** * Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language). */ "tags"?:(string)[] }; export type { Main }; /** Record announcing a livestream is happening */ const main = /*#__PURE__*/ l.record<"tid", Main>("tid", $nsid, /*#__PURE__*/ l.object({"title":/*#__PURE__*/ l.string({"maxLength":1400,"maxGraphemes":140}),"url":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"uri"})),"createdAt":/*#__PURE__*/ l.string({"format":"datetime"}),"lastSeenAt":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"datetime"})),"endedAt":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"datetime"})),"idleTimeoutSeconds":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()),"post":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => RepoStrongRef.main) as any)),"agent":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),"canonicalUrl":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({"format":"uri"})),"thumb":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.blob({"accept":["image/*"],"maxSize":1000000})),"notificationSettings":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => notificationSettings) as any)),"activity":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => StreamDefs.activityGame) as any),/*#__PURE__*/ l.typedRef((() => StreamDefs.activityLabel) as any)], false)),"tags":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.array(/*#__PURE__*/ l.string({"maxLength":640,"maxGraphemes":64}), {"maxLength":10}))})); export { main }; export const $type = $nsid; export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main); export const $build = /*#__PURE__*/ main.build.bind(main); export const $assert = /*#__PURE__*/ main.assert.bind(main); export const $check = /*#__PURE__*/ main.check.bind(main); export const $cast = /*#__PURE__*/ main.cast.bind(main); export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main); export const $matches = /*#__PURE__*/ main.matches.bind(main); export const $parse = /*#__PURE__*/ main.parse.bind(main); export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main); export const $validate = /*#__PURE__*/ main.validate.bind(main); export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main); type NotificationSettings = { $type?: "place.stream.livestream#notificationSettings"; /** * Whether this livestream should trigger a push notification to followers. */ "pushNotification"?:boolean }; export type { NotificationSettings }; const notificationSettings = /*#__PURE__*/ l.typedObject($nsid, "notificationSettings", /*#__PURE__*/ l.object({"pushNotification":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean())})); export { notificationSettings }; type LivestreamView = { $type?: "place.stream.livestream#livestreamView";"uri":l.AtUriString;"cid":l.CidString;"author":ActorDefs.ProfileViewBasic;"record":l.LexMap;"indexedAt":l.DatetimeString; /** * The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly. */ "viewerCount"?:ViewerCount }; export type { LivestreamView }; const livestreamView = /*#__PURE__*/ l.typedObject($nsid, "livestreamView", /*#__PURE__*/ l.object({"uri":/*#__PURE__*/ l.string({"format":"at-uri"}),"cid":/*#__PURE__*/ l.string({"format":"cid"}),"author":/*#__PURE__*/ l.ref((() => ActorDefs.profileViewBasic) as any),"record":/*#__PURE__*/ l.lexMap(),"indexedAt":/*#__PURE__*/ l.string({"format":"datetime"}),"viewerCount":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => viewerCount) as any))})); export { livestreamView }; type ViewerCount = { $type?: "place.stream.livestream#viewerCount"; /** * Viewers watching right now. */ "count":number; /** * Running number of playback sessions this livestream has had (cumulative, session-based; the X-style 'views' beside the concurrent count). */ "total"?:number }; export type { ViewerCount }; const viewerCount = /*#__PURE__*/ l.typedObject($nsid, "viewerCount", /*#__PURE__*/ l.object({"count":/*#__PURE__*/ l.integer(),"total":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer())})); export { viewerCount }; type TeleportArrival = { $type?: "place.stream.livestream#teleportArrival"; /** * The URI of the teleport record */ "teleportUri":l.AtUriString; /** * The streamer who is teleporting their viewers here */ "source":ActorDefs.ProfileViewBasic; /** * The chat profile of the source streamer */ "chatProfile"?:ChatProfile.Main; /** * How many viewers are arriving from this teleport */ "viewerCount":number; /** * When this teleport started */ "startsAt":l.DatetimeString }; export type { TeleportArrival }; const teleportArrival = /*#__PURE__*/ l.typedObject($nsid, "teleportArrival", /*#__PURE__*/ l.object({"teleportUri":/*#__PURE__*/ l.string({"format":"at-uri"}),"source":/*#__PURE__*/ l.ref((() => ActorDefs.profileViewBasic) as any),"chatProfile":/*#__PURE__*/ l.optional(/*#__PURE__*/ l.ref((() => ChatProfile.main) as any)),"viewerCount":/*#__PURE__*/ l.integer(),"startsAt":/*#__PURE__*/ l.string({"format":"datetime"})})); export { teleportArrival }; type TeleportCanceled = { $type?: "place.stream.livestream#teleportCanceled"; /** * The URI of the teleport record that was canceled */ "teleportUri":l.AtUriString; /** * Why this teleport was canceled */ "reason":"deleted" | "denied" | "expired" }; export type { TeleportCanceled }; const teleportCanceled = /*#__PURE__*/ l.typedObject($nsid, "teleportCanceled", /*#__PURE__*/ l.object({"teleportUri":/*#__PURE__*/ l.string({"format":"at-uri"}),"reason":/*#__PURE__*/ l.enum(["deleted","denied","expired"])})); export { teleportCanceled }; type StreamplaceAnything = { $type?: "place.stream.livestream#streamplaceAnything";"livestream":l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.$Typed | l.Unknown$TypedObject }; export type { StreamplaceAnything }; const streamplaceAnything = /*#__PURE__*/ l.typedObject($nsid, "streamplaceAnything", /*#__PURE__*/ l.object({"livestream":/*#__PURE__*/ l.typedUnion([/*#__PURE__*/ l.typedRef((() => livestreamView) as any),/*#__PURE__*/ l.typedRef((() => viewerCount) as any),/*#__PURE__*/ l.typedRef((() => teleportArrival) as any),/*#__PURE__*/ l.typedRef((() => teleportCanceled) as any),/*#__PURE__*/ l.typedRef((() => StreamDefs.blockView) as any),/*#__PURE__*/ l.typedRef((() => StreamDefs.renditions) as any),/*#__PURE__*/ l.typedRef((() => StreamDefs.rendition) as any),/*#__PURE__*/ l.typedRef((() => ChatDefs.messageView) as any),/*#__PURE__*/ l.typedRef((() => ChatDefs.pinnedRecordView) as any)], false)})); export { streamplaceAnything };