@atproto/api 0.15.8 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/agent.d.ts +8 -2
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +4 -2
  5. package/dist/agent.js.map +1 -1
  6. package/dist/client/index.d.ts +9 -3
  7. package/dist/client/index.d.ts.map +1 -1
  8. package/dist/client/index.js +17 -9
  9. package/dist/client/index.js.map +1 -1
  10. package/dist/client/lexicons.d.ts +536 -88
  11. package/dist/client/lexicons.d.ts.map +1 -1
  12. package/dist/client/lexicons.js +279 -44
  13. package/dist/client/lexicons.js.map +1 -1
  14. package/dist/client/types/app/bsky/feed/defs.d.ts +2 -0
  15. package/dist/client/types/app/bsky/feed/defs.d.ts.map +1 -1
  16. package/dist/client/types/app/bsky/feed/defs.js.map +1 -1
  17. package/dist/client/types/app/bsky/feed/like.d.ts +1 -0
  18. package/dist/client/types/app/bsky/feed/like.d.ts.map +1 -1
  19. package/dist/client/types/app/bsky/feed/like.js.map +1 -1
  20. package/dist/client/types/app/bsky/feed/repost.d.ts +1 -0
  21. package/dist/client/types/app/bsky/feed/repost.d.ts.map +1 -1
  22. package/dist/client/types/app/bsky/feed/repost.js.map +1 -1
  23. package/dist/client/types/app/bsky/notification/listNotifications.d.ts +2 -2
  24. package/dist/client/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
  25. package/dist/client/types/app/bsky/notification/listNotifications.js.map +1 -1
  26. package/dist/client/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +48 -0
  27. package/dist/client/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
  28. package/dist/client/types/app/bsky/unspecced/getPostThreadHiddenV2.js +29 -0
  29. package/dist/client/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
  30. package/dist/client/types/app/bsky/unspecced/getPostThreadV2.d.ts +79 -0
  31. package/dist/client/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
  32. package/dist/client/types/app/bsky/unspecced/getPostThreadV2.js +56 -0
  33. package/dist/client/types/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
  34. package/package.json +1 -1
  35. package/src/agent.ts +4 -2
  36. package/src/client/index.ts +37 -9
  37. package/src/client/lexicons.ts +298 -45
  38. package/src/client/types/app/bsky/feed/defs.ts +2 -0
  39. package/src/client/types/app/bsky/feed/like.ts +1 -0
  40. package/src/client/types/app/bsky/feed/repost.ts +1 -0
  41. package/src/client/types/app/bsky/notification/listNotifications.ts +3 -1
  42. package/src/client/types/app/bsky/unspecced/getPostThreadHiddenV2.ts +81 -0
  43. package/src/client/types/app/bsky/unspecced/getPostThreadV2.ts +148 -0
  44. package/tsconfig.build.tsbuildinfo +1 -1
@@ -6265,6 +6265,14 @@ export const schemaDict = {
6265
6265
  type: 'ref',
6266
6266
  ref: 'lex:app.bsky.actor.defs#profileViewBasic',
6267
6267
  },
6268
+ uri: {
6269
+ type: 'string',
6270
+ format: 'at-uri',
6271
+ },
6272
+ cid: {
6273
+ type: 'string',
6274
+ format: 'cid',
6275
+ },
6268
6276
  indexedAt: {
6269
6277
  type: 'string',
6270
6278
  format: 'datetime',
@@ -7231,48 +7239,6 @@ export const schemaDict = {
7231
7239
  },
7232
7240
  },
7233
7241
  },
7234
- AppBskyFeedGetPosts: {
7235
- lexicon: 1,
7236
- id: 'app.bsky.feed.getPosts',
7237
- defs: {
7238
- main: {
7239
- type: 'query',
7240
- description:
7241
- "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",
7242
- parameters: {
7243
- type: 'params',
7244
- required: ['uris'],
7245
- properties: {
7246
- uris: {
7247
- type: 'array',
7248
- description: 'List of post AT-URIs to return hydrated views for.',
7249
- items: {
7250
- type: 'string',
7251
- format: 'at-uri',
7252
- },
7253
- maxLength: 25,
7254
- },
7255
- },
7256
- },
7257
- output: {
7258
- encoding: 'application/json',
7259
- schema: {
7260
- type: 'object',
7261
- required: ['posts'],
7262
- properties: {
7263
- posts: {
7264
- type: 'array',
7265
- items: {
7266
- type: 'ref',
7267
- ref: 'lex:app.bsky.feed.defs#postView',
7268
- },
7269
- },
7270
- },
7271
- },
7272
- },
7273
- },
7274
- },
7275
- },
7276
7242
  AppBskyFeedGetPostThread: {
7277
7243
  lexicon: 1,
7278
7244
  id: 'app.bsky.feed.getPostThread',
@@ -7337,6 +7303,48 @@ export const schemaDict = {
7337
7303
  },
7338
7304
  },
7339
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
+ },
7340
7348
  AppBskyFeedGetQuotes: {
7341
7349
  lexicon: 1,
7342
7350
  id: 'app.bsky.feed.getQuotes',
@@ -7576,6 +7584,10 @@ export const schemaDict = {
7576
7584
  type: 'string',
7577
7585
  format: 'datetime',
7578
7586
  },
7587
+ via: {
7588
+ type: 'ref',
7589
+ ref: 'lex:com.atproto.repo.strongRef',
7590
+ },
7579
7591
  },
