@atproto/api 0.1.3 → 0.2.1

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 (208) hide show
  1. package/README.md +179 -25
  2. package/build.js +2 -1
  3. package/dist/agent.d.ts +11 -6
  4. package/dist/bsky-agent.d.ts +43 -0
  5. package/dist/client/index.d.ts +117 -215
  6. package/dist/client/lexicons.d.ts +1447 -1401
  7. package/dist/client/types/app/bsky/actor/defs.d.ts +47 -0
  8. package/dist/client/types/app/bsky/actor/getProfile.d.ts +2 -2
  9. package/dist/client/types/app/bsky/actor/getProfiles.d.ts +2 -2
  10. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +2 -2
  11. package/dist/client/types/app/bsky/actor/profile.d.ts +4 -60
  12. package/dist/client/types/app/bsky/actor/searchActors.d.ts +22 -0
  13. package/dist/client/types/app/bsky/actor/searchActorsTypeahead.d.ts +20 -0
  14. package/dist/client/types/app/bsky/embed/complexRecord.d.ts +24 -0
  15. package/dist/client/types/app/bsky/embed/external.d.ts +9 -13
  16. package/dist/client/types/app/bsky/embed/images.d.ts +9 -13
  17. package/dist/client/types/app/bsky/embed/post.d.ts +33 -0
  18. package/dist/client/types/app/bsky/embed/record.d.ts +21 -13
  19. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +24 -0
  20. package/dist/client/types/app/bsky/feed/defs.d.ts +77 -0
  21. package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +4 -4
  22. package/dist/client/types/app/bsky/{graph/getMembers.d.ts → feed/getLikes.d.ts} +12 -14
  23. package/dist/client/types/app/bsky/feed/getPostThread.d.ts +2 -24
  24. package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -3
  25. package/dist/client/types/app/bsky/feed/getTimeline.d.ts +3 -3
  26. package/dist/client/types/app/bsky/feed/post.d.ts +4 -29
  27. package/dist/client/types/app/bsky/graph/follow.d.ts +1 -2
  28. package/dist/client/types/app/bsky/graph/getFollowers.d.ts +5 -5
  29. package/dist/client/types/app/bsky/graph/getFollows.d.ts +5 -5
  30. package/dist/client/types/app/bsky/graph/getMutes.d.ts +3 -3
  31. package/dist/client/types/app/bsky/{notification/updateSeen.d.ts → graph/muteActor.d.ts} +1 -1
  32. package/dist/client/types/app/bsky/graph/unmuteActor.d.ts +17 -0
  33. package/dist/client/types/app/bsky/notification/getUnreadCount.d.ts +17 -0
  34. package/dist/client/types/app/bsky/{graph/getMemberships.d.ts → notification/listNotifications.d.ts} +13 -14
  35. package/dist/client/types/app/bsky/richtext/facet.d.ts +30 -0
  36. package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +21 -0
  37. package/dist/client/types/com/atproto/admin/defs.d.ts +181 -0
  38. package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +2 -2
  39. package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +3 -3
  40. package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +2 -2
  41. package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +3 -3
  42. package/dist/client/types/com/atproto/admin/getRecord.d.ts +2 -2
  43. package/dist/client/types/com/atproto/admin/getRepo.d.ts +2 -2
  44. package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +2 -2
  45. package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +2 -2
  46. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +3 -3
  47. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -6
  48. package/dist/client/types/com/atproto/{sync/getHead.d.ts → identity/resolveHandle.d.ts} +2 -2
  49. package/dist/client/types/com/atproto/identity/updateHandle.d.ts +17 -0
  50. package/dist/client/types/com/atproto/moderation/createReport.d.ts +38 -0
  51. package/dist/client/types/com/atproto/moderation/defs.d.ts +3 -0
  52. package/dist/client/types/com/atproto/repo/applyWrites.d.ts +47 -0
  53. package/dist/client/types/com/atproto/repo/createRecord.d.ts +7 -2
  54. package/dist/client/types/com/atproto/repo/deleteRecord.d.ts +7 -2
  55. package/dist/client/types/com/atproto/repo/describeRepo.d.ts +22 -0
  56. package/dist/client/types/com/atproto/repo/getRecord.d.ts +1 -1
  57. package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -3
  58. package/dist/client/types/com/atproto/repo/putRecord.d.ts +7 -2
  59. package/dist/client/types/com/atproto/repo/uploadBlob.d.ts +20 -0
  60. package/dist/client/types/{app/bsky/actor/createScene.d.ts → com/atproto/server/createAccount.d.ts} +14 -2
  61. package/dist/client/types/com/atproto/server/createInviteCode.d.ts +22 -0
  62. package/dist/client/types/com/atproto/server/createSession.d.ts +29 -0
  63. package/dist/client/types/com/atproto/server/deleteAccount.d.ts +25 -0
  64. package/dist/client/types/com/atproto/{sync/getRecord.d.ts → server/deleteSession.d.ts} +1 -5
  65. package/dist/client/types/com/atproto/server/describeServer.d.ts +27 -0
  66. package/dist/client/types/com/atproto/{sync/getRoot.d.ts → server/getSession.d.ts} +2 -2
  67. package/dist/client/types/com/atproto/server/refreshSession.d.ts +24 -0
  68. package/dist/client/types/com/atproto/{sync/updateRepo.d.ts → server/requestAccountDelete.d.ts} +1 -3
  69. package/dist/client/types/com/atproto/server/requestPasswordReset.d.ts +17 -0
  70. package/dist/client/types/com/atproto/server/resetPassword.d.ts +24 -0
  71. package/dist/client/types/com/atproto/sync/{getCheckout.d.ts → getBlob.d.ts} +1 -1
  72. package/dist/client/types/com/atproto/sync/{getCommitPath.d.ts → listBlobs.d.ts} +1 -1
  73. package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +1 -0
  74. package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +1 -1
  75. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -1
  76. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +58 -0
  77. package/dist/index.d.ts +6 -0
  78. package/dist/index.js +8055 -3651
  79. package/dist/index.js.map +4 -4
  80. package/dist/rich-text/detection.d.ts +4 -0
  81. package/dist/rich-text/rich-text.d.ts +39 -0
  82. package/dist/rich-text/sanitization.d.ts +4 -0
  83. package/dist/rich-text/unicode.d.ts +11 -0
  84. package/dist/types.d.ts +2 -2
  85. package/docs/rn-fetch-handler.ts +88 -0
  86. package/package.json +4 -1
  87. package/src/agent.ts +51 -15
  88. package/src/bsky-agent.ts +228 -0
  89. package/src/client/index.ts +330 -581
  90. package/src/client/lexicons.ts +1833 -1779
  91. package/src/client/types/app/bsky/actor/defs.ts +97 -0
  92. package/src/client/types/app/bsky/actor/getProfile.ts +4 -3
  93. package/src/client/types/app/bsky/actor/getProfiles.ts +4 -3
  94. package/src/client/types/app/bsky/actor/getSuggestions.ts +4 -3
  95. package/src/client/types/app/bsky/actor/profile.ts +5 -95
  96. package/src/client/types/app/bsky/actor/{searchTypeahead.ts → searchActors.ts} +6 -3
  97. package/src/client/types/app/bsky/actor/{search.ts → searchActorsTypeahead.ts} +4 -5
  98. package/src/client/types/app/bsky/embed/external.ts +14 -13
  99. package/src/client/types/app/bsky/embed/images.ts +14 -15
  100. package/src/client/types/app/bsky/embed/record.ts +32 -25
  101. package/src/client/types/app/bsky/embed/recordWithMedia.ts +53 -0
  102. package/src/client/types/app/bsky/feed/defs.ts +156 -0
  103. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +6 -5
  104. package/src/client/types/app/bsky/feed/{getVotes.ts → getLikes.ts} +11 -12
  105. package/src/client/types/app/bsky/feed/getPostThread.ts +5 -48
  106. package/src/client/types/app/bsky/feed/getRepostedBy.ts +5 -4
  107. package/src/client/types/app/bsky/feed/getTimeline.ts +5 -4
  108. package/src/client/types/app/bsky/feed/{vote.ts → like.ts} +4 -4
  109. package/src/client/types/app/bsky/feed/post.ts +10 -52
  110. package/src/client/types/app/bsky/feed/repost.ts +2 -1
  111. package/src/client/types/app/bsky/graph/follow.ts +3 -3
  112. package/src/client/types/app/bsky/graph/getFollowers.ts +7 -6
  113. package/src/client/types/app/bsky/graph/getFollows.ts +7 -6
  114. package/src/client/types/app/bsky/graph/getMutes.ts +5 -4
  115. package/src/client/types/app/bsky/graph/{mute.ts → muteActor.ts} +3 -2
  116. package/src/client/types/app/bsky/graph/{unmute.ts → unmuteActor.ts} +3 -2
  117. package/src/client/types/app/bsky/notification/{getCount.ts → getUnreadCount.ts} +2 -1
  118. package/src/client/types/app/bsky/notification/{list.ts → listNotifications.ts} +13 -9
  119. package/src/client/types/app/bsky/notification/updateSeen.ts +2 -1
  120. package/src/client/types/app/bsky/richtext/facet.ts +81 -0
  121. package/src/client/types/app/bsky/unspecced/getPopular.ts +38 -0
  122. package/src/client/types/com/atproto/admin/defs.ts +366 -0
  123. package/src/client/types/com/atproto/admin/getModerationAction.ts +4 -3
  124. package/src/client/types/com/atproto/admin/getModerationActions.ts +5 -4
  125. package/src/client/types/com/atproto/admin/getModerationReport.ts +4 -3
  126. package/src/client/types/com/atproto/admin/getModerationReports.ts +5 -4
  127. package/src/client/types/com/atproto/admin/getRecord.ts +4 -3
  128. package/src/client/types/com/atproto/admin/getRepo.ts +4 -3
  129. package/src/client/types/com/atproto/admin/resolveModerationReports.ts +4 -3
  130. package/src/client/types/com/atproto/admin/reverseModerationAction.ts +4 -3
  131. package/src/client/types/com/atproto/admin/searchRepos.ts +5 -4
  132. package/src/client/types/com/atproto/admin/takeModerationAction.ts +10 -10
  133. package/src/client/types/com/atproto/{handle/resolve.ts → identity/resolveHandle.ts} +2 -1
  134. package/src/client/types/com/atproto/{handle/update.ts → identity/updateHandle.ts} +2 -1
  135. package/src/client/types/com/atproto/{report/create.ts → moderation/createReport.ts} +10 -10
  136. package/src/client/types/com/atproto/moderation/defs.ts +17 -0
  137. package/src/client/types/com/atproto/repo/{batchWrite.ts → applyWrites.ts} +21 -12
  138. package/src/client/types/com/atproto/repo/createRecord.ts +15 -3
  139. package/src/client/types/com/atproto/repo/deleteRecord.ts +15 -3
  140. package/src/client/types/com/atproto/repo/{describe.ts → describeRepo.ts} +3 -2
  141. package/src/client/types/com/atproto/repo/getRecord.ts +4 -3
  142. package/src/client/types/com/atproto/repo/listRecords.ts +7 -6
  143. package/src/client/types/com/atproto/repo/putRecord.ts +18 -6
  144. package/src/client/types/com/atproto/repo/strongRef.ts +2 -1
  145. package/src/client/types/com/atproto/{blob/upload.ts → repo/uploadBlob.ts} +3 -2
  146. package/src/client/types/com/atproto/{account/create.ts → server/createAccount.ts} +9 -1
  147. package/src/client/types/com/atproto/{account → server}/createInviteCode.ts +2 -1
  148. package/src/client/types/com/atproto/{session/create.ts → server/createSession.ts} +2 -1
  149. package/src/client/types/com/atproto/{account/delete.ts → server/deleteAccount.ts} +2 -1
  150. package/src/client/types/com/atproto/{account/requestDelete.ts → server/deleteSession.ts} +2 -1
  151. package/src/client/types/com/atproto/server/{getAccountsConfig.ts → describeServer.ts} +4 -3
  152. package/src/client/types/com/atproto/{session/get.ts → server/getSession.ts} +2 -1
  153. package/src/client/types/com/atproto/{session/refresh.ts → server/refreshSession.ts} +2 -1
  154. package/src/client/types/com/atproto/{session/delete.ts → server/requestAccountDelete.ts} +2 -1
  155. package/src/client/types/com/atproto/{account → server}/requestPasswordReset.ts +2 -1
  156. package/src/client/types/com/atproto/{account → server}/resetPassword.ts +2 -1
  157. package/src/client/types/com/atproto/sync/getBlob.ts +33 -0
  158. package/src/client/types/com/atproto/sync/getBlocks.ts +2 -1
  159. package/src/client/types/com/atproto/sync/getCheckout.ts +2 -1
  160. package/src/client/types/com/atproto/sync/getCommitPath.ts +2 -1
  161. package/src/client/types/com/atproto/sync/getHead.ts +2 -1
  162. package/src/client/types/com/atproto/sync/getRecord.ts +2 -1
  163. package/src/client/types/com/atproto/sync/getRepo.ts +2 -1
  164. package/src/client/types/com/atproto/sync/listBlobs.ts +40 -0
  165. package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +6 -2
  166. package/src/client/types/com/atproto/sync/requestCrawl.ts +3 -2
  167. package/src/client/types/com/atproto/sync/subscribeRepos.ts +131 -0
  168. package/src/index.ts +12 -0
  169. package/src/rich-text/detection.ts +83 -0
  170. package/src/rich-text/rich-text.ts +401 -0
  171. package/src/rich-text/sanitization.ts +40 -0
  172. package/src/rich-text/unicode.ts +47 -0
  173. package/src/types.ts +2 -2
  174. package/tests/agent.test.ts +10 -6
  175. package/tests/bsky-agent.test.ts +140 -0
  176. package/tests/errors.test.ts +4 -4
  177. package/tests/rich-text-detection.test.ts +229 -0
  178. package/tests/rich-text-sanitization.test.ts +211 -0
  179. package/tests/rich-text.test.ts +661 -0
  180. package/tsconfig.build.tsbuildinfo +1 -1
  181. package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
  182. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
  183. package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
  184. package/dist/client/types/com/atproto/repo/strongRef.d.ts +0 -8
  185. package/dist/client/util.d.ts +0 -2
  186. package/src/client/types/app/bsky/actor/ref.ts +0 -64
  187. package/src/client/types/app/bsky/actor/updateProfile.ts +0 -71
  188. package/src/client/types/app/bsky/feed/feedViewPost.ts +0 -64
  189. package/src/client/types/app/bsky/feed/setVote.ts +0 -40
  190. package/src/client/types/app/bsky/graph/assertCreator.ts +0 -9
  191. package/src/client/types/app/bsky/graph/assertMember.ts +0 -9
  192. package/src/client/types/app/bsky/graph/assertion.ts +0 -27
  193. package/src/client/types/app/bsky/graph/confirmation.ts +0 -28
  194. package/src/client/types/app/bsky/system/actorUser.ts +0 -9
  195. package/src/client/types/app/bsky/system/declRef.ts +0 -26
  196. package/src/client/types/app/bsky/system/declaration.ts +0 -24
  197. package/src/client/types/com/atproto/account/get.ts +0 -26
  198. package/src/client/types/com/atproto/admin/blob.ts +0 -84
  199. package/src/client/types/com/atproto/admin/moderationAction.ts +0 -118
  200. package/src/client/types/com/atproto/admin/moderationReport.ts +0 -64
  201. package/src/client/types/com/atproto/admin/record.ts +0 -92
  202. package/src/client/types/com/atproto/admin/repo.ts +0 -103
  203. package/src/client/types/com/atproto/repo/recordRef.ts +0 -25
  204. package/src/client/types/com/atproto/repo/repoRef.ts +0 -24
  205. package/src/client/types/com/atproto/report/reasonType.ts +0 -16
  206. package/src/client/types/com/atproto/report/subject.ts +0 -66
  207. package/src/client/types/com/atproto/sync/subscribeAllRepos.ts +0 -7
  208. /package/dist/client/types/app/bsky/feed/{repost.d.ts → like.d.ts} +0 -0
