@atproto/api 0.15.9 → 0.15.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7239,48 +7239,6 @@ export const schemaDict = {
7239
7239
  },
7240
7240
  },
7241
7241
  },
7242
- AppBskyFeedGetPosts: {
7243
- lexicon: 1,
7244
- id: 'app.bsky.feed.getPosts',
7245
- defs: {
7246
- main: {
7247
- type: 'query',
7248
- description:
7249
- "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
7250
- parameters: {
7251
- type: 'params',
7252
- required: ['uris'],
7253
- properties: {
7254
- uris: {
7255
- type: 'array',
7256
- description: 'List of post AT-URIs to return hydrated views for.',
7257
- items: {
7258
- type: 'string',
7259
- format: 'at-uri',
7260
- },
7261
- maxLength: 25,
7262
- },
7263
- },
7264
- },
7265
- output: {
7266
- encoding: 'application/json',
7267
- schema: {
7268
- type: 'object',
7269
- required: ['posts'],
7270
- properties: {
7271
- posts: {
7272
- type: 'array',
7273
- items: {
7274
- type: 'ref',
7275
- ref: 'lex:app.bsky.feed.defs#postView',
7276
- },
7277
- },
7278
- },
7279
- },
7280
- },
7281
- },
7282
- },
7283
- },
7284
7242
  AppBskyFeedGetPostThread: {
7285
7243
  lexicon: 1,
7286
7244
  id: 'app.bsky.feed.getPostThread',
@@ -7345,6 +7303,48 @@ export const schemaDict = {
7345
7303
  },
7346
7304
  },
7347
7305
  },
7306
+ AppBskyFeedGetPosts: {
7307
+ lexicon: 1,
7308
+ id: 'app.bsky.feed.getPosts',
7309
+ defs: {
7310
+ main: {
7311
+ type: 'query',
7312
+ description:
7313
+ "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
7314
+ parameters: {
7315
+ type: 'params',
7316
+ required: ['uris'],
7317
+ properties: {
7318
+ uris: {
7319
+ type: 'array',
7320
+ description: 'List of post AT-URIs to return hydrated views for.',
7321
+ items: {
7322
+ type: 'string',
7323
+ format: 'at-uri',
7324
+ },
7325
+ maxLength: 25,
7326
+ },
7327
+ },
7328
+ },
7329
+ output: {
7330
+ encoding: 'application/json',
7331
+ schema: {
7332
+ type: 'object',
7333
+ required: ['posts'],
7334
+ properties: {
7335
+ posts: {
7336
+ type: 'array',
7337
+ items: {
7338
+ type: 'ref',
7339
+ ref: 'lex:app.bsky.feed.defs#postView',
7340
+ },
7341
+ },
7342
+ },
7343
+ },
7344
+ },
7345
+ },
7346
+ },
7347
+ },
7348
7348
  AppBskyFeedGetQuotes: {
7349
7349
  lexicon: 1,
7350
7350
  id: 'app.bsky.feed.getQuotes',
@@ -10294,6 +10294,238 @@ export const schemaDict = {
10294
10294
  },
10295
10295
  },
10296
10296
  },
