Update V2 additional replies naming convention (#3929)
* Rename * Import sorting
This commit is contained in:
parent
598fcb693d
commit
c6eb8a12e2
7
.changeset/brave-beers-thank.md
Normal file
7
.changeset/brave-beers-thank.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"@atproto/bsky": patch
|
||||||
|
"@atproto/api": patch
|
||||||
|
"@atproto/pds": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Rename `getPostThreadHiddenV2` to `getPostThreadOtherV2` to better reflect the intent of the API.
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"lexicon": 1,
|
"lexicon": 1,
|
||||||
"id": "app.bsky.unspecced.getPostThreadHiddenV2",
|
"id": "app.bsky.unspecced.getPostThreadOtherV2",
|
||||||
"defs": {
|
"defs": {
|
||||||
"main": {
|
"main": {
|
||||||
"type": "query",
|
"type": "query",
|
||||||
"description": "(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get the hidden posts in a thread. It is based in an anchor post at any depth of the tree, and returns hidden replies (recursive replies, with branching to their replies) below the anchor. It does not include ancestors nor the anchor. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
"description": "(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"type": "params",
|
"type": "params",
|
||||||
"required": ["anchor"],
|
"required": ["anchor"],
|
||||||
@ -29,17 +29,17 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"thread": {
|
"thread": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item.",
|
"description": "A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "ref",
|
"type": "ref",
|
||||||
"ref": "#threadHiddenItem"
|
"ref": "#threadItem"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"threadHiddenItem": {
|
"threadItem": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["uri", "depth", "value"],
|
"required": ["uri", "depth", "value"],
|
||||||
"properties": {
|
"properties": {
|
@ -50,7 +50,7 @@
|
|||||||
"encoding": "application/json",
|
"encoding": "application/json",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["thread", "hasHiddenReplies"],
|
"required": ["thread", "hasOtherReplies"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"thread": {
|
"thread": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@ -64,9 +64,9 @@
|
|||||||
"type": "ref",
|
"type": "ref",
|
||||||
"ref": "app.bsky.feed.defs#threadgateView"
|
"ref": "app.bsky.feed.defs#threadgateView"
|
||||||
},
|
},
|
||||||
"hasHiddenReplies": {
|
"hasOtherReplies": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them."
|
"description": "Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
packages/api/src/client/index.ts
generated
32
packages/api/src/client/index.ts
generated
@ -128,8 +128,8 @@ import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|||||||
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
||||||
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
||||||
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
||||||
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
||||||
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
||||||
|
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
||||||
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
||||||
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
||||||
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
||||||
@ -183,7 +183,7 @@ import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js'
|
|||||||
import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
||||||
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
||||||
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadHiddenV2 from './types/app/bsky/unspecced/getPostThreadHiddenV2.js'
|
import * as AppBskyUnspeccedGetPostThreadOtherV2 from './types/app/bsky/unspecced/getPostThreadOtherV2.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
||||||
@ -391,8 +391,8 @@ export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|||||||
export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
||||||
export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
||||||
export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
||||||
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
||||||
export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
||||||
|
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
||||||
export * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
export * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
||||||
export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
||||||
export * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
export * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
||||||
@ -446,7 +446,7 @@ export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js'
|
|||||||
export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js'
|
||||||
export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
||||||
export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
||||||
export * as AppBskyUnspeccedGetPostThreadHiddenV2 from './types/app/bsky/unspecced/getPostThreadHiddenV2.js'
|
export * as AppBskyUnspeccedGetPostThreadOtherV2 from './types/app/bsky/unspecced/getPostThreadOtherV2.js'
|
||||||
export * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
export * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
||||||
export * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
export * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
||||||
export * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
export * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
||||||
@ -2107,6 +2107,13 @@ export class AppBskyFeedNS {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPosts(
|
||||||
|
params?: AppBskyFeedGetPosts.QueryParams,
|
||||||
|
opts?: AppBskyFeedGetPosts.CallOptions,
|
||||||
|
): Promise<AppBskyFeedGetPosts.Response> {
|
||||||
|
return this._client.call('app.bsky.feed.getPosts', params, undefined, opts)
|
||||||
|
}
|
||||||
|
|
||||||
getPostThread(
|
getPostThread(
|
||||||
params?: AppBskyFeedGetPostThread.QueryParams,
|
params?: AppBskyFeedGetPostThread.QueryParams,
|
||||||
opts?: AppBskyFeedGetPostThread.CallOptions,
|
opts?: AppBskyFeedGetPostThread.CallOptions,
|
||||||
@ -2118,13 +2125,6 @@ export class AppBskyFeedNS {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getPosts(
|
|
||||||
params?: AppBskyFeedGetPosts.QueryParams,
|
|
||||||
opts?: AppBskyFeedGetPosts.CallOptions,
|
|
||||||
): Promise<AppBskyFeedGetPosts.Response> {
|
|
||||||
return this._client.call('app.bsky.feed.getPosts', params, undefined, opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
getQuotes(
|
getQuotes(
|
||||||
params?: AppBskyFeedGetQuotes.QueryParams,
|
params?: AppBskyFeedGetQuotes.QueryParams,
|
||||||
opts?: AppBskyFeedGetQuotes.CallOptions,
|
opts?: AppBskyFeedGetQuotes.CallOptions,
|
||||||
@ -3443,12 +3443,12 @@ export class AppBskyUnspeccedNS {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThreadHiddenV2(
|
getPostThreadOtherV2(
|
||||||
params?: AppBskyUnspeccedGetPostThreadHiddenV2.QueryParams,
|
params?: AppBskyUnspeccedGetPostThreadOtherV2.QueryParams,
|
||||||
opts?: AppBskyUnspeccedGetPostThreadHiddenV2.CallOptions,
|
opts?: AppBskyUnspeccedGetPostThreadOtherV2.CallOptions,
|
||||||
): Promise<AppBskyUnspeccedGetPostThreadHiddenV2.Response> {
|
): Promise<AppBskyUnspeccedGetPostThreadOtherV2.Response> {
|
||||||
return this._client.call(
|
return this._client.call(
|
||||||
'app.bsky.unspecced.getPostThreadHiddenV2',
|
'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
params,
|
params,
|
||||||
undefined,
|
undefined,
|
||||||
opts,
|
opts,
|
||||||
|
108
packages/api/src/client/lexicons.ts
generated
108
packages/api/src/client/lexicons.ts
generated
@ -7239,6 +7239,48 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
AppBskyFeedGetPosts: {
|
||||||
|
lexicon: 1,
|
||||||
|
id: 'app.bsky.feed.getPosts',
|
||||||
|
defs: {
|
||||||
|
main: {
|
||||||
|
type: 'query',
|
||||||
|
description:
|
||||||
|
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
||||||
|
parameters: {
|
||||||
|
type: 'params',
|
||||||
|
required: ['uris'],
|
||||||
|
properties: {
|
||||||
|
uris: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'List of post AT-URIs to return hydrated views for.',
|
||||||
|
items: {
|
||||||
|
type: 'string',
|
||||||
|
format: 'at-uri',
|
||||||
|
},
|
||||||
|
maxLength: 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
required: ['posts'],
|
||||||
|
properties: {
|
||||||
|
posts: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'ref',
|
||||||
|
ref: 'lex:app.bsky.feed.defs#postView',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
AppBskyFeedGetPostThread: {
|
AppBskyFeedGetPostThread: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getPostThread',
|
id: 'app.bsky.feed.getPostThread',
|
||||||
@ -7303,48 +7345,6 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyFeedGetPosts: {
|
|
||||||
lexicon: 1,
|
|
||||||
id: 'app.bsky.feed.getPosts',
|
|
||||||
defs: {
|
|
||||||
main: {
|
|
||||||
type: 'query',
|
|
||||||
description:
|
|
||||||
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
||||||
parameters: {
|
|
||||||
type: 'params',
|
|
||||||
required: ['uris'],
|
|
||||||
properties: {
|
|
||||||
uris: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'List of post AT-URIs to return hydrated views for.',
|
|
||||||
items: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'at-uri',
|
|
||||||
},
|
|
||||||
maxLength: 25,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
encoding: 'application/json',
|
|
||||||
schema: {
|
|
||||||
type: 'object',
|
|
||||||
required: ['posts'],
|
|
||||||
properties: {
|
|
||||||
posts: {
|
|
||||||
type: 'array',
|
|
||||||
items: {
|
|
||||||
type: 'ref',
|
|
||||||
ref: 'lex:app.bsky.feed.defs#postView',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
AppBskyFeedGetQuotes: {
|
AppBskyFeedGetQuotes: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getQuotes',
|
id: 'app.bsky.feed.getQuotes',
|
||||||
@ -10354,14 +10354,14 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2: {
|
AppBskyUnspeccedGetPostThreadOtherV2: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.unspecced.getPostThreadHiddenV2',
|
id: 'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
defs: {
|
defs: {
|
||||||
main: {
|
main: {
|
||||||
type: 'query',
|
type: 'query',
|
||||||
description:
|
description:
|
||||||
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get the hidden posts in a thread. It is based in an anchor post at any depth of the tree, and returns hidden replies (recursive replies, with branching to their replies) below the anchor. It does not include ancestors nor the anchor. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
||||||
parameters: {
|
parameters: {
|
||||||
type: 'params',
|
type: 'params',
|
||||||
required: ['anchor'],
|
required: ['anchor'],
|
||||||
@ -10389,17 +10389,17 @@ export const schemaDict = {
|
|||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description:
|
description:
|
||||||
'A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item.',
|
'A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.',
|
||||||
items: {
|
items: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem',
|
ref: 'lex:app.bsky.unspecced.getPostThreadOtherV2#threadItem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
threadHiddenItem: {
|
threadItem: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['uri', 'depth', 'value'],
|
required: ['uri', 'depth', 'value'],
|
||||||
properties: {
|
properties: {
|
||||||
@ -10477,7 +10477,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['thread', 'hasHiddenReplies'],
|
required: ['thread', 'hasOtherReplies'],
|
||||||
properties: {
|
properties: {
|
||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
@ -10492,10 +10492,10 @@ export const schemaDict = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
||||||
},
|
},
|
||||||
hasHiddenReplies: {
|
hasOtherReplies: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description:
|
description:
|
||||||
'Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them.',
|
'Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -16510,8 +16510,8 @@ export const ids = {
|
|||||||
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
||||||
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
||||||
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
||||||
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
||||||
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
||||||
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
||||||
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
||||||
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
||||||
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
||||||
@ -16568,8 +16568,8 @@ export const ids = {
|
|||||||
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
||||||
AppBskyUnspeccedGetPopularFeedGenerators:
|
AppBskyUnspeccedGetPopularFeedGenerators:
|
||||||
'app.bsky.unspecced.getPopularFeedGenerators',
|
'app.bsky.unspecced.getPopularFeedGenerators',
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2:
|
AppBskyUnspeccedGetPostThreadOtherV2:
|
||||||
'app.bsky.unspecced.getPostThreadHiddenV2',
|
'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
||||||
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
||||||
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
||||||
|
@ -14,7 +14,7 @@ import type * as AppBskyUnspeccedDefs from './defs.js'
|
|||||||
|
|
||||||
const is$typed = _is$typed,
|
const is$typed = _is$typed,
|
||||||
validate = _validate
|
validate = _validate
|
||||||
const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
|
const id = 'app.bsky.unspecced.getPostThreadOtherV2'
|
||||||
|
|
||||||
export interface QueryParams {
|
export interface QueryParams {
|
||||||
/** Reference (AT-URI) to post record. This is the anchor post. */
|
/** Reference (AT-URI) to post record. This is the anchor post. */
|
||||||
@ -26,8 +26,8 @@ export interface QueryParams {
|
|||||||
export type InputSchema = undefined
|
export type InputSchema = undefined
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadHiddenItem[]
|
thread: ThreadItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CallOptions {
|
export interface CallOptions {
|
||||||
@ -45,20 +45,20 @@ export function toKnownErr(e: any) {
|
|||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ThreadHiddenItem {
|
export interface ThreadItem {
|
||||||
$type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
|
$type?: 'app.bsky.unspecced.getPostThreadOtherV2#threadItem'
|
||||||
uri: string
|
uri: string
|
||||||
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
||||||
depth: number
|
depth: number
|
||||||
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashThreadHiddenItem = 'threadHiddenItem'
|
const hashThreadItem = 'threadItem'
|
||||||
|
|
||||||
export function isThreadHiddenItem<V>(v: V) {
|
export function isThreadItem<V>(v: V) {
|
||||||
return is$typed(v, id, hashThreadHiddenItem)
|
return is$typed(v, id, hashThreadItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateThreadHiddenItem<V>(v: V) {
|
export function validateThreadItem<V>(v: V) {
|
||||||
return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
|
return validate<ThreadItem & V>(v, id, hashThreadItem)
|
||||||
}
|
}
|
@ -38,8 +38,8 @@ export interface OutputSchema {
|
|||||||
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadItem[]
|
thread: ThreadItem[]
|
||||||
threadgate?: AppBskyFeedDefs.ThreadgateView
|
threadgate?: AppBskyFeedDefs.ThreadgateView
|
||||||
/** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
|
/** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
|
||||||
hasHiddenReplies: boolean
|
hasOtherReplies: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CallOptions {
|
export interface CallOptions {
|
||||||
|
@ -3,7 +3,7 @@ import { AppContext } from '../../../../context'
|
|||||||
import { Code, DataPlaneClient, isDataplaneError } from '../../../../data-plane'
|
import { Code, DataPlaneClient, isDataplaneError } from '../../../../data-plane'
|
||||||
import { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
|
import { HydrateCtx, Hydrator } from '../../../../hydration/hydrator'
|
||||||
import { Server } from '../../../../lexicon'
|
import { Server } from '../../../../lexicon'
|
||||||
import { QueryParams } from '../../../../lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2'
|
import { QueryParams } from '../../../../lexicon/types/app/bsky/unspecced/getPostThreadOtherV2'
|
||||||
import {
|
import {
|
||||||
HydrationFnInput,
|
HydrationFnInput,
|
||||||
PresentationFnInput,
|
PresentationFnInput,
|
||||||
@ -25,13 +25,13 @@ const BELOW = 1
|
|||||||
const BRANCHING_FACTOR = 0
|
const BRANCHING_FACTOR = 0
|
||||||
|
|
||||||
export default function (server: Server, ctx: AppContext) {
|
export default function (server: Server, ctx: AppContext) {
|
||||||
const getPostThreadHidden = createPipeline(
|
const getPostThreadOther = createPipeline(
|
||||||
skeleton,
|
skeleton,
|
||||||
hydration,
|
hydration,
|
||||||
noRules, // handled in presentation: 3p block-violating replies are turned to #blockedPost, viewer blocks turned to #notFoundPost.
|
noRules, // handled in presentation: 3p block-violating replies are turned to #blockedPost, viewer blocks turned to #notFoundPost.
|
||||||
presentation,
|
presentation,
|
||||||
)
|
)
|
||||||
server.app.bsky.unspecced.getPostThreadHiddenV2({
|
server.app.bsky.unspecced.getPostThreadOtherV2({
|
||||||
auth: ctx.authVerifier.optionalStandardOrRole,
|
auth: ctx.authVerifier.optionalStandardOrRole,
|
||||||
handler: async ({ params, auth, req }) => {
|
handler: async ({ params, auth, req }) => {
|
||||||
const { viewer, includeTakedowns, include3pBlocks } =
|
const { viewer, includeTakedowns, include3pBlocks } =
|
||||||
@ -46,7 +46,7 @@ export default function (server: Server, ctx: AppContext) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
body: await getPostThreadHidden({ ...params, hydrateCtx }, ctx),
|
body: await getPostThreadOther({ ...params, hydrateCtx }, ctx),
|
||||||
headers: resHeaders({
|
headers: resHeaders({
|
||||||
labelers: hydrateCtx.labelers,
|
labelers: hydrateCtx.labelers,
|
||||||
}),
|
}),
|
||||||
@ -94,7 +94,7 @@ const presentation = (
|
|||||||
inputs: PresentationFnInput<Context, Params, Skeleton>,
|
inputs: PresentationFnInput<Context, Params, Skeleton>,
|
||||||
) => {
|
) => {
|
||||||
const { ctx, params, skeleton, hydration } = inputs
|
const { ctx, params, skeleton, hydration } = inputs
|
||||||
const thread = ctx.views.threadHiddenV2(skeleton, hydration, {
|
const thread = ctx.views.threadOtherV2(skeleton, hydration, {
|
||||||
below: BELOW,
|
below: BELOW,
|
||||||
branchingFactor: BRANCHING_FACTOR,
|
branchingFactor: BRANCHING_FACTOR,
|
||||||
prioritizeFollowedUsers: params.prioritizeFollowedUsers,
|
prioritizeFollowedUsers: params.prioritizeFollowedUsers,
|
@ -85,7 +85,7 @@ const presentation = (
|
|||||||
inputs: PresentationFnInput<Context, Params, Skeleton>,
|
inputs: PresentationFnInput<Context, Params, Skeleton>,
|
||||||
) => {
|
) => {
|
||||||
const { ctx, params, skeleton, hydration } = inputs
|
const { ctx, params, skeleton, hydration } = inputs
|
||||||
const { hasHiddenReplies, thread } = ctx.views.threadV2(skeleton, hydration, {
|
const { hasOtherReplies, thread } = ctx.views.threadV2(skeleton, hydration, {
|
||||||
above: calculateAbove(ctx, params),
|
above: calculateAbove(ctx, params),
|
||||||
below: calculateBelow(ctx, skeleton.anchor, params),
|
below: calculateBelow(ctx, skeleton.anchor, params),
|
||||||
branchingFactor: params.branchingFactor,
|
branchingFactor: params.branchingFactor,
|
||||||
@ -100,7 +100,7 @@ const presentation = (
|
|||||||
postUriToThreadgateUri(rootUri),
|
postUriToThreadgateUri(rootUri),
|
||||||
hydration,
|
hydration,
|
||||||
)
|
)
|
||||||
return { hasHiddenReplies, thread, threadgate }
|
return { hasOtherReplies, thread, threadgate }
|
||||||
}
|
}
|
||||||
|
|
||||||
type Context = {
|
type Context = {
|
||||||
|
@ -49,7 +49,7 @@ import registerPush from './app/bsky/notification/registerPush'
|
|||||||
import updateSeen from './app/bsky/notification/updateSeen'
|
import updateSeen from './app/bsky/notification/updateSeen'
|
||||||
import getConfig from './app/bsky/unspecced/getConfig'
|
import getConfig from './app/bsky/unspecced/getConfig'
|
||||||
import getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'
|
import getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'
|
||||||
import getPostThreadHiddenV2 from './app/bsky/unspecced/getPostThreadHiddenV2'
|
import getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2'
|
||||||
import getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'
|
import getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2'
|
||||||
import getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'
|
import getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds'
|
||||||
import getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'
|
import getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks'
|
||||||
@ -84,7 +84,7 @@ export default function (server: Server, ctx: AppContext) {
|
|||||||
getListFeed(server, ctx)
|
getListFeed(server, ctx)
|
||||||
getQuotes(server, ctx)
|
getQuotes(server, ctx)
|
||||||
getPostThread(server, ctx)
|
getPostThread(server, ctx)
|
||||||
getPostThreadHiddenV2(server, ctx)
|
getPostThreadOtherV2(server, ctx)
|
||||||
getPostThreadV2(server, ctx)
|
getPostThreadV2(server, ctx)
|
||||||
getPosts(server, ctx)
|
getPosts(server, ctx)
|
||||||
searchPosts(server, ctx)
|
searchPosts(server, ctx)
|
||||||
|
34
packages/bsky/src/lexicon/index.ts
generated
34
packages/bsky/src/lexicon/index.ts
generated
@ -108,8 +108,8 @@ import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|||||||
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
||||||
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
||||||
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
||||||
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
||||||
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
||||||
|
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
||||||
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
||||||
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
||||||
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
||||||
@ -145,7 +145,7 @@ import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/
|
|||||||
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
||||||
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
||||||
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadHiddenV2 from './types/app/bsky/unspecced/getPostThreadHiddenV2.js'
|
import * as AppBskyUnspeccedGetPostThreadOtherV2 from './types/app/bsky/unspecced/getPostThreadOtherV2.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
||||||
@ -1499,17 +1499,6 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThread<AV extends AuthVerifier>(
|
|
||||||
cfg: ConfigOf<
|
|
||||||
AV,
|
|
||||||
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
|
||||||
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
|
||||||
>,
|
|
||||||
) {
|
|
||||||
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
|
||||||
}
|
|
||||||
|
|
||||||
getPosts<AV extends AuthVerifier>(
|
getPosts<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1521,6 +1510,17 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPostThread<AV extends AuthVerifier>(
|
||||||
|
cfg: ConfigOf<
|
||||||
|
AV,
|
||||||
|
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
||||||
|
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
||||||
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
getQuotes<AV extends AuthVerifier>(
|
getQuotes<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1946,14 +1946,14 @@ export class AppBskyUnspeccedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThreadHiddenV2<AV extends AuthVerifier>(
|
getPostThreadOtherV2<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.Handler<ExtractAuth<AV>>,
|
AppBskyUnspeccedGetPostThreadOtherV2.Handler<ExtractAuth<AV>>,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.HandlerReqCtx<ExtractAuth<AV>>
|
AppBskyUnspeccedGetPostThreadOtherV2.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
const nsid = 'app.bsky.unspecced.getPostThreadHiddenV2' // @ts-ignore
|
const nsid = 'app.bsky.unspecced.getPostThreadOtherV2' // @ts-ignore
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
108
packages/bsky/src/lexicon/lexicons.ts
generated
108
packages/bsky/src/lexicon/lexicons.ts
generated
@ -7239,6 +7239,48 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
AppBskyFeedGetPosts: {
|
||||||
|
lexicon: 1,
|
||||||
|
id: 'app.bsky.feed.getPosts',
|
||||||
|
defs: {
|
||||||
|
main: {
|
||||||
|
type: 'query',
|
||||||
|
description:
|
||||||
|
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
||||||
|
parameters: {
|
||||||
|
type: 'params',
|
||||||
|
required: ['uris'],
|
||||||
|
properties: {
|
||||||
|
uris: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'List of post AT-URIs to return hydrated views for.',
|
||||||
|
items: {
|
||||||
|
type: 'string',
|
||||||
|
format: 'at-uri',
|
||||||
|
},
|
||||||
|
maxLength: 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
required: ['posts'],
|
||||||
|
properties: {
|
||||||
|
posts: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'ref',
|
||||||
|
ref: 'lex:app.bsky.feed.defs#postView',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
AppBskyFeedGetPostThread: {
|
AppBskyFeedGetPostThread: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getPostThread',
|
id: 'app.bsky.feed.getPostThread',
|
||||||
@ -7303,48 +7345,6 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyFeedGetPosts: {
|
|
||||||
lexicon: 1,
|
|
||||||
id: 'app.bsky.feed.getPosts',
|
|
||||||
defs: {
|
|
||||||
main: {
|
|
||||||
type: 'query',
|
|
||||||
description:
|
|
||||||
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
||||||
parameters: {
|
|
||||||
type: 'params',
|
|
||||||
required: ['uris'],
|
|
||||||
properties: {
|
|
||||||
uris: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'List of post AT-URIs to return hydrated views for.',
|
|
||||||
items: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'at-uri',
|
|
||||||
},
|
|
||||||
maxLength: 25,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
encoding: 'application/json',
|
|
||||||
schema: {
|
|
||||||
type: 'object',
|
|
||||||
required: ['posts'],
|
|
||||||
properties: {
|
|
||||||
posts: {
|
|
||||||
type: 'array',
|
|
||||||
items: {
|
|
||||||
type: 'ref',
|
|
||||||
ref: 'lex:app.bsky.feed.defs#postView',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
AppBskyFeedGetQuotes: {
|
AppBskyFeedGetQuotes: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getQuotes',
|
id: 'app.bsky.feed.getQuotes',
|
||||||
@ -10354,14 +10354,14 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2: {
|
AppBskyUnspeccedGetPostThreadOtherV2: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.unspecced.getPostThreadHiddenV2',
|
id: 'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
defs: {
|
defs: {
|
||||||
main: {
|
main: {
|
||||||
type: 'query',
|
type: 'query',
|
||||||
description:
|
description:
|
||||||
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get the hidden posts in a thread. It is based in an anchor post at any depth of the tree, and returns hidden replies (recursive replies, with branching to their replies) below the anchor. It does not include ancestors nor the anchor. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
||||||
parameters: {
|
parameters: {
|
||||||
type: 'params',
|
type: 'params',
|
||||||
required: ['anchor'],
|
required: ['anchor'],
|
||||||
@ -10389,17 +10389,17 @@ export const schemaDict = {
|
|||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description:
|
description:
|
||||||
'A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item.',
|
'A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.',
|
||||||
items: {
|
items: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem',
|
ref: 'lex:app.bsky.unspecced.getPostThreadOtherV2#threadItem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
threadHiddenItem: {
|
threadItem: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['uri', 'depth', 'value'],
|
required: ['uri', 'depth', 'value'],
|
||||||
properties: {
|
properties: {
|
||||||
@ -10477,7 +10477,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['thread', 'hasHiddenReplies'],
|
required: ['thread', 'hasOtherReplies'],
|
||||||
properties: {
|
properties: {
|
||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
@ -10492,10 +10492,10 @@ export const schemaDict = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
||||||
},
|
},
|
||||||
hasHiddenReplies: {
|
hasOtherReplies: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description:
|
description:
|
||||||
'Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them.',
|
'Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -12892,8 +12892,8 @@ export const ids = {
|
|||||||
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
||||||
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
||||||
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
||||||
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
||||||
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
||||||
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
||||||
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
||||||
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
||||||
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
||||||
@ -12950,8 +12950,8 @@ export const ids = {
|
|||||||
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
||||||
AppBskyUnspeccedGetPopularFeedGenerators:
|
AppBskyUnspeccedGetPopularFeedGenerators:
|
||||||
'app.bsky.unspecced.getPopularFeedGenerators',
|
'app.bsky.unspecced.getPopularFeedGenerators',
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2:
|
AppBskyUnspeccedGetPostThreadOtherV2:
|
||||||
'app.bsky.unspecced.getPostThreadHiddenV2',
|
'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
||||||
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
||||||
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
||||||
|
@ -15,7 +15,7 @@ import type * as AppBskyUnspeccedDefs from './defs.js'
|
|||||||
|
|
||||||
const is$typed = _is$typed,
|
const is$typed = _is$typed,
|
||||||
validate = _validate
|
validate = _validate
|
||||||
const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
|
const id = 'app.bsky.unspecced.getPostThreadOtherV2'
|
||||||
|
|
||||||
export interface QueryParams {
|
export interface QueryParams {
|
||||||
/** Reference (AT-URI) to post record. This is the anchor post. */
|
/** Reference (AT-URI) to post record. This is the anchor post. */
|
||||||
@ -27,8 +27,8 @@ export interface QueryParams {
|
|||||||
export type InputSchema = undefined
|
export type InputSchema = undefined
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadHiddenItem[]
|
thread: ThreadItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
@ -57,20 +57,20 @@ export type Handler<HA extends HandlerAuth = never> = (
|
|||||||
ctx: HandlerReqCtx<HA>,
|
ctx: HandlerReqCtx<HA>,
|
||||||
) => Promise<HandlerOutput> | HandlerOutput
|
) => Promise<HandlerOutput> | HandlerOutput
|
||||||
|
|
||||||
export interface ThreadHiddenItem {
|
export interface ThreadItem {
|
||||||
$type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
|
$type?: 'app.bsky.unspecced.getPostThreadOtherV2#threadItem'
|
||||||
uri: string
|
uri: string
|
||||||
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
||||||
depth: number
|
depth: number
|
||||||
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashThreadHiddenItem = 'threadHiddenItem'
|
const hashThreadItem = 'threadItem'
|
||||||
|
|
||||||
export function isThreadHiddenItem<V>(v: V) {
|
export function isThreadItem<V>(v: V) {
|
||||||
return is$typed(v, id, hashThreadHiddenItem)
|
return is$typed(v, id, hashThreadItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateThreadHiddenItem<V>(v: V) {
|
export function validateThreadItem<V>(v: V) {
|
||||||
return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
|
return validate<ThreadItem & V>(v, id, hashThreadItem)
|
||||||
}
|
}
|
@ -39,8 +39,8 @@ export interface OutputSchema {
|
|||||||
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadItem[]
|
thread: ThreadItem[]
|
||||||
threadgate?: AppBskyFeedDefs.ThreadgateView
|
threadgate?: AppBskyFeedDefs.ThreadgateView
|
||||||
/** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
|
/** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
|
||||||
hasHiddenReplies: boolean
|
hasOtherReplies: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
|
@ -59,7 +59,7 @@ import {
|
|||||||
isRecord as isLabelerRecord,
|
isRecord as isLabelerRecord,
|
||||||
} from '../lexicon/types/app/bsky/labeler/service'
|
} from '../lexicon/types/app/bsky/labeler/service'
|
||||||
import { RecordDeleted as NotificationRecordDeleted } from '../lexicon/types/app/bsky/notification/defs'
|
import { RecordDeleted as NotificationRecordDeleted } from '../lexicon/types/app/bsky/notification/defs'
|
||||||
import { ThreadHiddenItem } from '../lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2'
|
import { ThreadItem as ThreadOtherItem } from '../lexicon/types/app/bsky/unspecced/getPostThreadOtherV2'
|
||||||
import {
|
import {
|
||||||
QueryParams as GetPostThreadV2QueryParams,
|
QueryParams as GetPostThreadV2QueryParams,
|
||||||
ThreadItem,
|
ThreadItem,
|
||||||
@ -75,13 +75,13 @@ import {
|
|||||||
uriToDid as creatorFromUri,
|
uriToDid as creatorFromUri,
|
||||||
} from '../util/uris'
|
} from '../util/uris'
|
||||||
import {
|
import {
|
||||||
ThreadHiddenAnchorPostNode,
|
|
||||||
ThreadHiddenItemValuePost,
|
|
||||||
ThreadHiddenPostNode,
|
|
||||||
ThreadItemValueBlocked,
|
ThreadItemValueBlocked,
|
||||||
ThreadItemValueNoUnauthenticated,
|
ThreadItemValueNoUnauthenticated,
|
||||||
ThreadItemValueNotFound,
|
ThreadItemValueNotFound,
|
||||||
ThreadItemValuePost,
|
ThreadItemValuePost,
|
||||||
|
ThreadOtherAnchorPostNode,
|
||||||
|
ThreadOtherItemValuePost,
|
||||||
|
ThreadOtherPostNode,
|
||||||
ThreadTree,
|
ThreadTree,
|
||||||
ThreadTreeVisible,
|
ThreadTreeVisible,
|
||||||
sortTrimFlattenThreadTree,
|
sortTrimFlattenThreadTree,
|
||||||
@ -1161,7 +1161,7 @@ export class Views {
|
|||||||
prioritizeFollowedUsers: boolean
|
prioritizeFollowedUsers: boolean
|
||||||
sort: GetPostThreadV2QueryParams['sort']
|
sort: GetPostThreadV2QueryParams['sort']
|
||||||
},
|
},
|
||||||
): { hasHiddenReplies: boolean; thread: ThreadItem[] } {
|
): { hasOtherReplies: boolean; thread: ThreadItem[] } {
|
||||||
const { anchor: anchorUri, uris } = skeleton
|
const { anchor: anchorUri, uris } = skeleton
|
||||||
|
|
||||||
// Not found.
|
// Not found.
|
||||||
@ -1169,7 +1169,7 @@ export class Views {
|
|||||||
const post = state.posts?.get(anchorUri)
|
const post = state.posts?.get(anchorUri)
|
||||||
if (!post || !postView) {
|
if (!post || !postView) {
|
||||||
return {
|
return {
|
||||||
hasHiddenReplies: false,
|
hasOtherReplies: false,
|
||||||
thread: [
|
thread: [
|
||||||
this.threadV2ItemNotFound({
|
this.threadV2ItemNotFound({
|
||||||
uri: anchorUri,
|
uri: anchorUri,
|
||||||
@ -1182,7 +1182,7 @@ export class Views {
|
|||||||
// Blocked (only 1p for anchor).
|
// Blocked (only 1p for anchor).
|
||||||
if (this.viewerBlockExists(postView.author.did, state)) {
|
if (this.viewerBlockExists(postView.author.did, state)) {
|
||||||
return {
|
return {
|
||||||
hasHiddenReplies: false,
|
hasOtherReplies: false,
|
||||||
thread: [
|
thread: [
|
||||||
this.threadV2ItemBlocked({
|
this.threadV2ItemBlocked({
|
||||||
uri: anchorUri,
|
uri: anchorUri,
|
||||||
@ -1229,7 +1229,7 @@ export class Views {
|
|||||||
|
|
||||||
const anchorDepth = 0 // The depth of the anchor post is always 0.
|
const anchorDepth = 0 // The depth of the anchor post is always 0.
|
||||||
let anchorTree: ThreadTree
|
let anchorTree: ThreadTree
|
||||||
let hasHiddenReplies = false
|
let hasOtherReplies = false
|
||||||
|
|
||||||
if (this.noUnauthenticatedPost(state, postView)) {
|
if (this.noUnauthenticatedPost(state, postView)) {
|
||||||
anchorTree = {
|
anchorTree = {
|
||||||
@ -1241,7 +1241,7 @@ export class Views {
|
|||||||
parent,
|
parent,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const { replies, hasHiddenReplies: hasHiddenRepliesShadow } =
|
const { replies, hasOtherReplies: hasOtherRepliesShadow } =
|
||||||
!anchorViolatesThreadGate
|
!anchorViolatesThreadGate
|
||||||
? this.threadV2Replies(
|
? this.threadV2Replies(
|
||||||
{
|
{
|
||||||
@ -1257,8 +1257,8 @@ export class Views {
|
|||||||
},
|
},
|
||||||
state,
|
state,
|
||||||
)
|
)
|
||||||
: { replies: undefined, hasHiddenReplies: false }
|
: { replies: undefined, hasOtherReplies: false }
|
||||||
hasHiddenReplies = hasHiddenRepliesShadow
|
hasOtherReplies = hasOtherRepliesShadow
|
||||||
|
|
||||||
anchorTree = {
|
anchorTree = {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
@ -1287,7 +1287,7 @@ export class Views {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hasHiddenReplies,
|
hasOtherReplies,
|
||||||
thread,
|
thread,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1432,14 +1432,14 @@ export class Views {
|
|||||||
prioritizeFollowedUsers: boolean
|
prioritizeFollowedUsers: boolean
|
||||||
},
|
},
|
||||||
state: HydrationState,
|
state: HydrationState,
|
||||||
): { replies: ThreadTreeVisible[] | undefined; hasHiddenReplies: boolean } {
|
): { replies: ThreadTreeVisible[] | undefined; hasOtherReplies: boolean } {
|
||||||
// Reached the `below` limit.
|
// Reached the `below` limit.
|
||||||
if (depth > below) {
|
if (depth > below) {
|
||||||
return { replies: undefined, hasHiddenReplies: false }
|
return { replies: undefined, hasOtherReplies: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
const childrenUris = childrenByParentUri[parentUri] ?? []
|
const childrenUris = childrenByParentUri[parentUri] ?? []
|
||||||
let hasHiddenReplies = false
|
let hasOtherReplies = false
|
||||||
const replies = mapDefined(childrenUris, (uri) => {
|
const replies = mapDefined(childrenUris, (uri) => {
|
||||||
const replyInclusion = this.checkThreadV2ReplyInclusion({
|
const replyInclusion = this.checkThreadV2ReplyInclusion({
|
||||||
uri,
|
uri,
|
||||||
@ -1452,14 +1452,14 @@ export class Views {
|
|||||||
const { authorDid, post, postView } = replyInclusion
|
const { authorDid, post, postView } = replyInclusion
|
||||||
|
|
||||||
// Hidden.
|
// Hidden.
|
||||||
const { isHidden } = this.isHiddenThreadPost(
|
const { isOther } = this.isOtherThreadPost(
|
||||||
{ post, postView, prioritizeFollowedUsers, rootUri, uri },
|
{ post, postView, prioritizeFollowedUsers, rootUri, uri },
|
||||||
state,
|
state,
|
||||||
)
|
)
|
||||||
if (isHidden) {
|
if (isOther) {
|
||||||
// Only care about anchor replies
|
// Only care about anchor replies
|
||||||
if (depth === 1) {
|
if (depth === 1) {
|
||||||
hasHiddenReplies = true
|
hasOtherReplies = true
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
@ -1504,7 +1504,7 @@ export class Views {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
replies,
|
replies,
|
||||||
hasHiddenReplies,
|
hasOtherReplies,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,8 +1537,8 @@ export class Views {
|
|||||||
moreParents: moreParents ?? false,
|
moreParents: moreParents ?? false,
|
||||||
moreReplies,
|
moreReplies,
|
||||||
opThread: isOPThread,
|
opThread: isOPThread,
|
||||||
hiddenByThreadgate: false, // Hidden posts are handled by threadHiddenV2
|
hiddenByThreadgate: false, // Hidden posts are handled by threadOtherV2
|
||||||
mutedByViewer: false, // Hidden posts are handled by threadHiddenV2
|
mutedByViewer: false, // Hidden posts are handled by threadOtherV2
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1599,7 +1599,7 @@ export class Views {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
threadHiddenV2(
|
threadOtherV2(
|
||||||
skeleton: { anchor: string; uris: string[] },
|
skeleton: { anchor: string; uris: string[] },
|
||||||
state: HydrationState,
|
state: HydrationState,
|
||||||
{
|
{
|
||||||
@ -1611,7 +1611,7 @@ export class Views {
|
|||||||
branchingFactor: number
|
branchingFactor: number
|
||||||
prioritizeFollowedUsers: boolean
|
prioritizeFollowedUsers: boolean
|
||||||
},
|
},
|
||||||
): ThreadHiddenItem[] {
|
): ThreadOtherItem[] {
|
||||||
const { anchor: anchorUri, uris } = skeleton
|
const { anchor: anchorUri, uris } = skeleton
|
||||||
|
|
||||||
// Not found.
|
// Not found.
|
||||||
@ -1634,10 +1634,10 @@ export class Views {
|
|||||||
const rootUri = getRootUri(anchorUri, post)
|
const rootUri = getRootUri(anchorUri, post)
|
||||||
const opDid = uriToDid(rootUri)
|
const opDid = uriToDid(rootUri)
|
||||||
|
|
||||||
const anchorTree: ThreadHiddenAnchorPostNode = {
|
const anchorTree: ThreadOtherAnchorPostNode = {
|
||||||
type: 'hiddenAnchor',
|
type: 'hiddenAnchor',
|
||||||
item: this.threadHiddenV2ItemPostAnchor({ depth: 0, uri: anchorUri }),
|
item: this.threadOtherV2ItemPostAnchor({ depth: 0, uri: anchorUri }),
|
||||||
replies: this.threadHiddenV2Replies(
|
replies: this.threadOtherV2Replies(
|
||||||
{
|
{
|
||||||
parentUri: anchorUri,
|
parentUri: anchorUri,
|
||||||
rootUri,
|
rootUri,
|
||||||
@ -1660,7 +1660,7 @@ export class Views {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private threadHiddenV2Replies(
|
private threadOtherV2Replies(
|
||||||
{
|
{
|
||||||
parentUri,
|
parentUri,
|
||||||
rootUri,
|
rootUri,
|
||||||
@ -1677,7 +1677,7 @@ export class Views {
|
|||||||
prioritizeFollowedUsers: boolean
|
prioritizeFollowedUsers: boolean
|
||||||
},
|
},
|
||||||
state: HydrationState,
|
state: HydrationState,
|
||||||
): ThreadHiddenPostNode[] | undefined {
|
): ThreadOtherPostNode[] | undefined {
|
||||||
// Reached the `below` limit.
|
// Reached the `below` limit.
|
||||||
if (depth > below) {
|
if (depth > below) {
|
||||||
return undefined
|
return undefined
|
||||||
@ -1695,13 +1695,13 @@ export class Views {
|
|||||||
}
|
}
|
||||||
const { post, postView } = replyInclusion
|
const { post, postView } = replyInclusion
|
||||||
|
|
||||||
// Hidden.
|
// Other posts to pull out
|
||||||
const { isHidden, hiddenByThreadgate, mutedByViewer } =
|
const { isOther, hiddenByThreadgate, mutedByViewer } =
|
||||||
this.isHiddenThreadPost(
|
this.isOtherThreadPost(
|
||||||
{ post, postView, rootUri, prioritizeFollowedUsers, uri },
|
{ post, postView, rootUri, prioritizeFollowedUsers, uri },
|
||||||
state,
|
state,
|
||||||
)
|
)
|
||||||
if (isHidden) {
|
if (isOther) {
|
||||||
// Only show hidden anchor replies, not all hidden.
|
// Only show hidden anchor replies, not all hidden.
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
return undefined
|
return undefined
|
||||||
@ -1712,7 +1712,7 @@ export class Views {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recurse down.
|
// Recurse down.
|
||||||
const replies = this.threadHiddenV2Replies(
|
const replies = this.threadOtherV2Replies(
|
||||||
{
|
{
|
||||||
parentUri: uri,
|
parentUri: uri,
|
||||||
rootUri,
|
rootUri,
|
||||||
@ -1724,7 +1724,7 @@ export class Views {
|
|||||||
state,
|
state,
|
||||||
)
|
)
|
||||||
|
|
||||||
const item = this.threadHiddenV2ItemPost({
|
const item = this.threadOtherV2ItemPost({
|
||||||
depth,
|
depth,
|
||||||
hiddenByThreadgate,
|
hiddenByThreadgate,
|
||||||
mutedByViewer,
|
mutedByViewer,
|
||||||
@ -1732,7 +1732,7 @@ export class Views {
|
|||||||
uri,
|
uri,
|
||||||
})
|
})
|
||||||
|
|
||||||
const tree: ThreadHiddenPostNode = {
|
const tree: ThreadOtherPostNode = {
|
||||||
type: 'hiddenPost',
|
type: 'hiddenPost',
|
||||||
item: item,
|
item: item,
|
||||||
tags: post.tags,
|
tags: post.tags,
|
||||||
@ -1743,13 +1743,13 @@ export class Views {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private threadHiddenV2ItemPostAnchor({
|
private threadOtherV2ItemPostAnchor({
|
||||||
depth,
|
depth,
|
||||||
uri,
|
uri,
|
||||||
}: {
|
}: {
|
||||||
depth: number
|
depth: number
|
||||||
uri: string
|
uri: string
|
||||||
}): ThreadHiddenAnchorPostNode['item'] {
|
}): ThreadOtherAnchorPostNode['item'] {
|
||||||
return {
|
return {
|
||||||
uri,
|
uri,
|
||||||
depth,
|
depth,
|
||||||
@ -1759,7 +1759,7 @@ export class Views {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private threadHiddenV2ItemPost({
|
private threadOtherV2ItemPost({
|
||||||
depth,
|
depth,
|
||||||
hiddenByThreadgate,
|
hiddenByThreadgate,
|
||||||
mutedByViewer,
|
mutedByViewer,
|
||||||
@ -1771,8 +1771,8 @@ export class Views {
|
|||||||
mutedByViewer: boolean
|
mutedByViewer: boolean
|
||||||
postView: PostView
|
postView: PostView
|
||||||
uri: string
|
uri: string
|
||||||
}): ThreadHiddenItemValuePost {
|
}): ThreadOtherItemValuePost {
|
||||||
const base = this.threadHiddenV2ItemPostAnchor({ depth, uri })
|
const base = this.threadOtherV2ItemPostAnchor({ depth, uri })
|
||||||
return {
|
return {
|
||||||
...base,
|
...base,
|
||||||
value: {
|
value: {
|
||||||
@ -1780,9 +1780,9 @@ export class Views {
|
|||||||
post: postView,
|
post: postView,
|
||||||
hiddenByThreadgate,
|
hiddenByThreadgate,
|
||||||
mutedByViewer,
|
mutedByViewer,
|
||||||
moreParents: false, // Hidden replies don't have parents.
|
moreParents: false, // "Other" replies don't have parents.
|
||||||
moreReplies: 0, // Hidden replies don't have replies hydrated.
|
moreReplies: 0, // "Other" replies don't have replies hydrated.
|
||||||
opThread: false, // Hidden replies don't contain OP threads.
|
opThread: false, // "Other" replies don't contain OP threads.
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1834,7 +1834,7 @@ export class Views {
|
|||||||
return { authorDid, post, postView }
|
return { authorDid, post, postView }
|
||||||
}
|
}
|
||||||
|
|
||||||
private isHiddenThreadPost(
|
private isOtherThreadPost(
|
||||||
{
|
{
|
||||||
post,
|
post,
|
||||||
postView,
|
postView,
|
||||||
@ -1850,7 +1850,7 @@ export class Views {
|
|||||||
},
|
},
|
||||||
state: HydrationState,
|
state: HydrationState,
|
||||||
): {
|
): {
|
||||||
isHidden: boolean
|
isOther: boolean
|
||||||
hiddenByTag: boolean
|
hiddenByTag: boolean
|
||||||
hiddenByThreadgate: boolean
|
hiddenByThreadgate: boolean
|
||||||
mutedByViewer: boolean
|
mutedByViewer: boolean
|
||||||
@ -1873,7 +1873,7 @@ export class Views {
|
|||||||
const mutedByViewer = this.viewerMuteExists(authorDid, state)
|
const mutedByViewer = this.viewerMuteExists(authorDid, state)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isHidden: hiddenByTag || hiddenByThreadgate || mutedByViewer,
|
isOther: hiddenByTag || hiddenByThreadgate || mutedByViewer,
|
||||||
hiddenByTag,
|
hiddenByTag,
|
||||||
hiddenByThreadgate,
|
hiddenByThreadgate,
|
||||||
mutedByViewer,
|
mutedByViewer,
|
||||||
|
@ -7,18 +7,18 @@ import {
|
|||||||
ThreadItemNotFound,
|
ThreadItemNotFound,
|
||||||
ThreadItemPost,
|
ThreadItemPost,
|
||||||
} from '../lexicon/types/app/bsky/unspecced/defs'
|
} from '../lexicon/types/app/bsky/unspecced/defs'
|
||||||
import { ThreadHiddenItem } from '../lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2'
|
import { ThreadItem as ThreadOtherItem } from '../lexicon/types/app/bsky/unspecced/getPostThreadOtherV2'
|
||||||
import {
|
import {
|
||||||
QueryParams as GetPostThreadV2QueryParams,
|
QueryParams as GetPostThreadV2QueryParams,
|
||||||
ThreadItem,
|
ThreadItem,
|
||||||
} from '../lexicon/types/app/bsky/unspecced/getPostThreadV2'
|
} from '../lexicon/types/app/bsky/unspecced/getPostThreadV2'
|
||||||
import { $Typed } from '../lexicon/util'
|
import { $Typed } from '../lexicon/util'
|
||||||
|
|
||||||
type ThreadMaybeHiddenPostNode = ThreadPostNode | ThreadHiddenPostNode
|
type ThreadMaybeOtherPostNode = ThreadPostNode | ThreadOtherPostNode
|
||||||
type ThreadNodeWithReplies =
|
type ThreadNodeWithReplies =
|
||||||
| ThreadPostNode
|
| ThreadPostNode
|
||||||
| ThreadHiddenPostNode
|
| ThreadOtherPostNode
|
||||||
| ThreadHiddenAnchorPostNode
|
| ThreadOtherAnchorPostNode
|
||||||
|
|
||||||
type ThreadItemValue<T extends ThreadItem['value']> = Omit<
|
type ThreadItemValue<T extends ThreadItem['value']> = Omit<
|
||||||
ThreadItem,
|
ThreadItem,
|
||||||
@ -63,37 +63,37 @@ type ThreadPostNode = {
|
|||||||
replies: ThreadTree[] | undefined
|
replies: ThreadTree[] | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThreadHiddenItemValue<T extends ThreadHiddenItem['value']> = Omit<
|
type ThreadOtherItemValue<T extends ThreadOtherItem['value']> = Omit<
|
||||||
ThreadHiddenItem,
|
ThreadOtherItem,
|
||||||
'value'
|
'value'
|
||||||
> & {
|
> & {
|
||||||
value: T
|
value: T
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThreadHiddenItemValuePost = ThreadHiddenItemValue<
|
export type ThreadOtherItemValuePost = ThreadOtherItemValue<
|
||||||
$Typed<ThreadItemPost>
|
$Typed<ThreadItemPost>
|
||||||
>
|
>
|
||||||
|
|
||||||
// This is an intermediary type that doesn't map to the views.
|
// This is an intermediary type that doesn't map to the views.
|
||||||
// It is useful to differentiate between the anchor post and the replies for the hidden case,
|
// It is useful to differentiate between the anchor post and the replies for the hidden case,
|
||||||
// while also differentiating between hidden and visible cases.
|
// while also differentiating between hidden and visible cases.
|
||||||
export type ThreadHiddenAnchorPostNode = {
|
export type ThreadOtherAnchorPostNode = {
|
||||||
type: 'hiddenAnchor'
|
type: 'hiddenAnchor'
|
||||||
item: Omit<ThreadHiddenItem, 'value'> & { value: undefined }
|
item: Omit<ThreadOtherItem, 'value'> & { value: undefined }
|
||||||
replies: ThreadHiddenPostNode[] | undefined
|
replies: ThreadOtherPostNode[] | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThreadHiddenPostNode = {
|
export type ThreadOtherPostNode = {
|
||||||
type: 'hiddenPost'
|
type: 'hiddenPost'
|
||||||
item: ThreadHiddenItemValuePost
|
item: ThreadOtherItemValuePost
|
||||||
tags: Set<string>
|
tags: Set<string>
|
||||||
replies: ThreadHiddenPostNode[] | undefined
|
replies: ThreadOtherPostNode[] | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const isNodeWithReplies = (node: ThreadTree): node is ThreadNodeWithReplies =>
|
const isNodeWithReplies = (node: ThreadTree): node is ThreadNodeWithReplies =>
|
||||||
'replies' in node && node.replies !== undefined
|
'replies' in node && node.replies !== undefined
|
||||||
|
|
||||||
const isPostNode = (node: ThreadTree): node is ThreadMaybeHiddenPostNode =>
|
const isPostNode = (node: ThreadTree): node is ThreadMaybeOtherPostNode =>
|
||||||
node.type === 'post' || node.type === 'hiddenPost'
|
node.type === 'post' || node.type === 'hiddenPost'
|
||||||
|
|
||||||
export type ThreadTreeVisible =
|
export type ThreadTreeVisible =
|
||||||
@ -102,9 +102,9 @@ export type ThreadTreeVisible =
|
|||||||
| ThreadNotFoundNode
|
| ThreadNotFoundNode
|
||||||
| ThreadPostNode
|
| ThreadPostNode
|
||||||
|
|
||||||
export type ThreadTreeHidden = ThreadHiddenAnchorPostNode | ThreadHiddenPostNode
|
export type ThreadTreeOther = ThreadOtherAnchorPostNode | ThreadOtherPostNode
|
||||||
|
|
||||||
export type ThreadTree = ThreadTreeVisible | ThreadTreeHidden
|
export type ThreadTree = ThreadTreeVisible | ThreadTreeOther
|
||||||
|
|
||||||
/** This function mutates the tree parameter. */
|
/** This function mutates the tree parameter. */
|
||||||
export function sortTrimFlattenThreadTree(
|
export function sortTrimFlattenThreadTree(
|
||||||
@ -146,8 +146,8 @@ function sortTrimThreadTree(
|
|||||||
if (!isPostNode(bn)) {
|
if (!isPostNode(bn)) {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
const aNode: ThreadMaybeHiddenPostNode = an
|
const aNode: ThreadMaybeOtherPostNode = an
|
||||||
const bNode: ThreadMaybeHiddenPostNode = bn
|
const bNode: ThreadMaybeOtherPostNode = bn
|
||||||
|
|
||||||
// First applies bumping.
|
// First applies bumping.
|
||||||
const bump = applyBumping(aNode, bNode, opts)
|
const bump = applyBumping(aNode, bNode, opts)
|
||||||
@ -171,8 +171,8 @@ function sortTrimThreadTree(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function applyBumping(
|
function applyBumping(
|
||||||
aNode: ThreadMaybeHiddenPostNode,
|
aNode: ThreadMaybeOtherPostNode,
|
||||||
bNode: ThreadMaybeHiddenPostNode,
|
bNode: ThreadMaybeOtherPostNode,
|
||||||
opts: SortTrimFlattenOptions,
|
opts: SortTrimFlattenOptions,
|
||||||
): number | null {
|
): number | null {
|
||||||
if (!isPostNode(aNode)) {
|
if (!isPostNode(aNode)) {
|
||||||
@ -191,7 +191,7 @@ function applyBumping(
|
|||||||
} = opts
|
} = opts
|
||||||
|
|
||||||
type BumpDirection = 'up' | 'down'
|
type BumpDirection = 'up' | 'down'
|
||||||
type BumpPredicateFn = (i: ThreadMaybeHiddenPostNode) => boolean
|
type BumpPredicateFn = (i: ThreadMaybeOtherPostNode) => boolean
|
||||||
|
|
||||||
const maybeBump = (
|
const maybeBump = (
|
||||||
bump: BumpDirection,
|
bump: BumpDirection,
|
||||||
@ -276,8 +276,8 @@ function applyBumping(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function applySorting(
|
function applySorting(
|
||||||
aNode: ThreadMaybeHiddenPostNode,
|
aNode: ThreadMaybeOtherPostNode,
|
||||||
bNode: ThreadMaybeHiddenPostNode,
|
bNode: ThreadMaybeOtherPostNode,
|
||||||
opts: SortTrimFlattenOptions,
|
opts: SortTrimFlattenOptions,
|
||||||
): number {
|
): number {
|
||||||
const a = aNode.item.value
|
const a = aNode.item.value
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on 1 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on 1 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -1,
|
"depth": -1,
|
||||||
@ -100,7 +100,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on 2 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on 2 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -1,
|
"depth": -1,
|
||||||
@ -248,7 +248,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on 2.0 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on 2.0 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -2,
|
"depth": -2,
|
||||||
@ -396,7 +396,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on 3 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on 3 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -1,
|
"depth": -1,
|
||||||
@ -494,7 +494,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on r 0 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on r 0 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -1,
|
"depth": -1,
|
||||||
@ -642,7 +642,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on r 0.0 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on r 0.0 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": -2,
|
"depth": -2,
|
||||||
@ -790,7 +790,7 @@ Object {
|
|||||||
|
|
||||||
exports[`appview thread views v2 simple thread returns thread anchored on root 1`] = `
|
exports[`appview thread views v2 simple thread returns thread anchored on root 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"hasHiddenReplies": false,
|
"hasOtherReplies": false,
|
||||||
"thread": Array [
|
"thread": Array [
|
||||||
Object {
|
Object {
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
@ -3,14 +3,14 @@ import { AppBskyUnspeccedDefs, AtpAgent } from '@atproto/api'
|
|||||||
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
||||||
import { ids } from '../../src/lexicon/lexicons'
|
import { ids } from '../../src/lexicon/lexicons'
|
||||||
import { ThreadItemPost } from '../../src/lexicon/types/app/bsky/unspecced/defs'
|
import { ThreadItemPost } from '../../src/lexicon/types/app/bsky/unspecced/defs'
|
||||||
import { OutputSchema as OutputSchemaHiddenThread } from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2'
|
import { OutputSchema as OutputSchemaHiddenThread } from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2'
|
||||||
import {
|
import {
|
||||||
OutputSchema as OutputSchemaThread,
|
OutputSchema as OutputSchemaThread,
|
||||||
QueryParams as QueryParamsThread,
|
QueryParams as QueryParamsThread,
|
||||||
} from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadV2'
|
} from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadV2'
|
||||||
import {
|
import {
|
||||||
ThreadHiddenItemValuePost,
|
|
||||||
ThreadItemValuePost,
|
ThreadItemValuePost,
|
||||||
|
ThreadOtherItemValuePost,
|
||||||
} from '../../src/views/threads-v2'
|
} from '../../src/views/threads-v2'
|
||||||
import { forSnapshot } from '../_util'
|
import { forSnapshot } from '../_util'
|
||||||
import * as seeds from '../seed/thread-v2'
|
import * as seeds from '../seed/thread-v2'
|
||||||
@ -96,10 +96,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: 0, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: 0, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: 1, uri: seed.r['0'].ref.uriStr }),
|
expect.objectContaining({ depth: 1, uri: seed.r['0'].ref.uriStr }),
|
||||||
@ -122,10 +122,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: 0, uri: seed.r['0'].ref.uriStr }),
|
expect.objectContaining({ depth: 0, uri: seed.r['0'].ref.uriStr }),
|
||||||
@ -144,10 +144,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: -1, uri: seed.r['0'].ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.r['0'].ref.uriStr }),
|
||||||
@ -166,10 +166,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: 0, uri: seed.r['1'].ref.uriStr }),
|
expect.objectContaining({ depth: 0, uri: seed.r['1'].ref.uriStr }),
|
||||||
@ -187,10 +187,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: 0, uri: seed.r['2'].ref.uriStr }),
|
expect.objectContaining({ depth: 0, uri: seed.r['2'].ref.uriStr }),
|
||||||
@ -209,10 +209,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: -1, uri: seed.r['2'].ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.r['2'].ref.uriStr }),
|
||||||
@ -231,10 +231,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ depth: 0, uri: seed.r['3'].ref.uriStr }),
|
expect.objectContaining({ depth: 0, uri: seed.r['3'].ref.uriStr }),
|
||||||
@ -290,10 +290,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
const anchorIndex = t.findIndex((i) => i.uri === post.ref.uriStr)
|
const anchorIndex = t.findIndex((i) => i.uri === post.ref.uriStr)
|
||||||
const anchorPost = t[anchorIndex]
|
const anchorPost = t[anchorIndex]
|
||||||
|
|
||||||
@ -333,10 +333,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toHaveLength(16) // anchor + 15 ancestors, as limited by `maxThreadParents`.
|
expect(t).toHaveLength(16) // anchor + 15 ancestors, as limited by `maxThreadParents`.
|
||||||
|
|
||||||
const first = t.at(0)
|
const first = t.at(0)
|
||||||
@ -367,10 +367,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toHaveLength(1)
|
expect(t).toHaveLength(1)
|
||||||
|
|
||||||
const first = t.at(0)
|
const first = t.at(0)
|
||||||
@ -394,10 +394,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toHaveLength(11)
|
expect(t).toHaveLength(11)
|
||||||
const first = t.at(0)
|
const first = t.at(0)
|
||||||
expect(first!.uri).toBe(seed.root.ref.uriStr)
|
expect(first!.uri).toBe(seed.root.ref.uriStr)
|
||||||
@ -417,10 +417,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toHaveLength(4)
|
expect(t).toHaveLength(4)
|
||||||
|
|
||||||
const first = t.at(0)
|
const first = t.at(0)
|
||||||
@ -593,10 +593,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
if ('length' in args) {
|
if ('length' in args) {
|
||||||
expect(data.thread).toHaveLength(args.length)
|
expect(data.thread).toHaveLength(args.length)
|
||||||
} else {
|
} else {
|
||||||
@ -632,10 +632,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -780,10 +780,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
const opThreadPostsUris = new Set(
|
const opThreadPostsUris = new Set(
|
||||||
opThreadPosts.map((k) =>
|
opThreadPosts.map((k) =>
|
||||||
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
||||||
@ -884,10 +884,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
const tUris = t.map((i) => i.uri)
|
const tUris = t.map((i) => i.uri)
|
||||||
const postUris = postKeys.map((k) =>
|
const postUris = postKeys.map((k) =>
|
||||||
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
||||||
@ -937,10 +937,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
const tUris = t.map((i) => i.uri)
|
const tUris = t.map((i) => i.uri)
|
||||||
const postUris = postKeys.map((k) =>
|
const postUris = postKeys.map((k) =>
|
||||||
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
||||||
@ -1089,10 +1089,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
const tUris = t.map((i) => i.uri)
|
const tUris = t.map((i) => i.uri)
|
||||||
const postUris = postKeys.map((k) =>
|
const postUris = postKeys.map((k) =>
|
||||||
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
||||||
@ -1128,10 +1128,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1223,10 +1223,10 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
||||||
expect.objectContaining({ uri: seed.r['3'].ref.uriStr }),
|
expect.objectContaining({ uri: seed.r['3'].ref.uriStr }),
|
||||||
@ -1246,9 +1246,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.r['0'].ref.uriStr,
|
uri: seed.r['0'].ref.uriStr,
|
||||||
@ -1271,9 +1271,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.r['0'].ref.uriStr,
|
uri: seed.r['0'].ref.uriStr,
|
||||||
@ -1305,9 +1305,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
||||||
@ -1330,9 +1330,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -1370,9 +1370,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.r['1'].ref.uriStr,
|
uri: seed.r['1'].ref.uriStr,
|
||||||
@ -1402,9 +1402,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -1442,9 +1442,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
||||||
@ -1466,9 +1466,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.r['2'].ref.uriStr,
|
uri: seed.r['2'].ref.uriStr,
|
||||||
@ -1498,9 +1498,9 @@ describe('appview thread views v2', () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -1535,9 +1535,9 @@ describe('appview thread views v2', () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -1565,9 +1565,9 @@ describe('appview thread views v2', () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
uri: seed.root.ref.uriStr,
|
uri: seed.root.ref.uriStr,
|
||||||
@ -1622,9 +1622,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1644,13 +1644,13 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it(`top-level muted replies are returned when fetching hidden, sorted by newest`, async () => {
|
it(`top-level muted replies are returned when fetching hidden, sorted by newest`, async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{ anchor: seed.root.ref.uriStr },
|
{ anchor: seed.root.ref.uriStr },
|
||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
// Fetching as `op` mutes `opMuted`.
|
// Fetching as `op` mutes `opMuted`.
|
||||||
seed.users.op.did,
|
seed.users.op.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -1681,9 +1681,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1703,13 +1703,13 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it(`fetches hidden replies includes own mutes, not OP mutes, sorted by newest`, async () => {
|
it(`fetches hidden replies includes own mutes, not OP mutes, sorted by newest`, async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{ anchor: seed.root.ref.uriStr },
|
{ anchor: seed.root.ref.uriStr },
|
||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
// Fetching as `muter` mutes `muted`.
|
// Fetching as `muter` mutes `muted`.
|
||||||
seed.users.muter.did,
|
seed.users.muter.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -1737,9 +1737,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
// No muted posts by `opMuted`, gets the full thread.
|
// No muted posts by `opMuted`, gets the full thread.
|
||||||
expect(t.length).toBe(1 + Object.keys(seed.r).length) // root + replies
|
expect(t.length).toBe(1 + Object.keys(seed.r).length) // root + replies
|
||||||
@ -1765,9 +1765,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1792,12 +1792,12 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it(`top-level threadgated replies are returned to OP when fetching hidden, sorted by newest`, async () => {
|
it(`top-level threadgated replies are returned to OP when fetching hidden, sorted by newest`, async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{ anchor: seed.root.ref.uriStr },
|
{ anchor: seed.root.ref.uriStr },
|
||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
seed.users.op.did,
|
seed.users.op.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -1832,9 +1832,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(false)
|
expect(hasOtherReplies).toBe(false)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1895,9 +1895,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
@ -1928,13 +1928,13 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it(`top-level threadgated replies are returned to other viewers when fetching hidden, sorted by newest`, async () => {
|
it(`top-level threadgated replies are returned to other viewers when fetching hidden, sorted by newest`, async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{ anchor: seed.root.ref.uriStr },
|
{ anchor: seed.root.ref.uriStr },
|
||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
// `viewer` also gets the replies as hidden.
|
// `viewer` also gets the replies as hidden.
|
||||||
seed.users.viewer.did,
|
seed.users.viewer.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -1978,9 +1978,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
||||||
@ -2002,7 +2002,7 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('finds the hidden by tag', async () => {
|
it('finds the hidden by tag', async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{
|
{
|
||||||
anchor: seed.root.ref.uriStr,
|
anchor: seed.root.ref.uriStr,
|
||||||
prioritizeFollowedUsers,
|
prioritizeFollowedUsers,
|
||||||
@ -2010,7 +2010,7 @@ describe('appview thread views v2', () => {
|
|||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
seed.users.viewer.did,
|
seed.users.viewer.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -2041,9 +2041,9 @@ describe('appview thread views v2', () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const { thread: t, hasHiddenReplies } = data
|
const { thread: t, hasOtherReplies } = data
|
||||||
|
|
||||||
expect(hasHiddenReplies).toBe(true)
|
expect(hasOtherReplies).toBe(true)
|
||||||
assertPosts(t)
|
assertPosts(t)
|
||||||
expect(t).toEqual([
|
expect(t).toEqual([
|
||||||
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
||||||
@ -2064,7 +2064,7 @@ describe('appview thread views v2', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('finds the hidden by tag', async () => {
|
it('finds the hidden by tag', async () => {
|
||||||
const { data } = await agent.app.bsky.unspecced.getPostThreadHiddenV2(
|
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
||||||
{
|
{
|
||||||
anchor: seed.root.ref.uriStr,
|
anchor: seed.root.ref.uriStr,
|
||||||
prioritizeFollowedUsers,
|
prioritizeFollowedUsers,
|
||||||
@ -2072,7 +2072,7 @@ describe('appview thread views v2', () => {
|
|||||||
{
|
{
|
||||||
headers: await network.serviceHeaders(
|
headers: await network.serviceHeaders(
|
||||||
seed.users.viewer.did,
|
seed.users.viewer.did,
|
||||||
ids.AppBskyUnspeccedGetPostThreadHiddenV2,
|
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -2103,7 +2103,7 @@ function assertPosts(
|
|||||||
|
|
||||||
function assertHiddenPosts(
|
function assertHiddenPosts(
|
||||||
t: OutputSchemaHiddenThread['thread'],
|
t: OutputSchemaHiddenThread['thread'],
|
||||||
): asserts t is ThreadHiddenItemValuePost[] {
|
): asserts t is ThreadOtherItemValuePost[] {
|
||||||
t.forEach((i) => {
|
t.forEach((i) => {
|
||||||
assert(
|
assert(
|
||||||
AppBskyUnspeccedDefs.isThreadItemPost(i.value),
|
AppBskyUnspeccedDefs.isThreadItemPost(i.value),
|
||||||
|
34
packages/ozone/src/lexicon/index.ts
generated
34
packages/ozone/src/lexicon/index.ts
generated
@ -108,8 +108,8 @@ import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|||||||
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
||||||
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
||||||
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
||||||
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
||||||
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
||||||
|
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
||||||
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
||||||
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
||||||
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
||||||
@ -145,7 +145,7 @@ import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/
|
|||||||
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
||||||
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
||||||
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadHiddenV2 from './types/app/bsky/unspecced/getPostThreadHiddenV2.js'
|
import * as AppBskyUnspeccedGetPostThreadOtherV2 from './types/app/bsky/unspecced/getPostThreadOtherV2.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
||||||
@ -1549,17 +1549,6 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThread<AV extends AuthVerifier>(
|
|
||||||
cfg: ConfigOf<
|
|
||||||
AV,
|
|
||||||
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
|
||||||
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
|
||||||
>,
|
|
||||||
) {
|
|
||||||
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
|
||||||
}
|
|
||||||
|
|
||||||
getPosts<AV extends AuthVerifier>(
|
getPosts<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1571,6 +1560,17 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPostThread<AV extends AuthVerifier>(
|
||||||
|
cfg: ConfigOf<
|
||||||
|
AV,
|
||||||
|
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
||||||
|
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
||||||
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
getQuotes<AV extends AuthVerifier>(
|
getQuotes<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1996,14 +1996,14 @@ export class AppBskyUnspeccedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThreadHiddenV2<AV extends AuthVerifier>(
|
getPostThreadOtherV2<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.Handler<ExtractAuth<AV>>,
|
AppBskyUnspeccedGetPostThreadOtherV2.Handler<ExtractAuth<AV>>,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.HandlerReqCtx<ExtractAuth<AV>>
|
AppBskyUnspeccedGetPostThreadOtherV2.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
const nsid = 'app.bsky.unspecced.getPostThreadHiddenV2' // @ts-ignore
|
const nsid = 'app.bsky.unspecced.getPostThreadOtherV2' // @ts-ignore
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
108
packages/ozone/src/lexicon/lexicons.ts
generated
108
packages/ozone/src/lexicon/lexicons.ts
generated
@ -7239,6 +7239,48 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
AppBskyFeedGetPosts: {
|
||||||
|
lexicon: 1,
|
||||||
|
id: 'app.bsky.feed.getPosts',
|
||||||
|
defs: {
|
||||||
|
main: {
|
||||||
|
type: 'query',
|
||||||
|
description:
|
||||||
|
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
||||||
|
parameters: {
|
||||||
|
type: 'params',
|
||||||
|
required: ['uris'],
|
||||||
|
properties: {
|
||||||
|
uris: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'List of post AT-URIs to return hydrated views for.',
|
||||||
|
items: {
|
||||||
|
type: 'string',
|
||||||
|
format: 'at-uri',
|
||||||
|
},
|
||||||
|
maxLength: 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
required: ['posts'],
|
||||||
|
properties: {
|
||||||
|
posts: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'ref',
|
||||||
|
ref: 'lex:app.bsky.feed.defs#postView',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
AppBskyFeedGetPostThread: {
|
AppBskyFeedGetPostThread: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getPostThread',
|
id: 'app.bsky.feed.getPostThread',
|
||||||
@ -7303,48 +7345,6 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyFeedGetPosts: {
|
|
||||||
lexicon: 1,
|
|
||||||
id: 'app.bsky.feed.getPosts',
|
|
||||||
defs: {
|
|
||||||
main: {
|
|
||||||
type: 'query',
|
|
||||||
description:
|
|
||||||
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
||||||
parameters: {
|
|
||||||
type: 'params',
|
|
||||||
required: ['uris'],
|
|
||||||
properties: {
|
|
||||||
uris: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'List of post AT-URIs to return hydrated views for.',
|
|
||||||
items: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'at-uri',
|
|
||||||
},
|
|
||||||
maxLength: 25,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
encoding: 'application/json',
|
|
||||||
schema: {
|
|
||||||
type: 'object',
|
|
||||||
required: ['posts'],
|
|
||||||
properties: {
|
|
||||||
posts: {
|
|
||||||
type: 'array',
|
|
||||||
items: {
|
|
||||||
type: 'ref',
|
|
||||||
ref: 'lex:app.bsky.feed.defs#postView',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
AppBskyFeedGetQuotes: {
|
AppBskyFeedGetQuotes: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getQuotes',
|
id: 'app.bsky.feed.getQuotes',
|
||||||
@ -10354,14 +10354,14 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2: {
|
AppBskyUnspeccedGetPostThreadOtherV2: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.unspecced.getPostThreadHiddenV2',
|
id: 'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
defs: {
|
defs: {
|
||||||
main: {
|
main: {
|
||||||
type: 'query',
|
type: 'query',
|
||||||
description:
|
description:
|
||||||
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get the hidden posts in a thread. It is based in an anchor post at any depth of the tree, and returns hidden replies (recursive replies, with branching to their replies) below the anchor. It does not include ancestors nor the anchor. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
||||||
parameters: {
|
parameters: {
|
||||||
type: 'params',
|
type: 'params',
|
||||||
required: ['anchor'],
|
required: ['anchor'],
|
||||||
@ -10389,17 +10389,17 @@ export const schemaDict = {
|
|||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description:
|
description:
|
||||||
'A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item.',
|
'A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.',
|
||||||
items: {
|
items: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem',
|
ref: 'lex:app.bsky.unspecced.getPostThreadOtherV2#threadItem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
threadHiddenItem: {
|
threadItem: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['uri', 'depth', 'value'],
|
required: ['uri', 'depth', 'value'],
|
||||||
properties: {
|
properties: {
|
||||||
@ -10477,7 +10477,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['thread', 'hasHiddenReplies'],
|
required: ['thread', 'hasOtherReplies'],
|
||||||
properties: {
|
properties: {
|
||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
@ -10492,10 +10492,10 @@ export const schemaDict = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
||||||
},
|
},
|
||||||
hasHiddenReplies: {
|
hasOtherReplies: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description:
|
description:
|
||||||
'Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them.',
|
'Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -16510,8 +16510,8 @@ export const ids = {
|
|||||||
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
||||||
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
||||||
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
||||||
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
||||||
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
||||||
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
||||||
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
||||||
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
||||||
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
||||||
@ -16568,8 +16568,8 @@ export const ids = {
|
|||||||
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
||||||
AppBskyUnspeccedGetPopularFeedGenerators:
|
AppBskyUnspeccedGetPopularFeedGenerators:
|
||||||
'app.bsky.unspecced.getPopularFeedGenerators',
|
'app.bsky.unspecced.getPopularFeedGenerators',
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2:
|
AppBskyUnspeccedGetPostThreadOtherV2:
|
||||||
'app.bsky.unspecced.getPostThreadHiddenV2',
|
'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
||||||
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
||||||
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
||||||
|
@ -15,7 +15,7 @@ import type * as AppBskyUnspeccedDefs from './defs.js'
|
|||||||
|
|
||||||
const is$typed = _is$typed,
|
const is$typed = _is$typed,
|
||||||
validate = _validate
|
validate = _validate
|
||||||
const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
|
const id = 'app.bsky.unspecced.getPostThreadOtherV2'
|
||||||
|
|
||||||
export interface QueryParams {
|
export interface QueryParams {
|
||||||
/** Reference (AT-URI) to post record. This is the anchor post. */
|
/** Reference (AT-URI) to post record. This is the anchor post. */
|
||||||
@ -27,8 +27,8 @@ export interface QueryParams {
|
|||||||
export type InputSchema = undefined
|
export type InputSchema = undefined
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadHiddenItem[]
|
thread: ThreadItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
@ -57,20 +57,20 @@ export type Handler<HA extends HandlerAuth = never> = (
|
|||||||
ctx: HandlerReqCtx<HA>,
|
ctx: HandlerReqCtx<HA>,
|
||||||
) => Promise<HandlerOutput> | HandlerOutput
|
) => Promise<HandlerOutput> | HandlerOutput
|
||||||
|
|
||||||
export interface ThreadHiddenItem {
|
export interface ThreadItem {
|
||||||
$type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
|
$type?: 'app.bsky.unspecced.getPostThreadOtherV2#threadItem'
|
||||||
uri: string
|
uri: string
|
||||||
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
||||||
depth: number
|
depth: number
|
||||||
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashThreadHiddenItem = 'threadHiddenItem'
|
const hashThreadItem = 'threadItem'
|
||||||
|
|
||||||
export function isThreadHiddenItem<V>(v: V) {
|
export function isThreadItem<V>(v: V) {
|
||||||
return is$typed(v, id, hashThreadHiddenItem)
|
return is$typed(v, id, hashThreadItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateThreadHiddenItem<V>(v: V) {
|
export function validateThreadItem<V>(v: V) {
|
||||||
return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
|
return validate<ThreadItem & V>(v, id, hashThreadItem)
|
||||||
}
|
}
|
@ -39,8 +39,8 @@ export interface OutputSchema {
|
|||||||
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadItem[]
|
thread: ThreadItem[]
|
||||||
threadgate?: AppBskyFeedDefs.ThreadgateView
|
threadgate?: AppBskyFeedDefs.ThreadgateView
|
||||||
/** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
|
/** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
|
||||||
hasHiddenReplies: boolean
|
hasOtherReplies: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
|
34
packages/pds/src/lexicon/index.ts
generated
34
packages/pds/src/lexicon/index.ts
generated
@ -108,8 +108,8 @@ import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGene
|
|||||||
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js'
|
||||||
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js'
|
||||||
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js'
|
||||||
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
|
||||||
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js'
|
||||||
|
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js'
|
||||||
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js'
|
||||||
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js'
|
||||||
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js'
|
||||||
@ -145,7 +145,7 @@ import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/
|
|||||||
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js'
|
||||||
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js'
|
||||||
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadHiddenV2 from './types/app/bsky/unspecced/getPostThreadHiddenV2.js'
|
import * as AppBskyUnspeccedGetPostThreadOtherV2 from './types/app/bsky/unspecced/getPostThreadOtherV2.js'
|
||||||
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
import * as AppBskyUnspeccedGetPostThreadV2 from './types/app/bsky/unspecced/getPostThreadV2.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
import * as AppBskyUnspeccedGetSuggestedFeeds from './types/app/bsky/unspecced/getSuggestedFeeds.js'
|
||||||
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
import * as AppBskyUnspeccedGetSuggestedFeedsSkeleton from './types/app/bsky/unspecced/getSuggestedFeedsSkeleton.js'
|
||||||
@ -1549,17 +1549,6 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThread<AV extends AuthVerifier>(
|
|
||||||
cfg: ConfigOf<
|
|
||||||
AV,
|
|
||||||
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
|
||||||
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
|
||||||
>,
|
|
||||||
) {
|
|
||||||
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
|
||||||
}
|
|
||||||
|
|
||||||
getPosts<AV extends AuthVerifier>(
|
getPosts<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1571,6 +1560,17 @@ export class AppBskyFeedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPostThread<AV extends AuthVerifier>(
|
||||||
|
cfg: ConfigOf<
|
||||||
|
AV,
|
||||||
|
AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>,
|
||||||
|
AppBskyFeedGetPostThread.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
|
||||||
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
getQuotes<AV extends AuthVerifier>(
|
getQuotes<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
@ -1996,14 +1996,14 @@ export class AppBskyUnspeccedNS {
|
|||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostThreadHiddenV2<AV extends AuthVerifier>(
|
getPostThreadOtherV2<AV extends AuthVerifier>(
|
||||||
cfg: ConfigOf<
|
cfg: ConfigOf<
|
||||||
AV,
|
AV,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.Handler<ExtractAuth<AV>>,
|
AppBskyUnspeccedGetPostThreadOtherV2.Handler<ExtractAuth<AV>>,
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2.HandlerReqCtx<ExtractAuth<AV>>
|
AppBskyUnspeccedGetPostThreadOtherV2.HandlerReqCtx<ExtractAuth<AV>>
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
const nsid = 'app.bsky.unspecced.getPostThreadHiddenV2' // @ts-ignore
|
const nsid = 'app.bsky.unspecced.getPostThreadOtherV2' // @ts-ignore
|
||||||
return this._server.xrpc.method(nsid, cfg)
|
return this._server.xrpc.method(nsid, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
108
packages/pds/src/lexicon/lexicons.ts
generated
108
packages/pds/src/lexicon/lexicons.ts
generated
@ -7239,6 +7239,48 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
AppBskyFeedGetPosts: {
|
||||||
|
lexicon: 1,
|
||||||
|
id: 'app.bsky.feed.getPosts',
|
||||||
|
defs: {
|
||||||
|
main: {
|
||||||
|
type: 'query',
|
||||||
|
description:
|
||||||
|
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
||||||
|
parameters: {
|
||||||
|
type: 'params',
|
||||||
|
required: ['uris'],
|
||||||
|
properties: {
|
||||||
|
uris: {
|
||||||
|
type: 'array',
|
||||||
|
description: 'List of post AT-URIs to return hydrated views for.',
|
||||||
|
items: {
|
||||||
|
type: 'string',
|
||||||
|
format: 'at-uri',
|
||||||
|
},
|
||||||
|
maxLength: 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
required: ['posts'],
|
||||||
|
properties: {
|
||||||
|
posts: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'ref',
|
||||||
|
ref: 'lex:app.bsky.feed.defs#postView',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
AppBskyFeedGetPostThread: {
|
AppBskyFeedGetPostThread: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getPostThread',
|
id: 'app.bsky.feed.getPostThread',
|
||||||
@ -7303,48 +7345,6 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyFeedGetPosts: {
|
|
||||||
lexicon: 1,
|
|
||||||
id: 'app.bsky.feed.getPosts',
|
|
||||||
defs: {
|
|
||||||
main: {
|
|
||||||
type: 'query',
|
|
||||||
description:
|
|
||||||
"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
|
|
||||||
parameters: {
|
|
||||||
type: 'params',
|
|
||||||
required: ['uris'],
|
|
||||||
properties: {
|
|
||||||
uris: {
|
|
||||||
type: 'array',
|
|
||||||
description: 'List of post AT-URIs to return hydrated views for.',
|
|
||||||
items: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'at-uri',
|
|
||||||
},
|
|
||||||
maxLength: 25,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
encoding: 'application/json',
|
|
||||||
schema: {
|
|
||||||
type: 'object',
|
|
||||||
required: ['posts'],
|
|
||||||
properties: {
|
|
||||||
posts: {
|
|
||||||
type: 'array',
|
|
||||||
items: {
|
|
||||||
type: 'ref',
|
|
||||||
ref: 'lex:app.bsky.feed.defs#postView',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
AppBskyFeedGetQuotes: {
|
AppBskyFeedGetQuotes: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.feed.getQuotes',
|
id: 'app.bsky.feed.getQuotes',
|
||||||
@ -10354,14 +10354,14 @@ export const schemaDict = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2: {
|
AppBskyUnspeccedGetPostThreadOtherV2: {
|
||||||
lexicon: 1,
|
lexicon: 1,
|
||||||
id: 'app.bsky.unspecced.getPostThreadHiddenV2',
|
id: 'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
defs: {
|
defs: {
|
||||||
main: {
|
main: {
|
||||||
type: 'query',
|
type: 'query',
|
||||||
description:
|
description:
|
||||||
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get the hidden posts in a thread. It is based in an anchor post at any depth of the tree, and returns hidden replies (recursive replies, with branching to their replies) below the anchor. It does not include ancestors nor the anchor. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
"(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.",
|
||||||
parameters: {
|
parameters: {
|
||||||
type: 'params',
|
type: 'params',
|
||||||
required: ['anchor'],
|
required: ['anchor'],
|
||||||
@ -10389,17 +10389,17 @@ export const schemaDict = {
|
|||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
description:
|
description:
|
||||||
'A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item.',
|
'A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.',
|
||||||
items: {
|
items: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem',
|
ref: 'lex:app.bsky.unspecced.getPostThreadOtherV2#threadItem',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
threadHiddenItem: {
|
threadItem: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['uri', 'depth', 'value'],
|
required: ['uri', 'depth', 'value'],
|
||||||
properties: {
|
properties: {
|
||||||
@ -10477,7 +10477,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['thread', 'hasHiddenReplies'],
|
required: ['thread', 'hasOtherReplies'],
|
||||||
properties: {
|
properties: {
|
||||||
thread: {
|
thread: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
@ -10492,10 +10492,10 @@ export const schemaDict = {
|
|||||||
type: 'ref',
|
type: 'ref',
|
||||||
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
||||||
},
|
},
|
||||||
hasHiddenReplies: {
|
hasOtherReplies: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description:
|
description:
|
||||||
'Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them.',
|
'Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -16510,8 +16510,8 @@ export const ids = {
|
|||||||
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
|
||||||
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
|
||||||
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
|
||||||
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
|
||||||
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
|
||||||
|
AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
|
||||||
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
|
||||||
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
|
||||||
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
|
||||||
@ -16568,8 +16568,8 @@ export const ids = {
|
|||||||
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
|
||||||
AppBskyUnspeccedGetPopularFeedGenerators:
|
AppBskyUnspeccedGetPopularFeedGenerators:
|
||||||
'app.bsky.unspecced.getPopularFeedGenerators',
|
'app.bsky.unspecced.getPopularFeedGenerators',
|
||||||
AppBskyUnspeccedGetPostThreadHiddenV2:
|
AppBskyUnspeccedGetPostThreadOtherV2:
|
||||||
'app.bsky.unspecced.getPostThreadHiddenV2',
|
'app.bsky.unspecced.getPostThreadOtherV2',
|
||||||
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
|
||||||
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
|
||||||
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
AppBskyUnspeccedGetSuggestedFeedsSkeleton:
|
||||||
|
@ -15,7 +15,7 @@ import type * as AppBskyUnspeccedDefs from './defs.js'
|
|||||||
|
|
||||||
const is$typed = _is$typed,
|
const is$typed = _is$typed,
|
||||||
validate = _validate
|
validate = _validate
|
||||||
const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
|
const id = 'app.bsky.unspecced.getPostThreadOtherV2'
|
||||||
|
|
||||||
export interface QueryParams {
|
export interface QueryParams {
|
||||||
/** Reference (AT-URI) to post record. This is the anchor post. */
|
/** Reference (AT-URI) to post record. This is the anchor post. */
|
||||||
@ -27,8 +27,8 @@ export interface QueryParams {
|
|||||||
export type InputSchema = undefined
|
export type InputSchema = undefined
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** A flat list of hidden thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadHiddenItem[]
|
thread: ThreadItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
@ -57,20 +57,20 @@ export type Handler<HA extends HandlerAuth = never> = (
|
|||||||
ctx: HandlerReqCtx<HA>,
|
ctx: HandlerReqCtx<HA>,
|
||||||
) => Promise<HandlerOutput> | HandlerOutput
|
) => Promise<HandlerOutput> | HandlerOutput
|
||||||
|
|
||||||
export interface ThreadHiddenItem {
|
export interface ThreadItem {
|
||||||
$type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
|
$type?: 'app.bsky.unspecced.getPostThreadOtherV2#threadItem'
|
||||||
uri: string
|
uri: string
|
||||||
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
/** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. */
|
||||||
depth: number
|
depth: number
|
||||||
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
value: $Typed<AppBskyUnspeccedDefs.ThreadItemPost> | { $type: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashThreadHiddenItem = 'threadHiddenItem'
|
const hashThreadItem = 'threadItem'
|
||||||
|
|
||||||
export function isThreadHiddenItem<V>(v: V) {
|
export function isThreadItem<V>(v: V) {
|
||||||
return is$typed(v, id, hashThreadHiddenItem)
|
return is$typed(v, id, hashThreadItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateThreadHiddenItem<V>(v: V) {
|
export function validateThreadItem<V>(v: V) {
|
||||||
return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
|
return validate<ThreadItem & V>(v, id, hashThreadItem)
|
||||||
}
|
}
|
@ -39,8 +39,8 @@ export interface OutputSchema {
|
|||||||
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
/** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
|
||||||
thread: ThreadItem[]
|
thread: ThreadItem[]
|
||||||
threadgate?: AppBskyFeedDefs.ThreadgateView
|
threadgate?: AppBskyFeedDefs.ThreadgateView
|
||||||
/** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
|
/** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. */
|
||||||
hasHiddenReplies: boolean
|
hasOtherReplies: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export type HandlerInput = undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user