Skip to content

Commit

Permalink
Add threadContext to threadViewPost
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbsky committed Jan 3, 2025
1 parent 3365bf8 commit f7a8f60
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 4 deletions.
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
17 changes: 16 additions & 1 deletion packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5545,6 +5545,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 @@ -5645,6 +5656,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down Expand Up @@ -12359,7 +12374,7 @@ export const schemaDict = {
items: {
type: 'string',
description:
'If specified, only events where the policy matches the given policy are returned',
'If specified, only events where the action policies match any of the given policies are returned',
},
},
cursor: {
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 @@ -5545,6 +5545,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 @@ -5645,6 +5656,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
17 changes: 16 additions & 1 deletion packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5545,6 +5545,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 @@ -5645,6 +5656,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down Expand Up @@ -12359,7 +12374,7 @@ export const schemaDict = {
items: {
type: 'string',
description:
'If specified, only events where the policy matches the given policy are returned',
'If specified, only events where the action policies match any of the given policies are returned',
},
},
cursor: {
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
17 changes: 16 additions & 1 deletion packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5545,6 +5545,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 @@ -5645,6 +5656,10 @@ export const schemaDict = {
],
},
},
threadContext: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#threadContext',
},
},
},
notFoundPost: {
Expand Down Expand Up @@ -12359,7 +12374,7 @@ export const schemaDict = {
items: {
type: 'string',
description:
'If specified, only events where the policy matches the given policy are returned',
'If specified, only events where the action policies match any of the given policies are returned',
},
},
cursor: {
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 f7a8f60

Please sign in to comment.