10297
+ AppBskyUnspeccedGetPostThreadHiddenV2: {
10298
+ lexicon: 1,
10299
+ id: 'app.bsky.unspecced.getPostThreadHiddenV2',
10300
+ defs: {
10301
+ main: {
10302
+ type: 'query',
10303
+ description:
10304
+ "(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.",
10305
+ parameters: {
10306
+ type: 'params',
10307
+ required: ['anchor'],
10308
+ properties: {
10309
+ anchor: {
10310
+ type: 'string',
10311
+ format: 'at-uri',
10312
+ description:
10313
+ 'Reference (AT-URI) to post record. This is the anchor post.',
10314
+ },
10315
+ },
10316
+ },
10317
+ output: {
10318
+ encoding: 'application/json',
10319
+ schema: {
10320
+ type: 'object',
10321
+ required: ['thread'],
10322
+ properties: {
10323
+ thread: {
10324
+ type: 'array',
10325
+ description:
10326
+ 'A flat list of thread hidden items. The depth of each item is indicated by the depth property inside the item.',
10327
+ items: {
10328
+ type: 'ref',
10329
+ ref: 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem',
10330
+ },
10331
+ },
10332
+ },
10333
+ },
10334
+ },
10335
+ },
10336
+ threadHiddenItem: {
10337
+ type: 'object',
10338
+ required: ['uri', 'depth', 'value'],
10339
+ properties: {
10340
+ uri: {
10341
+ type: 'string',
10342
+ format: 'at-uri',
10343
+ },
10344
+ depth: {
10345
+ type: 'integer',
10346
+ description:
10347
+ '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.',
10348
+ },
10349
+ value: {
10350
+ type: 'union',
10351
+ refs: [
10352
+ 'lex:app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItemPost',
10353
+ ],
10354
+ },
10355
+ },
10356
+ },
10357
+ threadHiddenItemPost: {
10358
+ type: 'object',
10359
+ required: ['post', 'hiddenByThreadgate', 'mutedByViewer'],
10360
+ properties: {
10361
+ post: {
10362
+ type: 'ref',
10363
+ ref: 'lex:app.bsky.feed.defs#postView',
10364
+ },
10365
+ hiddenByThreadgate: {
10366
+ type: 'boolean',
10367
+ description:
10368
+ 'The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread.',
10369
+ },
10370
+ mutedByViewer: {
10371
+ type: 'boolean',
10372
+ description:
10373
+ 'This is by an account muted by the viewer requesting it.',
10374
+ },
10375
+ },
10376
+ },
10377
+ },
10378
+ },
10379
+ AppBskyUnspeccedGetPostThreadV2: {
10380
+ lexicon: 1,
10381
+ id: 'app.bsky.unspecced.getPostThreadV2',
10382
+ defs: {
10383
+ main: {
10384
+ type: 'query',
10385
+ description:
10386
+ "(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 posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests.",
10387
+ parameters: {
10388
+ type: 'params',
10389
+ required: ['anchor'],
10390
+ properties: {
10391
+ anchor: {
10392
+ type: 'string',
10393
+ format: 'at-uri',
10394
+ description:
10395
+ 'Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post.',
10396
+ },
10397
+ above: {
10398
+ type: 'boolean',
10399
+ description: 'Whether to include parents above the anchor.',
10400
+ default: true,
10401
+ },
10402
+ below: {
10403
+ type: 'integer',
10404
+ description:
10405
+ 'How many levels of replies to include below the anchor.',
10406
+ default: 6,
10407
+ minimum: 0,
10408
+ maximum: 20,
10409
+ },
10410
+ branchingFactor: {
10411
+ type: 'integer',
10412
+ description:
10413
+ 'Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated).',
10414
+ default: 10,
10415
+ minimum: 0,
10416
+ maximum: 100,
10417
+ },
10418
+ prioritizeFollowedUsers: {
10419
+ type: 'boolean',
10420
+ description:
10421
+ 'Whether to prioritize posts from followed users. It only has effect when the user is authenticated.',
10422
+ default: false,
10423
+ },
10424
+ sort: {
10425
+ type: 'string',
10426
+ description: 'Sorting for the thread replies.',
10427
+ knownValues: ['newest', 'oldest', 'top'],
10428
+ default: 'oldest',
10429
+ },
10430
+ },
10431
+ },
10432
+ output: {
10433
+ encoding: 'application/json',
10434
+ schema: {
10435
+ type: 'object',
10436
+ required: ['thread', 'hasHiddenReplies'],
10437
+ properties: {
10438
+ thread: {
10439
+ type: 'array',
10440
+ description:
10441
+ 'A flat list of thread items. The depth of each item is indicated by the depth property inside the item.',
10442
+ items: {
10443
+ type: 'ref',
10444
+ ref: 'lex:app.bsky.unspecced.getPostThreadV2#threadItem',
10445
+ },
10446
+ },
10447
+ threadgate: {
10448
+ type: 'ref',
10449
+ ref: 'lex:app.bsky.feed.defs#threadgateView',
10450
+ },
10451
+ hasHiddenReplies: {
10452
+ type: 'boolean',
10453
+ description:
10454
+ 'Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them.',
10455
+ },
10456
+ },
10457
+ },
10458
+ },
10459
+ },
10460
+ threadItem: {
10461
+ type: 'object',
10462
+ required: ['uri', 'depth', 'value'],
10463
+ properties: {
10464
+ uri: {
10465
+ type: 'string',
10466
+ format: 'at-uri',
10467
+ },
10468
+ depth: {
10469
+ type: 'integer',
10470
+ description:
10471
+ '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.',
10472
+ },
10473
+ value: {
10474
+ type: 'union',
10475
+ refs: [
10476
+ 'lex:app.bsky.unspecced.getPostThreadV2#threadItemPost',
10477
+ 'lex:app.bsky.unspecced.getPostThreadV2#threadItemNoUnauthenticated',
10478
+ 'lex:app.bsky.unspecced.getPostThreadV2#threadItemNotFound',
10479
+ 'lex:app.bsky.unspecced.getPostThreadV2#threadItemBlocked',
10480
+ ],
10481
+ },
10482
+ },
10483
+ },
10484
+ threadItemPost: {
10485
+ type: 'object',
10486
+ required: ['post', 'moreParents', 'moreReplies', 'opThread'],
10487
+ properties: {
10488
+ post: {
10489
+ type: 'ref',
10490
+ ref: 'lex:app.bsky.feed.defs#postView',
10491
+ },
10492
+ moreParents: {
10493
+ type: 'boolean',
10494
+ description:
10495
+ 'This post has more parents that were not present in the response. This is just a boolean, without the number of parents.',
10496
+ },
10497
+ moreReplies: {
10498
+ type: 'integer',
10499
+ description:
10500
+ 'This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate.',
10501
+ },
10502
+ opThread: {
10503
+ type: 'boolean',
10504
+ description:
10505
+ 'This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread.',
10506
+ },
10507
+ },
10508
+ },
10509
+ threadItemNoUnauthenticated: {
10510
+ type: 'object',
10511
+ properties: {},
10512
+ },
10513
+ threadItemNotFound: {
10514
+ type: 'object',
10515
+ properties: {},
10516
+ },
10517
+ threadItemBlocked: {
10518
+ type: 'object',
10519
+ required: ['author'],
10520
+ properties: {
10521
+ author: {
10522
+ type: 'ref',
10523
+ ref: 'lex:app.bsky.feed.defs#blockedAuthor',
10524
+ },
10525
+ },
10526
+ },
10527
+ },
10528
+ },
10297
10529
  AppBskyUnspeccedGetSuggestedFeeds: {
10298
10530
  lexicon: 1,
10299
10531
  id: 'app.bsky.unspecced.getSuggestedFeeds',
@@ -16275,8 +16507,8 @@ export const ids = {
16275
16507
  AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
16276
16508
  AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
16277
16509
  AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
16278
- AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
16279
16510
  AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
16511
+ AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
16280
16512
  AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
16281
16513
  AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
16282
16514
  AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
@@ -16333,6 +16565,9 @@ export const ids = {
16333
16565
  AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
16334
16566
  AppBskyUnspeccedGetPopularFeedGenerators:
16335
16567
  'app.bsky.unspecced.getPopularFeedGenerators',
16568
+ AppBskyUnspeccedGetPostThreadHiddenV2:
16569
+ 'app.bsky.unspecced.getPostThreadHiddenV2',
16570
+ AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
16336
16571
  AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
16337
16572
  AppBskyUnspeccedGetSuggestedFeedsSkeleton:
16338
16573
  'app.bsky.unspecced.getSuggestedFeedsSkeleton',
@@ -0,0 +1,81 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as AppBskyFeedDefs from '../feed/defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'app.bsky.unspecced.getPostThreadHiddenV2'
18
+
19
+ export interface QueryParams {
20
+ /** Reference (AT-URI) to post record. This is the anchor post. */
21
+ anchor: string
22
+ }
23
+
24
+ export type InputSchema = undefined
25
+
26
+ export interface OutputSchema {
27
+ /** A flat list of thread hidden items. The depth of each item is indicated by the depth property inside the item. */
28
+ thread: ThreadHiddenItem[]
29
+ }
30
+
31
+ export interface CallOptions {
32
+ signal?: AbortSignal
33
+ headers?: HeadersMap
34
+ }
35
+
36
+ export interface Response {
37
+ success: boolean
38
+ headers: HeadersMap
39
+ data: OutputSchema
40
+ }
41
+
42
+ export function toKnownErr(e: any) {
43
+ return e
44
+ }
45
+
46
+ export interface ThreadHiddenItem {
47
+ $type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItem'
48
+ uri: string
49
+ /** 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. */
50
+ depth: number
51
+ value: $Typed<ThreadHiddenItemPost> | { $type: string }
52
+ }
53
+
54
+ const hashThreadHiddenItem = 'threadHiddenItem'
55
+
56
+ export function isThreadHiddenItem<V>(v: V) {
57
+ return is$typed(v, id, hashThreadHiddenItem)
58
+ }
59
+
60
+ export function validateThreadHiddenItem<V>(v: V) {
61
+ return validate<ThreadHiddenItem & V>(v, id, hashThreadHiddenItem)
62
+ }
63
+
64
+ export interface ThreadHiddenItemPost {
65
+ $type?: 'app.bsky.unspecced.getPostThreadHiddenV2#threadHiddenItemPost'
66
+ post: AppBskyFeedDefs.PostView
67
+ /** The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. */
68
+ hiddenByThreadgate: boolean
69
+ /** This is by an account muted by the viewer requesting it. */
70
+ mutedByViewer: boolean
71
+ }
72
+
73
+ const hashThreadHiddenItemPost = 'threadHiddenItemPost'
74
+
75
+ export function isThreadHiddenItemPost<V>(v: V) {
76
+ return is$typed(v, id, hashThreadHiddenItemPost)
77
+ }
78
+
79
+ export function validateThreadHiddenItemPost<V>(v: V) {
80
+ return validate<ThreadHiddenItemPost & V>(v, id, hashThreadHiddenItemPost)
81
+ }
@@ -0,0 +1,148 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as AppBskyFeedDefs from '../feed/defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'app.bsky.unspecced.getPostThreadV2'
18
+
19
+ export interface QueryParams {
20
+ /** Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post. */
21
+ anchor: string
22
+ /** Whether to include parents above the anchor. */
23
+ above?: boolean
24
+ /** How many levels of replies to include below the anchor. */
25
+ below?: number
26
+ /** Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated). */
27
+ branchingFactor?: number
28
+ /** Whether to prioritize posts from followed users. It only has effect when the user is authenticated. */
29
+ prioritizeFollowedUsers?: boolean
30
+ /** Sorting for the thread replies. */
31
+ sort?: 'newest' | 'oldest' | 'top' | (string & {})
32
+ }
33
+
34
+ export type InputSchema = undefined
35
+
36
+ export interface OutputSchema {
37
+ /** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
38
+ thread: ThreadItem[]
39
+ threadgate?: AppBskyFeedDefs.ThreadgateView
40
+ /** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
41
+ hasHiddenReplies: boolean
42
+ }
43
+
44
+ export interface CallOptions {
45
+ signal?: AbortSignal
46
+ headers?: HeadersMap
47
+ }
48
+
49
+ export interface Response {
50
+ success: boolean
51
+ headers: HeadersMap
52
+ data: OutputSchema
53
+ }
54
+
55
+ export function toKnownErr(e: any) {
56
+ return e
57
+ }
58
+
59
+ export interface ThreadItem {
60
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItem'
61
+ uri: string
62
+ /** 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. */
63
+ depth: number
64
+ value:
65
+ | $Typed<ThreadItemPost>
66
+ | $Typed<ThreadItemNoUnauthenticated>
67
+ | $Typed<ThreadItemNotFound>
68
+ | $Typed<ThreadItemBlocked>
69
+ | { $type: string }
70
+ }
71
+
72
+ const hashThreadItem = 'threadItem'
73
+
74
+ export function isThreadItem<V>(v: V) {
75
+ return is$typed(v, id, hashThreadItem)
76
+ }
77
+
78
+ export function validateThreadItem<V>(v: V) {
79
+ return validate<ThreadItem & V>(v, id, hashThreadItem)
80
+ }
81
+
82
+ export interface ThreadItemPost {
83
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemPost'
84
+ post: AppBskyFeedDefs.PostView
85
+ /** This post has more parents that were not present in the response. This is just a boolean, without the number of parents. */
86
+ moreParents: boolean
87
+ /** This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. */
88
+ moreReplies: number
89
+ /** This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. */
90
+ opThread: boolean
91
+ }
92
+
93
+ const hashThreadItemPost = 'threadItemPost'
94
+
95
+ export function isThreadItemPost<V>(v: V) {
96
+ return is$typed(v, id, hashThreadItemPost)
97
+ }
98
+
99
+ export function validateThreadItemPost<V>(v: V) {
100
+ return validate<ThreadItemPost & V>(v, id, hashThreadItemPost)
101
+ }
102
+
103
+ export interface ThreadItemNoUnauthenticated {
104
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemNoUnauthenticated'
105
+ }
106
+
107
+ const hashThreadItemNoUnauthenticated = 'threadItemNoUnauthenticated'
108
+
109
+ export function isThreadItemNoUnauthenticated<V>(v: V) {
110
+ return is$typed(v, id, hashThreadItemNoUnauthenticated)
111
+ }
112
+
113
+ export function validateThreadItemNoUnauthenticated<V>(v: V) {
114
+ return validate<ThreadItemNoUnauthenticated & V>(
115
+ v,
116
+ id,
117
+ hashThreadItemNoUnauthenticated,
118
+ )
119
+ }
120
+
121
+ export interface ThreadItemNotFound {
122
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemNotFound'
123
+ }
124
+
125
+ const hashThreadItemNotFound = 'threadItemNotFound'
126
+
127
+ export function isThreadItemNotFound<V>(v: V) {
128
+ return is$typed(v, id, hashThreadItemNotFound)
129
+ }
130
+
131
+ export function validateThreadItemNotFound<V>(v: V) {
132
+ return validate<ThreadItemNotFound & V>(v, id, hashThreadItemNotFound)
133
+ }
134
+
135
+ export interface ThreadItemBlocked {
136
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemBlocked'
137
+ author: AppBskyFeedDefs.BlockedAuthor
138
+ }
139
+
140
+ const hashThreadItemBlocked = 'threadItemBlocked'
141
+
142
+ export function isThreadItemBlocked<V>(v: V) {
143
+ return is$typed(v, id, hashThreadItemBlocked)
144
+ }
145
+
146
+ export function validateThreadItemBlocked<V>(v: V) {
147
+ return validate<ThreadItemBlocked & V>(v, id, hashThreadItemBlocked)
148
+ }