@@ -0,0 +1,156 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyActorDefs from '../actor/defs'
9
+ import * as AppBskyEmbedImages from '../embed/images'
10
+ import * as AppBskyEmbedExternal from '../embed/external'
11
+ import * as AppBskyEmbedRecord from '../embed/record'
12
+ import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
13
+
14
+ export interface PostView {
15
+ uri: string
16
+ cid: string
17
+ author: AppBskyActorDefs.ProfileViewBasic
18
+ record: {}
19
+ embed?:
20
+ | AppBskyEmbedImages.View
21
+ | AppBskyEmbedExternal.View
22
+ | AppBskyEmbedRecord.View
23
+ | AppBskyEmbedRecordWithMedia.View
24
+ | { $type: string; [k: string]: unknown }
25
+ replyCount?: number
26
+ repostCount?: number
27
+ likeCount?: number
28
+ indexedAt: string
29
+ viewer?: ViewerState
30
+ [k: string]: unknown
31
+ }
32
+
33
+ export function isPostView(v: unknown): v is PostView {
34
+ return (
35
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#postView'
36
+ )
37
+ }
38
+
39
+ export function validatePostView(v: unknown): ValidationResult {
40
+ return lexicons.validate('app.bsky.feed.defs#postView', v)
41
+ }
42
+
43
+ export interface ViewerState {
44
+ repost?: string
45
+ like?: string
46
+ [k: string]: unknown
47
+ }
48
+
49
+ export function isViewerState(v: unknown): v is ViewerState {
50
+ return (
51
+ isObj(v) &&
52
+ hasProp(v, '$type') &&
53
+ v.$type === 'app.bsky.feed.defs#viewerState'
54
+ )
55
+ }
56
+
57
+ export function validateViewerState(v: unknown): ValidationResult {
58
+ return lexicons.validate('app.bsky.feed.defs#viewerState', v)
59
+ }
60
+
61
+ export interface FeedViewPost {
62
+ post: PostView
63
+ reply?: ReplyRef
64
+ reason?: ReasonRepost | { $type: string; [k: string]: unknown }
65
+ [k: string]: unknown
66
+ }
67
+
68
+ export function isFeedViewPost(v: unknown): v is FeedViewPost {
69
+ return (
70
+ isObj(v) &&
71
+ hasProp(v, '$type') &&
72
+ v.$type === 'app.bsky.feed.defs#feedViewPost'
73
+ )
74
+ }
75
+
76
+ export function validateFeedViewPost(v: unknown): ValidationResult {
77
+ return lexicons.validate('app.bsky.feed.defs#feedViewPost', v)
78
+ }
79
+
80
+ export interface ReplyRef {
81
+ root: PostView
82
+ parent: PostView
83
+ [k: string]: unknown
84
+ }
85
+
86
+ export function isReplyRef(v: unknown): v is ReplyRef {
87
+ return (
88
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#replyRef'
89
+ )
90
+ }
91
+
92
+ export function validateReplyRef(v: unknown): ValidationResult {
93
+ return lexicons.validate('app.bsky.feed.defs#replyRef', v)
94
+ }
95
+
96
+ export interface ReasonRepost {
97
+ by: AppBskyActorDefs.ProfileViewBasic
98
+ indexedAt: string
99
+ [k: string]: unknown
100
+ }
101
+
102
+ export function isReasonRepost(v: unknown): v is ReasonRepost {
103
+ return (
104
+ isObj(v) &&
105
+ hasProp(v, '$type') &&
106
+ v.$type === 'app.bsky.feed.defs#reasonRepost'
107
+ )
108
+ }
109
+
110
+ export function validateReasonRepost(v: unknown): ValidationResult {
111
+ return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
112
+ }
113
+
114
+ export interface ThreadViewPost {
115
+ post: PostView
116
+ parent?:
117
+ | ThreadViewPost
118
+ | NotFoundPost
119
+ | { $type: string; [k: string]: unknown }
120
+ replies?: (
121
+ | ThreadViewPost
122
+ | NotFoundPost
123
+ | { $type: string; [k: string]: unknown }
124
+ )[]
125
+ [k: string]: unknown
126
+ }
127
+
128
+ export function isThreadViewPost(v: unknown): v is ThreadViewPost {
129
+ return (
130
+ isObj(v) &&
131
+ hasProp(v, '$type') &&
132
+ v.$type === 'app.bsky.feed.defs#threadViewPost'
133
+ )
134
+ }
135
+
136
+ export function validateThreadViewPost(v: unknown): ValidationResult {
137
+ return lexicons.validate('app.bsky.feed.defs#threadViewPost', v)
138
+ }
139
+
140
+ export interface NotFoundPost {
141
+ uri: string
142
+ notFound: true
143
+ [k: string]: unknown
144
+ }
145
+
146
+ export function isNotFoundPost(v: unknown): v is NotFoundPost {
147
+ return (
148
+ isObj(v) &&
149
+ hasProp(v, '$type') &&
150
+ v.$type === 'app.bsky.feed.defs#notFoundPost'
151
+ )
152
+ }
153
+
154
+ export function validateNotFoundPost(v: unknown): ValidationResult {
155
+ return lexicons.validate('app.bsky.feed.defs#notFoundPost', v)
156
+ }
@@ -2,22 +2,23 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyFeedFeedViewPost from './feedViewPost'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyFeedDefs from './defs'
9
10
 
