@atproto/pds 0.4.138 → 0.4.140

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 (40) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/lexicon/index.d.ts +6 -2
  3. package/dist/lexicon/index.d.ts.map +1 -1
  4. package/dist/lexicon/index.js +12 -4
  5. package/dist/lexicon/index.js.map +1 -1
  6. package/dist/lexicon/lexicons.d.ts +536 -88
  7. package/dist/lexicon/lexicons.d.ts.map +1 -1
  8. package/dist/lexicon/lexicons.js +279 -44
  9. package/dist/lexicon/lexicons.js.map +1 -1
  10. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +2 -0
  11. package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
  12. package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
  13. package/dist/lexicon/types/app/bsky/feed/like.d.ts +1 -0
  14. package/dist/lexicon/types/app/bsky/feed/like.d.ts.map +1 -1
  15. package/dist/lexicon/types/app/bsky/feed/like.js.map +1 -1
  16. package/dist/lexicon/types/app/bsky/feed/repost.d.ts +1 -0
  17. package/dist/lexicon/types/app/bsky/feed/repost.d.ts.map +1 -1
  18. package/dist/lexicon/types/app/bsky/feed/repost.js.map +1 -1
  19. package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
  20. package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
  21. package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
  22. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +61 -0
  23. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
  24. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +25 -0
  25. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
  26. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +92 -0
  27. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
  28. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js +52 -0
  29. package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
  30. package/package.json +6 -6
  31. package/src/lexicon/index.ts +33 -9
  32. package/src/lexicon/lexicons.ts +298 -45
  33. package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
  34. package/src/lexicon/types/app/bsky/feed/like.ts +1 -0
  35. package/src/lexicon/types/app/bsky/feed/repost.ts +1 -0
  36. package/src/lexicon/types/app/bsky/notification/listNotifications.ts +3 -1
  37. package/src/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.ts +93 -0
  38. package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +160 -0
  39. package/tests/proxied/__snapshots__/views.test.ts.snap +114 -108
  40. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,160 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
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 { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
14
+ import type * as AppBskyFeedDefs from '../feed/defs.js'
15
+
16
+ const is$typed = _is$typed,
17
+ validate = _validate
18
+ const id = 'app.bsky.unspecced.getPostThreadV2'
19
+
20
+ export interface QueryParams {
21
+ /** 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. */
22
+ anchor: string
23
+ /** Whether to include parents above the anchor. */
24
+ above: boolean
25
+ /** How many levels of replies to include below the anchor. */
26
+ below: number
27
+ /** 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). */
28
+ branchingFactor: number
29
+ /** Whether to prioritize posts from followed users. It only has effect when the user is authenticated. */
30
+ prioritizeFollowedUsers: boolean
31
+ /** Sorting for the thread replies. */
32
+ sort: 'newest' | 'oldest' | 'top' | (string & {})
33
+ }
34
+
35
+ export type InputSchema = undefined
36
+
37
+ export interface OutputSchema {
38
+ /** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. */
39
+ thread: ThreadItem[]
40
+ threadgate?: AppBskyFeedDefs.ThreadgateView
41
+ /** Whether this thread has hidden replies. If true, a call can be made to the `getPostThreadHiddenV2` endpoint to retrieve them. */
42
+ hasHiddenReplies: boolean
43
+ }
44
+
45
+ export type HandlerInput = undefined
46
+
47
+ export interface HandlerSuccess {
48
+ encoding: 'application/json'
49
+ body: OutputSchema
50
+ headers?: { [key: string]: string }
51
+ }
52
+
53
+ export interface HandlerError {
54
+ status: number
55
+ message?: string
56
+ }
57
+
58
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
59
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
60
+ auth: HA
61
+ params: QueryParams
62
+ input: HandlerInput
63
+ req: express.Request
64
+ res: express.Response
65
+ resetRouteRateLimits: () => Promise<void>
66
+ }
67
+ export type Handler<HA extends HandlerAuth = never> = (
68
+ ctx: HandlerReqCtx<HA>,
69
+ ) => Promise<HandlerOutput> | HandlerOutput
70
+
71
+ export interface ThreadItem {
72
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItem'
73
+ uri: string
74
+ /** 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. */
75
+ depth: number
76
+ value:
77
+ | $Typed<ThreadItemPost>
78
+ | $Typed<ThreadItemNoUnauthenticated>
79
+ | $Typed<ThreadItemNotFound>
80
+ | $Typed<ThreadItemBlocked>
81
+ | { $type: string }
82
+ }
83
+
84
+ const hashThreadItem = 'threadItem'
85
+
86
+ export function isThreadItem<V>(v: V) {
87
+ return is$typed(v, id, hashThreadItem)
88
+ }
89
+
90
+ export function validateThreadItem<V>(v: V) {
91
+ return validate<ThreadItem & V>(v, id, hashThreadItem)
92
+ }
93
+
94
+ export interface ThreadItemPost {
95
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemPost'
96
+ post: AppBskyFeedDefs.PostView
97
+ /** This post has more parents that were not present in the response. This is just a boolean, without the number of parents. */
98
+ moreParents: boolean
99
+ /** 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. */
100
+ moreReplies: number
101
+ /** 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. */
102
+ opThread: boolean
103
+ }
104
+
105
+ const hashThreadItemPost = 'threadItemPost'
106
+
107
+ export function isThreadItemPost<V>(v: V) {
108
+ return is$typed(v, id, hashThreadItemPost)
109
+ }
110
+
111
+ export function validateThreadItemPost<V>(v: V) {
112
+ return validate<ThreadItemPost & V>(v, id, hashThreadItemPost)
113
+ }
114
+
115
+ export interface ThreadItemNoUnauthenticated {
116
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemNoUnauthenticated'
117
+ }
118
+
119
+ const hashThreadItemNoUnauthenticated = 'threadItemNoUnauthenticated'
120
+
121
+ export function isThreadItemNoUnauthenticated<V>(v: V) {
122
+ return is$typed(v, id, hashThreadItemNoUnauthenticated)
123
+ }
124
+
125
+ export function validateThreadItemNoUnauthenticated<V>(v: V) {
126
+ return validate<ThreadItemNoUnauthenticated & V>(
127
+ v,
128
+ id,
129
+ hashThreadItemNoUnauthenticated,
130
+ )
131
+ }
132
+
133
+ export interface ThreadItemNotFound {
134
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemNotFound'
135
+ }
136
+
137
+ const hashThreadItemNotFound = 'threadItemNotFound'
138
+
139
+ export function isThreadItemNotFound<V>(v: V) {
140
+ return is$typed(v, id, hashThreadItemNotFound)
141
+ }
142
+
143
+ export function validateThreadItemNotFound<V>(v: V) {
144
+ return validate<ThreadItemNotFound & V>(v, id, hashThreadItemNotFound)
145
+ }
146
+
147
+ export interface ThreadItemBlocked {
148
+ $type?: 'app.bsky.unspecced.getPostThreadV2#threadItemBlocked'
149
+ author: AppBskyFeedDefs.BlockedAuthor
150
+ }
151
+
152
+ const hashThreadItemBlocked = 'threadItemBlocked'
153
+
154
+ export function isThreadItemBlocked<V>(v: V) {
155
+ return is$typed(v, id, hashThreadItemBlocked)
156
+ }
157
+
158
+ export function validateThreadItemBlocked<V>(v: V) {
159
+ return validate<ThreadItemBlocked & V>(v, id, hashThreadItemBlocked)
160
+ }