@atproto/bsky 0.0.253 → 0.0.255

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 (899) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/api/age-assurance/index.d.ts +1 -1
  3. package/dist/api/age-assurance/index.d.ts.map +1 -1
  4. package/dist/api/age-assurance/index.js.map +1 -1
  5. package/dist/api/age-assurance/redirects/kws-age-verified.d.ts +2 -2
  6. package/dist/api/age-assurance/redirects/kws-age-verified.d.ts.map +1 -1
  7. package/dist/api/age-assurance/redirects/kws-age-verified.js.map +1 -1
  8. package/dist/api/age-assurance/stash.d.ts +2 -2
  9. package/dist/api/age-assurance/stash.d.ts.map +1 -1
  10. package/dist/api/age-assurance/stash.js.map +1 -1
  11. package/dist/api/age-assurance/types.d.ts +3 -3
  12. package/dist/api/age-assurance/types.d.ts.map +1 -1
  13. package/dist/api/age-assurance/types.js.map +1 -1
  14. package/dist/api/age-assurance/util.d.ts +2 -2
  15. package/dist/api/age-assurance/util.d.ts.map +1 -1
  16. package/dist/api/age-assurance/util.js.map +1 -1
  17. package/dist/api/age-assurance/webhooks/kws-age-verified.d.ts +2 -2
  18. package/dist/api/age-assurance/webhooks/kws-age-verified.d.ts.map +1 -1
  19. package/dist/api/age-assurance/webhooks/kws-age-verified.js.map +1 -1
  20. package/dist/api/app/bsky/actor/getProfile.d.ts +2 -2
  21. package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
  22. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  23. package/dist/api/app/bsky/actor/getProfiles.d.ts +2 -2
  24. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  25. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  26. package/dist/api/app/bsky/actor/getSuggestions.d.ts +2 -2
  27. package/dist/api/app/bsky/actor/getSuggestions.d.ts.map +1 -1
  28. package/dist/api/app/bsky/actor/getSuggestions.js.map +1 -1
  29. package/dist/api/app/bsky/actor/searchActors.d.ts +2 -2
  30. package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
  31. package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
  32. package/dist/api/app/bsky/actor/searchActorsTypeahead.d.ts +2 -2
  33. package/dist/api/app/bsky/actor/searchActorsTypeahead.d.ts.map +1 -1
  34. package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
  35. package/dist/api/app/bsky/ageassurance/begin.d.ts +2 -2
  36. package/dist/api/app/bsky/ageassurance/begin.d.ts.map +1 -1
  37. package/dist/api/app/bsky/ageassurance/begin.js.map +1 -1
  38. package/dist/api/app/bsky/ageassurance/getConfig.d.ts +2 -2
  39. package/dist/api/app/bsky/ageassurance/getConfig.d.ts.map +1 -1
  40. package/dist/api/app/bsky/ageassurance/getConfig.js.map +1 -1
  41. package/dist/api/app/bsky/ageassurance/getState.d.ts +2 -2
  42. package/dist/api/app/bsky/ageassurance/getState.d.ts.map +1 -1
  43. package/dist/api/app/bsky/ageassurance/getState.js.map +1 -1
  44. package/dist/api/app/bsky/bookmark/createBookmark.d.ts +2 -2
  45. package/dist/api/app/bsky/bookmark/createBookmark.d.ts.map +1 -1
  46. package/dist/api/app/bsky/bookmark/createBookmark.js.map +1 -1
  47. package/dist/api/app/bsky/bookmark/deleteBookmark.d.ts +2 -2
  48. package/dist/api/app/bsky/bookmark/deleteBookmark.d.ts.map +1 -1
  49. package/dist/api/app/bsky/bookmark/deleteBookmark.js.map +1 -1
  50. package/dist/api/app/bsky/bookmark/getBookmarks.d.ts +2 -2
  51. package/dist/api/app/bsky/bookmark/getBookmarks.d.ts.map +1 -1
  52. package/dist/api/app/bsky/bookmark/getBookmarks.js.map +1 -1
  53. package/dist/api/app/bsky/contact/dismissMatch.d.ts +2 -2
  54. package/dist/api/app/bsky/contact/dismissMatch.d.ts.map +1 -1
  55. package/dist/api/app/bsky/contact/dismissMatch.js.map +1 -1
  56. package/dist/api/app/bsky/contact/getMatches.d.ts +2 -2
  57. package/dist/api/app/bsky/contact/getMatches.d.ts.map +1 -1
  58. package/dist/api/app/bsky/contact/getMatches.js.map +1 -1
  59. package/dist/api/app/bsky/contact/getSyncStatus.d.ts +2 -2
  60. package/dist/api/app/bsky/contact/getSyncStatus.d.ts.map +1 -1
  61. package/dist/api/app/bsky/contact/getSyncStatus.js.map +1 -1
  62. package/dist/api/app/bsky/contact/importContacts.d.ts +2 -2
  63. package/dist/api/app/bsky/contact/importContacts.d.ts.map +1 -1
  64. package/dist/api/app/bsky/contact/importContacts.js.map +1 -1
  65. package/dist/api/app/bsky/contact/removeData.d.ts +2 -2
  66. package/dist/api/app/bsky/contact/removeData.d.ts.map +1 -1
  67. package/dist/api/app/bsky/contact/removeData.js.map +1 -1
  68. package/dist/api/app/bsky/contact/sendNotification.d.ts +2 -2
  69. package/dist/api/app/bsky/contact/sendNotification.d.ts.map +1 -1
  70. package/dist/api/app/bsky/contact/sendNotification.js.map +1 -1
  71. package/dist/api/app/bsky/contact/startPhoneVerification.d.ts +2 -2
  72. package/dist/api/app/bsky/contact/startPhoneVerification.d.ts.map +1 -1
  73. package/dist/api/app/bsky/contact/startPhoneVerification.js.map +1 -1
  74. package/dist/api/app/bsky/contact/util.d.ts +2 -2
  75. package/dist/api/app/bsky/contact/util.d.ts.map +1 -1
  76. package/dist/api/app/bsky/contact/util.js.map +1 -1
  77. package/dist/api/app/bsky/contact/verifyPhone.d.ts +2 -2
  78. package/dist/api/app/bsky/contact/verifyPhone.d.ts.map +1 -1
  79. package/dist/api/app/bsky/contact/verifyPhone.js.map +1 -1
  80. package/dist/api/app/bsky/draft/createDraft.d.ts +2 -2
  81. package/dist/api/app/bsky/draft/createDraft.d.ts.map +1 -1
  82. package/dist/api/app/bsky/draft/createDraft.js.map +1 -1
  83. package/dist/api/app/bsky/draft/deleteDraft.d.ts +2 -2
  84. package/dist/api/app/bsky/draft/deleteDraft.d.ts.map +1 -1
  85. package/dist/api/app/bsky/draft/deleteDraft.js.map +1 -1
  86. package/dist/api/app/bsky/draft/getDrafts.d.ts +2 -2
  87. package/dist/api/app/bsky/draft/getDrafts.d.ts.map +1 -1
  88. package/dist/api/app/bsky/draft/getDrafts.js.map +1 -1
  89. package/dist/api/app/bsky/draft/updateDraft.d.ts +2 -2
  90. package/dist/api/app/bsky/draft/updateDraft.d.ts.map +1 -1
  91. package/dist/api/app/bsky/draft/updateDraft.js.map +1 -1
  92. package/dist/api/app/bsky/embed/getEmbedExternalView.d.ts +2 -2
  93. package/dist/api/app/bsky/embed/getEmbedExternalView.d.ts.map +1 -1
  94. package/dist/api/app/bsky/embed/getEmbedExternalView.js.map +1 -1
  95. package/dist/api/app/bsky/feed/getActorFeeds.d.ts +2 -2
  96. package/dist/api/app/bsky/feed/getActorFeeds.d.ts.map +1 -1
  97. package/dist/api/app/bsky/feed/getActorFeeds.js.map +1 -1
  98. package/dist/api/app/bsky/feed/getActorLikes.d.ts +2 -2
  99. package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
  100. package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
  101. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +7 -7
  102. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  103. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  104. package/dist/api/app/bsky/feed/getFeed.d.ts +3 -3
  105. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  106. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  107. package/dist/api/app/bsky/feed/getFeedGenerator.d.ts +2 -2
  108. package/dist/api/app/bsky/feed/getFeedGenerator.d.ts.map +1 -1
  109. package/dist/api/app/bsky/feed/getFeedGenerator.js.map +1 -1
  110. package/dist/api/app/bsky/feed/getFeedGenerators.d.ts +2 -2
  111. package/dist/api/app/bsky/feed/getFeedGenerators.d.ts.map +1 -1
  112. package/dist/api/app/bsky/feed/getFeedGenerators.js.map +1 -1
  113. package/dist/api/app/bsky/feed/getLikes.d.ts +2 -2
  114. package/dist/api/app/bsky/feed/getLikes.d.ts.map +1 -1
  115. package/dist/api/app/bsky/feed/getLikes.js.map +1 -1
  116. package/dist/api/app/bsky/feed/getListFeed.d.ts +6 -6
  117. package/dist/api/app/bsky/feed/getListFeed.d.ts.map +1 -1
  118. package/dist/api/app/bsky/feed/getListFeed.js.map +1 -1
  119. package/dist/api/app/bsky/feed/getPostThread.d.ts +2 -2
  120. package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
  121. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  122. package/dist/api/app/bsky/feed/getPosts.d.ts +2 -2
  123. package/dist/api/app/bsky/feed/getPosts.d.ts.map +1 -1
  124. package/dist/api/app/bsky/feed/getPosts.js.map +1 -1
  125. package/dist/api/app/bsky/feed/getQuotes.d.ts +2 -2
  126. package/dist/api/app/bsky/feed/getQuotes.d.ts.map +1 -1
  127. package/dist/api/app/bsky/feed/getQuotes.js.map +1 -1
  128. package/dist/api/app/bsky/feed/getRepostedBy.d.ts +2 -2
  129. package/dist/api/app/bsky/feed/getRepostedBy.d.ts.map +1 -1
  130. package/dist/api/app/bsky/feed/getRepostedBy.js.map +1 -1
  131. package/dist/api/app/bsky/feed/getSuggestedFeeds.d.ts +2 -2
  132. package/dist/api/app/bsky/feed/getSuggestedFeeds.d.ts.map +1 -1
  133. package/dist/api/app/bsky/feed/getSuggestedFeeds.js.map +1 -1
  134. package/dist/api/app/bsky/feed/getTimeline.d.ts +6 -6
  135. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  136. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  137. package/dist/api/app/bsky/feed/searchPosts.d.ts +2 -2
  138. package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
  139. package/dist/api/app/bsky/feed/searchPosts.js +11 -3
  140. package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
  141. package/dist/api/app/bsky/feed/searchPostsV2.d.ts +2 -2
  142. package/dist/api/app/bsky/feed/searchPostsV2.d.ts.map +1 -1
  143. package/dist/api/app/bsky/feed/searchPostsV2.js +10 -2
  144. package/dist/api/app/bsky/feed/searchPostsV2.js.map +1 -1
  145. package/dist/api/app/bsky/graph/getActorStarterPacks.d.ts +2 -2
  146. package/dist/api/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -1
  147. package/dist/api/app/bsky/graph/getActorStarterPacks.js.map +1 -1
  148. package/dist/api/app/bsky/graph/getBlocks.d.ts +2 -2
  149. package/dist/api/app/bsky/graph/getBlocks.d.ts.map +1 -1
  150. package/dist/api/app/bsky/graph/getBlocks.js.map +1 -1
  151. package/dist/api/app/bsky/graph/getFollowers.d.ts +2 -2
  152. package/dist/api/app/bsky/graph/getFollowers.d.ts.map +1 -1
  153. package/dist/api/app/bsky/graph/getFollowers.js.map +1 -1
  154. package/dist/api/app/bsky/graph/getFollows.d.ts +2 -2
  155. package/dist/api/app/bsky/graph/getFollows.d.ts.map +1 -1
  156. package/dist/api/app/bsky/graph/getFollows.js.map +1 -1
  157. package/dist/api/app/bsky/graph/getKnownFollowers.d.ts +2 -2
  158. package/dist/api/app/bsky/graph/getKnownFollowers.d.ts.map +1 -1
  159. package/dist/api/app/bsky/graph/getKnownFollowers.js.map +1 -1
  160. package/dist/api/app/bsky/graph/getList.d.ts +2 -2
  161. package/dist/api/app/bsky/graph/getList.d.ts.map +1 -1
  162. package/dist/api/app/bsky/graph/getList.js.map +1 -1
  163. package/dist/api/app/bsky/graph/getListBlocks.d.ts +2 -2
  164. package/dist/api/app/bsky/graph/getListBlocks.d.ts.map +1 -1
  165. package/dist/api/app/bsky/graph/getListBlocks.js.map +1 -1
  166. package/dist/api/app/bsky/graph/getListMutes.d.ts +2 -2
  167. package/dist/api/app/bsky/graph/getListMutes.d.ts.map +1 -1
  168. package/dist/api/app/bsky/graph/getListMutes.js.map +1 -1
  169. package/dist/api/app/bsky/graph/getLists.d.ts +2 -2
  170. package/dist/api/app/bsky/graph/getLists.d.ts.map +1 -1
  171. package/dist/api/app/bsky/graph/getLists.js.map +1 -1
  172. package/dist/api/app/bsky/graph/getListsWithMembership.d.ts +2 -2
  173. package/dist/api/app/bsky/graph/getListsWithMembership.d.ts.map +1 -1
  174. package/dist/api/app/bsky/graph/getListsWithMembership.js.map +1 -1
  175. package/dist/api/app/bsky/graph/getMutes.d.ts +2 -2
  176. package/dist/api/app/bsky/graph/getMutes.d.ts.map +1 -1
  177. package/dist/api/app/bsky/graph/getMutes.js.map +1 -1
  178. package/dist/api/app/bsky/graph/getRelationships.d.ts +2 -2
  179. package/dist/api/app/bsky/graph/getRelationships.d.ts.map +1 -1
  180. package/dist/api/app/bsky/graph/getRelationships.js.map +1 -1
  181. package/dist/api/app/bsky/graph/getStarterPack.d.ts +2 -2
  182. package/dist/api/app/bsky/graph/getStarterPack.d.ts.map +1 -1
  183. package/dist/api/app/bsky/graph/getStarterPack.js.map +1 -1
  184. package/dist/api/app/bsky/graph/getStarterPacks.d.ts +2 -2
  185. package/dist/api/app/bsky/graph/getStarterPacks.d.ts.map +1 -1
  186. package/dist/api/app/bsky/graph/getStarterPacks.js.map +1 -1
  187. package/dist/api/app/bsky/graph/getStarterPacksWithMembership.d.ts +2 -2
  188. package/dist/api/app/bsky/graph/getStarterPacksWithMembership.d.ts.map +1 -1
  189. package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js.map +1 -1
  190. package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -2
  191. package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
  192. package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
  193. package/dist/api/app/bsky/graph/muteActor.d.ts +2 -2
  194. package/dist/api/app/bsky/graph/muteActor.d.ts.map +1 -1
  195. package/dist/api/app/bsky/graph/muteActor.js.map +1 -1
  196. package/dist/api/app/bsky/graph/muteActorList.d.ts +2 -2
  197. package/dist/api/app/bsky/graph/muteActorList.d.ts.map +1 -1
  198. package/dist/api/app/bsky/graph/muteActorList.js.map +1 -1
  199. package/dist/api/app/bsky/graph/muteThread.d.ts +2 -2
  200. package/dist/api/app/bsky/graph/muteThread.d.ts.map +1 -1
  201. package/dist/api/app/bsky/graph/muteThread.js.map +1 -1
  202. package/dist/api/app/bsky/graph/searchStarterPacks.d.ts +2 -2
  203. package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
  204. package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
  205. package/dist/api/app/bsky/graph/unmuteActor.d.ts +2 -2
  206. package/dist/api/app/bsky/graph/unmuteActor.d.ts.map +1 -1
  207. package/dist/api/app/bsky/graph/unmuteActor.js.map +1 -1
  208. package/dist/api/app/bsky/graph/unmuteActorList.d.ts +2 -2
  209. package/dist/api/app/bsky/graph/unmuteActorList.d.ts.map +1 -1
  210. package/dist/api/app/bsky/graph/unmuteActorList.js.map +1 -1
  211. package/dist/api/app/bsky/graph/unmuteThread.d.ts +2 -2
  212. package/dist/api/app/bsky/graph/unmuteThread.d.ts.map +1 -1
  213. package/dist/api/app/bsky/graph/unmuteThread.js.map +1 -1
  214. package/dist/api/app/bsky/labeler/getServices.d.ts +2 -2
  215. package/dist/api/app/bsky/labeler/getServices.d.ts.map +1 -1
  216. package/dist/api/app/bsky/labeler/getServices.js.map +1 -1
  217. package/dist/api/app/bsky/notification/getPreferences.d.ts +2 -2
  218. package/dist/api/app/bsky/notification/getPreferences.d.ts.map +1 -1
  219. package/dist/api/app/bsky/notification/getPreferences.js.map +1 -1
  220. package/dist/api/app/bsky/notification/getUnreadCount.d.ts +2 -2
  221. package/dist/api/app/bsky/notification/getUnreadCount.d.ts.map +1 -1
  222. package/dist/api/app/bsky/notification/getUnreadCount.js.map +1 -1
  223. package/dist/api/app/bsky/notification/listActivitySubscriptions.d.ts +2 -2
  224. package/dist/api/app/bsky/notification/listActivitySubscriptions.d.ts.map +1 -1
  225. package/dist/api/app/bsky/notification/listActivitySubscriptions.js.map +1 -1
  226. package/dist/api/app/bsky/notification/listNotifications.d.ts +2 -2
  227. package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
  228. package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
  229. package/dist/api/app/bsky/notification/putActivitySubscription.d.ts +2 -2
  230. package/dist/api/app/bsky/notification/putActivitySubscription.d.ts.map +1 -1
  231. package/dist/api/app/bsky/notification/putActivitySubscription.js.map +1 -1
  232. package/dist/api/app/bsky/notification/putPreferences.d.ts +2 -2
  233. package/dist/api/app/bsky/notification/putPreferences.d.ts.map +1 -1
  234. package/dist/api/app/bsky/notification/putPreferences.js.map +1 -1
  235. package/dist/api/app/bsky/notification/putPreferencesV2.d.ts +2 -2
  236. package/dist/api/app/bsky/notification/putPreferencesV2.d.ts.map +1 -1
  237. package/dist/api/app/bsky/notification/putPreferencesV2.js.map +1 -1
  238. package/dist/api/app/bsky/notification/registerPush.d.ts +2 -2
  239. package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
  240. package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
  241. package/dist/api/app/bsky/notification/unregisterPush.d.ts +2 -2
  242. package/dist/api/app/bsky/notification/unregisterPush.d.ts.map +1 -1
  243. package/dist/api/app/bsky/notification/unregisterPush.js.map +1 -1
  244. package/dist/api/app/bsky/notification/updateSeen.d.ts +2 -2
  245. package/dist/api/app/bsky/notification/updateSeen.d.ts.map +1 -1
  246. package/dist/api/app/bsky/notification/updateSeen.js.map +1 -1
  247. package/dist/api/app/bsky/notification/util.d.ts +2 -2
  248. package/dist/api/app/bsky/notification/util.d.ts.map +1 -1
  249. package/dist/api/app/bsky/notification/util.js.map +1 -1
  250. package/dist/api/app/bsky/unspecced/getAgeAssuranceState.d.ts +2 -2
  251. package/dist/api/app/bsky/unspecced/getAgeAssuranceState.d.ts.map +1 -1
  252. package/dist/api/app/bsky/unspecced/getAgeAssuranceState.js.map +1 -1
  253. package/dist/api/app/bsky/unspecced/getConfig.d.ts +2 -2
  254. package/dist/api/app/bsky/unspecced/getConfig.d.ts.map +1 -1
  255. package/dist/api/app/bsky/unspecced/getConfig.js.map +1 -1
  256. package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.d.ts +2 -2
  257. package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.d.ts.map +1 -1
  258. package/dist/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js.map +1 -1
  259. package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.d.ts +2 -2
  260. package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.d.ts.map +1 -1
  261. package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.js.map +1 -1
  262. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts +2 -2
  263. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -1
  264. package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -1
  265. package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts +2 -2
  266. package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
  267. package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
  268. package/dist/api/app/bsky/unspecced/getSuggestedFeeds.d.ts +2 -2
  269. package/dist/api/app/bsky/unspecced/getSuggestedFeeds.d.ts.map +1 -1
  270. package/dist/api/app/bsky/unspecced/getSuggestedFeeds.js.map +1 -1
  271. package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.d.ts +2 -2
  272. package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.d.ts.map +1 -1
  273. package/dist/api/app/bsky/unspecced/getSuggestedOnboardingUsers.js.map +1 -1
  274. package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.d.ts +2 -2
  275. package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.d.ts.map +1 -1
  276. package/dist/api/app/bsky/unspecced/getSuggestedStarterPacks.js.map +1 -1
  277. package/dist/api/app/bsky/unspecced/getSuggestedUsers.d.ts +2 -2
  278. package/dist/api/app/bsky/unspecced/getSuggestedUsers.d.ts.map +1 -1
  279. package/dist/api/app/bsky/unspecced/getSuggestedUsers.js.map +1 -1
  280. package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts +2 -2
  281. package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.d.ts.map +1 -1
  282. package/dist/api/app/bsky/unspecced/getSuggestedUsersForDiscover.js.map +1 -1
  283. package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts +2 -2
  284. package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.d.ts.map +1 -1
  285. package/dist/api/app/bsky/unspecced/getSuggestedUsersForExplore.js.map +1 -1
  286. package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts +2 -2
  287. package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.d.ts.map +1 -1
  288. package/dist/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.js.map +1 -1
  289. package/dist/api/app/bsky/unspecced/getTaggedSuggestions.d.ts +2 -2
  290. package/dist/api/app/bsky/unspecced/getTaggedSuggestions.d.ts.map +1 -1
  291. package/dist/api/app/bsky/unspecced/getTaggedSuggestions.js.map +1 -1
  292. package/dist/api/app/bsky/unspecced/getTrendingTopics.d.ts +2 -2
  293. package/dist/api/app/bsky/unspecced/getTrendingTopics.d.ts.map +1 -1
  294. package/dist/api/app/bsky/unspecced/getTrendingTopics.js.map +1 -1
  295. package/dist/api/app/bsky/unspecced/getTrends.d.ts +2 -2
  296. package/dist/api/app/bsky/unspecced/getTrends.d.ts.map +1 -1
  297. package/dist/api/app/bsky/unspecced/getTrends.js.map +1 -1
  298. package/dist/api/app/bsky/unspecced/initAgeAssurance.d.ts +2 -2
  299. package/dist/api/app/bsky/unspecced/initAgeAssurance.d.ts.map +1 -1
  300. package/dist/api/app/bsky/unspecced/initAgeAssurance.js.map +1 -1
  301. package/dist/api/blob-dispatcher.d.ts +2 -2
  302. package/dist/api/blob-dispatcher.d.ts.map +1 -1
  303. package/dist/api/blob-dispatcher.js.map +1 -1
  304. package/dist/api/blob-resolver.d.ts +6 -6
  305. package/dist/api/blob-resolver.d.ts.map +1 -1
  306. package/dist/api/blob-resolver.js.map +1 -1
  307. package/dist/api/com/atproto/admin/getAccountInfos.d.ts +2 -2
  308. package/dist/api/com/atproto/admin/getAccountInfos.d.ts.map +1 -1
  309. package/dist/api/com/atproto/admin/getAccountInfos.js.map +1 -1
  310. package/dist/api/com/atproto/admin/getSubjectStatus.d.ts +2 -2
  311. package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  312. package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
  313. package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts +2 -2
  314. package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
  315. package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
  316. package/dist/api/com/atproto/identity/resolveHandle.d.ts +2 -2
  317. package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  318. package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
  319. package/dist/api/com/atproto/label/queryLabels.d.ts +2 -2
  320. package/dist/api/com/atproto/label/queryLabels.d.ts.map +1 -1
  321. package/dist/api/com/atproto/label/queryLabels.js.map +1 -1
  322. package/dist/api/com/atproto/repo/getRecord.d.ts +2 -2
  323. package/dist/api/com/atproto/repo/getRecord.d.ts.map +1 -1
  324. package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
  325. package/dist/api/com/atproto/temp/fetchLabels.d.ts +2 -2
  326. package/dist/api/com/atproto/temp/fetchLabels.d.ts.map +1 -1
  327. package/dist/api/com/atproto/temp/fetchLabels.js.map +1 -1
  328. package/dist/api/external.d.ts +1 -1
  329. package/dist/api/external.d.ts.map +1 -1
  330. package/dist/api/external.js.map +1 -1
  331. package/dist/api/health.d.ts +1 -1
  332. package/dist/api/health.d.ts.map +1 -1
  333. package/dist/api/health.js.map +1 -1
  334. package/dist/api/index.d.ts +2 -2
  335. package/dist/api/index.d.ts.map +1 -1
  336. package/dist/api/index.js.map +1 -1
  337. package/dist/api/internal/bsky/actor/getProfiles.d.ts +2 -2
  338. package/dist/api/internal/bsky/actor/getProfiles.d.ts.map +1 -1
  339. package/dist/api/internal/bsky/actor/getProfiles.js.map +1 -1
  340. package/dist/api/kws/api.d.ts +2 -2
  341. package/dist/api/kws/api.d.ts.map +1 -1
  342. package/dist/api/kws/api.js.map +1 -1
  343. package/dist/api/kws/index.d.ts +1 -1
  344. package/dist/api/kws/index.d.ts.map +1 -1
  345. package/dist/api/kws/index.js.map +1 -1
  346. package/dist/api/kws/types.d.ts +3 -3
  347. package/dist/api/kws/types.d.ts.map +1 -1
  348. package/dist/api/kws/types.js.map +1 -1
  349. package/dist/api/kws/util.d.ts +4 -4
  350. package/dist/api/kws/util.d.ts.map +1 -1
  351. package/dist/api/kws/util.js.map +1 -1
  352. package/dist/api/kws/webhook.d.ts +2 -2
  353. package/dist/api/kws/webhook.d.ts.map +1 -1
  354. package/dist/api/kws/webhook.js.map +1 -1
  355. package/dist/api/sitemap.d.ts +1 -1
  356. package/dist/api/sitemap.d.ts.map +1 -1
  357. package/dist/api/sitemap.js.map +1 -1
  358. package/dist/api/util.d.ts +3 -3
  359. package/dist/api/util.d.ts.map +1 -1
  360. package/dist/api/util.js.map +1 -1
  361. package/dist/api/well-known.d.ts +1 -1
  362. package/dist/api/well-known.d.ts.map +1 -1
  363. package/dist/api/well-known.js.map +1 -1
  364. package/dist/auth-verifier.d.ts +5 -5
  365. package/dist/auth-verifier.d.ts.map +1 -1
  366. package/dist/auth-verifier.js +1 -1
  367. package/dist/auth-verifier.js.map +1 -1
  368. package/dist/bsync.d.ts +2 -2
  369. package/dist/bsync.d.ts.map +1 -1
  370. package/dist/bsync.js.map +1 -1
  371. package/dist/cache/read-through.d.ts +1 -1
  372. package/dist/cache/read-through.d.ts.map +1 -1
  373. package/dist/cache/read-through.js.map +1 -1
  374. package/dist/config.d.ts +1 -1
  375. package/dist/config.d.ts.map +1 -1
  376. package/dist/config.js.map +1 -1
  377. package/dist/context.d.ts +18 -18
  378. package/dist/context.d.ts.map +1 -1
  379. package/dist/context.js.map +1 -1
  380. package/dist/courier.d.ts +2 -2
  381. package/dist/courier.d.ts.map +1 -1
  382. package/dist/courier.js.map +1 -1
  383. package/dist/data-plane/client/hosts.d.ts +1 -1
  384. package/dist/data-plane/client/hosts.d.ts.map +1 -1
  385. package/dist/data-plane/client/hosts.js.map +1 -1
  386. package/dist/data-plane/client/index.d.ts +2 -2
  387. package/dist/data-plane/client/index.d.ts.map +1 -1
  388. package/dist/data-plane/client/index.js.map +1 -1
  389. package/dist/data-plane/client/util.d.ts +1 -1
  390. package/dist/data-plane/client/util.d.ts.map +1 -1
  391. package/dist/data-plane/client/util.js.map +1 -1
  392. package/dist/data-plane/server/bsync-subscription.d.ts +2 -2
  393. package/dist/data-plane/server/bsync-subscription.d.ts.map +1 -1
  394. package/dist/data-plane/server/bsync-subscription.js +1 -1
  395. package/dist/data-plane/server/bsync-subscription.js.map +1 -1
  396. package/dist/data-plane/server/db/database-schema.d.ts +44 -44
  397. package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
  398. package/dist/data-plane/server/db/database-schema.js.map +1 -1
  399. package/dist/data-plane/server/db/db.d.ts +2 -2
  400. package/dist/data-plane/server/db/db.d.ts.map +1 -1
  401. package/dist/data-plane/server/db/db.js.map +1 -1
  402. package/dist/data-plane/server/db/migrations/20230309T045948368Z-init.d.ts +1 -1
  403. package/dist/data-plane/server/db/migrations/20230309T045948368Z-init.d.ts.map +1 -1
  404. package/dist/data-plane/server/db/migrations/20230309T045948368Z-init.js.map +1 -1
  405. package/dist/data-plane/server/db/migrations/20230408T152211201Z-notification-init.d.ts +1 -1
  406. package/dist/data-plane/server/db/migrations/20230408T152211201Z-notification-init.d.ts.map +1 -1
  407. package/dist/data-plane/server/db/migrations/20230408T152211201Z-notification-init.js.map +1 -1
  408. package/dist/data-plane/server/db/migrations/20230417T210628672Z-moderation-init.d.ts +1 -1
  409. package/dist/data-plane/server/db/migrations/20230417T210628672Z-moderation-init.d.ts.map +1 -1
  410. package/dist/data-plane/server/db/migrations/20230417T210628672Z-moderation-init.js.map +1 -1
  411. package/dist/data-plane/server/db/migrations/20230420T211446071Z-did-cache.d.ts +1 -1
  412. package/dist/data-plane/server/db/migrations/20230420T211446071Z-did-cache.d.ts.map +1 -1
  413. package/dist/data-plane/server/db/migrations/20230420T211446071Z-did-cache.js.map +1 -1
  414. package/dist/data-plane/server/db/migrations/20230427T194702079Z-notif-record-index.d.ts +1 -1
  415. package/dist/data-plane/server/db/migrations/20230427T194702079Z-notif-record-index.d.ts.map +1 -1
  416. package/dist/data-plane/server/db/migrations/20230427T194702079Z-notif-record-index.js.map +1 -1
  417. package/dist/data-plane/server/db/migrations/20230605T144730094Z-post-profile-aggs.d.ts +1 -1
  418. package/dist/data-plane/server/db/migrations/20230605T144730094Z-post-profile-aggs.d.ts.map +1 -1
  419. package/dist/data-plane/server/db/migrations/20230605T144730094Z-post-profile-aggs.js.map +1 -1
  420. package/dist/data-plane/server/db/migrations/20230607T211442112Z-feed-generator-init.d.ts +1 -1
  421. package/dist/data-plane/server/db/migrations/20230607T211442112Z-feed-generator-init.d.ts.map +1 -1
  422. package/dist/data-plane/server/db/migrations/20230607T211442112Z-feed-generator-init.js.map +1 -1
  423. package/dist/data-plane/server/db/migrations/20230608T155101190Z-algo-whats-hot-view.d.ts +1 -1
  424. package/dist/data-plane/server/db/migrations/20230608T155101190Z-algo-whats-hot-view.d.ts.map +1 -1
  425. package/dist/data-plane/server/db/migrations/20230608T155101190Z-algo-whats-hot-view.js.map +1 -1
  426. package/dist/data-plane/server/db/migrations/20230608T201813132Z-mute-lists.d.ts +1 -1
  427. package/dist/data-plane/server/db/migrations/20230608T201813132Z-mute-lists.d.ts.map +1 -1
  428. package/dist/data-plane/server/db/migrations/20230608T201813132Z-mute-lists.js.map +1 -1
  429. package/dist/data-plane/server/db/migrations/20230608T205147239Z-mutes.d.ts +1 -1
  430. package/dist/data-plane/server/db/migrations/20230608T205147239Z-mutes.d.ts.map +1 -1
  431. package/dist/data-plane/server/db/migrations/20230608T205147239Z-mutes.js.map +1 -1
  432. package/dist/data-plane/server/db/migrations/20230609T153623961Z-blocks.d.ts +1 -1
  433. package/dist/data-plane/server/db/migrations/20230609T153623961Z-blocks.d.ts.map +1 -1
  434. package/dist/data-plane/server/db/migrations/20230609T153623961Z-blocks.js.map +1 -1
  435. package/dist/data-plane/server/db/migrations/20230609T232122649Z-actor-deletion-indexes.d.ts +1 -1
  436. package/dist/data-plane/server/db/migrations/20230609T232122649Z-actor-deletion-indexes.d.ts.map +1 -1
  437. package/dist/data-plane/server/db/migrations/20230609T232122649Z-actor-deletion-indexes.js.map +1 -1
  438. package/dist/data-plane/server/db/migrations/20230610T203555962Z-suggested-follows.d.ts +1 -1
  439. package/dist/data-plane/server/db/migrations/20230610T203555962Z-suggested-follows.d.ts.map +1 -1
  440. package/dist/data-plane/server/db/migrations/20230610T203555962Z-suggested-follows.js.map +1 -1
  441. package/dist/data-plane/server/db/migrations/20230611T215300060Z-actor-state.d.ts +1 -1
  442. package/dist/data-plane/server/db/migrations/20230611T215300060Z-actor-state.d.ts.map +1 -1
  443. package/dist/data-plane/server/db/migrations/20230611T215300060Z-actor-state.js.map +1 -1
  444. package/dist/data-plane/server/db/migrations/20230620T161134972Z-post-langs.d.ts +1 -1
  445. package/dist/data-plane/server/db/migrations/20230620T161134972Z-post-langs.d.ts.map +1 -1
  446. package/dist/data-plane/server/db/migrations/20230620T161134972Z-post-langs.js.map +1 -1
  447. package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.d.ts +1 -1
  448. package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.d.ts.map +1 -1
  449. package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.js.map +1 -1
  450. package/dist/data-plane/server/db/migrations/20230629T220835893Z-remove-post-hierarchy.d.ts +1 -1
  451. package/dist/data-plane/server/db/migrations/20230629T220835893Z-remove-post-hierarchy.d.ts.map +1 -1
  452. package/dist/data-plane/server/db/migrations/20230629T220835893Z-remove-post-hierarchy.js.map +1 -1
  453. package/dist/data-plane/server/db/migrations/20230703T045536691Z-feed-and-label-indices.d.ts +1 -1
  454. package/dist/data-plane/server/db/migrations/20230703T045536691Z-feed-and-label-indices.d.ts.map +1 -1
  455. package/dist/data-plane/server/db/migrations/20230703T045536691Z-feed-and-label-indices.js.map +1 -1
  456. package/dist/data-plane/server/db/migrations/20230720T164800037Z-posts-cursor-idx.d.ts +1 -1
  457. package/dist/data-plane/server/db/migrations/20230720T164800037Z-posts-cursor-idx.d.ts.map +1 -1
  458. package/dist/data-plane/server/db/migrations/20230720T164800037Z-posts-cursor-idx.js.map +1 -1
  459. package/dist/data-plane/server/db/migrations/20230807T035309811Z-feed-item-delete-invite-for-user-idx.d.ts +1 -1
  460. package/dist/data-plane/server/db/migrations/20230807T035309811Z-feed-item-delete-invite-for-user-idx.d.ts.map +1 -1
  461. package/dist/data-plane/server/db/migrations/20230807T035309811Z-feed-item-delete-invite-for-user-idx.js.map +1 -1
  462. package/dist/data-plane/server/db/migrations/20230808T172902639Z-repo-rev.d.ts +1 -1
  463. package/dist/data-plane/server/db/migrations/20230808T172902639Z-repo-rev.d.ts.map +1 -1
  464. package/dist/data-plane/server/db/migrations/20230808T172902639Z-repo-rev.js.map +1 -1
  465. package/dist/data-plane/server/db/migrations/20230810T203349843Z-action-duration.d.ts +1 -1
  466. package/dist/data-plane/server/db/migrations/20230810T203349843Z-action-duration.d.ts.map +1 -1
  467. package/dist/data-plane/server/db/migrations/20230810T203349843Z-action-duration.js.map +1 -1
  468. package/dist/data-plane/server/db/migrations/20230817T195936007Z-native-notifications.d.ts +1 -1
  469. package/dist/data-plane/server/db/migrations/20230817T195936007Z-native-notifications.d.ts.map +1 -1
  470. package/dist/data-plane/server/db/migrations/20230817T195936007Z-native-notifications.js.map +1 -1
  471. package/dist/data-plane/server/db/migrations/20230830T205507322Z-suggested-feeds.d.ts +1 -1
  472. package/dist/data-plane/server/db/migrations/20230830T205507322Z-suggested-feeds.d.ts.map +1 -1
  473. package/dist/data-plane/server/db/migrations/20230830T205507322Z-suggested-feeds.js.map +1 -1
  474. package/dist/data-plane/server/db/migrations/20230904T211011773Z-block-lists.d.ts +1 -1
  475. package/dist/data-plane/server/db/migrations/20230904T211011773Z-block-lists.d.ts.map +1 -1
  476. package/dist/data-plane/server/db/migrations/20230904T211011773Z-block-lists.js.map +1 -1
  477. package/dist/data-plane/server/db/migrations/20230906T222220386Z-thread-gating.d.ts +1 -1
  478. package/dist/data-plane/server/db/migrations/20230906T222220386Z-thread-gating.d.ts.map +1 -1
  479. package/dist/data-plane/server/db/migrations/20230906T222220386Z-thread-gating.js.map +1 -1
  480. package/dist/data-plane/server/db/migrations/20230920T213858047Z-add-tags-to-post.d.ts +1 -1
  481. package/dist/data-plane/server/db/migrations/20230920T213858047Z-add-tags-to-post.d.ts.map +1 -1
  482. package/dist/data-plane/server/db/migrations/20230920T213858047Z-add-tags-to-post.js.map +1 -1
  483. package/dist/data-plane/server/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +1 -1
  484. package/dist/data-plane/server/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts.map +1 -1
  485. package/dist/data-plane/server/db/migrations/20230929T192920807Z-record-cursor-indexes.js.map +1 -1
  486. package/dist/data-plane/server/db/migrations/20231003T202833377Z-create-moderation-subject-status.d.ts +1 -1
  487. package/dist/data-plane/server/db/migrations/20231003T202833377Z-create-moderation-subject-status.d.ts.map +1 -1
  488. package/dist/data-plane/server/db/migrations/20231003T202833377Z-create-moderation-subject-status.js.map +1 -1
  489. package/dist/data-plane/server/db/migrations/20231220T225126090Z-blob-takedowns.d.ts +1 -1
  490. package/dist/data-plane/server/db/migrations/20231220T225126090Z-blob-takedowns.d.ts.map +1 -1
  491. package/dist/data-plane/server/db/migrations/20231220T225126090Z-blob-takedowns.js.map +1 -1
  492. package/dist/data-plane/server/db/migrations/20240124T023719200Z-tagged-suggestions.d.ts +1 -1
  493. package/dist/data-plane/server/db/migrations/20240124T023719200Z-tagged-suggestions.d.ts.map +1 -1
  494. package/dist/data-plane/server/db/migrations/20240124T023719200Z-tagged-suggestions.js.map +1 -1
  495. package/dist/data-plane/server/db/migrations/20240226T225725627Z-labelers.d.ts +1 -1
  496. package/dist/data-plane/server/db/migrations/20240226T225725627Z-labelers.d.ts.map +1 -1
  497. package/dist/data-plane/server/db/migrations/20240226T225725627Z-labelers.js.map +1 -1
  498. package/dist/data-plane/server/db/migrations/20240530T170337073Z-account-deactivation.d.ts +1 -1
  499. package/dist/data-plane/server/db/migrations/20240530T170337073Z-account-deactivation.d.ts.map +1 -1
  500. package/dist/data-plane/server/db/migrations/20240530T170337073Z-account-deactivation.js.map +1 -1
  501. package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.d.ts +1 -1
  502. package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.d.ts.map +1 -1
  503. package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.js.map +1 -1
  504. package/dist/data-plane/server/db/migrations/20240606T222548219Z-starter-packs.d.ts +1 -1
  505. package/dist/data-plane/server/db/migrations/20240606T222548219Z-starter-packs.d.ts.map +1 -1
  506. package/dist/data-plane/server/db/migrations/20240606T222548219Z-starter-packs.js.map +1 -1
  507. package/dist/data-plane/server/db/migrations/20240719T203853939Z-priority-notifs.d.ts +1 -1
  508. package/dist/data-plane/server/db/migrations/20240719T203853939Z-priority-notifs.d.ts.map +1 -1
  509. package/dist/data-plane/server/db/migrations/20240719T203853939Z-priority-notifs.js.map +1 -1
  510. package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts +1 -1
  511. package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts.map +1 -1
  512. package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.js.map +1 -1
  513. package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts +1 -1
  514. package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts.map +1 -1
  515. package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.js.map +1 -1
  516. package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts +1 -1
  517. package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts.map +1 -1
  518. package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.js.map +1 -1
  519. package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts +1 -1
  520. package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts.map +1 -1
  521. package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.js.map +1 -1
  522. package/dist/data-plane/server/db/migrations/20240829T211238293Z-simplify-actor-sync.d.ts +1 -1
  523. package/dist/data-plane/server/db/migrations/20240829T211238293Z-simplify-actor-sync.d.ts.map +1 -1
  524. package/dist/data-plane/server/db/migrations/20240829T211238293Z-simplify-actor-sync.js.map +1 -1
  525. package/dist/data-plane/server/db/migrations/20240831T134810923Z-pinned-posts.d.ts +1 -1
  526. package/dist/data-plane/server/db/migrations/20240831T134810923Z-pinned-posts.d.ts.map +1 -1
  527. package/dist/data-plane/server/db/migrations/20240831T134810923Z-pinned-posts.js.map +1 -1
  528. package/dist/data-plane/server/db/migrations/20241114T153108102Z-add-starter-packs-name.d.ts +1 -1
  529. package/dist/data-plane/server/db/migrations/20241114T153108102Z-add-starter-packs-name.d.ts.map +1 -1
  530. package/dist/data-plane/server/db/migrations/20241114T153108102Z-add-starter-packs-name.js.map +1 -1
  531. package/dist/data-plane/server/db/migrations/20250116T222618297Z-post-embed-video.d.ts +1 -1
  532. package/dist/data-plane/server/db/migrations/20250116T222618297Z-post-embed-video.d.ts.map +1 -1
  533. package/dist/data-plane/server/db/migrations/20250116T222618297Z-post-embed-video.js.map +1 -1
  534. package/dist/data-plane/server/db/migrations/20250207T174822012Z-add-label-exp.d.ts +1 -1
  535. package/dist/data-plane/server/db/migrations/20250207T174822012Z-add-label-exp.d.ts.map +1 -1
  536. package/dist/data-plane/server/db/migrations/20250207T174822012Z-add-label-exp.js.map +1 -1
  537. package/dist/data-plane/server/db/migrations/20250404T163421487Z-verifications.d.ts +1 -1
  538. package/dist/data-plane/server/db/migrations/20250404T163421487Z-verifications.d.ts.map +1 -1
  539. package/dist/data-plane/server/db/migrations/20250404T163421487Z-verifications.js.map +1 -1
  540. package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts +1 -1
  541. package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts.map +1 -1
  542. package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.js.map +1 -1
  543. package/dist/data-plane/server/db/migrations/20250528T221913281Z-add-record-tags.d.ts +1 -1
  544. package/dist/data-plane/server/db/migrations/20250528T221913281Z-add-record-tags.d.ts.map +1 -1
  545. package/dist/data-plane/server/db/migrations/20250528T221913281Z-add-record-tags.js.map +1 -1
  546. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts +1 -1
  547. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts.map +1 -1
  548. package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.js.map +1 -1
  549. package/dist/data-plane/server/db/migrations/20250611T140649895Z-add-activity-subscription.d.ts +1 -1
  550. package/dist/data-plane/server/db/migrations/20250611T140649895Z-add-activity-subscription.d.ts.map +1 -1
  551. package/dist/data-plane/server/db/migrations/20250611T140649895Z-add-activity-subscription.js.map +1 -1
  552. package/dist/data-plane/server/db/migrations/20250627T025331240Z-add-actor-age-assurance-columns.d.ts +1 -1
  553. package/dist/data-plane/server/db/migrations/20250627T025331240Z-add-actor-age-assurance-columns.d.ts.map +1 -1
  554. package/dist/data-plane/server/db/migrations/20250627T025331240Z-add-actor-age-assurance-columns.js.map +1 -1
  555. package/dist/data-plane/server/db/migrations/20250812T183735692Z-add-bookmarks.d.ts +1 -1
  556. package/dist/data-plane/server/db/migrations/20250812T183735692Z-add-bookmarks.d.ts.map +1 -1
  557. package/dist/data-plane/server/db/migrations/20250812T183735692Z-add-bookmarks.js.map +1 -1
  558. package/dist/data-plane/server/db/migrations/20250813T174955711Z-add-post-agg-bookmarks.d.ts +1 -1
  559. package/dist/data-plane/server/db/migrations/20250813T174955711Z-add-post-agg-bookmarks.d.ts.map +1 -1
  560. package/dist/data-plane/server/db/migrations/20250813T174955711Z-add-post-agg-bookmarks.js.map +1 -1
  561. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.d.ts +1 -1
  562. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.d.ts.map +1 -1
  563. package/dist/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.js.map +1 -1
  564. package/dist/data-plane/server/db/migrations/20260112T133951271Z-add-drafts.d.ts +1 -1
  565. package/dist/data-plane/server/db/migrations/20260112T133951271Z-add-drafts.d.ts.map +1 -1
  566. package/dist/data-plane/server/db/migrations/20260112T133951271Z-add-drafts.js.map +1 -1
  567. package/dist/data-plane/server/db/migrations/20260604T224952774Z-post-embed-gallery-image.d.ts +1 -1
  568. package/dist/data-plane/server/db/migrations/20260604T224952774Z-post-embed-gallery-image.d.ts.map +1 -1
  569. package/dist/data-plane/server/db/migrations/20260604T224952774Z-post-embed-gallery-image.js.map +1 -1
  570. package/dist/data-plane/server/db/migrations/provider.d.ts +2 -2
  571. package/dist/data-plane/server/db/migrations/provider.d.ts.map +1 -1
  572. package/dist/data-plane/server/db/migrations/provider.js.map +1 -1
  573. package/dist/data-plane/server/db/pagination.d.ts +2 -2
  574. package/dist/data-plane/server/db/pagination.d.ts.map +1 -1
  575. package/dist/data-plane/server/db/pagination.js.map +1 -1
  576. package/dist/data-plane/server/db/tables/actor-block.d.ts +1 -1
  577. package/dist/data-plane/server/db/tables/actor-block.d.ts.map +1 -1
  578. package/dist/data-plane/server/db/tables/actor-block.js.map +1 -1
  579. package/dist/data-plane/server/db/tables/actor.d.ts +1 -1
  580. package/dist/data-plane/server/db/tables/actor.d.ts.map +1 -1
  581. package/dist/data-plane/server/db/tables/actor.js.map +1 -1
  582. package/dist/data-plane/server/db/tables/did-cache.d.ts +1 -1
  583. package/dist/data-plane/server/db/tables/did-cache.d.ts.map +1 -1
  584. package/dist/data-plane/server/db/tables/did-cache.js.map +1 -1
  585. package/dist/data-plane/server/db/tables/feed-generator.d.ts +1 -1
  586. package/dist/data-plane/server/db/tables/feed-generator.d.ts.map +1 -1
  587. package/dist/data-plane/server/db/tables/feed-generator.js.map +1 -1
  588. package/dist/data-plane/server/db/tables/follow.d.ts +1 -1
  589. package/dist/data-plane/server/db/tables/follow.d.ts.map +1 -1
  590. package/dist/data-plane/server/db/tables/follow.js.map +1 -1
  591. package/dist/data-plane/server/db/tables/labeler.d.ts +1 -1
  592. package/dist/data-plane/server/db/tables/labeler.d.ts.map +1 -1
  593. package/dist/data-plane/server/db/tables/labeler.js.map +1 -1
  594. package/dist/data-plane/server/db/tables/like.d.ts +1 -1
  595. package/dist/data-plane/server/db/tables/like.d.ts.map +1 -1
  596. package/dist/data-plane/server/db/tables/like.js.map +1 -1
  597. package/dist/data-plane/server/db/tables/list-block.d.ts +1 -1
  598. package/dist/data-plane/server/db/tables/list-block.d.ts.map +1 -1
  599. package/dist/data-plane/server/db/tables/list-block.js.map +1 -1
  600. package/dist/data-plane/server/db/tables/list-item.d.ts +1 -1
  601. package/dist/data-plane/server/db/tables/list-item.d.ts.map +1 -1
  602. package/dist/data-plane/server/db/tables/list-item.js.map +1 -1
  603. package/dist/data-plane/server/db/tables/list.d.ts +1 -1
  604. package/dist/data-plane/server/db/tables/list.d.ts.map +1 -1
  605. package/dist/data-plane/server/db/tables/list.js.map +1 -1
  606. package/dist/data-plane/server/db/tables/notification.d.ts +1 -1
  607. package/dist/data-plane/server/db/tables/notification.d.ts.map +1 -1
  608. package/dist/data-plane/server/db/tables/notification.js.map +1 -1
  609. package/dist/data-plane/server/db/tables/post-agg.d.ts +1 -1
  610. package/dist/data-plane/server/db/tables/post-agg.d.ts.map +1 -1
  611. package/dist/data-plane/server/db/tables/post-agg.js.map +1 -1
  612. package/dist/data-plane/server/db/tables/post.d.ts +1 -1
  613. package/dist/data-plane/server/db/tables/post.d.ts.map +1 -1
  614. package/dist/data-plane/server/db/tables/post.js.map +1 -1
  615. package/dist/data-plane/server/db/tables/profile-agg.d.ts +1 -1
  616. package/dist/data-plane/server/db/tables/profile-agg.d.ts.map +1 -1
  617. package/dist/data-plane/server/db/tables/profile-agg.js.map +1 -1
  618. package/dist/data-plane/server/db/tables/quote.d.ts +1 -1
  619. package/dist/data-plane/server/db/tables/quote.d.ts.map +1 -1
  620. package/dist/data-plane/server/db/tables/quote.js.map +1 -1
  621. package/dist/data-plane/server/db/tables/record.d.ts +1 -1
  622. package/dist/data-plane/server/db/tables/record.d.ts.map +1 -1
  623. package/dist/data-plane/server/db/tables/record.js.map +1 -1
  624. package/dist/data-plane/server/db/tables/repost.d.ts +1 -1
  625. package/dist/data-plane/server/db/tables/repost.d.ts.map +1 -1
  626. package/dist/data-plane/server/db/tables/repost.js.map +1 -1
  627. package/dist/data-plane/server/db/tables/starter-pack.d.ts +1 -1
  628. package/dist/data-plane/server/db/tables/starter-pack.d.ts.map +1 -1
  629. package/dist/data-plane/server/db/tables/starter-pack.js.map +1 -1
  630. package/dist/data-plane/server/db/tables/verification.d.ts +1 -1
  631. package/dist/data-plane/server/db/tables/verification.d.ts.map +1 -1
  632. package/dist/data-plane/server/db/tables/verification.js.map +1 -1
  633. package/dist/data-plane/server/db/types.d.ts +1 -1
  634. package/dist/data-plane/server/db/types.d.ts.map +1 -1
  635. package/dist/data-plane/server/db/types.js.map +1 -1
  636. package/dist/data-plane/server/db/util.d.ts +2 -2
  637. package/dist/data-plane/server/db/util.d.ts.map +1 -1
  638. package/dist/data-plane/server/db/util.js.map +1 -1
  639. package/dist/data-plane/server/index.d.ts +2 -2
  640. package/dist/data-plane/server/index.d.ts.map +1 -1
  641. package/dist/data-plane/server/index.js.map +1 -1
  642. package/dist/data-plane/server/indexing/index.d.ts +5 -5
  643. package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
  644. package/dist/data-plane/server/indexing/index.js.map +1 -1
  645. package/dist/data-plane/server/indexing/plugins/block.d.ts +2 -2
  646. package/dist/data-plane/server/indexing/plugins/block.d.ts.map +1 -1
  647. package/dist/data-plane/server/indexing/plugins/block.js.map +1 -1
  648. package/dist/data-plane/server/indexing/plugins/chat-declaration.d.ts +2 -2
  649. package/dist/data-plane/server/indexing/plugins/chat-declaration.d.ts.map +1 -1
  650. package/dist/data-plane/server/indexing/plugins/chat-declaration.js.map +1 -1
  651. package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts +2 -2
  652. package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts.map +1 -1
  653. package/dist/data-plane/server/indexing/plugins/feed-generator.js.map +1 -1
  654. package/dist/data-plane/server/indexing/plugins/follow.d.ts +2 -2
  655. package/dist/data-plane/server/indexing/plugins/follow.d.ts.map +1 -1
  656. package/dist/data-plane/server/indexing/plugins/follow.js.map +1 -1
  657. package/dist/data-plane/server/indexing/plugins/germ-declaration.d.ts +2 -2
  658. package/dist/data-plane/server/indexing/plugins/germ-declaration.d.ts.map +1 -1
  659. package/dist/data-plane/server/indexing/plugins/germ-declaration.js.map +1 -1
  660. package/dist/data-plane/server/indexing/plugins/labeler.d.ts +2 -2
  661. package/dist/data-plane/server/indexing/plugins/labeler.d.ts.map +1 -1
  662. package/dist/data-plane/server/indexing/plugins/labeler.js.map +1 -1
  663. package/dist/data-plane/server/indexing/plugins/like.d.ts +2 -2
  664. package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
  665. package/dist/data-plane/server/indexing/plugins/like.js.map +1 -1
  666. package/dist/data-plane/server/indexing/plugins/list-block.d.ts +2 -2
  667. package/dist/data-plane/server/indexing/plugins/list-block.d.ts.map +1 -1
  668. package/dist/data-plane/server/indexing/plugins/list-block.js.map +1 -1
  669. package/dist/data-plane/server/indexing/plugins/list-item.d.ts +2 -2
  670. package/dist/data-plane/server/indexing/plugins/list-item.d.ts.map +1 -1
  671. package/dist/data-plane/server/indexing/plugins/list-item.js.map +1 -1
  672. package/dist/data-plane/server/indexing/plugins/list.d.ts +2 -2
  673. package/dist/data-plane/server/indexing/plugins/list.d.ts.map +1 -1
  674. package/dist/data-plane/server/indexing/plugins/list.js.map +1 -1
  675. package/dist/data-plane/server/indexing/plugins/notif-declaration.d.ts +2 -2
  676. package/dist/data-plane/server/indexing/plugins/notif-declaration.d.ts.map +1 -1
  677. package/dist/data-plane/server/indexing/plugins/notif-declaration.js.map +1 -1
  678. package/dist/data-plane/server/indexing/plugins/post-gate.d.ts +2 -2
  679. package/dist/data-plane/server/indexing/plugins/post-gate.d.ts.map +1 -1
  680. package/dist/data-plane/server/indexing/plugins/post-gate.js.map +1 -1
  681. package/dist/data-plane/server/indexing/plugins/post.d.ts +4 -4
  682. package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
  683. package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
  684. package/dist/data-plane/server/indexing/plugins/profile.d.ts +2 -2
  685. package/dist/data-plane/server/indexing/plugins/profile.d.ts.map +1 -1
  686. package/dist/data-plane/server/indexing/plugins/profile.js.map +1 -1
  687. package/dist/data-plane/server/indexing/plugins/repost.d.ts +2 -2
  688. package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
  689. package/dist/data-plane/server/indexing/plugins/repost.js.map +1 -1
  690. package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts +2 -2
  691. package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts.map +1 -1
  692. package/dist/data-plane/server/indexing/plugins/starter-pack.js.map +1 -1
  693. package/dist/data-plane/server/indexing/plugins/status.d.ts +2 -2
  694. package/dist/data-plane/server/indexing/plugins/status.d.ts.map +1 -1
  695. package/dist/data-plane/server/indexing/plugins/status.js.map +1 -1
  696. package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts +2 -2
  697. package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts.map +1 -1
  698. package/dist/data-plane/server/indexing/plugins/thread-gate.js.map +1 -1
  699. package/dist/data-plane/server/indexing/plugins/verification.d.ts +2 -2
  700. package/dist/data-plane/server/indexing/plugins/verification.d.ts.map +1 -1
  701. package/dist/data-plane/server/indexing/plugins/verification.js.map +1 -1
  702. package/dist/data-plane/server/indexing/processor.d.ts +6 -6
  703. package/dist/data-plane/server/indexing/processor.d.ts.map +1 -1
  704. package/dist/data-plane/server/indexing/processor.js +1 -1
  705. package/dist/data-plane/server/indexing/processor.js.map +1 -1
  706. package/dist/data-plane/server/routes/activity-subscription.d.ts +3 -3
  707. package/dist/data-plane/server/routes/activity-subscription.d.ts.map +1 -1
  708. package/dist/data-plane/server/routes/activity-subscription.js.map +1 -1
  709. package/dist/data-plane/server/routes/blocks.d.ts +3 -3
  710. package/dist/data-plane/server/routes/blocks.d.ts.map +1 -1
  711. package/dist/data-plane/server/routes/blocks.js.map +1 -1
  712. package/dist/data-plane/server/routes/bookmarks.d.ts +3 -3
  713. package/dist/data-plane/server/routes/bookmarks.d.ts.map +1 -1
  714. package/dist/data-plane/server/routes/bookmarks.js.map +1 -1
  715. package/dist/data-plane/server/routes/drafts.d.ts +3 -3
  716. package/dist/data-plane/server/routes/drafts.d.ts.map +1 -1
  717. package/dist/data-plane/server/routes/drafts.js.map +1 -1
  718. package/dist/data-plane/server/routes/feed-gens.d.ts +3 -3
  719. package/dist/data-plane/server/routes/feed-gens.d.ts.map +1 -1
  720. package/dist/data-plane/server/routes/feed-gens.js.map +1 -1
  721. package/dist/data-plane/server/routes/feeds.d.ts +3 -3
  722. package/dist/data-plane/server/routes/feeds.d.ts.map +1 -1
  723. package/dist/data-plane/server/routes/feeds.js.map +1 -1
  724. package/dist/data-plane/server/routes/follows.d.ts +3 -3
  725. package/dist/data-plane/server/routes/follows.d.ts.map +1 -1
  726. package/dist/data-plane/server/routes/follows.js.map +1 -1
  727. package/dist/data-plane/server/routes/identity.d.ts +4 -4
  728. package/dist/data-plane/server/routes/identity.d.ts.map +1 -1
  729. package/dist/data-plane/server/routes/identity.js +1 -1
  730. package/dist/data-plane/server/routes/identity.js.map +1 -1
  731. package/dist/data-plane/server/routes/index.d.ts +3 -3
  732. package/dist/data-plane/server/routes/index.d.ts.map +1 -1
  733. package/dist/data-plane/server/routes/index.js.map +1 -1
  734. package/dist/data-plane/server/routes/interactions.d.ts +3 -3
  735. package/dist/data-plane/server/routes/interactions.d.ts.map +1 -1
  736. package/dist/data-plane/server/routes/interactions.js.map +1 -1
  737. package/dist/data-plane/server/routes/labels.d.ts +3 -3
  738. package/dist/data-plane/server/routes/labels.d.ts.map +1 -1
  739. package/dist/data-plane/server/routes/labels.js.map +1 -1
  740. package/dist/data-plane/server/routes/likes.d.ts +3 -3
  741. package/dist/data-plane/server/routes/likes.d.ts.map +1 -1
  742. package/dist/data-plane/server/routes/likes.js.map +1 -1
  743. package/dist/data-plane/server/routes/lists.d.ts +3 -3
  744. package/dist/data-plane/server/routes/lists.d.ts.map +1 -1
  745. package/dist/data-plane/server/routes/lists.js.map +1 -1
  746. package/dist/data-plane/server/routes/moderation.d.ts +3 -3
  747. package/dist/data-plane/server/routes/moderation.d.ts.map +1 -1
  748. package/dist/data-plane/server/routes/moderation.js.map +1 -1
  749. package/dist/data-plane/server/routes/mutes.d.ts +3 -3
  750. package/dist/data-plane/server/routes/mutes.d.ts.map +1 -1
  751. package/dist/data-plane/server/routes/mutes.js.map +1 -1
  752. package/dist/data-plane/server/routes/notifs.d.ts +4 -4
  753. package/dist/data-plane/server/routes/notifs.d.ts.map +1 -1
  754. package/dist/data-plane/server/routes/notifs.js.map +1 -1
  755. package/dist/data-plane/server/routes/profile.d.ts +3 -3
  756. package/dist/data-plane/server/routes/profile.d.ts.map +1 -1
  757. package/dist/data-plane/server/routes/profile.js +1 -1
  758. package/dist/data-plane/server/routes/profile.js.map +1 -1
  759. package/dist/data-plane/server/routes/quotes.d.ts +3 -3
  760. package/dist/data-plane/server/routes/quotes.d.ts.map +1 -1
  761. package/dist/data-plane/server/routes/quotes.js.map +1 -1
  762. package/dist/data-plane/server/routes/records.d.ts +3 -3
  763. package/dist/data-plane/server/routes/records.d.ts.map +1 -1
  764. package/dist/data-plane/server/routes/records.js.map +1 -1
  765. package/dist/data-plane/server/routes/relationships.d.ts +3 -3
  766. package/dist/data-plane/server/routes/relationships.d.ts.map +1 -1
  767. package/dist/data-plane/server/routes/relationships.js.map +1 -1
  768. package/dist/data-plane/server/routes/reposts.d.ts +3 -3
  769. package/dist/data-plane/server/routes/reposts.d.ts.map +1 -1
  770. package/dist/data-plane/server/routes/reposts.js.map +1 -1
  771. package/dist/data-plane/server/routes/search.d.ts +3 -3
  772. package/dist/data-plane/server/routes/search.d.ts.map +1 -1
  773. package/dist/data-plane/server/routes/search.js.map +1 -1
  774. package/dist/data-plane/server/routes/site-standard.d.ts +3 -3
  775. package/dist/data-plane/server/routes/site-standard.d.ts.map +1 -1
  776. package/dist/data-plane/server/routes/site-standard.js.map +1 -1
  777. package/dist/data-plane/server/routes/sitemap.d.ts +2 -2
  778. package/dist/data-plane/server/routes/sitemap.d.ts.map +1 -1
  779. package/dist/data-plane/server/routes/sitemap.js.map +1 -1
  780. package/dist/data-plane/server/routes/starter-packs.d.ts +3 -3
  781. package/dist/data-plane/server/routes/starter-packs.d.ts.map +1 -1
  782. package/dist/data-plane/server/routes/starter-packs.js.map +1 -1
  783. package/dist/data-plane/server/routes/suggestions.d.ts +3 -3
  784. package/dist/data-plane/server/routes/suggestions.d.ts.map +1 -1
  785. package/dist/data-plane/server/routes/suggestions.js.map +1 -1
  786. package/dist/data-plane/server/routes/sync.d.ts +3 -3
  787. package/dist/data-plane/server/routes/sync.d.ts.map +1 -1
  788. package/dist/data-plane/server/routes/sync.js.map +1 -1
  789. package/dist/data-plane/server/routes/threads.d.ts +3 -3
  790. package/dist/data-plane/server/routes/threads.d.ts.map +1 -1
  791. package/dist/data-plane/server/routes/threads.js.map +1 -1
  792. package/dist/data-plane/server/subscription.d.ts +2 -2
  793. package/dist/data-plane/server/subscription.d.ts.map +1 -1
  794. package/dist/data-plane/server/subscription.js +1 -1
  795. package/dist/data-plane/server/subscription.js.map +1 -1
  796. package/dist/data-plane/server/util.d.ts +2 -2
  797. package/dist/data-plane/server/util.d.ts.map +1 -1
  798. package/dist/data-plane/server/util.js.map +1 -1
  799. package/dist/error.d.ts +1 -1
  800. package/dist/error.d.ts.map +1 -1
  801. package/dist/error.js.map +1 -1
  802. package/dist/etcd.d.ts +1 -1
  803. package/dist/etcd.d.ts.map +1 -1
  804. package/dist/etcd.js.map +1 -1
  805. package/dist/feature-gates/index.d.ts +1 -1
  806. package/dist/feature-gates/index.d.ts.map +1 -1
  807. package/dist/feature-gates/index.js +1 -0
  808. package/dist/feature-gates/index.js.map +1 -1
  809. package/dist/feature-gates/types.d.ts +1 -1
  810. package/dist/feature-gates/types.d.ts.map +1 -1
  811. package/dist/feature-gates/types.js.map +1 -1
  812. package/dist/feature-gates/utils.d.ts +2 -2
  813. package/dist/feature-gates/utils.d.ts.map +1 -1
  814. package/dist/feature-gates/utils.js.map +1 -1
  815. package/dist/hydration/actor.d.ts +7 -5
  816. package/dist/hydration/actor.d.ts.map +1 -1
  817. package/dist/hydration/actor.js +2 -0
  818. package/dist/hydration/actor.js.map +1 -1
  819. package/dist/hydration/external.d.ts +4 -4
  820. package/dist/hydration/external.d.ts.map +1 -1
  821. package/dist/hydration/external.js +1 -1
  822. package/dist/hydration/external.js.map +1 -1
  823. package/dist/hydration/feed.d.ts +4 -4
  824. package/dist/hydration/feed.d.ts.map +1 -1
  825. package/dist/hydration/feed.js.map +1 -1
  826. package/dist/hydration/graph.d.ts +5 -5
  827. package/dist/hydration/graph.d.ts.map +1 -1
  828. package/dist/hydration/graph.js +1 -1
  829. package/dist/hydration/graph.js.map +1 -1
  830. package/dist/hydration/hydrator.d.ts +11 -11
  831. package/dist/hydration/hydrator.d.ts.map +1 -1
  832. package/dist/hydration/hydrator.js +1 -1
  833. package/dist/hydration/hydrator.js.map +1 -1
  834. package/dist/hydration/label.d.ts +5 -5
  835. package/dist/hydration/label.d.ts.map +1 -1
  836. package/dist/hydration/label.js +1 -1
  837. package/dist/hydration/label.js.map +1 -1
  838. package/dist/hydration/util.d.ts +3 -3
  839. package/dist/hydration/util.d.ts.map +1 -1
  840. package/dist/hydration/util.js.map +1 -1
  841. package/dist/image/invalidator.d.ts +1 -1
  842. package/dist/image/invalidator.d.ts.map +1 -1
  843. package/dist/image/invalidator.js.map +1 -1
  844. package/dist/image/server.d.ts +3 -3
  845. package/dist/image/server.d.ts.map +1 -1
  846. package/dist/image/server.js.map +1 -1
  847. package/dist/image/sharp.d.ts +2 -2
  848. package/dist/image/sharp.d.ts.map +1 -1
  849. package/dist/image/sharp.js.map +1 -1
  850. package/dist/image/uri.d.ts +2 -2
  851. package/dist/image/uri.d.ts.map +1 -1
  852. package/dist/image/uri.js.map +1 -1
  853. package/dist/index.d.ts +3 -3
  854. package/dist/index.d.ts.map +1 -1
  855. package/dist/index.js.map +1 -1
  856. package/dist/kws.d.ts +2 -2
  857. package/dist/kws.d.ts.map +1 -1
  858. package/dist/kws.js.map +1 -1
  859. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +6 -0
  860. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
  861. package/dist/lexicons/app/bsky/actor/defs.defs.js +1 -0
  862. package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
  863. package/dist/logger.d.ts +1 -1
  864. package/dist/logger.d.ts.map +1 -1
  865. package/dist/logger.js.map +1 -1
  866. package/dist/pipeline.d.ts +1 -1
  867. package/dist/pipeline.d.ts.map +1 -1
  868. package/dist/pipeline.js.map +1 -1
  869. package/dist/rolodex.d.ts +2 -2
  870. package/dist/rolodex.d.ts.map +1 -1
  871. package/dist/rolodex.js.map +1 -1
  872. package/dist/stash.d.ts +2 -2
  873. package/dist/stash.d.ts.map +1 -1
  874. package/dist/stash.js.map +1 -1
  875. package/dist/util/http.d.ts +1 -1
  876. package/dist/util/http.d.ts.map +1 -1
  877. package/dist/util/http.js.map +1 -1
  878. package/dist/util/standard-site.d.ts +1 -1
  879. package/dist/util/standard-site.d.ts.map +1 -1
  880. package/dist/util/standard-site.js.map +1 -1
  881. package/dist/util/uris.d.ts +2 -2
  882. package/dist/util/uris.d.ts.map +1 -1
  883. package/dist/util/uris.js.map +1 -1
  884. package/dist/util.d.ts +1 -1
  885. package/dist/util.d.ts.map +1 -1
  886. package/dist/util.js.map +1 -1
  887. package/dist/views/index.d.ts +11 -11
  888. package/dist/views/index.d.ts.map +1 -1
  889. package/dist/views/index.js.map +1 -1
  890. package/dist/views/threads-v2.d.ts +3 -3
  891. package/dist/views/threads-v2.d.ts.map +1 -1
  892. package/dist/views/threads-v2.js.map +1 -1
  893. package/dist/views/types.d.ts +1 -1
  894. package/dist/views/types.d.ts.map +1 -1
  895. package/dist/views/types.js.map +1 -1
  896. package/dist/views/util.d.ts +2 -2
  897. package/dist/views/util.d.ts.map +1 -1
  898. package/dist/views/util.js.map +1 -1
  899. package/package.json +14 -14
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getEmbedExternalView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getEmbedExternalView.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/embed/getEmbedExternalView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqBvD"}
1
+ {"version":3,"file":"getEmbedExternalView.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/embed/getEmbedExternalView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqBvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getEmbedExternalView.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/embed/getEmbedExternalView.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oDAAoD,GACrD,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAIL,cAAc,EACd,OAAO,GACR,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,oBAAoB,GAAG,cAAc,CACzC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACr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IAEvB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/C,QAAQ,EAAE;YACR,GAAG,OAAO;YACV,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,cAAc;SACf;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAA;AACpD,CAAC,CAAA","sourcesContent":["import { AtUriString, LexMap } from '@atproto/lex'\nimport { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport {\n SiteStandardDocuments,\n SiteStandardPublications,\n getSiteStandardRecordsFromHydrationMapsByDocumentUri,\n} from '../../../../hydration/external.js'\nimport { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js'\nimport { app, com } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n SkeletonFnInput,\n createPipeline,\n noRules,\n} from '../../../../pipeline.js'\nimport { Views } from '../../../../views/index.js'\nimport { ExternalEmbedView, StrongRef } from '../../../../views/types.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getEmbedExternalView = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.embed.getEmbedExternalView, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const result = await getEmbedExternalView({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n return { uris: inputs.params.uris as AtUriString[] }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateEmbedExternalViewFromUris(\n skeleton.uris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n): Output => {\n const { hydration } = inputs\n const documents = hydration.siteStandardDocuments\n const publications = hydration.siteStandardPublications\n // Dispatch by record type. Today site.standard is the only kind we know\n // how to render; future record types get their own branch.\n if (\n (documents && documents.size > 0) ||\n (publications && publications.size > 0)\n ) {\n return standardSitePresentation(inputs, documents, publications)\n }\n return {}\n}\n\nconst standardSitePresentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n documents: SiteStandardDocuments | undefined,\n publications: SiteStandardPublications | undefined,\n): Output => {\n const { ctx, params, hydration } = inputs\n\n // Pick the first hydrated doc, then pair it with the publication its\n // `site` field points at (if any). Docs the dataplane auto-resolved a\n // publication for end up matched; unrelated publications fall away.\n const { document, publication } =\n getSiteStandardRecordsFromHydrationMapsByDocumentUri(\n documents,\n publications,\n )\n\n // Emit response refs/records only for the records we actually selected.\n // Anything else (e.g. extra publications the dataplane returned) is\n // intentionally excluded so the strongRefs Cardy writes onto the post\n // match the view we built. Profiles are emitted in the same order as\n // refs (one per slot) so consumers can match by index.\n const associatedRefs: StrongRef[] = []\n const associatedRecords: LexMap[] = []\n for (const slot of [document, publication]) {\n if (!slot) continue\n associatedRefs.push(\n com.atproto.repo.strongRef.$build({\n uri: slot.ref.uri,\n cid: slot.info.cid,\n }),\n )\n associatedRecords.push(slot.info.record as LexMap)\n }\n\n if (!associatedRefs.length) return {}\n\n const overlay = ctx.views.externalEmbedFromStandardSiteRecords({\n document,\n publication,\n state: hydration,\n assumedUrl: params.url,\n })\n // The view builder rejected the records (validation failed, or the pair\n // didn't produce the title viewExternal requires). Return nothing — Cardy\n // falls back to its own card render and doesn't write strongRefs to the\n // post.\n if (!overlay) return {}\n\n const view = app.bsky.embed.external.view.$build({\n external: {\n ...overlay,\n uri: params.url,\n associatedRefs,\n },\n })\n\n return { view, associatedRefs, associatedRecords }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.embed.getEmbedExternalView.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n uris: AtUriString[]\n}\n\ntype Output = {\n view?: ExternalEmbedView\n associatedRefs?: StrongRef[]\n associatedRecords?: LexMap[]\n}\n"]}
1
+ {"version":3,"file":"getEmbedExternalView.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/embed/getEmbedExternalView.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oDAAoD,GACrD,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAIL,cAAc,EACd,OAAO,GACR,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,oBAAoB,GAAG,cAAc,CACzC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YACzE,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,E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ACf;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAA;AACpD,CAAC,CAAA","sourcesContent":["import type { AtUriString, LexMap } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport {\n type SiteStandardDocuments,\n type SiteStandardPublications,\n getSiteStandardRecordsFromHydrationMapsByDocumentUri,\n} from '../../../../hydration/external.js'\nimport type { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js'\nimport { app, com } from '../../../../lexicons/index.js'\nimport {\n type HydrationFnInput,\n type PresentationFnInput,\n type SkeletonFnInput,\n createPipeline,\n noRules,\n} from '../../../../pipeline.js'\nimport type { Views } from '../../../../views/index.js'\nimport type { ExternalEmbedView, StrongRef } from '../../../../views/types.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getEmbedExternalView = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.embed.getEmbedExternalView, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const result = await getEmbedExternalView({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n return { uris: inputs.params.uris as AtUriString[] }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateEmbedExternalViewFromUris(\n skeleton.uris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n): Output => {\n const { hydration } = inputs\n const documents = hydration.siteStandardDocuments\n const publications = hydration.siteStandardPublications\n // Dispatch by record type. Today site.standard is the only kind we know\n // how to render; future record types get their own branch.\n if (\n (documents && documents.size > 0) ||\n (publications && publications.size > 0)\n ) {\n return standardSitePresentation(inputs, documents, publications)\n }\n return {}\n}\n\nconst standardSitePresentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n documents: SiteStandardDocuments | undefined,\n publications: SiteStandardPublications | undefined,\n): Output => {\n const { ctx, params, hydration } = inputs\n\n // Pick the first hydrated doc, then pair it with the publication its\n // `site` field points at (if any). Docs the dataplane auto-resolved a\n // publication for end up matched; unrelated publications fall away.\n const { document, publication } =\n getSiteStandardRecordsFromHydrationMapsByDocumentUri(\n documents,\n publications,\n )\n\n // Emit response refs/records only for the records we actually selected.\n // Anything else (e.g. extra publications the dataplane returned) is\n // intentionally excluded so the strongRefs Cardy writes onto the post\n // match the view we built. Profiles are emitted in the same order as\n // refs (one per slot) so consumers can match by index.\n const associatedRefs: StrongRef[] = []\n const associatedRecords: LexMap[] = []\n for (const slot of [document, publication]) {\n if (!slot) continue\n associatedRefs.push(\n com.atproto.repo.strongRef.$build({\n uri: slot.ref.uri,\n cid: slot.info.cid,\n }),\n )\n associatedRecords.push(slot.info.record as LexMap)\n }\n\n if (!associatedRefs.length) return {}\n\n const overlay = ctx.views.externalEmbedFromStandardSiteRecords({\n document,\n publication,\n state: hydration,\n assumedUrl: params.url,\n })\n // The view builder rejected the records (validation failed, or the pair\n // didn't produce the title viewExternal requires). Return nothing — Cardy\n // falls back to its own card render and doesn't write strongRefs to the\n // post.\n if (!overlay) return {}\n\n const view = app.bsky.embed.external.view.$build({\n external: {\n ...overlay,\n uri: params.url,\n associatedRefs,\n },\n })\n\n return { view, associatedRefs, associatedRecords }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.embed.getEmbedExternalView.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n uris: AtUriString[]\n}\n\ntype Output = {\n view?: ExternalEmbedView\n associatedRefs?: StrongRef[]\n associatedRecords?: LexMap[]\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getActorFeeds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getActorFeeds.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorFeeds.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAanD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqBvD"}
1
+ {"version":3,"file":"getActorFeeds.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorFeeds.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqBvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getActorFeeds.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorFeeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAQlE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CA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G,MAAM,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC9D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;IACpD,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC;QACjD,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC,CAAA;IACF,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,IAAqB;QACxC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;KACrC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,KAAK,EAAE,MAIxB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IACxC,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,eAAe,CACvC,QAAQ,CAAC,QAAQ,EACjB,MAAM,CAAC,UAAU,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,MAIrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO;QACL,KAAK;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline, noRules } from '../../../../pipeline.js'\nimport { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getActorFeeds = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.feed.getActorFeeds, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const result = await getActorFeeds({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n if (clearlyBadCursor(params.cursor)) {\n return { feedUris: [] }\n }\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n const feedsRes = await ctx.dataplane.getActorFeeds({\n actorDid: did,\n cursor: params.cursor,\n limit: params.limit,\n })\n return {\n feedUris: feedsRes.uris as AtUriString[],\n cursor: parseString(feedsRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedGens(\n skeleton.feedUris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feeds = mapDefined(skeleton.feedUris, (uri) =>\n ctx.views.feedGenerator(uri, hydration),\n )\n return {\n feeds,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getActorFeeds.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n feedUris: AtUriString[]\n cursor?: string\n}\n"]}
1
+ {"version":3,"file":"getActorFeeds.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorFeeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAQvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,aAAa,GAAG,cAAc,CAClC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;QACtC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE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ACxC,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,eAAe,CACvC,QAAQ,CAAC,QAAQ,EACjB,MAAM,CAAC,UAAU,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,MAIrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO;QACL,KAAK;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline, noRules } from '../../../../pipeline.js'\nimport type { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getActorFeeds = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.feed.getActorFeeds, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const result = await getActorFeeds({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n if (clearlyBadCursor(params.cursor)) {\n return { feedUris: [] }\n }\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n const feedsRes = await ctx.dataplane.getActorFeeds({\n actorDid: did,\n cursor: params.cursor,\n limit: params.limit,\n })\n return {\n feedUris: feedsRes.uris as AtUriString[],\n cursor: parseString(feedsRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedGens(\n skeleton.feedUris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feeds = mapDefined(skeleton.feedUris, (uri) =>\n ctx.views.feedGenerator(uri, hydration),\n )\n return {\n feeds,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getActorFeeds.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n feedUris: AtUriString[]\n cursor?: string\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getActorLikes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getActorLikes.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorLikes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAenD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4BvD"}
1
+ {"version":3,"file":"getActorLikes.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorLikes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAexD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4BvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getActorLikes.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorLikes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AASlE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,aAAa,GAAG,cAAc,CAClC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;QACtC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAA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,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport { FeedItem } from '../../../../hydration/feed.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { uriToDid as creatorFromUri } from '../../../../util/uris.js'\nimport { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getActorLikes = createPipeline(\n skeleton,\n hydration,\n noPostBlocks,\n presentation,\n )\n server.add(app.bsky.feed.getActorLikes, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n\n const result = await getActorLikes({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({\n repoRev,\n labelers: hydrateCtx.labelers,\n }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const { actor, limit, cursor } = params\n const viewer = params.hydrateCtx.viewer\n if (clearlyBadCursor(cursor)) {\n return { items: [] }\n }\n const [actorDid] = await ctx.hydrator.actor.getDids([actor])\n if (!actorDid || !viewer || viewer !== actorDid) {\n throw new InvalidRequestError('Profile not found')\n }\n\n const likesRes = await ctx.dataplane.getActorLikes({\n actorDid,\n limit,\n cursor,\n })\n\n const items = likesRes.likes.map((l) => ({\n post: { uri: l.subject as AtUriString },\n }))\n\n return {\n items,\n cursor: parseString(likesRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx)\n}\n\nconst noPostBlocks = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const creator = creatorFromUri(item.post.uri)\n return !ctx.views.viewerBlockExists(creator, hydration)\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return {\n feed,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getActorLikes.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n items: FeedItem[]\n cursor?: string\n}\n"]}
1
+ {"version":3,"file":"getActorLikes.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getActorLikes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AASvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;A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AC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAC/E,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,MAIrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9C,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IACF,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,MAIrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type { FeedItem } from '../../../../hydration/feed.js'\nimport type {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { uriToDid as creatorFromUri } from '../../../../util/uris.js'\nimport type { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getActorLikes = createPipeline(\n skeleton,\n hydration,\n noPostBlocks,\n presentation,\n )\n server.add(app.bsky.feed.getActorLikes, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n\n const result = await getActorLikes({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({\n repoRev,\n labelers: hydrateCtx.labelers,\n }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const { actor, limit, cursor } = params\n const viewer = params.hydrateCtx.viewer\n if (clearlyBadCursor(cursor)) {\n return { items: [] }\n }\n const [actorDid] = await ctx.hydrator.actor.getDids([actor])\n if (!actorDid || !viewer || viewer !== actorDid) {\n throw new InvalidRequestError('Profile not found')\n }\n\n const likesRes = await ctx.dataplane.getActorLikes({\n actorDid,\n limit,\n cursor,\n })\n\n const items = likesRes.likes.map((l) => ({\n post: { uri: l.subject as AtUriString },\n }))\n\n return {\n items,\n cursor: parseString(likesRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx)\n}\n\nconst noPostBlocks = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const creator = creatorFromUri(item.post.uri)\n return !ctx.views.viewerBlockExists(creator, hydration)\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return {\n feed,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getActorLikes.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n items: FeedItem[]\n cursor?: string\n}\n"]}
@@ -1,11 +1,11 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
3
- import { DataPlaneClient } from '../../../../data-plane/index.js';
4
- import { Actor } from '../../../../hydration/actor.js';
5
- import { FeedItem } from '../../../../hydration/feed.js';
6
- import { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
+ import type { DataPlaneClient } from '../../../../data-plane/index.js';
4
+ import type { Actor } from '../../../../hydration/actor.js';
5
+ import type { FeedItem } from '../../../../hydration/feed.js';
6
+ import { type HydrateCtx, type Hydrator } from '../../../../hydration/hydrator.js';
7
7
  import { app } from '../../../../lexicons/index.js';
8
- import { Views } from '../../../../views/index.js';
8
+ import type { Views } from '../../../../views/index.js';
9
9
  export default function (server: Server, ctx: AppContext): void;
10
10
  export declare const skeleton: (inputs: {
11
11
  ctx: Context;
@@ -1 +1 @@
1
- {"version":3,"file":"getAuthorFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getAuthorFeed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE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,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAC1B,OAAO,KAAK,CAAA;QACd,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACf,CAAC;QACD,2BAA2B;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QAC3B,OAAO,MAAM,CAAA;IACf,CAAC;IAEO,GAAG,CAAC,GAAgB,EAAE,IAAsB;QAClD,6CAA6C;QAC7C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAA;QACd,CAAC;QACD,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,KAAK,CAAA;QACd,CAAC;QACD,yDAAyD;QACzD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;QACpC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,oEAAoE;QACpE,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;CACF;AAED,SAAS,YAAY,CAAC,IAAU;IAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,IAAI,CAAA;AAC9C,CAAC","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport { Actor } from '../../../../hydration/actor.js'\nimport { FeedItem, Post } from '../../../../hydration/feed.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n mergeStates,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { FeedType } from '../../../../proto/bsky_pb.js'\nimport { safePinnedPost, uriToDid } from '../../../../util/uris.js'\nimport { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getAuthorFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutedReposts,\n presentation,\n )\n server.add(app.bsky.feed.getAuthorFeed, {\n auth: ctx.authVerifier.optionalStandardOrRole,\n handler: async ({ params, auth, req }) => {\n const { viewer, includeTakedowns, skipViewerBlocks } =\n ctx.authVerifier.parseCreds(auth)\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n includeTakedowns,\n skipViewerBlocks,\n })\n\n const result = await getAuthorFeed({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({\n repoRev,\n labelers: hydrateCtx.labelers,\n }),\n }\n },\n })\n}\n\nconst FILTER_TO_FEED_TYPE = {\n posts_with_replies: undefined, // default: all posts, replies, and reposts\n posts_no_replies: FeedType.POSTS_NO_REPLIES,\n posts_with_media: FeedType.POSTS_WITH_MEDIA,\n posts_and_author_threads: FeedType.POSTS_AND_AUTHOR_THREADS,\n posts_with_video: FeedType.POSTS_WITH_VIDEO,\n}\n\nexport const skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n const actors = await ctx.hydrator.actor.getActors([did], {\n includeTakedowns: params.hydrateCtx.includeTakedowns,\n skipCacheForDids: params.hydrateCtx.skipCacheForViewer,\n })\n const actor = actors.get(did)\n if (!actor) {\n throw new InvalidRequestError('Profile not found')\n }\n if (clearlyBadCursor(params.cursor)) {\n return { actor, filter: params.filter, items: [] }\n }\n\n const pinnedPost = safePinnedPost(actor.profile?.pinnedPost)\n const isFirstPageRequest = !params.cursor\n const shouldInsertPinnedPost =\n isFirstPageRequest &&\n params.includePins &&\n pinnedPost &&\n uriToDid(pinnedPost.uri) === actor.did\n\n const res = await ctx.dataplane.getAuthorFeed({\n actorDid: did,\n limit: params.limit,\n cursor: params.cursor,\n feedType: FILTER_TO_FEED_TYPE[params.filter],\n })\n\n let items: FeedItem[] = res.items.map((item) => ({\n post: { uri: item.uri as AtUriString, cid: item.cid || undefined },\n repost: item.repost\n ? { uri: item.repost as AtUriString, cid: item.repostCid || undefined }\n : undefined,\n }))\n\n if (shouldInsertPinnedPost && pinnedPost) {\n const pinnedItem = {\n post: {\n uri: pinnedPost.uri,\n cid: pinnedPost.cid,\n },\n authorPinned: true,\n }\n\n items = items.filter((item) => item.post.uri !== pinnedItem.post.uri)\n items.unshift(pinnedItem)\n }\n\n return {\n actor,\n filter: params.filter,\n items,\n cursor: parseString(res.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}): Promise<HydrationState> => {\n const { ctx, params, skeleton } = inputs\n const [feedPostState, profileViewerState] = await Promise.all([\n ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx),\n ctx.hydrator.hydrateProfileViewers([skeleton.actor.did], params.hydrateCtx),\n ])\n return mergeStates(feedPostState, profileViewerState)\n}\n\nconst noBlocksOrMutedReposts = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}): Skeleton => {\n const { ctx, skeleton, hydration } = inputs\n const relationship = hydration.profileViewers?.get(skeleton.actor.did)\n if (\n relationship &&\n (relationship.blocking || ctx.views.blockingByList(relationship, hydration))\n ) {\n throw new InvalidRequestError(\n `Requester has blocked actor: ${skeleton.actor.did}`,\n 'BlockedActor',\n )\n }\n if (\n relationship &&\n (relationship.blockedBy || ctx.views.blockedByList(relationship, hydration))\n ) {\n throw new InvalidRequestError(\n `Requester is blocked by actor: ${skeleton.actor.did}`,\n 'BlockedByActor',\n )\n }\n\n const checkBlocksAndMutes = (item: FeedItem) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.originatorBlocked &&\n (!bam.authorMuted || bam.originatorMuted) // repost of muted content\n )\n }\n\n if (skeleton.filter === 'posts_and_author_threads') {\n // ensure replies are only included if the feed contains all\n // replies up to the thread root (i.e. a complete self-thread.)\n const selfThread = new SelfThreadTracker(skeleton.items, hydration)\n skeleton.items = skeleton.items.filter((item) => {\n return (\n checkBlocksAndMutes(item) &&\n (item.repost || item.authorPinned || selfThread.ok(item.post.uri))\n )\n })\n } else {\n skeleton.items = skeleton.items.filter(checkBlocksAndMutes)\n }\n\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return { feed, cursor: skeleton.cursor }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getAuthorFeed.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n actor: Actor\n items: FeedItem[]\n filter: app.bsky.feed.getAuthorFeed.$Params['filter']\n cursor?: string\n}\n\nclass SelfThreadTracker {\n feedUris = new Set<AtUriString>()\n cache = new Map<AtUriString, boolean>()\n\n constructor(\n items: FeedItem[],\n private hydration: HydrationState,\n ) {\n items.forEach((item) => {\n if (!item.repost) {\n this.feedUris.add(item.post.uri)\n }\n })\n }\n\n ok(uri: AtUriString, loop = new Set<AtUriString>()) {\n // if we've already checked this uri, pull from the cache\n if (this.cache.has(uri)) {\n return this.cache.get(uri) ?? false\n }\n // loop detection\n if (loop.has(uri)) {\n this.cache.set(uri, false)\n return false\n } else {\n loop.add(uri)\n }\n // cache through the result\n const result = this._ok(uri, loop)\n this.cache.set(uri, result)\n return result\n }\n\n private _ok(uri: AtUriString, loop: Set<AtUriString>): boolean {\n // must be in the feed to be in a self-thread\n if (!this.feedUris.has(uri)) {\n return false\n }\n // must be hydratable to be part of self-thread\n const post = this.hydration.posts?.get(uri)\n if (!post) {\n return false\n }\n // root posts (no parent) are trivial case of self-thread\n const parentUri = getParentUri(post)\n if (parentUri === null) {\n return true\n }\n // recurse w/ cache: this post is in a self-thread if its parent is.\n return this.ok(parentUri, loop)\n }\n}\n\nfunction getParentUri(post: Post) {\n return post.record.reply?.parent.uri ?? null\n}\n"]}
1
+ {"version":3,"file":"getAuthorFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getAuthorFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAKvE,OAAO,EAIL,WAAW,GACZ,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,CAAC,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B,OAAO,MAAM,CAAA;IACf,CAAC;IAEO,GAAG,CAAC,GAAgB,EAAE,IAAsB;QAClD,6CAA6C;QAC7C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAA;QACd,CAAC;QACD,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,KAAK,CAAA;QACd,CAAC;QACD,yDAAyD;QACzD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;QACpC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,oEAAoE;QACpE,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;CACF;AAED,SAAS,YAAY,CAAC,IAAU;IAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,IAAI,CAAA;AAC9C,CAAC","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { AtUriString } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type { Actor } from '../../../../hydration/actor.js'\nimport type { FeedItem, Post } from '../../../../hydration/feed.js'\nimport {\n type HydrateCtx,\n type HydrationState,\n type Hydrator,\n mergeStates,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { FeedType } from '../../../../proto/bsky_pb.js'\nimport { safePinnedPost, uriToDid } from '../../../../util/uris.js'\nimport type { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getAuthorFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutedReposts,\n presentation,\n )\n server.add(app.bsky.feed.getAuthorFeed, {\n auth: ctx.authVerifier.optionalStandardOrRole,\n handler: async ({ params, auth, req }) => {\n const { viewer, includeTakedowns, skipViewerBlocks } =\n ctx.authVerifier.parseCreds(auth)\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n includeTakedowns,\n skipViewerBlocks,\n })\n\n const result = await getAuthorFeed({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({\n repoRev,\n labelers: hydrateCtx.labelers,\n }),\n }\n },\n })\n}\n\nconst FILTER_TO_FEED_TYPE = {\n posts_with_replies: undefined, // default: all posts, replies, and reposts\n posts_no_replies: FeedType.POSTS_NO_REPLIES,\n posts_with_media: FeedType.POSTS_WITH_MEDIA,\n posts_and_author_threads: FeedType.POSTS_AND_AUTHOR_THREADS,\n posts_with_video: FeedType.POSTS_WITH_VIDEO,\n}\n\nexport const skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n const actors = await ctx.hydrator.actor.getActors([did], {\n includeTakedowns: params.hydrateCtx.includeTakedowns,\n skipCacheForDids: params.hydrateCtx.skipCacheForViewer,\n })\n const actor = actors.get(did)\n if (!actor) {\n throw new InvalidRequestError('Profile not found')\n }\n if (clearlyBadCursor(params.cursor)) {\n return { actor, filter: params.filter, items: [] }\n }\n\n const pinnedPost = safePinnedPost(actor.profile?.pinnedPost)\n const isFirstPageRequest = !params.cursor\n const shouldInsertPinnedPost =\n isFirstPageRequest &&\n params.includePins &&\n pinnedPost &&\n uriToDid(pinnedPost.uri) === actor.did\n\n const res = await ctx.dataplane.getAuthorFeed({\n actorDid: did,\n limit: params.limit,\n cursor: params.cursor,\n feedType: FILTER_TO_FEED_TYPE[params.filter],\n })\n\n let items: FeedItem[] = res.items.map((item) => ({\n post: { uri: item.uri as AtUriString, cid: item.cid || undefined },\n repost: item.repost\n ? { uri: item.repost as AtUriString, cid: item.repostCid || undefined }\n : undefined,\n }))\n\n if (shouldInsertPinnedPost && pinnedPost) {\n const pinnedItem = {\n post: {\n uri: pinnedPost.uri,\n cid: pinnedPost.cid,\n },\n authorPinned: true,\n }\n\n items = items.filter((item) => item.post.uri !== pinnedItem.post.uri)\n items.unshift(pinnedItem)\n }\n\n return {\n actor,\n filter: params.filter,\n items,\n cursor: parseString(res.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}): Promise<HydrationState> => {\n const { ctx, params, skeleton } = inputs\n const [feedPostState, profileViewerState] = await Promise.all([\n ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx),\n ctx.hydrator.hydrateProfileViewers([skeleton.actor.did], params.hydrateCtx),\n ])\n return mergeStates(feedPostState, profileViewerState)\n}\n\nconst noBlocksOrMutedReposts = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}): Skeleton => {\n const { ctx, skeleton, hydration } = inputs\n const relationship = hydration.profileViewers?.get(skeleton.actor.did)\n if (\n relationship &&\n (relationship.blocking || ctx.views.blockingByList(relationship, hydration))\n ) {\n throw new InvalidRequestError(\n `Requester has blocked actor: ${skeleton.actor.did}`,\n 'BlockedActor',\n )\n }\n if (\n relationship &&\n (relationship.blockedBy || ctx.views.blockedByList(relationship, hydration))\n ) {\n throw new InvalidRequestError(\n `Requester is blocked by actor: ${skeleton.actor.did}`,\n 'BlockedByActor',\n )\n }\n\n const checkBlocksAndMutes = (item: FeedItem) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.originatorBlocked &&\n (!bam.authorMuted || bam.originatorMuted) // repost of muted content\n )\n }\n\n if (skeleton.filter === 'posts_and_author_threads') {\n // ensure replies are only included if the feed contains all\n // replies up to the thread root (i.e. a complete self-thread.)\n const selfThread = new SelfThreadTracker(skeleton.items, hydration)\n skeleton.items = skeleton.items.filter((item) => {\n return (\n checkBlocksAndMutes(item) &&\n (item.repost || item.authorPinned || selfThread.ok(item.post.uri))\n )\n })\n } else {\n skeleton.items = skeleton.items.filter(checkBlocksAndMutes)\n }\n\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return { feed, cursor: skeleton.cursor }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getAuthorFeed.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n actor: Actor\n items: FeedItem[]\n filter: app.bsky.feed.getAuthorFeed.$Params['filter']\n cursor?: string\n}\n\nclass SelfThreadTracker {\n feedUris = new Set<AtUriString>()\n cache = new Map<AtUriString, boolean>()\n\n constructor(\n items: FeedItem[],\n private hydration: HydrationState,\n ) {\n items.forEach((item) => {\n if (!item.repost) {\n this.feedUris.add(item.post.uri)\n }\n })\n }\n\n ok(uri: AtUriString, loop = new Set<AtUriString>()) {\n // if we've already checked this uri, pull from the cache\n if (this.cache.has(uri)) {\n return this.cache.get(uri) ?? false\n }\n // loop detection\n if (loop.has(uri)) {\n this.cache.set(uri, false)\n return false\n } else {\n loop.add(uri)\n }\n // cache through the result\n const result = this._ok(uri, loop)\n this.cache.set(uri, result)\n return result\n }\n\n private _ok(uri: AtUriString, loop: Set<AtUriString>): boolean {\n // must be in the feed to be in a self-thread\n if (!this.feedUris.has(uri)) {\n return false\n }\n // must be hydratable to be part of self-thread\n const post = this.hydration.posts?.get(uri)\n if (!post) {\n return false\n }\n // root posts (no parent) are trivial case of self-thread\n const parentUri = getParentUri(post)\n if (parentUri === null) {\n return true\n }\n // recurse w/ cache: this post is in a self-thread if its parent is.\n return this.ok(parentUri, loop)\n }\n}\n\nfunction getParentUri(post: Post) {\n return post.record.reply?.parent.uri ?? null\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { Headers as HeadersMap, Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
3
- import { FeedItem } from '../../../../hydration/feed.js';
1
+ import { type Headers as HeadersMap, type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
+ import type { FeedItem } from '../../../../hydration/feed.js';
4
4
  export default function (server: Server, ctx: AppContext): void;
5
5
  export type AlgoResponse = {
6
6
  feedItems: AlgoResponseItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"getFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,OAAO,IAAI,UAAU,EAErB,MAAM,EAKP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAOnD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAgDvD;AA6LD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,gBAAgB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
1
+ {"version":3,"file":"getFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,OAAO,IAAI,UAAU,EAE1B,KAAK,MAAM,EAKZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAOxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAa7D,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAgDvD;AA6LD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,gBAAgB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,mBAAmB,EAEnB,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE9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AAC,SAAS,CAAC,CAAC,CAAC,MAAM;KACtD,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport {\n XrpcInvalidResponseError,\n XrpcResponseError,\n xrpcSafe,\n} from '@atproto/lex'\nimport {\n Headers as HeadersMap,\n InvalidRequestError,\n Server,\n ServerTimer,\n UpstreamFailureError,\n XRPCError,\n serverTimingHeader,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport { FeedItem } from '../../../../hydration/feed.js'\nimport { HydrateCtx } from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline.js'\nimport { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { BSKY_USER_AGENT, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getFeed, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n return (\n method === app.bsky.feed.getFeedSkeleton.$lxm ||\n method === app.bsky.feed.getFeed.$lxm\n )\n },\n skipAudCheck: true,\n }),\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const headers = noUndefinedVals({\n 'user-agent': BSKY_USER_AGENT,\n authorization: req.headers['authorization'],\n 'accept-language': req.headers['accept-language'],\n 'x-bsky-topics': Array.isArray(req.headers['x-bsky-topics'])\n ? req.headers['x-bsky-topics'].join(',')\n : req.headers['x-bsky-topics'],\n })\n // @NOTE feed cursors should not be affected by appview swap\n const {\n timerSkele,\n timerHydr,\n resHeaders: feedResHeaders,\n ...result\n } = await getFeed({ ...params, hydrateCtx, headers }, ctx)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: {\n ...feedResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n 'server-timing': serverTimingHeader([timerSkele, timerHydr]),\n },\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const timerSkele = new ServerTimer('skele').start()\n const {\n feedItems: algoItems,\n reqId,\n cursor,\n resHeaders,\n ...passthrough\n } = await skeletonFromFeedGen(ctx, params)\n\n return {\n cursor,\n items: algoItems,\n reqId,\n timerSkele: timerSkele.stop(),\n timerHydr: new ServerTimer('hydr').start(),\n resHeaders,\n passthrough,\n }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n const timerHydr = new ServerTimer('hydr').start()\n const hydration = await ctx.hydrator.hydrateFeedItems(\n skeleton.items,\n params.hydrateCtx,\n )\n skeleton.timerHydr = timerHydr.stop()\n return hydration\n}\n\nconst noBlocksOrMutes = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.ancestorAuthorBlocked\n )\n })\n\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) => {\n const post = ctx.views.feedViewPost(item, hydration)\n if (!post) return\n return {\n ...post,\n feedContext: item.feedContext,\n }\n })\n return {\n feed: feed.map((fi) => ({ ...fi, reqId: skeleton.reqId })),\n cursor: skeleton.cursor,\n timerSkele: skeleton.timerSkele,\n timerHydr: skeleton.timerHydr,\n resHeaders: skeleton.resHeaders,\n ...skeleton.passthrough,\n }\n}\n\ntype Context = AppContext\n\ntype Params = app.bsky.feed.getFeed.$Params & {\n hydrateCtx: HydrateCtx\n headers: HeadersMap\n}\n\ntype Skeleton = {\n items: AlgoResponseItem[]\n reqId?: string\n passthrough: Record<string, unknown> // pass through additional items in feedgen response\n resHeaders?: HeadersMap\n cursor?: string\n timerSkele: ServerTimer\n timerHydr: ServerTimer\n}\n\nconst skeletonFromFeedGen = async (\n ctx: Context,\n params: Params,\n): Promise<AlgoResponse> => {\n const { feed, headers } = params\n const found = await ctx.hydrator.feed.getFeedGens([feed], true)\n const feedDid = found.get(feed)?.record.did\n if (!feedDid) {\n throw new InvalidRequestError('could not find feed')\n }\n\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(`could not resolve identity: ${feedDid}`)\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n // @TODO currently passthrough auth headers from pds\n const result = await xrpcSafe(fgEndpoint, app.bsky.feed.getFeedSkeleton, {\n strictResponseProcessing: false,\n signal: AbortSignal.timeout(10_000),\n headers,\n params: {\n feed: params.feed,\n // The feedgen is not guaranteed to honor the limit, but we try it.\n limit: params.limit,\n cursor: params.cursor,\n },\n })\n\n if (!result.success) {\n const cause = result.reason\n\n // Pass through structurally valid XRPC error response (4xx/5xx), such as\n // auth errors\n if (cause instanceof XrpcResponseError) {\n const { status, body } = cause.toDownstreamError()\n throw new XRPCError(status, body.message, body.error, { cause })\n }\n\n // The response does not match the schema\n if (cause instanceof XrpcInvalidResponseError) {\n throw new UpstreamFailureError(\n 'feed provided an invalid response',\n 'InvalidFeedResponse',\n { cause },\n )\n }\n\n // Typically a network error.\n throw new UpstreamFailureError('feed unavailable', undefined, { cause })\n }\n\n const { feed: feedSkele, cursor, ...skele } = result.body\n const feedItems = feedSkele.slice(0, params.limit).map((item) => ({\n post: { uri: item.post },\n repost:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonRepost.$isTypeOf(item.reason)\n ? { uri: item.reason.repost }\n : undefined,\n authorPinned:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonPin.$isTypeOf(item.reason)\n ? true\n : undefined,\n feedContext: item.feedContext,\n }))\n\n const contentLang = result.headers.get('content-language')\n\n return {\n ...skele,\n resHeaders: contentLang ? { 'content-language': contentLang } : undefined,\n feedItems,\n // Prevents loops if the custom feed echoes the input cursor back.\n cursor: cursor === params.cursor ? undefined : cursor,\n }\n}\n\nexport type AlgoResponse = {\n feedItems: AlgoResponseItem[]\n resHeaders?: HeadersMap\n cursor?: string\n reqId?: string\n}\n\nexport type AlgoResponseItem = FeedItem & {\n feedContext?: string\n}\n"]}
1
+ {"version":3,"file":"getFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,mBAAmB,EAEnB,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,UAAU,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MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;KACtD,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport {\n XrpcInvalidResponseError,\n XrpcResponseError,\n xrpcSafe,\n} from '@atproto/lex'\nimport {\n type Headers as HeadersMap,\n InvalidRequestError,\n type Server,\n ServerTimer,\n UpstreamFailureError,\n XRPCError,\n serverTimingHeader,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport type { FeedItem } from '../../../../hydration/feed.js'\nimport type { HydrateCtx } from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n type HydrationFnInput,\n type PresentationFnInput,\n type RulesFnInput,\n type SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline.js'\nimport type { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { BSKY_USER_AGENT, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getFeed, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n return (\n method === app.bsky.feed.getFeedSkeleton.$lxm ||\n method === app.bsky.feed.getFeed.$lxm\n )\n },\n skipAudCheck: true,\n }),\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const headers = noUndefinedVals({\n 'user-agent': BSKY_USER_AGENT,\n authorization: req.headers['authorization'],\n 'accept-language': req.headers['accept-language'],\n 'x-bsky-topics': Array.isArray(req.headers['x-bsky-topics'])\n ? req.headers['x-bsky-topics'].join(',')\n : req.headers['x-bsky-topics'],\n })\n // @NOTE feed cursors should not be affected by appview swap\n const {\n timerSkele,\n timerHydr,\n resHeaders: feedResHeaders,\n ...result\n } = await getFeed({ ...params, hydrateCtx, headers }, ctx)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: {\n ...feedResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n 'server-timing': serverTimingHeader([timerSkele, timerHydr]),\n },\n }\n },\n })\n}\n\nconst skeleton = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const timerSkele = new ServerTimer('skele').start()\n const {\n feedItems: algoItems,\n reqId,\n cursor,\n resHeaders,\n ...passthrough\n } = await skeletonFromFeedGen(ctx, params)\n\n return {\n cursor,\n items: algoItems,\n reqId,\n timerSkele: timerSkele.stop(),\n timerHydr: new ServerTimer('hydr').start(),\n resHeaders,\n passthrough,\n }\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n const timerHydr = new ServerTimer('hydr').start()\n const hydration = await ctx.hydrator.hydrateFeedItems(\n skeleton.items,\n params.hydrateCtx,\n )\n skeleton.timerHydr = timerHydr.stop()\n return hydration\n}\n\nconst noBlocksOrMutes = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.ancestorAuthorBlocked\n )\n })\n\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) => {\n const post = ctx.views.feedViewPost(item, hydration)\n if (!post) return\n return {\n ...post,\n feedContext: item.feedContext,\n }\n })\n return {\n feed: feed.map((fi) => ({ ...fi, reqId: skeleton.reqId })),\n cursor: skeleton.cursor,\n timerSkele: skeleton.timerSkele,\n timerHydr: skeleton.timerHydr,\n resHeaders: skeleton.resHeaders,\n ...skeleton.passthrough,\n }\n}\n\ntype Context = AppContext\n\ntype Params = app.bsky.feed.getFeed.$Params & {\n hydrateCtx: HydrateCtx\n headers: HeadersMap\n}\n\ntype Skeleton = {\n items: AlgoResponseItem[]\n reqId?: string\n passthrough: Record<string, unknown> // pass through additional items in feedgen response\n resHeaders?: HeadersMap\n cursor?: string\n timerSkele: ServerTimer\n timerHydr: ServerTimer\n}\n\nconst skeletonFromFeedGen = async (\n ctx: Context,\n params: Params,\n): Promise<AlgoResponse> => {\n const { feed, headers } = params\n const found = await ctx.hydrator.feed.getFeedGens([feed], true)\n const feedDid = found.get(feed)?.record.did\n if (!feedDid) {\n throw new InvalidRequestError('could not find feed')\n }\n\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(`could not resolve identity: ${feedDid}`)\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n // @TODO currently passthrough auth headers from pds\n const result = await xrpcSafe(fgEndpoint, app.bsky.feed.getFeedSkeleton, {\n strictResponseProcessing: false,\n signal: AbortSignal.timeout(10_000),\n headers,\n params: {\n feed: params.feed,\n // The feedgen is not guaranteed to honor the limit, but we try it.\n limit: params.limit,\n cursor: params.cursor,\n },\n })\n\n if (!result.success) {\n const cause = result.reason\n\n // Pass through structurally valid XRPC error response (4xx/5xx), such as\n // auth errors\n if (cause instanceof XrpcResponseError) {\n const { status, body } = cause.toDownstreamError()\n throw new XRPCError(status, body.message, body.error, { cause })\n }\n\n // The response does not match the schema\n if (cause instanceof XrpcInvalidResponseError) {\n throw new UpstreamFailureError(\n 'feed provided an invalid response',\n 'InvalidFeedResponse',\n { cause },\n )\n }\n\n // Typically a network error.\n throw new UpstreamFailureError('feed unavailable', undefined, { cause })\n }\n\n const { feed: feedSkele, cursor, ...skele } = result.body\n const feedItems = feedSkele.slice(0, params.limit).map((item) => ({\n post: { uri: item.post },\n repost:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonRepost.$isTypeOf(item.reason)\n ? { uri: item.reason.repost }\n : undefined,\n authorPinned:\n item.reason != null &&\n app.bsky.feed.defs.skeletonReasonPin.$isTypeOf(item.reason)\n ? true\n : undefined,\n feedContext: item.feedContext,\n }))\n\n const contentLang = result.headers.get('content-language')\n\n return {\n ...skele,\n resHeaders: contentLang ? { 'content-language': contentLang } : undefined,\n feedItems,\n // Prevents loops if the custom feed echoes the input cursor back.\n cursor: cursor === params.cursor ? undefined : cursor,\n }\n}\n\nexport type AlgoResponse = {\n feedItems: AlgoResponseItem[]\n resHeaders?: HeadersMap\n cursor?: string\n reqId?: string\n}\n\nexport type AlgoResponseItem = FeedItem & {\n feedContext?: string\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getFeedGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFeedGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuDvD"}
1
+ {"version":3,"file":"getFeedGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuDvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFeedGenerator.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAElE,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;QACzC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;YACvB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YACzE,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,QAA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AC5B,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,kGAAkG;oBAClG,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(app.bsky.feed.getFeedGenerator, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const { feed } = params\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const hydration = await ctx.hydrator.hydrateFeedGens([feed], hydrateCtx)\n const feedInfo = hydration.feedgens?.get(feed)\n if (!feedInfo) {\n throw new InvalidRequestError('could not find feed')\n }\n\n const feedDid = feedInfo.record.did\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(\n `could not resolve identity: ${feedDid}`,\n )\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n const feedView = ctx.views.feedGenerator(feed, hydration)\n if (!feedView) {\n throw new InvalidRequestError('could not find feed')\n }\n\n return {\n encoding: 'application/json',\n body: {\n view: feedView,\n // @TODO temporarily hard-coding to true while external feedgens catch-up on describeFeedGenerator\n isOnline: true,\n isValid: true,\n },\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"getFeedGenerator.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;QACzC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;YACvB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YACzE,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAA;YACxE,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,IAA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AE,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport {\n Code,\n getServiceEndpoint,\n isDataplaneError,\n unpackIdentityServices,\n} from '../../../../data-plane/index.js'\nimport { app } from '../../../../lexicons/index.js'\nimport type { GetIdentityByDidResponse } from '../../../../proto/bsky_pb.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(app.bsky.feed.getFeedGenerator, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const { feed } = params\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const hydration = await ctx.hydrator.hydrateFeedGens([feed], hydrateCtx)\n const feedInfo = hydration.feedgens?.get(feed)\n if (!feedInfo) {\n throw new InvalidRequestError('could not find feed')\n }\n\n const feedDid = feedInfo.record.did\n let identity: GetIdentityByDidResponse\n try {\n identity = await ctx.dataplane.getIdentityByDid({ did: feedDid })\n } catch (err) {\n if (isDataplaneError(err, Code.NotFound)) {\n throw new InvalidRequestError(\n `could not resolve identity: ${feedDid}`,\n )\n }\n throw err\n }\n\n const services = unpackIdentityServices(identity.services)\n const fgEndpoint = getServiceEndpoint(services, {\n id: 'bsky_fg',\n type: 'BskyFeedGenerator',\n })\n if (!fgEndpoint) {\n throw new InvalidRequestError(\n `invalid feed generator service details in did document: ${feedDid}`,\n )\n }\n\n const feedView = ctx.views.feedGenerator(feed, hydration)\n if (!feedView) {\n throw new InvalidRequestError('could not find feed')\n }\n\n return {\n encoding: 'application/json',\n body: {\n view: feedView,\n // @TODO temporarily hard-coding to true while external feedgens catch-up on describeFeedGenerator\n isOnline: true,\n isValid: true,\n },\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getFeedGenerators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFeedGenerators.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerators.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
1
+ {"version":3,"file":"getFeedGenerators.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerators.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFeedGenerators.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAS5C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,iBAAiB,GAAG,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,CAAC,QAAQ,EACjB,MAAM,CAAC,UAAU,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,MAIrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO;QACL,KAAK;KACN,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { AtUriString } from '@atproto/syntax'\nimport { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline, noRules } from '../../../../pipeline.js'\nimport { Views } from '../../../../views/index.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeedGenerators = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.feed.getFeedGenerators, {\n auth: ctx.authVerifier.standardOptional,\n opts: {\n // @TODO remove after grace period has passed, behavior is non-standard.\n // temporarily added for compat w/ previous version of xrpc-server to avoid breakage of a few specified parties.\n paramsParseLoose: true,\n },\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const view = await getFeedGenerators({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: view,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: { params: Params }): Promise<Skeleton> => {\n return {\n feedUris: inputs.params.feeds,\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedGens(\n skeleton.feedUris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feeds = mapDefined(skeleton.feedUris, (uri) =>\n ctx.views.feedGenerator(uri, hydration),\n )\n return {\n feeds,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.feed.getFeedGenerators.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n feedUris: AtUriString[]\n}\n"]}
1
+ {"version":3,"file":"getFeedGenerators.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getFeedGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAS5C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,iBAAiB,GAAG,cAAc,CACtC,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAC1C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,IAAI,EAAE;YACJ,wEAAwE;YACxE,gHAAgH;YAChH,gBAAgB,EAAE,IAAI;SACvB;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC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CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { AtUriString } from '@atproto/syntax'\nimport type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline, noRules } from '../../../../pipeline.js'\nimport type { Views } from '../../../../views/index.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getFeedGenerators = createPipeline(\n skeleton,\n hydration,\n noRules,\n presentation,\n )\n server.add(app.bsky.feed.getFeedGenerators, {\n auth: ctx.authVerifier.standardOptional,\n opts: {\n // @TODO remove after grace period has passed, behavior is non-standard.\n // temporarily added for compat w/ previous version of xrpc-server to avoid breakage of a few specified parties.\n paramsParseLoose: true,\n },\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n const view = await getFeedGenerators({ ...params, hydrateCtx }, ctx)\n return {\n encoding: 'application/json',\n body: view,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: { params: Params }): Promise<Skeleton> => {\n return {\n feedUris: inputs.params.feeds,\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n return await ctx.hydrator.hydrateFeedGens(\n skeleton.feedUris,\n params.hydrateCtx,\n )\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feeds = mapDefined(skeleton.feedUris, (uri) =>\n ctx.views.feedGenerator(uri, hydration),\n )\n return {\n feeds,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.feed.getFeedGenerators.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype Skeleton = {\n feedUris: AtUriString[]\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getLikes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLikes.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getLikes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAanD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuBvD"}
1
+ {"version":3,"file":"getLikes.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getLikes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuBvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getLikes.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getLikes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAIL,uBAAuB,GACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAOlE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAgB,cAAc,EAAE,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AAC,CAAA;IACF,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAA;AACH,CAAC,CAAA;AAeD,MAAM,wBAAwB,GAAG,CAAC,MAA0B,EAAE,EAAE;IAC9D,iEAAiE;IACjE,4EAA4E;IAC5E,OAAO,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;AACnC,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport {\n AtUriString,\n DatetimeString,\n DidString,\n normalizeDatetimeAlways,\n} from '@atproto/syntax'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { RulesFnInput, createPipeline } from '../../../../pipeline.js'\nimport { uriToDid as creatorFromUri } from '../../../../util/uris.js'\nimport { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getLikes = createPipeline(skeleton, hydration, noBlocks, presentation)\n server.add(app.bsky.feed.getLikes, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const { viewer, includeTakedowns, skipViewerBlocks } =\n ctx.authVerifier.parseCreds(auth)\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n includeTakedowns,\n skipViewerBlocks,\n })\n const result = await getLikes({ ...params, hydrateCtx }, ctx)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const authorDid = creatorFromUri(params.uri)\n\n if (clearlyBadCursor(params.cursor)) {\n return { authorDid, likes: [] }\n }\n if (looksLikeNonSortedCursor(params.cursor)) {\n throw new InvalidRequestError(\n 'Cursor appear to be out of date, please try reloading.',\n )\n }\n const likesRes = await ctx.hydrator.dataplane.getLikesBySubjectSorted({\n subject: { uri: params.uri, cid: params.cid },\n cursor: params.cursor,\n limit: params.limit,\n })\n return {\n authorDid,\n likes: likesRes.uris as AtUriString[],\n cursor: parseString(likesRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n const likesState = await ctx.hydrator.hydrateLikes(\n skeleton.authorDid,\n skeleton.likes,\n params.hydrateCtx,\n )\n return likesState\n}\n\nconst noBlocks = (input: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = input\n\n skeleton.likes = skeleton.likes.filter((likeUri) => {\n const like = hydration.likes?.get(likeUri)\n if (!like) return false\n const likerDid = creatorFromUri(likeUri)\n return (\n !hydration.likeBlocks?.get(likeUri) &&\n !ctx.views.viewerBlockExists(likerDid, hydration)\n )\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}): app.bsky.feed.getLikes.$OutputBody => {\n const { ctx, params, skeleton, hydration } = inputs\n const likeViews = mapDefined(skeleton.likes, (uri) => {\n const like = hydration.likes?.get(uri)\n if (!like || !like.record) {\n return\n }\n const creatorDid = creatorFromUri(uri)\n const actor = ctx.views.profile(creatorDid, hydration)\n if (!actor) {\n return\n }\n return {\n actor,\n createdAt: normalizeDatetimeAlways(like.record.createdAt),\n indexedAt: like.sortedAt.toISOString() as DatetimeString,\n }\n })\n return {\n likes: likeViews,\n cursor: skeleton.cursor,\n uri: params.uri,\n cid: params.cid,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.feed.getLikes.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n authorDid: DidString\n likes: AtUriString[]\n cursor?: string\n}\n\nconst looksLikeNonSortedCursor = (cursor: string | undefined) => {\n // the old cursor values used with getLikesBySubject() were dids.\n // we now use getLikesBySubjectSorted(), whose cursors look like timestamps.\n return cursor?.startsWith('did:')\n}\n"]}
1
+ {"version":3,"file":"getLikes.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getLikes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAIL,uBAAuB,GACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAOvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAqB,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;IAC5E,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACjC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QACvC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAClD,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;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AAG,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAM;QACR,CAAC;QACD,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;QACtC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QACtD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAM;QACR,CAAC;QACD,OAAO;YACL,KAAK;YACL,SAAS,EAAE,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACzD,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAoB;SACzD,CAAA;IACH,CAAC,CAAC,CAAA;IACF,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAA;AACH,CAAC,CAAA;AAeD,MAAM,wBAAwB,GAAG,CAAC,MAA0B,EAAE,EAAE;IAC9D,iEAAiE;IACjE,4EAA4E;IAC5E,OAAO,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;AACnC,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport {\n type AtUriString,\n type DatetimeString,\n type DidString,\n normalizeDatetimeAlways,\n} from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type {\n HydrateCtx,\n HydrationState,\n Hydrator,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { type RulesFnInput, createPipeline } from '../../../../pipeline.js'\nimport { uriToDid as creatorFromUri } from '../../../../util/uris.js'\nimport type { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getLikes = createPipeline(skeleton, hydration, noBlocks, presentation)\n server.add(app.bsky.feed.getLikes, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const { viewer, includeTakedowns, skipViewerBlocks } =\n ctx.authVerifier.parseCreds(auth)\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({\n labelers,\n viewer,\n includeTakedowns,\n skipViewerBlocks,\n })\n const result = await getLikes({ ...params, hydrateCtx }, ctx)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const authorDid = creatorFromUri(params.uri)\n\n if (clearlyBadCursor(params.cursor)) {\n return { authorDid, likes: [] }\n }\n if (looksLikeNonSortedCursor(params.cursor)) {\n throw new InvalidRequestError(\n 'Cursor appear to be out of date, please try reloading.',\n )\n }\n const likesRes = await ctx.hydrator.dataplane.getLikesBySubjectSorted({\n subject: { uri: params.uri, cid: params.cid },\n cursor: params.cursor,\n limit: params.limit,\n })\n return {\n authorDid,\n likes: likesRes.uris as AtUriString[],\n cursor: parseString(likesRes.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = inputs\n const likesState = await ctx.hydrator.hydrateLikes(\n skeleton.authorDid,\n skeleton.likes,\n params.hydrateCtx,\n )\n return likesState\n}\n\nconst noBlocks = (input: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = input\n\n skeleton.likes = skeleton.likes.filter((likeUri) => {\n const like = hydration.likes?.get(likeUri)\n if (!like) return false\n const likerDid = creatorFromUri(likeUri)\n return (\n !hydration.likeBlocks?.get(likeUri) &&\n !ctx.views.viewerBlockExists(likerDid, hydration)\n )\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}): app.bsky.feed.getLikes.$OutputBody => {\n const { ctx, params, skeleton, hydration } = inputs\n const likeViews = mapDefined(skeleton.likes, (uri) => {\n const like = hydration.likes?.get(uri)\n if (!like || !like.record) {\n return\n }\n const creatorDid = creatorFromUri(uri)\n const actor = ctx.views.profile(creatorDid, hydration)\n if (!actor) {\n return\n }\n return {\n actor,\n createdAt: normalizeDatetimeAlways(like.record.createdAt),\n indexedAt: like.sortedAt.toISOString() as DatetimeString,\n }\n })\n return {\n likes: likeViews,\n cursor: skeleton.cursor,\n uri: params.uri,\n cid: params.cid,\n }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.feed.getLikes.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n authorDid: DidString\n likes: AtUriString[]\n cursor?: string\n}\n\nconst looksLikeNonSortedCursor = (cursor: string | undefined) => {\n // the old cursor values used with getLikesBySubject() were dids.\n // we now use getLikesBySubjectSorted(), whose cursors look like timestamps.\n return cursor?.startsWith('did:')\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
3
- import { DataPlaneClient } from '../../../../data-plane/index.js';
4
- import { FeedItem } from '../../../../hydration/feed.js';
5
- import { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
+ import type { DataPlaneClient } from '../../../../data-plane/index.js';
4
+ import type { FeedItem } from '../../../../hydration/feed.js';
5
+ import { type HydrateCtx, type Hydrator } from '../../../../hydration/hydrator.js';
6
6
  import { app } from '../../../../lexicons/index.js';
7
- import { Views } from '../../../../views/index.js';
7
+ import type { Views } from '../../../../views/index.js';
8
8
  export default function (server: Server, ctx: AppContext): void;
9
9
  export declare const skeleton: (inputs: {
10
10
  ctx: Context;
@@ -1 +1 @@
1
- {"version":3,"file":"getListFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getListFeed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EACL,UAAU,EAEV,QAAQ,EAET,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAGnD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAGlD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyBvD;AAED,eAAO,MAAM,QAAQ,WAAkB;IACrC,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,KAAG,OAAO,CAAC,QAAQ,CAmBnB,CAAA;AAmED,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,eAAe,CAAA;CAC3B,CAAA;AAED,KAAK,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAA;AAE5E,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA"}
1
+ {"version":3,"file":"getListFeed.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getListFeed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,QAAQ,EAEd,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAGnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAGvD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyBvD;AAED,eAAO,MAAM,QAAQ,WAAkB;IACrC,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,KAAG,OAAO,CAAC,QAAQ,CAmBnB,CAAA;AAmED,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,eAAe,CAAA;CAC3B,CAAA;AAED,KAAK,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAA;AAE5E,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getListFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getListFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAIL,WAAW,GACZ,MA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AAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CACxC,CAAA;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,KAAK,EAAE,KAIxB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IACvC,MAAM,KAAK,GAAgC,IAAI,GAAG,EAAE,CAAA;IACpD,KAAK,CAAC,GAAG,CACP,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EACrB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACtD,CAAA;IACD,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAChF,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { AtUriString, DidString } from '@atproto/syntax'\nimport { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport { FeedItem } from '../../../../hydration/feed.js'\nimport {\n HydrateCtx,\n HydrationState,\n Hydrator,\n mergeStates,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { uriToDid } from '../../../../util/uris.js'\nimport { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getListFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getListFeed, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n\n const result = await getListFeed({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers, repoRev }),\n }\n },\n })\n}\n\nexport const skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n if (clearlyBadCursor(params.cursor)) {\n return { items: [] }\n }\n const res = await ctx.dataplane.getListFeed({\n listUri: params.list,\n limit: params.limit,\n cursor: params.cursor,\n })\n return {\n items: res.items.map((item) => ({\n post: { uri: item.uri as AtUriString, cid: item.cid || undefined },\n repost: item.repost\n ? { uri: item.repost as AtUriString, cid: item.repostCid || undefined }\n : undefined,\n })),\n cursor: parseString(res.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}): Promise<HydrationState> => {\n const { ctx, params, skeleton } = inputs\n const [feedItemsState, bidirectionalBlocks] = await Promise.all([\n ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx),\n getBlocks({ ctx, params, skeleton }),\n ])\n return mergeStates(feedItemsState, {\n bidirectionalBlocks,\n })\n}\n\nconst noBlocksOrMutes = (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}): Skeleton => {\n const { ctx, params, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n const creatorBlocks = hydration.bidirectionalBlocks?.get(\n uriToDid(params.list),\n )\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.ancestorAuthorBlocked &&\n !creatorBlocks?.get(uriToDid(item.post.uri))\n )\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return { feed, cursor: skeleton.cursor }\n}\n\nconst getBlocks = async (input: {\n ctx: Context\n skeleton: Skeleton\n params: Params\n}) => {\n const { ctx, skeleton, params } = input\n const pairs: Map<DidString, DidString[]> = new Map()\n pairs.set(\n uriToDid(params.list),\n skeleton.items.map((item) => uriToDid(item.post.uri)),\n )\n return await ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx)\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getListFeed.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n items: FeedItem[]\n cursor?: string\n}\n"]}
1
+ {"version":3,"file":"getListFeed.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getListFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAIL,WAAW,GACZ,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,WAAW,GAAG,cAAc,CAChC,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACpC,IAAI,EAAE,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CAAA;IACD,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAChF,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { AtUriString, DidString } from '@atproto/syntax'\nimport type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type { FeedItem } from '../../../../hydration/feed.js'\nimport {\n type HydrateCtx,\n type HydrationState,\n type Hydrator,\n mergeStates,\n} from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport { createPipeline } from '../../../../pipeline.js'\nimport { uriToDid } from '../../../../util/uris.js'\nimport type { Views } from '../../../../views/index.js'\nimport { clearlyBadCursor, resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getListFeed = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.feed.getListFeed, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ params, auth, req }) => {\n const viewer = auth.credentials.iss\n const labelers = ctx.reqLabelers(req)\n const hydrateCtx = await ctx.hydrator.createContext({ labelers, viewer })\n\n const result = await getListFeed({ ...params, hydrateCtx }, ctx)\n\n const repoRev = await ctx.hydrator.actor.getRepoRevSafe(viewer)\n\n return {\n encoding: 'application/json',\n body: result,\n headers: resHeaders({ labelers: hydrateCtx.labelers, repoRev }),\n }\n },\n })\n}\n\nexport const skeleton = async (inputs: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = inputs\n if (clearlyBadCursor(params.cursor)) {\n return { items: [] }\n }\n const res = await ctx.dataplane.getListFeed({\n listUri: params.list,\n limit: params.limit,\n cursor: params.cursor,\n })\n return {\n items: res.items.map((item) => ({\n post: { uri: item.uri as AtUriString, cid: item.cid || undefined },\n repost: item.repost\n ? { uri: item.repost as AtUriString, cid: item.repostCid || undefined }\n : undefined,\n })),\n cursor: parseString(res.cursor),\n }\n}\n\nconst hydration = async (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}): Promise<HydrationState> => {\n const { ctx, params, skeleton } = inputs\n const [feedItemsState, bidirectionalBlocks] = await Promise.all([\n ctx.hydrator.hydrateFeedItems(skeleton.items, params.hydrateCtx),\n getBlocks({ ctx, params, skeleton }),\n ])\n return mergeStates(feedItemsState, {\n bidirectionalBlocks,\n })\n}\n\nconst noBlocksOrMutes = (inputs: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}): Skeleton => {\n const { ctx, params, skeleton, hydration } = inputs\n skeleton.items = skeleton.items.filter((item) => {\n const bam = ctx.views.feedItemBlocksAndMutes(item, hydration)\n const creatorBlocks = hydration.bidirectionalBlocks?.get(\n uriToDid(params.list),\n )\n return (\n !bam.authorBlocked &&\n !bam.authorMuted &&\n !bam.originatorBlocked &&\n !bam.originatorMuted &&\n !bam.ancestorAuthorBlocked &&\n !creatorBlocks?.get(uriToDid(item.post.uri))\n )\n })\n return skeleton\n}\n\nconst presentation = (inputs: {\n ctx: Context\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = inputs\n const feed = mapDefined(skeleton.items, (item) =>\n ctx.views.feedViewPost(item, hydration),\n )\n return { feed, cursor: skeleton.cursor }\n}\n\nconst getBlocks = async (input: {\n ctx: Context\n skeleton: Skeleton\n params: Params\n}) => {\n const { ctx, skeleton, params } = input\n const pairs: Map<DidString, DidString[]> = new Map()\n pairs.set(\n uriToDid(params.list),\n skeleton.items.map((item) => uriToDid(item.post.uri)),\n )\n return await ctx.hydrator.hydrateBidirectionalBlocks(pairs, params.hydrateCtx)\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n dataplane: DataPlaneClient\n}\n\ntype Params = app.bsky.feed.getListFeed.$Params & { hydrateCtx: HydrateCtx }\n\ntype Skeleton = {\n items: FeedItem[]\n cursor?: string\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getPostThread.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPostThread.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getPostThread.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiDvD"}
1
+ {"version":3,"file":"getPostThread.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/feed/getPostThread.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiDvD"}