10
11
  export interface QueryParams {
11
- author: string
12
+ actor: string
12
13
  limit?: number
13
- before?: string
14
+ cursor?: string
14
15
  }
15
16
 
16
17
  export type InputSchema = undefined
17
18
 
18
19
  export interface OutputSchema {
19
20
  cursor?: string
20
- feed: AppBskyFeedFeedViewPost.Main[]
21
+ feed: AppBskyFeedDefs.FeedViewPost[]
21
22
  [k: string]: unknown
22
23
  }
23
24
 
@@ -2,17 +2,17 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyActorRef from '../actor/ref'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyActorDefs from '../actor/defs'
9
10
 
10
11
  export interface QueryParams {
11
12
  uri: string
12
13
  cid?: string
13
- direction?: 'up' | 'down'
14
14
  limit?: number
15
- before?: string
15
+ cursor?: string
16
16
  }
17
17
 
18
18
  export type InputSchema = undefined
@@ -21,7 +21,7 @@ export interface OutputSchema {
21
21
  uri: string
22
22
  cid?: string
23
23
  cursor?: string
24
- votes: Vote[]
24
+ likes: Like[]
25
25
  [k: string]: unknown
26
26
  }
27
27
 
@@ -41,20 +41,19 @@ export function toKnownErr(e: any) {
41
41
  return e
42
42
  }
