Skip to content

Commit

Permalink
[threadContext 1] Add threadContext to threadViewPost - lex (#3318)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbsky authored Jan 21, 2025
1 parent 1ada2d0 commit b1dd050
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lexicons/app/bsky/feed/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
"pinned": { "type": "boolean" }
}
},
"threadContext": {
"type": "object",
"description": "Metadata about this post within the context of the thread it is in.",
"properties": {
"rootAuthorLike": { "type": "string", "format": "at-uri" }
}
},
"feedViewPost": {
"type": "object",
"required": ["post"],
Expand Down Expand Up @@ -108,7 +115,8 @@
"type": "union",
"refs": ["#threadViewPost", "#notFoundPost", "#blockedPost"]
}
}
},
"threadContext": { "type": "ref", "ref": "#threadContext" }
}
},
"notFoundPost": {
Expand Down
15 changes: 15 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,17 @@ export const schemaDict = {
},
},
},
threadContext: {
type: 'object',
description:
'Metadata about this post within the context of the thread it is in.',
properties: {
rootAuthorLike: {
type: 'string',
format: 'at-uri',
},
},
},
feedViewPost: {
type: 'object',
required: ['post'],
Expand Down Expand Up @@ -5673,6 +5684,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/api/src/client/types/app/bsky/feed/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
}

/** Metadata about this post within the context of the thread it is in. */
export interface ThreadContext {
rootAuthorLike?: string
[k: string]: unknown
}

export function isThreadContext(v: unknown): v is ThreadContext {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadContext'
)
}

export function validateThreadContext(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadContext', v)
}

export interface FeedViewPost {
post: PostView
reply?: ReplyRef
Expand Down Expand Up @@ -164,6 +182,7 @@ export interface ThreadViewPost {
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
threadContext?: ThreadContext
[k: string]: unknown
}

Expand Down
15 changes: 15 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,17 @@ export const schemaDict = {
},
},
},
threadContext: {
type: 'object',
description:
'Metadata about this post within the context of the thread it is in.',
properties: {
rootAuthorLike: {
type: 'string',
format: 'at-uri',
},
},
},
feedViewPost: {
type: 'object',
required: ['post'],
Expand Down Expand Up @@ -5673,6 +5684,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/bsky/src/lexicon/types/app/bsky/feed/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
}

/** Metadata about this post within the context of the thread it is in. */
export interface ThreadContext {
rootAuthorLike?: string
[k: string]: unknown
}

export function isThreadContext(v: unknown): v is ThreadContext {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadContext'
)
}

export function validateThreadContext(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadContext', v)
}

export interface FeedViewPost {
post: PostView
reply?: ReplyRef
Expand Down Expand Up @@ -164,6 +182,7 @@ export interface ThreadViewPost {
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
threadContext?: ThreadContext
[k: string]: unknown
}

Expand Down
15 changes: 15 additions & 0 deletions packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,17 @@ export const schemaDict = {
},
},
},
threadContext: {
type: 'object',
description:
'Metadata about this post within the context of the thread it is in.',
properties: {
rootAuthorLike: {
type: 'string',
format: 'at-uri',
},
},
},
feedViewPost: {
type: 'object',
required: ['post'],
Expand Down Expand Up @@ -5673,6 +5684,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/ozone/src/lexicon/types/app/bsky/feed/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
}

/** Metadata about this post within the context of the thread it is in. */
export interface ThreadContext {
rootAuthorLike?: string
[k: string]: unknown
}

export function isThreadContext(v: unknown): v is ThreadContext {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadContext'
)
}

export function validateThreadContext(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadContext', v)
}

export interface FeedViewPost {
post: PostView
reply?: ReplyRef
Expand Down Expand Up @@ -164,6 +182,7 @@ export interface ThreadViewPost {
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
threadContext?: ThreadContext
[k: string]: unknown
}

Expand Down
15 changes: 15 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,17 @@ export const schemaDict = {
},
},
},
threadContext: {
type: 'object',
description:
'Metadata about this post within the context of the thread it is in.',
properties: {
rootAuthorLike: {
type: 'string',
format: 'at-uri',
},
},
},
feedViewPost: {
type: 'object',
required: ['post'],
Expand Down Expand Up @@ -5673,6 +5684,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/pds/src/lexicon/types/app/bsky/feed/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
}

/** Metadata about this post within the context of the thread it is in. */
export interface ThreadContext {
rootAuthorLike?: string
[k: string]: unknown
}

export function isThreadContext(v: unknown): v is ThreadContext {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadContext'
)
}

export function validateThreadContext(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadContext', v)
}

export interface FeedViewPost {
post: PostView
reply?: ReplyRef
Expand Down Expand Up @@ -164,6 +182,7 @@ export interface ThreadViewPost {
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
threadContext?: ThreadContext
[k: string]: unknown
}

Expand Down

0 comments on commit b1dd050

Please sign in to comment.