7580
7592
  },
7581
7593
  },
@@ -7790,6 +7802,10 @@ export const schemaDict = {
7790
7802
  type: 'string',
7791
7803
  format: 'datetime',
7792
7804
  },
7805
+ via: {
7806
+ type: 'ref',
7807
+ ref: 'lex:com.atproto.repo.strongRef',
7808
+ },
7793
7809
  },
7794
7810
  },
7795
7811
  },
@@ -7802,7 +7818,7 @@ export const schemaDict = {
7802
7818
  main: {
7803
7819
  type: 'query',
7804
7820
  description:
7805
- 'Find posts matching search criteria, returning views of those posts.',
7821
+ 'Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations.',
7806
7822
  parameters: {
7807
7823
  type: 'params',
7808
7824
  required: ['q'],
@@ -9845,7 +9861,7 @@ export const schemaDict = {
9845
9861
  reason: {
9846
9862
  type: 'string',
9847
9863
  description:
9848
- "Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', 'starterpack-joined', 'verified', and 'unverified'.",
9864
+ 'The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.',
9849
9865
  knownValues: [
9850
9866
  'like',
9851
9867
  'repost',
@@ -9856,6 +9872,8 @@ export const schemaDict = {
9856
9872
  'starterpack-joined',
9857
9873
  'verified',
9858
9874
  'unverified',
9875
+ 'like-via-repost',
9876
+ 'repost-via-repost',
9859
9877
  ],
9860
9878
  },
9861
9879
  reasonSubject: {
@@ -10276,6 +10294,238 @@ export const schemaDict = {
10276
10294
  },
10277
10295
  },
10278
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
+ },
10279
10529
  AppBskyUnspeccedGetSuggestedFeeds: {
10280
10530
  lexicon: 1,
10281
10531
  id: 'app.bsky.unspecced.getSuggestedFeeds',
@@ -16257,8 +16507,8 @@ export const ids = {
16257
16507
  AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton',
16258
16508
  AppBskyFeedGetLikes: 'app.bsky.feed.getLikes',
16259
16509
  AppBskyFeedGetListFeed: 'app.bsky.feed.getListFeed',
16260
- AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
16261
16510
  AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread',
16511
+ AppBskyFeedGetPosts: 'app.bsky.feed.getPosts',
16262
16512
  AppBskyFeedGetQuotes: 'app.bsky.feed.getQuotes',
16263
16513
  AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy',
16264
16514
  AppBskyFeedGetSuggestedFeeds: 'app.bsky.feed.getSuggestedFeeds',
@@ -16315,6 +16565,9 @@ export const ids = {
16315
16565
  AppBskyUnspeccedGetConfig: 'app.bsky.unspecced.getConfig',
16316
16566
  AppBskyUnspeccedGetPopularFeedGenerators:
16317
16567
  'app.bsky.unspecced.getPopularFeedGenerators',
16568
+ AppBskyUnspeccedGetPostThreadHiddenV2:
16569
+ 'app.bsky.unspecced.getPostThreadHiddenV2',
16570
+ AppBskyUnspeccedGetPostThreadV2: 'app.bsky.unspecced.getPostThreadV2',
16318
16571
  AppBskyUnspeccedGetSuggestedFeeds: 'app.bsky.unspecced.getSuggestedFeeds',
16319
16572
  AppBskyUnspeccedGetSuggestedFeedsSkeleton:
16320
16573
  'app.bsky.unspecced.getSuggestedFeedsSkeleton',
@@ -142,6 +142,8 @@ export function validateReplyRef<V>(v: V) {
142
142
  export interface ReasonRepost {
143
143
  $type?: 'app.bsky.feed.defs#reasonRepost'
144
144
  by: AppBskyActorDefs.ProfileViewBasic
145
+ uri?: string
146
+ cid?: string
145
147
  indexedAt: string
146
148
  }
147
149
 
@@ -19,6 +19,7 @@ export interface Record {
19
19
  $type: 'app.bsky.feed.like'
20
20
  subject: ComAtprotoRepoStrongRef.Main
21
21
  createdAt: string
22
+ via?: ComAtprotoRepoStrongRef.Main
22
23
  [k: string]: unknown
23
24
  }
24
25
 
@@ -19,6 +19,7 @@ export interface Record {
19
19
  $type: 'app.bsky.feed.repost'
20
20
  subject: ComAtprotoRepoStrongRef.Main
21
21
  createdAt: string
22
+ via?: ComAtprotoRepoStrongRef.Main
22
23
  [k: string]: unknown
23
24
  }
24
25
 
@@ -55,7 +55,7 @@ export interface Notification {
55
55
  uri: string
56
56
  cid: string
57
57
  author: AppBskyActorDefs.ProfileView
58
- /** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', 'starterpack-joined', 'verified', and 'unverified'. */
58
+ /** The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. */
59
59
  reason:
60
60
  | 'like'
61
61
  | 'repost'
@@ -66,6 +66,8 @@ export interface Notification {
66
66
  | 'starterpack-joined'
67
67
  | 'verified'
68
68
  | 'unverified'
69
+ | 'like-via-repost'
70
+ | 'repost-via-repost'
69
71
  | (string & {})
70
72
  reasonSubject?: string
71
73
  record: { [_ in string]: unknown }
@@ -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
+ }