43
43
 
44
- export interface Vote {
45
- direction: 'up' | 'down'
44
+ export interface Like {
46
45
  indexedAt: string
47
46
  createdAt: string
48
- actor: AppBskyActorRef.WithInfo
47
+ actor: AppBskyActorDefs.ProfileView
49
48
  [k: string]: unknown
50
49
  }
51
50
 
52
- export function isVote(v: unknown): v is Vote {
51
+ export function isLike(v: unknown): v is Like {
53
52
  return (
54
- isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getVotes#vote'
53
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getLikes#like'
55
54
  )
56
55
  }
57
56
 
58
- export function validateVote(v: unknown): ValidationResult {
59
- return lexicons.validate('app.bsky.feed.getVotes#vote', v)
57
+ export function validateLike(v: unknown): ValidationResult {
58
+ return lexicons.validate('app.bsky.feed.getLikes#like', v)
60
59
  }
@@ -2,10 +2,11 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyFeedPost from './post'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyFeedDefs from './defs'
9
10
 
10
11
  export interface QueryParams {
11
12
  uri: string
@@ -16,8 +17,8 @@ export type InputSchema = undefined
16
17
 
17
18
  export interface OutputSchema {
18
19
  thread:
19
- | ThreadViewPost
20
- | NotFoundPost
20
+ | AppBskyFeedDefs.ThreadViewPost
21
+ | AppBskyFeedDefs.NotFoundPost
21
22
  | { $type: string; [k: string]: unknown }
22
23
  [k: string]: unknown
23
24
  }
@@ -44,47 +45,3 @@ export function toKnownErr(e: any) {
44
45
  }
45
46
  return e
46
47
  }
47
-
48
- export interface ThreadViewPost {
49
- post: AppBskyFeedPost.View
50
- parent?:
51
- | ThreadViewPost
52
- | NotFoundPost
53
- | { $type: string; [k: string]: unknown }
54
- replies?: (
55
- | ThreadViewPost
56
- | NotFoundPost
57
- | { $type: string; [k: string]: unknown }
58
- )[]
59
- [k: string]: unknown
60
- }
61
-
62
- export function isThreadViewPost(v: unknown): v is ThreadViewPost {
63
- return (
64
- isObj(v) &&
65
- hasProp(v, '$type') &&
66
- v.$type === 'app.bsky.feed.getPostThread#threadViewPost'
67
- )
68
- }
69
-
70
- export function validateThreadViewPost(v: unknown): ValidationResult {
71
- return lexicons.validate('app.bsky.feed.getPostThread#threadViewPost', v)
72
- }
73
-
74
- export interface NotFoundPost {
75
- uri: string
76
- notFound: true
77
- [k: string]: unknown
78
- }
79
-
80
- export function isNotFoundPost(v: unknown): v is NotFoundPost {
81
- return (
82
- isObj(v) &&
83
- hasProp(v, '$type') &&
84
- v.$type === 'app.bsky.feed.getPostThread#notFoundPost'
85
- )
86
- }
87
-
88
- export function validateNotFoundPost(v: unknown): ValidationResult {
89
- return lexicons.validate('app.bsky.feed.getPostThread#notFoundPost', v)
90
- }
@@ -2,16 +2,17 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyActorRef from '../actor/ref'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyActorDefs from '../actor/defs'
9
10
 
10
11
  export interface QueryParams {
11
12
  uri: string
12
13
  cid?: string
13
14
  limit?: number
14
- before?: string
15
+ cursor?: string
15
16
  }
16
17
 
17
18
  export type InputSchema = undefined
@@ -20,7 +21,7 @@ export interface OutputSchema {
20
21
  uri: string
21
22
  cid?: string
22
23
  cursor?: string
23
- repostedBy: AppBskyActorRef.WithInfo[]
24
+ repostedBy: AppBskyActorDefs.ProfileView[]
24
25
  [k: string]: unknown
25
26
  }
26
27
 
@@ -2,22 +2,23 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyFeedFeedViewPost from './feedViewPost'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyFeedDefs from './defs'
9
10
 
10
11
  export interface QueryParams {
11
12
  algorithm?: string
12
13
  limit?: number
13
- before?: string
14
+ cursor?: string
14
15
  }
15
16
 
16
17
  export type InputSchema = undefined
17
18
 
18
19
  export interface OutputSchema {
19
20
  cursor?: string
20
- feed: AppBskyFeedFeedViewPost.Main[]
21
+ feed: AppBskyFeedDefs.FeedViewPost[]
21
22
  [k: string]: unknown
22
23
  }
23
24
 
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
- import { ValidationResult } from '@atproto/lexicon'
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
5
  import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
7
8
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
8
9
 
9
10
  export interface Record {
10
11
  subject: ComAtprotoRepoStrongRef.Main
11
- direction: 'up' | 'down'
12
12
  createdAt: string
13
13
  [k: string]: unknown
14
14
  }
@@ -17,10 +17,10 @@ export function isRecord(v: unknown): v is Record {
17
17
  return (
18
18
  isObj(v) &&
19
19
  hasProp(v, '$type') &&
20
- (v.$type === 'app.bsky.feed.vote#main' || v.$type === 'app.bsky.feed.vote')
20
+ (v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like')
21
21
  )
22
22
  }
23
23
 
24
24
  export function validateRecord(v: unknown): ValidationResult {
25
- return lexicons.validate('app.bsky.feed.vote#main', v)
25
+ return lexicons.validate('app.bsky.feed.like#main', v)
26
26
  }
@@ -1,23 +1,28 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
- import { ValidationResult } from '@atproto/lexicon'
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
5
  import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyRichtextFacet from '../richtext/facet'
7
9
  import * as AppBskyEmbedImages from '../embed/images'
8
10
  import * as AppBskyEmbedExternal from '../embed/external'
9
11
  import * as AppBskyEmbedRecord from '../embed/record'
12
+ import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
10
13
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
11
- import * as AppBskyActorRef from '../actor/ref'
12
14
 
13
15
  export interface Record {
14
16
  text: string
17
+ /** Deprecated: replaced by app.bsky.richtext.facet. */
15
18
  entities?: Entity[]
19
+ facets?: AppBskyRichtextFacet.Main[]
16
20
  reply?: ReplyRef
17
21
  embed?:
18
22
  | AppBskyEmbedImages.Main
19
23
  | AppBskyEmbedExternal.Main
20
24
  | AppBskyEmbedRecord.Main
25
+ | AppBskyEmbedRecordWithMedia.Main
21
26
  | { $type: string; [k: string]: unknown }
22
27
  createdAt: string
23
28
  [k: string]: unknown
@@ -51,9 +56,10 @@ export function validateReplyRef(v: unknown): ValidationResult {
51
56
  return lexicons.validate('app.bsky.feed.post#replyRef', v)
52
57
  }
53
58
 
59
+ /** Deprecated: use facets instead. */
54
60
  export interface Entity {
55
61
  index: TextSlice
56
- /** Expected values are 'mention', 'hashtag', and 'link'. */
62
+ /** Expected values are 'mention' and 'link'. */
57
63
  type: string
58
64
  value: string
59
65
  [k: string]: unknown
@@ -69,7 +75,7 @@ export function validateEntity(v: unknown): ValidationResult {
69
75
  return lexicons.validate('app.bsky.feed.post#entity', v)
70
76
  }
71
77
 
72
- /** A text segment. Start is inclusive, end is exclusive. */
78
+ /** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. */
73
79
  export interface TextSlice {
74
80
  start: number
75
81
  end: number
@@ -87,51 +93,3 @@ export function isTextSlice(v: unknown): v is TextSlice {
87
93
  export function validateTextSlice(v: unknown): ValidationResult {
88
94
  return lexicons.validate('app.bsky.feed.post#textSlice', v)
89
95
  }
90
-
91
- export interface View {
92
- uri: string
93
- cid: string
94
- author: AppBskyActorRef.WithInfo
95
- record: {}
96
- embed?:
97
- | AppBskyEmbedImages.Presented
98
- | AppBskyEmbedExternal.Presented
99
- | AppBskyEmbedRecord.Presented
100
- | { $type: string; [k: string]: unknown }
101
- replyCount: number
102
- repostCount: number
103
- upvoteCount: number
104
- downvoteCount: number
105
- indexedAt: string
106
- viewer: ViewerState
107
- [k: string]: unknown
108
- }
109
-
110
- export function isView(v: unknown): v is View {
111
- return (
112
- isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#view'
113
- )
114
- }
115
-
116
- export function validateView(v: unknown): ValidationResult {
117
- return lexicons.validate('app.bsky.feed.post#view', v)
118
- }
119
-
120
- export interface ViewerState {
121
- repost?: string
122
- upvote?: string
123
- downvote?: string
124
- [k: string]: unknown
125
- }
126
-
127
- export function isViewerState(v: unknown): v is ViewerState {
128
- return (
129
- isObj(v) &&
130
- hasProp(v, '$type') &&
131
- v.$type === 'app.bsky.feed.post#viewerState'
132
- )
133
- }
134
-
135
- export function validateViewerState(v: unknown): ValidationResult {
136
- return lexicons.validate('app.bsky.feed.post#viewerState', v)
137
- }
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
- import { ValidationResult } from '@atproto/lexicon'
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
5
  import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
7
8
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
8
9
 
9
10
  export interface Record {
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
- import { ValidationResult } from '@atproto/lexicon'
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
5
  import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
- import * as AppBskyActorRef from '../actor/ref'
7
+ import { CID } from 'multiformats/cid'
8
8
 
9
9
  export interface Record {
10
- subject: AppBskyActorRef.Main
10
+ subject: string
11
11
  createdAt: string
12
12
  [k: string]: unknown
13
13
  }
@@ -2,23 +2,24 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyActorRef from '../actor/ref'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyActorDefs from '../actor/defs'
9
10
 
10
11
  export interface QueryParams {
11
- user: string
12
+ actor: string
12
13
  limit?: number
13
- before?: string
14
+ cursor?: string
14
15
  }
15
16
 
16
17
  export type InputSchema = undefined
17
18
 
18
19
  export interface OutputSchema {
19
- subject: AppBskyActorRef.WithInfo
20
+ subject: AppBskyActorDefs.ProfileView
20
21
  cursor?: string
21
- followers: AppBskyActorRef.WithInfo[]
22
+ followers: AppBskyActorDefs.ProfileView[]
22
23
  [k: string]: unknown
23
24
  }
24
25
 
@@ -2,23 +2,24 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyActorRef from '../actor/ref'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyActorDefs from '../actor/defs'
9
10
 
10
11
  export interface QueryParams {
11
- user: string
12
+ actor: string
12
13
  limit?: number
13
- before?: string
14
+ cursor?: string
14
15
  }
15
16
 
16
17
  export type InputSchema = undefined
17
18
 
18
19
  export interface OutputSchema {
19
- subject: AppBskyActorRef.WithInfo
20
+ subject: AppBskyActorDefs.ProfileView
20
21
  cursor?: string
21
- follows: AppBskyActorRef.WithInfo[]
22
+ follows: AppBskyActorDefs.ProfileView[]
22
23
  [k: string]: unknown
23
24
  }
24
25
 
@@ -2,21 +2,22 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
- import * as AppBskyActorRef from '../actor/ref'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyActorDefs from '../actor/defs'
9
10
 
10
11
  export interface QueryParams {
11
12
  limit?: number
12
- before?: string
13
+ cursor?: string
13
14
  }
14
15
 
15
16
  export type InputSchema = undefined
16
17
 
17
18
  export interface OutputSchema {
18
19
  cursor?: string
19
- mutes: AppBskyActorRef.WithInfo[]
20
+ mutes: AppBskyActorDefs.ProfileView[]
20
21
  [k: string]: unknown
21
22
  }
22
23
 
@@ -2,14 +2,15 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
8
9
 
9
10
  export interface QueryParams {}
10
11
 
11
12
  export interface InputSchema {
12
- user: string
13
+ actor: string
13
14
  [k: string]: unknown
14
15
  }
15
16
 
@@ -2,14 +2,15 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
8
9
 
9
10
  export interface QueryParams {}
10
11
 
11
12
  export interface InputSchema {
12
- user: string
13
+ actor: string
13
14
  [k: string]: unknown
14
15
  }
15
16
 
@@ -2,9 +2,10 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
- import { ValidationResult } from '@atproto/lexicon'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
8
9
 
9
10
  export interface QueryParams {}
10
11