add codegen

This commit is contained in:
Hailey 2025-03-26 11:50:01 -07:00
parent ff581e1e0b
commit 00b4095672
6 changed files with 145 additions and 0 deletions
lexicons/app/bsky/unspecced
packages
api/src/client/types/app/bsky/unspecced
bsky/src/lexicon/types/app/bsky/unspecced
ozone/src/lexicon/types/app/bsky/unspecced
pds/src/lexicon/types/app/bsky/unspecced

@ -32,6 +32,31 @@
"description": { "type": "string" },
"link": { "type": "string" }
}
},
"trend": {
"type": "object",
"required": [
"topic",
"displayName",
"link",
"startTime",
"postCount",
"actors"
],
"properties": {
"topic": { "type": "string" },
"displayName": { "type": "string" },
"link": { "type": "string" },
"startTime": { "type": "string" },
"postCount": { "type": "integer" },
"actors": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewBasic"
}
}
}
}
}
}

@ -0,0 +1,36 @@
{
"lexicon": 1,
"id": "app.bsky.unspecced.getTrends",
"defs": {
"main": {
"type": "query",
"description": "Get the current trends on the network",
"parameters": {
"type": "params",
"properties": {
"viewer": {
"type": "string",
"format": "did",
"description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 25,
"default": 10
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.unspecced.defs#trend"
}
}
}
}
}
}

@ -9,6 +9,7 @@ import {
is$typed as _is$typed,
type OmitKey,
} from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
@ -80,3 +81,23 @@ export function isTrendingTopic<V>(v: V) {
export function validateTrendingTopic<V>(v: V) {
return validate<TrendingTopic & V>(v, id, hashTrendingTopic)
}
export interface Trend {
$type?: 'app.bsky.unspecced.defs#trend'
topic: string
displayName: string
link: string
startTime: string
postCount: number
actors: AppBskyActorDefs.ProfileViewBasic[]
}
const hashTrend = 'trend'
export function isTrend<V>(v: V) {
return is$typed(v, id, hashTrend)
}
export function validateTrend<V>(v: V) {
return validate<Trend & V>(v, id, hashTrend)
}

@ -9,6 +9,7 @@ import {
is$typed as _is$typed,
type OmitKey,
} from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
@ -80,3 +81,23 @@ export function isTrendingTopic<V>(v: V) {
export function validateTrendingTopic<V>(v: V) {
return validate<TrendingTopic & V>(v, id, hashTrendingTopic)
}
export interface Trend {
$type?: 'app.bsky.unspecced.defs#trend'
topic: string
displayName: string
link: string
startTime: string
postCount: number
actors: AppBskyActorDefs.ProfileViewBasic[]
}
const hashTrend = 'trend'
export function isTrend<V>(v: V) {
return is$typed(v, id, hashTrend)
}
export function validateTrend<V>(v: V) {
return validate<Trend & V>(v, id, hashTrend)
}

@ -9,6 +9,7 @@ import {
is$typed as _is$typed,
type OmitKey,
} from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
@ -80,3 +81,23 @@ export function isTrendingTopic<V>(v: V) {
export function validateTrendingTopic<V>(v: V) {
return validate<TrendingTopic & V>(v, id, hashTrendingTopic)
}
export interface Trend {
$type?: 'app.bsky.unspecced.defs#trend'
topic: string
displayName: string
link: string
startTime: string
postCount: number
actors: AppBskyActorDefs.ProfileViewBasic[]
}
const hashTrend = 'trend'
export function isTrend<V>(v: V) {
return is$typed(v, id, hashTrend)
}
export function validateTrend<V>(v: V) {
return validate<Trend & V>(v, id, hashTrend)
}

@ -9,6 +9,7 @@ import {
is$typed as _is$typed,
type OmitKey,
} from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
@ -80,3 +81,23 @@ export function isTrendingTopic<V>(v: V) {
export function validateTrendingTopic<V>(v: V) {
return validate<TrendingTopic & V>(v, id, hashTrendingTopic)
}
export interface Trend {
$type?: 'app.bsky.unspecced.defs#trend'
topic: string
displayName: string
link: string
startTime: string
postCount: number
actors: AppBskyActorDefs.ProfileViewBasic[]
}
const hashTrend = 'trend'
export function isTrend<V>(v: V) {
return is$typed(v, id, hashTrend)
}
export function validateTrend<V>(v: V) {
return validate<Trend & V>(v, id, hashTrend)
}