@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @atproto/bsky
2
2
 
3
+ ## 0.0.255
4
+
5
+ ### Patch Changes
6
+
7
+ - [#5197](https://github.com/bluesky-social/atproto/pull/5197) [`a0c49d9`](https://github.com/bluesky-social/atproto/commit/a0c49d9e8bc685c5a747a8d3b2775c73c63fdb6f) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rewrite import statements to be compatible with TypeScript's `verbatimModuleSyntax` config.
8
+
9
+ - [#5201](https://github.com/bluesky-social/atproto/pull/5201) [`dc9525a`](https://github.com/bluesky-social/atproto/commit/dc9525a844c336597fa5d2ccb958606c7a1df83e) Thanks [@estrattonbailey](https://github.com/estrattonbailey)! - Hide posts in search based on moderation tags on their author, in addition to tags on the post itself
10
+
11
+ - Updated dependencies [[`729ffaf`](https://github.com/bluesky-social/atproto/commit/729ffaf03a7ff484294dd682e1af349c2073f6d2), [`a0c49d9`](https://github.com/bluesky-social/atproto/commit/a0c49d9e8bc685c5a747a8d3b2775c73c63fdb6f)]:
12
+ - @atproto/api@0.20.27
13
+ - @atproto-labs/fetch-node@0.3.5
14
+ - @atproto/xrpc-server@0.11.8
15
+ - @atproto/identity@0.5.5
16
+ - @atproto/lex@0.2.1
17
+ - @atproto/common@0.7.1
18
+ - @atproto/crypto@0.5.4
19
+ - @atproto/syntax@0.7.1
20
+ - @atproto/repo@0.10.5
21
+ - @atproto/sync@0.3.9
22
+ - @atproto/did@0.5.4
23
+ - @atproto-labs/xrpc-utils@0.1.7
24
+
25
+ ## 0.0.254
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [[`d1be0ce`](https://github.com/bluesky-social/atproto/commit/d1be0cead444ef95e64cac5ea5318edbec9d8112), [`963b944`](https://github.com/bluesky-social/atproto/commit/963b9440190c7e59abc0c05de70ecea9cab6fe37), [`6b493b7`](https://github.com/bluesky-social/atproto/commit/6b493b77f56b7de47f5eb91d29f726cdc7794e46), [`d1be0ce`](https://github.com/bluesky-social/atproto/commit/d1be0cead444ef95e64cac5ea5318edbec9d8112), [`963b944`](https://github.com/bluesky-social/atproto/commit/963b9440190c7e59abc0c05de70ecea9cab6fe37), [`d79f6d5`](https://github.com/bluesky-social/atproto/commit/d79f6d59a073c05cc37bd0d1482beeea482b67ed), [`1497fea`](https://github.com/bluesky-social/atproto/commit/1497fea9c975e46e56fd99914fba2ad96affa934)]:
30
+ - @atproto/syntax@0.7.0
31
+ - @atproto/lex@0.2.0
32
+ - @atproto/api@0.20.26
33
+ - @atproto/common@0.7.0
34
+ - @atproto/xrpc-server@0.11.7
35
+ - @atproto/repo@0.10.4
36
+ - @atproto/sync@0.3.8
37
+ - @atproto-labs/xrpc-utils@0.1.6
38
+ - @atproto/identity@0.5.4
39
+
3
40
  ## 0.0.253
4
41
 
5
42
  ### Patch Changes
@@ -1,4 +1,4 @@
1
1
  import { Router } from 'express';
2
- import { AppContext } from '../../context.js';
2
+ import type { AppContext } from '../../context.js';
3
3
  export declare const createRouter: (ctx: AppContext) => Router;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAM7C,eAAO,MAAM,YAAY,QAAS,UAAU,KAAG,MAkB9C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD,eAAO,MAAM,YAAY,QAAS,UAAU,KAAG,MAkB9C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/age-assurance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAE9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAU,EAAE;IACtD,sCAAsC,CAAC,GAAG,CAAC,CAAA;IAE3C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAA;IAC7C,MAAM,CAAC,IAAI,CACT,0CAA0C,EAC1C,WAAW,CAAC;QACV,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,wBAAwB;KAC7C,CAAC,EACF,kBAAkB,CAAC,GAAG,CAAC,CACxB,CAAA;IACD,MAAM,CAAC,GAAG,CACR,2CAA2C,EAC3C,mBAAmB,CAAC,GAAG,CAAC,CACzB,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,sCAAsC,GAEL,CAAC,GAAe,EAAE,EAAE;IACzD,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { Router, raw } from 'express'\nimport { AppContext } from '../../context.js'\nimport { webhookAuth } from '../kws/webhook.js'\nimport { handler as ageVerifiedRedirect } from './redirects/kws-age-verified.js'\nimport { AppContextWithAA } from './types.js'\nimport { handler as ageVerifiedWebhook } from './webhooks/kws-age-verified.js'\n\nexport const createRouter = (ctx: AppContext): Router => {\n assertAppContextWithAgeAssuranceClient(ctx)\n\n const router = Router()\n router.use(raw({ type: 'application/json' }))\n router.post(\n '/age-assurance/webhooks/kws-age-verified',\n webhookAuth({\n secret: ctx.cfg.kws.ageVerifiedWebhookSecret,\n }),\n ageVerifiedWebhook(ctx),\n )\n router.get(\n '/age-assurance/redirects/kws-age-verified',\n ageVerifiedRedirect(ctx),\n )\n\n return router\n}\n\nconst assertAppContextWithAgeAssuranceClient: (\n ctx: AppContext,\n) => asserts ctx is AppContextWithAA = (ctx: AppContext) => {\n if (!ctx.kwsClient) {\n throw new Error('Tried to set up KWS router without kwsClient configured.')\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/age-assurance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAE9E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAU,EAAE;IACtD,sCAAsC,CAAC,GAAG,CAAC,CAAA;IAE3C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAA;IAC7C,MAAM,CAAC,IAAI,CACT,0CAA0C,EAC1C,WAAW,CAAC;QACV,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,wBAAwB;KAC7C,CAAC,EACF,kBAAkB,CAAC,GAAG,CAAC,CACxB,CAAA;IACD,MAAM,CAAC,GAAG,CACR,2CAA2C,EAC3C,mBAAmB,CAAC,GAAG,CAAC,CACzB,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,sCAAsC,GAEL,CAAC,GAAe,EAAE,EAAE;IACzD,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { Router, raw } from 'express'\nimport type { AppContext } from '../../context.js'\nimport { webhookAuth } from '../kws/webhook.js'\nimport { handler as ageVerifiedRedirect } from './redirects/kws-age-verified.js'\nimport type { AppContextWithAA } from './types.js'\nimport { handler as ageVerifiedWebhook } from './webhooks/kws-age-verified.js'\n\nexport const createRouter = (ctx: AppContext): Router => {\n assertAppContextWithAgeAssuranceClient(ctx)\n\n const router = Router()\n router.use(raw({ type: 'application/json' }))\n router.post(\n '/age-assurance/webhooks/kws-age-verified',\n webhookAuth({\n secret: ctx.cfg.kws.ageVerifiedWebhookSecret,\n }),\n ageVerifiedWebhook(ctx),\n )\n router.get(\n '/age-assurance/redirects/kws-age-verified',\n ageVerifiedRedirect(ctx),\n )\n\n return router\n}\n\nconst assertAppContextWithAgeAssuranceClient: (\n ctx: AppContext,\n) => asserts ctx is AppContextWithAA = (ctx: AppContext) => {\n if (!ctx.kwsClient) {\n throw new Error('Tried to set up KWS router without kwsClient configured.')\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { RequestHandler } from 'express';
2
- import { AppContextWithAA } from '../types.js';
1
+ import type { RequestHandler } from 'express';
2
+ import type { AppContextWithAA } from '../types.js';
3
3
  export declare const handler: (ctx: AppContextWithAA) => RequestHandler;
4
4
  //# sourceMappingURL=kws-age-verified.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kws-age-verified.d.ts","sourceRoot":"","sources":["../../../../src/api/age-assurance/redirects/kws-age-verified.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAUjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AA8B9C,eAAO,MAAM,OAAO,QACZ,gBAAgB,KAAG,cAiExB,CAAA"}
1
+ {"version":3,"file":"kws-age-verified.d.ts","sourceRoot":"","sources":["../../../../src/api/age-assurance/redirects/kws-age-verified.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAW7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AA8BnD,eAAO,MAAM,OAAO,QACZ,gBAAgB,KAAG,cAiExB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"kws-age-verified.js","sourceRoot":"","sources":["../../../../src/api/age-assurance/redirects/kws-age-verified.ts"],"names":[],"mappings":"AACA,OAAO,E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B,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClE,MAAM,EAAE,SAAS;SAClB,CAAC,CAAA;QAEF,OAAO,GAAG;aACP,MAAM,CAAC,GAAG,CAAC;aACX,SAAS,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;aACxD,GAAG,EAAE,CAAA;IACV,CAAC;AACH,CAAC,CAAA","sourcesContent":["import express, { RequestHandler } from 'express'\nimport { ageAssuranceLogger as logger } from '../../../logger.js'\nimport { getClientUa, validateSignature } from '../../kws/util.js'\nimport { AGE_ASSURANCE_CONFIG } from '../const.js'\nimport { parseKWSAgeVerifiedStatus } from '../kws/age-verified.js'\nimport {\n type KWSExternalPayloadV2,\n parseKWSExternalPayloadV2,\n} from '../kws/external-payload.js'\nimport { createEvent } from '../stash.js'\nimport { AppContextWithAA } from '../types.js'\nimport { computeAgeAssuranceAccessOrThrow } from '../util.js'\n\nfunction parseQueryParams(\n ctx: AppContextWithAA,\n req: express.Request,\n): {\n status: string\n externalPayload: string\n} {\n try {\n const status = String(req.query.status)\n const externalPayload = String(req.query.externalPayload)\n const signature = String(req.query.signature)\n\n validateSignature(\n ctx.cfg.kws.ageVerifiedRedirectSecret,\n `${status}:${externalPayload}`,\n signature,\n )\n\n return {\n status,\n externalPayload,\n }\n } catch (err) {\n throw new Error('Invalid KWS API request', { cause: err })\n }\n}\n\nexport const handler =\n (ctx: AppContextWithAA): RequestHandler =>\n async (req: express.Request, res: express.Response) => {\n let externalPayload: KWSExternalPayloadV2 | undefined\n\n try {\n const query = parseQueryParams(ctx, req)\n const { verified, verifiedMinimumAge } = parseKWSAgeVerifiedStatus(\n query.status,\n )\n externalPayload = parseKWSExternalPayloadV2(query.externalPayload)\n const { actorDid, attemptId, countryCode, regionCode } = externalPayload\n\n /*\n * KWS does not send unverified webhooks for age verification, so we\n * expect all webhooks to be verified. This is just a sanity check.\n */\n if (!verified) {\n const message =\n 'Expected KWS verification redirect to have verified status'\n logger.error({}, message)\n throw new Error(message)\n }\n\n const { access } = computeAgeAssuranceAccessOrThrow(\n AGE_ASSURANCE_CONFIG,\n {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n },\n )\n\n await createEvent(ctx, actorDid, {\n attemptId,\n // Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.\n completeIp: req.ip,\n completeUa: getClientUa(req),\n countryCode,\n regionCode,\n status: 'assured',\n access,\n })\n\n const q = new URLSearchParams({ actorDid, result: 'success' })\n\n return res\n .status(302)\n .setHeader('Location', `${ctx.cfg.kws.redirectUrl}?${q}`)\n .end()\n } catch (err) {\n logger.error(\n { err, ...externalPayload },\n 'Failed to handle KWS verification redirect',\n )\n\n const q = new URLSearchParams({\n ...(externalPayload ? { actorDid: externalPayload.actorDid } : {}),\n result: 'unknown',\n })\n\n return res\n .status(302)\n .setHeader('Location', `${ctx.cfg.kws.redirectUrl}?${q}`)\n .end()\n }\n }\n"]}
1
+ {"version":3,"file":"kws-age-verified.js","sourceRoot":"","sources":["../../../../src/api/age-assurance/redirects/kws-age-verified.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAEL,yBAAyB,GAC1B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAA;AAE7D,SAAS,gBAAgB,CACvB,GAAqB,EACrB,GAAoB;IAKpB,IAAI,CAAC;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,MAAM,EAAE,MAAM,EAAE,GAAG,gCAAgC,CACjD,oBAAoB,EACpB;YACE,WAAW;YACX,UAAU;YACV,kBAAkB;SACnB,CACF,CAAA;QAED,MAAM,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE;YAC/B,SAAS;YACT,mFAAmF;YACnF,UAAU,EAAE,GAAG,CAAC,EAAE;YAClB,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC;YAC5B,WAAW;YACX,UAAU;YACV,MAAM,EAAE,SAAS;YACjB,MAAM;SACP,CAAC,CAAA;QAEF,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;QAE9D,OAAO,GAAG;aACP,MAAM,CAAC,GAAG,CAAC;aACX,SAAS,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;aACxD,GAAG,EAAE,CAAA;IACV,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,GAAG,eAAe,EAAE,EAC3B,4CAA4C,CAC7C,CAAA;QAED,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC;YAC5B,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClE,MAAM,EAAE,SAAS;SAClB,CAAC,CAAA;QAEF,OAAO,GAAG;aACP,MAAM,CAAC,GAAG,CAAC;aACX,SAAS,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;aACxD,GAAG,EAAE,CAAA;IACV,CAAC;AACH,CAAC,CAAA","sourcesContent":["import type { RequestHandler } from 'express'\nimport type express from 'express'\nimport { ageAssuranceLogger as logger } from '../../../logger.js'\nimport { getClientUa, validateSignature } from '../../kws/util.js'\nimport { AGE_ASSURANCE_CONFIG } from '../const.js'\nimport { parseKWSAgeVerifiedStatus } from '../kws/age-verified.js'\nimport {\n type KWSExternalPayloadV2,\n parseKWSExternalPayloadV2,\n} from '../kws/external-payload.js'\nimport { createEvent } from '../stash.js'\nimport type { AppContextWithAA } from '../types.js'\nimport { computeAgeAssuranceAccessOrThrow } from '../util.js'\n\nfunction parseQueryParams(\n ctx: AppContextWithAA,\n req: express.Request,\n): {\n status: string\n externalPayload: string\n} {\n try {\n const status = String(req.query.status)\n const externalPayload = String(req.query.externalPayload)\n const signature = String(req.query.signature)\n\n validateSignature(\n ctx.cfg.kws.ageVerifiedRedirectSecret,\n `${status}:${externalPayload}`,\n signature,\n )\n\n return {\n status,\n externalPayload,\n }\n } catch (err) {\n throw new Error('Invalid KWS API request', { cause: err })\n }\n}\n\nexport const handler =\n (ctx: AppContextWithAA): RequestHandler =>\n async (req: express.Request, res: express.Response) => {\n let externalPayload: KWSExternalPayloadV2 | undefined\n\n try {\n const query = parseQueryParams(ctx, req)\n const { verified, verifiedMinimumAge } = parseKWSAgeVerifiedStatus(\n query.status,\n )\n externalPayload = parseKWSExternalPayloadV2(query.externalPayload)\n const { actorDid, attemptId, countryCode, regionCode } = externalPayload\n\n /*\n * KWS does not send unverified webhooks for age verification, so we\n * expect all webhooks to be verified. This is just a sanity check.\n */\n if (!verified) {\n const message =\n 'Expected KWS verification redirect to have verified status'\n logger.error({}, message)\n throw new Error(message)\n }\n\n const { access } = computeAgeAssuranceAccessOrThrow(\n AGE_ASSURANCE_CONFIG,\n {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n },\n )\n\n await createEvent(ctx, actorDid, {\n attemptId,\n // Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.\n completeIp: req.ip,\n completeUa: getClientUa(req),\n countryCode,\n regionCode,\n status: 'assured',\n access,\n })\n\n const q = new URLSearchParams({ actorDid, result: 'success' })\n\n return res\n .status(302)\n .setHeader('Location', `${ctx.cfg.kws.redirectUrl}?${q}`)\n .end()\n } catch (err) {\n logger.error(\n { err, ...externalPayload },\n 'Failed to handle KWS verification redirect',\n )\n\n const q = new URLSearchParams({\n ...(externalPayload ? { actorDid: externalPayload.actorDid } : {}),\n result: 'unknown',\n })\n\n return res\n .status(302)\n .setHeader('Location', `${ctx.cfg.kws.redirectUrl}?${q}`)\n .end()\n }\n }\n"]}
@@ -1,4 +1,4 @@
1
- import { AppContext } from '../../context.js';
2
- import { app } from '../../lexicons/index.js';
1
+ import type { AppContext } from '../../context.js';
2
+ import type { app } from '../../lexicons/index.js';
3
3
  export declare function createEvent(ctx: AppContext, actorDid: string, event: Omit<app.bsky.ageassurance.defs.Event, 'createdAt'>): Promise<app.bsky.ageassurance.defs.Event>;
4
4
  //# sourceMappingURL=stash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stash.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/stash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAG7C,wBAAsB,WAAW,CAC/B,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,6CAa3D"}
1
+ {"version":3,"file":"stash.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/stash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAGlD,wBAAsB,WAAW,CAC/B,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,6CAa3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"stash.js","sourceRoot":"","sources":["../../../src/api/age-assurance/stash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,GAAe,EACf,QAAgB,EAChB,KAA0D;IAE1D,MAAM,OAAO,GAAqC;QAChD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAoB;QACrD,GAAG,KAAK;KACT,CAAA;IACD,MAAM,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;QAC3B,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,UAAU,CAAC,4BAA4B;QAClD,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE;QAClB,OAAO;KACR,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { TID } from '@atproto/common'\nimport { DatetimeString } from '@atproto/syntax'\nimport { AppContext } from '../../context.js'\nimport { app } from '../../lexicons/index.js'\nimport { Namespaces } from '../../stash.js'\n\nexport async function createEvent(\n ctx: AppContext,\n actorDid: string,\n event: Omit<app.bsky.ageassurance.defs.Event, 'createdAt'>,\n) {\n const payload: app.bsky.ageassurance.defs.Event = {\n createdAt: new Date().toISOString() as DatetimeString,\n ...event,\n }\n await ctx.stashClient.create({\n actorDid: actorDid,\n namespace: Namespaces.AppBskyAgeassuranceDefsEvent,\n key: TID.nextStr(),\n payload,\n })\n return payload\n}\n"]}
1
+ {"version":3,"file":"stash.js","sourceRoot":"","sources":["../../../src/api/age-assurance/stash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,GAAe,EACf,QAAgB,EAChB,KAA0D;IAE1D,MAAM,OAAO,GAAqC;QAChD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAoB;QACrD,GAAG,KAAK;KACT,CAAA;IACD,MAAM,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;QAC3B,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,UAAU,CAAC,4BAA4B;QAClD,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE;QAClB,OAAO;KACR,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { TID } from '@atproto/common'\nimport type { DatetimeString } from '@atproto/syntax'\nimport type { AppContext } from '../../context.js'\nimport type { app } from '../../lexicons/index.js'\nimport { Namespaces } from '../../stash.js'\n\nexport async function createEvent(\n ctx: AppContext,\n actorDid: string,\n event: Omit<app.bsky.ageassurance.defs.Event, 'createdAt'>,\n) {\n const payload: app.bsky.ageassurance.defs.Event = {\n createdAt: new Date().toISOString() as DatetimeString,\n ...event,\n }\n await ctx.stashClient.create({\n actorDid: actorDid,\n namespace: Namespaces.AppBskyAgeassuranceDefsEvent,\n key: TID.nextStr(),\n payload,\n })\n return payload\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { KwsConfig, ServerConfig } from '../../config.js';
2
- import { AppContext } from '../../context.js';
3
- import { KwsClient } from '../../kws.js';
1
+ import type { KwsConfig, ServerConfig } from '../../config.js';
2
+ import type { AppContext } from '../../context.js';
3
+ import type { KwsClient } from '../../kws.js';
4
4
  export type AppContextWithAA = AppContext & {
5
5
  kwsClient: KwsClient;
6
6
  cfg: ServerConfig & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,SAAS,EAAE,SAAS,CAAA;IACpB,GAAG,EAAE,YAAY,GAAG;QAClB,GAAG,EAAE,SAAS,CAAA;KACf,CAAA;CACF,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,SAAS,EAAE,SAAS,CAAA;IACpB,GAAG,EAAE,YAAY,GAAG;QAClB,GAAG,EAAE,SAAS,CAAA;KACf,CAAA;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/age-assurance/types.ts"],"names":[],"mappings":"","sourcesContent":["import { KwsConfig, ServerConfig } from '../../config.js'\nimport { AppContext } from '../../context.js'\nimport { KwsClient } from '../../kws.js'\n\nexport type AppContextWithAA = AppContext & {\n kwsClient: KwsClient\n cfg: ServerConfig & {\n kws: KwsConfig\n }\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/age-assurance/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KwsConfig, ServerConfig } from '../../config.js'\nimport type { AppContext } from '../../context.js'\nimport type { KwsClient } from '../../kws.js'\n\nexport type AppContextWithAA = AppContext & {\n kwsClient: KwsClient\n cfg: ServerConfig & {\n kws: KwsConfig\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { AgeAssuranceRuleID, AppBskyAgeassuranceDefs } from '@atproto/api';
2
- import { app } from '../../lexicons/index.js';
1
+ import { type AgeAssuranceRuleID, type AppBskyAgeassuranceDefs } from '@atproto/api';
2
+ import type { app } from '../../lexicons/index.js';
3
3
  /**
4
4
  * Compute age assurance access based on verified minimum age. Thrown errors
5
5
  * are internal errors, so handle them accordingly.
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EAGxB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAE7C;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EACzC,EACE,WAAW,EACX,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,GACA;IAAE,MAAM,EAAE,uBAAuB,CAAC,MAAM,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAsCxE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,UAI5E"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/api/age-assurance/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAG7B,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAElD;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EACzC,EACE,WAAW,EACX,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAA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AAC","sourcesContent":["import {\n AgeAssuranceRuleID,\n AppBskyAgeassuranceDefs,\n computeAgeAssuranceRegionAccess,\n getAgeAssuranceRegionConfig,\n} from '@atproto/api'\nimport { app } from '../../lexicons/index.js'\n\n/**\n * Compute age assurance access based on verified minimum age. Thrown errors\n * are internal errors, so handle them accordingly.\n */\nexport function computeAgeAssuranceAccessOrThrow(\n config: app.bsky.ageassurance.defs.Config,\n {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n }: {\n countryCode: string\n regionCode?: string\n verifiedMinimumAge: number\n },\n): { access: AppBskyAgeassuranceDefs.Access; reason: AgeAssuranceRuleID } {\n const region = getAgeAssuranceRegionConfig(config, {\n countryCode,\n regionCode,\n })\n\n if (region) {\n const result = computeAgeAssuranceRegionAccess(region, {\n assuredAge: verifiedMinimumAge,\n /*\n * We don't care about this here, this is a client-only rule. If we have\n * verified data, we can use that, and the account creation date is\n * irrelevant.\n */\n accountCreatedAt: undefined,\n })\n\n if (result) {\n return result\n } else {\n /*\n * If we don't get a result, it's because none of the rules matched,\n * which is a configuration error: there should always be a default\n * rule.\n */\n throw new Error('Cound not compute age assurance region access')\n }\n } else {\n /**\n * If we had geolocation data, but we don't have a region config for this\n * geolocation, then it means a user outside of our configured regions\n * has completed age verification. In this case, we can't determine their\n * access level, so we throw an error.\n *\n * This case is also guarded in `app.bsky.ageassurance.begin`.\n */\n throw new Error('Could not get config for region')\n }\n}\n\nexport function createLocationString(countryCode: string, regionCode?: string) {\n return regionCode\n ? `${countryCode.toUpperCase()}-${regionCode.toUpperCase()}`\n : countryCode.toUpperCase()\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/api/age-assurance/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,cAAc,CAAA;AAGrB;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAyC,EACzC,EACE,WAAW,EACX,UAAU,EACV,kBAAkB,GAKnB;IAED,MAAM,MAAM,GAAG,2BAA2B,CAAC,MAAM,EAAE;QACjD,WAAW;QACX,UAAU;KACX,CAAC,CAAA;IAEF,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,GAAG,+BAA+B,CAAC,MAAM,EAAE;YACrD,UAAU,EAAE,kBAAkB;YAC9B;;;;eAIG;YACH,gBAAgB,EAAE,SAAS;SAC5B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAA;QACf,CAAC;aAAM,CAAC;YACN;;;;eAIG;YACH,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;SAAM,CAAC;QACN;;;;;;;WAOG;QACH,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,WAAmB,EAAE,UAAmB;IAC3E,OAAO,UAAU;QACf,CAAC,CAAC,GAAG,WAAW,CAAC,WAAW,EAAE,IAAI,UAAU,CAAC,WAAW,EAAE,EAAE;QAC5D,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAA;AAC/B,CAAC","sourcesContent":["import {\n type AgeAssuranceRuleID,\n type AppBskyAgeassuranceDefs,\n computeAgeAssuranceRegionAccess,\n getAgeAssuranceRegionConfig,\n} from '@atproto/api'\nimport type { app } from '../../lexicons/index.js'\n\n/**\n * Compute age assurance access based on verified minimum age. Thrown errors\n * are internal errors, so handle them accordingly.\n */\nexport function computeAgeAssuranceAccessOrThrow(\n config: app.bsky.ageassurance.defs.Config,\n {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n }: {\n countryCode: string\n regionCode?: string\n verifiedMinimumAge: number\n },\n): { access: AppBskyAgeassuranceDefs.Access; reason: AgeAssuranceRuleID } {\n const region = getAgeAssuranceRegionConfig(config, {\n countryCode,\n regionCode,\n })\n\n if (region) {\n const result = computeAgeAssuranceRegionAccess(region, {\n assuredAge: verifiedMinimumAge,\n /*\n * We don't care about this here, this is a client-only rule. If we have\n * verified data, we can use that, and the account creation date is\n * irrelevant.\n */\n accountCreatedAt: undefined,\n })\n\n if (result) {\n return result\n } else {\n /*\n * If we don't get a result, it's because none of the rules matched,\n * which is a configuration error: there should always be a default\n * rule.\n */\n throw new Error('Cound not compute age assurance region access')\n }\n } else {\n /**\n * If we had geolocation data, but we don't have a region config for this\n * geolocation, then it means a user outside of our configured regions\n * has completed age verification. In this case, we can't determine their\n * access level, so we throw an error.\n *\n * This case is also guarded in `app.bsky.ageassurance.begin`.\n */\n throw new Error('Could not get config for region')\n }\n}\n\nexport function createLocationString(countryCode: string, regionCode?: string) {\n return regionCode\n ? `${countryCode.toUpperCase()}-${regionCode.toUpperCase()}`\n : countryCode.toUpperCase()\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { RequestHandler } from 'express';
2
- import { type AppContextWithAA } from '../types.js';
1
+ import type { RequestHandler } from 'express';
2
+ import type { AppContextWithAA } from '../types.js';
3
3
  export declare const handler: (ctx: AppContextWithAA) => RequestHandler;
4
4
  //# sourceMappingURL=kws-age-verified.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kws-age-verified.d.ts","sourceRoot":"","sources":["../../../../src/api/age-assurance/webhooks/kws-age-verified.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AASjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGnD,eAAO,MAAM,OAAO,QACZ,gBAAgB,KAAG,cA6DxB,CAAA"}
1
+ {"version":3,"file":"kws-age-verified.d.ts","sourceRoot":"","sources":["../../../../src/api/age-assurance/webhooks/kws-age-verified.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAU7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGnD,eAAO,MAAM,OAAO,QACZ,gBAA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{ ageAssuranceLogger as logger } from '../../../logger.js'\nimport { AGE_ASSURANCE_CONFIG } from '../const.js'\nimport {\n type KWSWebhookAgeVerified,\n parseKWSAgeVerifiedWebhook,\n} from '../kws/age-verified.js'\nimport { parseKWSExternalPayloadV2 } from '../kws/external-payload.js'\nimport { createEvent } from '../stash.js'\nimport { type AppContextWithAA } from '../types.js'\nimport { computeAgeAssuranceAccessOrThrow } from '../util.js'\n\nexport const handler =\n (ctx: AppContextWithAA): RequestHandler =>\n async (req: express.Request, res: express.Response) => {\n let body: KWSWebhookAgeVerified\n try {\n body = parseKWSAgeVerifiedWebhook(req.body)\n } catch (err) {\n const message = 'Failed to parse KWS webhook body'\n logger.error({ err }, message)\n return res.status(400).json({ error: message })\n }\n\n const { status, externalPayload } = body.payload\n const { verified, verifiedMinimumAge } = status\n const { actorDid, countryCode, regionCode, attemptId } =\n parseKWSExternalPayloadV2(externalPayload)\n\n /*\n * KWS does not send unverified webhooks for age verification, so we\n * expect all webhooks to be verified. This is just a sanity check.\n */\n if (!verified) {\n const message = 'Expected KWS webhook to have verified status'\n logger.error({}, message)\n return res.status(400).json({ error: message })\n }\n\n let result: ReturnType<typeof computeAgeAssuranceAccessOrThrow> | undefined\n try {\n result = computeAgeAssuranceAccessOrThrow(AGE_ASSURANCE_CONFIG, {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n })\n } catch (err) {\n // internal errors\n logger.error(\n { err, attemptId, actorDid, countryCode, regionCode },\n 'Failed to compute age assurance access',\n )\n }\n\n try {\n if (result) {\n await createEvent(ctx, actorDid, {\n attemptId,\n countryCode,\n regionCode,\n status: 'assured',\n access: result.access,\n })\n }\n\n return res.status(200).end()\n } catch (err) {\n const message = 'Failed to handle KWS webhook'\n logger.error(\n { err, attemptId, actorDid, countryCode, regionCode },\n message,\n )\n return res.status(500).json({ error: message })\n }\n }\n"]}
1
+ {"version":3,"file":"kws-age-verified.js","sourceRoot":"","sources":["../../../../src/api/age-assurance/webhooks/kws-age-verified.ts"],"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AO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;IACjD,CAAC;IAED,IAAI,MAAuE,CAAA;IAC3E,IAAI,CAAC;QACH,MAAM,GAAG,gCAAgC,CAAC,oBAAoB,EAAE;YAC9D,WAAW;YACX,UAAU;YACV,kBAAkB;SACnB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,kBAAkB;QAClB,MAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,EACrD,wCAAwC,CACzC,CAAA;IACH,CAAC;IAED,IAAI,CAAC;QACH,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE;gBAC/B,SAAS;gBACT,WAAW;gBACX,UAAU;gBACV,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;IAC9B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,8BAA8B,CAAA;QAC9C,MAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,EACrD,OAAO,CACR,CAAA;QACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;IACjD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import type { RequestHandler } from 'express'\nimport type express from 'express'\nimport { ageAssuranceLogger as logger } from '../../../logger.js'\nimport { AGE_ASSURANCE_CONFIG } from '../const.js'\nimport {\n type KWSWebhookAgeVerified,\n parseKWSAgeVerifiedWebhook,\n} from '../kws/age-verified.js'\nimport { parseKWSExternalPayloadV2 } from '../kws/external-payload.js'\nimport { createEvent } from '../stash.js'\nimport type { AppContextWithAA } from '../types.js'\nimport { computeAgeAssuranceAccessOrThrow } from '../util.js'\n\nexport const handler =\n (ctx: AppContextWithAA): RequestHandler =>\n async (req: express.Request, res: express.Response) => {\n let body: KWSWebhookAgeVerified\n try {\n body = parseKWSAgeVerifiedWebhook(req.body)\n } catch (err) {\n const message = 'Failed to parse KWS webhook body'\n logger.error({ err }, message)\n return res.status(400).json({ error: message })\n }\n\n const { status, externalPayload } = body.payload\n const { verified, verifiedMinimumAge } = status\n const { actorDid, countryCode, regionCode, attemptId } =\n parseKWSExternalPayloadV2(externalPayload)\n\n /*\n * KWS does not send unverified webhooks for age verification, so we\n * expect all webhooks to be verified. This is just a sanity check.\n */\n if (!verified) {\n const message = 'Expected KWS webhook to have verified status'\n logger.error({}, message)\n return res.status(400).json({ error: message })\n }\n\n let result: ReturnType<typeof computeAgeAssuranceAccessOrThrow> | undefined\n try {\n result = computeAgeAssuranceAccessOrThrow(AGE_ASSURANCE_CONFIG, {\n countryCode,\n regionCode,\n verifiedMinimumAge,\n })\n } catch (err) {\n // internal errors\n logger.error(\n { err, attemptId, actorDid, countryCode, regionCode },\n 'Failed to compute age assurance access',\n )\n }\n\n try {\n if (result) {\n await createEvent(ctx, actorDid, {\n attemptId,\n countryCode,\n regionCode,\n status: 'assured',\n access: result.access,\n })\n }\n\n return res.status(200).end()\n } catch (err) {\n const message = 'Failed to handle KWS webhook'\n logger.error(\n { err, attemptId, actorDid, countryCode, regionCode },\n message,\n )\n return res.status(500).json({ error: message })\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=getProfile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getProfile.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfile.ts"],"names":[],"mappings":"AACA,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,QA6BvD"}
1
+ {"version":3,"file":"getProfile.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfile.ts"],"names":[],"mappings":"AACA,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,QA6BvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getProfile.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAOlE,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,UAAU,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAC7E,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACpC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,sBAAsB;QAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAA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AAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IACvC,OAAO,GAAG,CAAC,QAAQ,CAAC,uBAAuB,CACzC,CAAC,QAAQ,CAAC,GAAG,CAAC,EACd,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;QACrB,gCAAgC,EAAE,IAAI;KACvC,CAAC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAClD,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IAClE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;IACpD,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,mBAAmB,CAC3B,4BAA4B,EAC5B,iBAAiB,CAClB,CAAA;QACH,CAAC;aAAM,IAAI,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,mBAAmB,CAC3B,wBAAwB,EACxB,oBAAoB,CACrB,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import { DidString } 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 { 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 getProfile = createPipeline(skeleton, hydration, noRules, presentation)\n server.add(app.bsky.actor.getProfile, {\n auth: ctx.authVerifier.optionalStandardOrRole,\n handler: async ({ auth, params, 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 getProfile({ ...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 (input: {\n ctx: Context\n params: Params\n}): Promise<SkeletonState> => {\n const { ctx, params } = input\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n return { did }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(\n [skeleton.did],\n params.hydrateCtx.copy({\n overrideIncludeTakedownsForActor: true,\n }),\n )\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n hydration: HydrationState\n}) => {\n const { ctx, params, skeleton, hydration } = input\n const profile = ctx.views.profileDetailed(skeleton.did, hydration)\n if (!profile) {\n throw new InvalidRequestError('Profile not found')\n } else if (!params.hydrateCtx.includeTakedowns) {\n if (ctx.views.actorIsTakendown(skeleton.did, hydration)) {\n throw new InvalidRequestError(\n 'Account has been suspended',\n 'AccountTakedown',\n )\n } else if (ctx.views.actorIsDeactivated(skeleton.did, hydration)) {\n throw new InvalidRequestError(\n 'Account is deactivated',\n 'AccountDeactivated',\n )\n }\n }\n return profile\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getProfile.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype SkeletonState = { did: DidString }\n"]}
1
+ {"version":3,"file":"getProfile.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAOvE,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,UAAU,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAC7E,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACpC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,sBAAsB;QAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAClD,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAClD,QAAQ;gBACR,MAAM;gBACN,gBAAgB;gBAChB,gBAAgB;aACjB,CAAC,CAAA;YAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,EAAE,GAAG,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AO,GAAG,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IAClE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;IACpD,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,mBAAmB,CAC3B,4BAA4B,EAC5B,iBAAiB,CAClB,CAAA;QACH,CAAC;aAAM,IAAI,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,mBAAmB,CAC3B,wBAAwB,EACxB,oBAAoB,CACrB,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import type { DidString } 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 { 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 getProfile = createPipeline(skeleton, hydration, noRules, presentation)\n server.add(app.bsky.actor.getProfile, {\n auth: ctx.authVerifier.optionalStandardOrRole,\n handler: async ({ auth, params, 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 getProfile({ ...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 (input: {\n ctx: Context\n params: Params\n}): Promise<SkeletonState> => {\n const { ctx, params } = input\n const [did] = await ctx.hydrator.actor.getDids([params.actor])\n if (!did) {\n throw new InvalidRequestError('Profile not found')\n }\n return { did }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(\n [skeleton.did],\n params.hydrateCtx.copy({\n overrideIncludeTakedownsForActor: true,\n }),\n )\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n hydration: HydrationState\n}) => {\n const { ctx, params, skeleton, hydration } = input\n const profile = ctx.views.profileDetailed(skeleton.did, hydration)\n if (!profile) {\n throw new InvalidRequestError('Profile not found')\n } else if (!params.hydrateCtx.includeTakedowns) {\n if (ctx.views.actorIsTakendown(skeleton.did, hydration)) {\n throw new InvalidRequestError(\n 'Account has been suspended',\n 'AccountTakedown',\n )\n } else if (ctx.views.actorIsDeactivated(skeleton.did, hydration)) {\n throw new InvalidRequestError(\n 'Account is deactivated',\n 'AccountDeactivated',\n )\n }\n }\n return profile\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getProfile.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype SkeletonState = { did: DidString }\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=getProfiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getProfiles.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfiles.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,QA0CvD"}
1
+ {"version":3,"file":"getProfiles.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfiles.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,QA0CvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getProfiles.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfiles.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,UAAU,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAC7E,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QACrC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,6BAA6B,CAAC;YACnD,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;gBACnB,IAAI,CAAC,MAA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,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACnE,OAAO,EAAE,IAAI,EAAE,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,KAAK,EAAE,KAIxB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IACvC,OAAO,GAAG,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAC/E,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACjD,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC,CAC1C,CAAA;IACD,OAAO,EAAE,QAAQ,EAAE,CAAA;AACrB,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { DidString } 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 getProfile = createPipeline(skeleton, hydration, noRules, presentation)\n server.add(app.bsky.actor.getProfiles, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n if (!method) return false\n return (\n method === app.bsky.actor.getProfiles.$lxm ||\n method.startsWith('chat.bsky.')\n )\n },\n }),\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 ({ auth, params, 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 viewer,\n labelers,\n includeTakedowns,\n skipViewerBlocks,\n })\n\n const result = await getProfile({ ...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 (input: {\n ctx: Context\n params: Params\n}): Promise<SkeletonState> => {\n const { ctx, params } = input\n const dids = await ctx.hydrator.actor.getDidsDefined(params.actors)\n return { dids }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(skeleton.dids, params.hydrateCtx)\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n const profiles = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileDetailed(did, hydration),\n )\n return { profiles }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getProfiles.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype SkeletonState = { dids: DidString[] }\n"]}
1
+ {"version":3,"file":"getProfiles.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getProfiles.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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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 getProfile = createPipeline(skeleton, hydration, noRules, presentation)\n server.add(app.bsky.actor.getProfiles, {\n auth: ctx.authVerifier.standardOptionalParameterized({\n lxmCheck: (method) => {\n if (!method) return false\n return (\n method === app.bsky.actor.getProfiles.$lxm ||\n method.startsWith('chat.bsky.')\n )\n },\n }),\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 ({ auth, params, 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 viewer,\n labelers,\n includeTakedowns,\n skipViewerBlocks,\n })\n\n const result = await getProfile({ ...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 (input: {\n ctx: Context\n params: Params\n}): Promise<SkeletonState> => {\n const { ctx, params } = input\n const dids = await ctx.hydrator.actor.getDidsDefined(params.actors)\n return { dids }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(skeleton.dids, params.hydrateCtx)\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: SkeletonState\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n const profiles = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileDetailed(did, hydration),\n )\n return { profiles }\n}\n\ntype Context = {\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getProfiles.$Params & {\n hydrateCtx: HydrateCtx\n}\n\ntype SkeletonState = { dids: DidString[] }\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=getSuggestions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSuggestions.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getSuggestions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAanD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAoCvD"}
1
+ {"version":3,"file":"getSuggestions.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getSuggestions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAoCvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSuggestions.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getSuggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAA;AAS7D,OAAO,EA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IAC1C,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,EAAE,CACN,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC;QAC5C,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,CAC9C,CAAA;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,CAChD,CAAA;IACD,OAAO;QACL,MAAM;QACN,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;KAChC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport { Client, DidString, isDidString } from '@atproto/lex'\nimport { Headers as HeadersMap, 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 } from '../../../../pipeline.js'\nimport { Views } from '../../../../views/index.js'\nimport { resHeaders } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const getSuggestions = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.actor.getSuggestions, {\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({ viewer, labelers })\n const headers = noUndefinedVals({\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 const { resHeaders: resultHeaders, ...result } = await getSuggestions(\n { ...params, hydrateCtx, headers },\n ctx,\n )\n const suggestionsResHeaders = noUndefinedVals({\n 'content-language': resultHeaders?.get('content-language'),\n })\n return {\n encoding: 'application/json',\n body: result,\n headers: {\n ...suggestionsResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n },\n }\n },\n })\n}\n\nconst skeleton = async (input: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = input\n const viewer = params.hydrateCtx.viewer\n\n if (viewer && ctx.suggestionsClient) {\n const res = await ctx.suggestionsClient.xrpc(\n app.bsky.unspecced.getSuggestionsSkeleton,\n {\n headers: params.headers,\n params: {\n relativeToDid: viewer,\n viewer: viewer ?? undefined,\n limit: params.limit,\n cursor: params.cursor,\n },\n },\n )\n return {\n dids: res.body.actors.map((a) => a.did),\n cursor: res.body.cursor,\n recId: res.body.recId,\n recIdStr: res.body.recIdStr,\n resHeaders: res.headers,\n }\n } else {\n // @NOTE for appview swap moving to rkey-based cursors which are somewhat permissive, should not hard-break pagination\n const suggestions = await ctx.dataplane.getFollowSuggestions({\n actorDid: viewer ?? undefined,\n cursor: params.cursor,\n limit: params.limit,\n })\n // @NOTE filtering to avoid type casting\n let dids = suggestions.dids.filter(isDidString)\n if (viewer !== null) {\n const follows = await ctx.dataplane.getActorFollowsActors({\n actorDid: viewer,\n targetDids: dids,\n })\n dids = dids.filter((did, i) => !follows.uris[i] && did !== viewer)\n }\n return { dids, cursor: parseString(suggestions.cursor) }\n }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocksOrMutes = (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n skeleton.dids = skeleton.dids.filter(\n (did) =>\n !ctx.views.viewerBlockExists(did, hydration) &&\n !ctx.views.viewerMuteExists(did, hydration),\n )\n return skeleton\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileKnownFollowers(did, hydration),\n )\n return {\n actors,\n cursor: skeleton.cursor,\n recId: skeleton.recId,\n recIdStr: skeleton.recIdStr,\n resHeaders: skeleton.resHeaders,\n }\n}\n\ntype Context = {\n suggestionsClient: Client | undefined\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getSuggestions.$Params & {\n hydrateCtx: HydrateCtx\n headers: HeadersMap\n}\n\ntype Skeleton = {\n dids: DidString[]\n cursor?: string\n recId?: number\n recIdStr?: string\n resHeaders?: Headers\n}\n"]}
1
+ {"version":3,"file":"getSuggestions.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/getSuggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAA+B,WAAW,EAAE,MAAM,cAAc,CAAA;AASvE,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;AAExD,OAAO,EAAE,UA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S,CAAC;QAC5C,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,CAC9C,CAAA;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC1C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,CAChD,CAAA;IACD,OAAO;QACL,MAAM;QACN,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;KAChC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined, noUndefinedVals } from '@atproto/common'\nimport { type Client, type DidString, isDidString } from '@atproto/lex'\nimport type { Headers as HeadersMap, 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 } 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 getSuggestions = createPipeline(\n skeleton,\n hydration,\n noBlocksOrMutes,\n presentation,\n )\n server.add(app.bsky.actor.getSuggestions, {\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({ viewer, labelers })\n const headers = noUndefinedVals({\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 const { resHeaders: resultHeaders, ...result } = await getSuggestions(\n { ...params, hydrateCtx, headers },\n ctx,\n )\n const suggestionsResHeaders = noUndefinedVals({\n 'content-language': resultHeaders?.get('content-language'),\n })\n return {\n encoding: 'application/json',\n body: result,\n headers: {\n ...suggestionsResHeaders,\n ...resHeaders({ labelers: hydrateCtx.labelers }),\n },\n }\n },\n })\n}\n\nconst skeleton = async (input: {\n ctx: Context\n params: Params\n}): Promise<Skeleton> => {\n const { ctx, params } = input\n const viewer = params.hydrateCtx.viewer\n\n if (viewer && ctx.suggestionsClient) {\n const res = await ctx.suggestionsClient.xrpc(\n app.bsky.unspecced.getSuggestionsSkeleton,\n {\n headers: params.headers,\n params: {\n relativeToDid: viewer,\n viewer: viewer ?? undefined,\n limit: params.limit,\n cursor: params.cursor,\n },\n },\n )\n return {\n dids: res.body.actors.map((a) => a.did),\n cursor: res.body.cursor,\n recId: res.body.recId,\n recIdStr: res.body.recIdStr,\n resHeaders: res.headers,\n }\n } else {\n // @NOTE for appview swap moving to rkey-based cursors which are somewhat permissive, should not hard-break pagination\n const suggestions = await ctx.dataplane.getFollowSuggestions({\n actorDid: viewer ?? undefined,\n cursor: params.cursor,\n limit: params.limit,\n })\n // @NOTE filtering to avoid type casting\n let dids = suggestions.dids.filter(isDidString)\n if (viewer !== null) {\n const follows = await ctx.dataplane.getActorFollowsActors({\n actorDid: viewer,\n targetDids: dids,\n })\n dids = dids.filter((did, i) => !follows.uris[i] && did !== viewer)\n }\n return { dids, cursor: parseString(suggestions.cursor) }\n }\n}\n\nconst hydration = async (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n}) => {\n const { ctx, params, skeleton } = input\n return ctx.hydrator.hydrateProfilesDetailed(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocksOrMutes = (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n skeleton.dids = skeleton.dids.filter(\n (did) =>\n !ctx.views.viewerBlockExists(did, hydration) &&\n !ctx.views.viewerMuteExists(did, hydration),\n )\n return skeleton\n}\n\nconst presentation = (input: {\n ctx: Context\n params: Params\n skeleton: Skeleton\n hydration: HydrationState\n}) => {\n const { ctx, skeleton, hydration } = input\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileKnownFollowers(did, hydration),\n )\n return {\n actors,\n cursor: skeleton.cursor,\n recId: skeleton.recId,\n recIdStr: skeleton.recIdStr,\n resHeaders: skeleton.resHeaders,\n }\n}\n\ntype Context = {\n suggestionsClient: Client | undefined\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n}\n\ntype Params = app.bsky.actor.getSuggestions.$Params & {\n hydrateCtx: HydrateCtx\n headers: HeadersMap\n}\n\ntype Skeleton = {\n dids: DidString[]\n cursor?: string\n recId?: number\n recIdStr?: string\n resHeaders?: Headers\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=searchActors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchActors.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAenD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwCvD"}
1
+ {"version":3,"file":"searchActors.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAexD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwCvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"searchActors.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,YAAY,GAAG,cAAc,CACjC,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAClD,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAClD,MAAM;gBACN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mapDefined } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.js'\nimport { app } from '../../../../lexicons/index.js'\nimport {\n HydrationFnInput,\n PresentationFnInput,\n RulesFnInput,\n SkeletonFnInput,\n createPipeline,\n} from '../../../../pipeline.js'\nimport { Views } from '../../../../views/index.js'\nimport { resHeaders, resolveSearchV2Override } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const searchActors = createPipeline(\n skeleton,\n hydration,\n noBlocks,\n presentation,\n )\n server.add(app.bsky.actor.searchActors, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, 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 viewer,\n labelers,\n includeTakedowns,\n skipViewerBlocks,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const results = await searchActors(\n {\n ...params,\n hydrateCtx,\n isV2Override: resolveSearchV2Override(req, ctx.cfg),\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: results,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeletonV1 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n // @TODO\n // add hits total\n\n if (ctx.searchClient) {\n // @NOTE cursors won't change on appview swap\n const res = await ctx.searchClient.call(\n app.bsky.unspecced.searchActorsSkeleton,\n {\n q: term,\n cursor: params.cursor,\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n )\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n cursor: parseString(res.cursor),\n }\n }\n\n const res = await ctx.dataplane.searchActors({\n term,\n limit: params.limit,\n cursor: params.cursor,\n })\n return {\n dids: res.dids as DidString[],\n cursor: parseString(res.cursor),\n }\n}\n\nconst skeletonV2 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n const res = await ctx.dataplane.searchActorsV2({\n params: {\n query: term,\n viewer: params.hydrateCtx.viewer ?? undefined,\n limit: params.limit,\n cursor: params.cursor,\n },\n })\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n cursor: parseString(res.pageInfo?.cursor),\n }\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useV2 =\n input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SearchV2Enable,\n ) || input.params.isV2Override\n const skeletonFn = useV2 ? skeletonV2 : skeletonV1\n return skeletonFn(input)\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateProfiles(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocks = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.dids = skeleton.dids.filter(\n (did) => !ctx.views.viewerBlockExists(did, hydration),\n )\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profile(did, hydration),\n )\n return {\n actors,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n searchClient?: Client\n}\n\ntype Params = app.bsky.actor.searchActors.$Params & {\n hydrateCtx: HydrateCtx\n isV2Override: boolean\n}\n\ntype Skeleton = {\n dids: DidString[]\n hitsTotal?: number\n cursor?: string\n}\n"]}
1
+ {"version":3,"file":"searchActors.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,YAAY,GAAG,cAAc,CACjC,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,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,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAClD,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YACrC,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAClD,MAAM;gBACN,QAAQ;gBACR,gBAAgB;gBAChB,gBAAgB;gBAChB,QAAQ,EAAE,GAAG,CAAC,kBAAkB,CAAC,KAAK,CACpC,GAAG,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;oBACjD,MAAM;oBACN,GAAG;iBACJ,CAAC,CACH;aACF,CAAC,CAAA;YACF,MAAM,OAAO,GAAG,MAA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C,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,KAAK,EACrB,MAAmD,EACnD,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IACxC,OAAO,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AACvE,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,MAA+C,EAAE,EAAE;IACnE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CACtD,CAAA;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CACnB,MAAsD,EACtD,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAClC,CAAA;IACD,OAAO;QACL,MAAM;QACN,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { Client, DidString } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type { HydrateCtx, Hydrator } from '../../../../hydration/hydrator.js'\nimport { parseString } from '../../../../hydration/util.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 { Views } from '../../../../views/index.js'\nimport { resHeaders, resolveSearchV2Override } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const searchActors = createPipeline(\n skeleton,\n hydration,\n noBlocks,\n presentation,\n )\n server.add(app.bsky.actor.searchActors, {\n auth: ctx.authVerifier.standardOptional,\n handler: async ({ auth, params, 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 viewer,\n labelers,\n includeTakedowns,\n skipViewerBlocks,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const results = await searchActors(\n {\n ...params,\n hydrateCtx,\n isV2Override: resolveSearchV2Override(req, ctx.cfg),\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: results,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeletonV1 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n // @TODO\n // add hits total\n\n if (ctx.searchClient) {\n // @NOTE cursors won't change on appview swap\n const res = await ctx.searchClient.call(\n app.bsky.unspecced.searchActorsSkeleton,\n {\n q: term,\n cursor: params.cursor,\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n )\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n cursor: parseString(res.cursor),\n }\n }\n\n const res = await ctx.dataplane.searchActors({\n term,\n limit: params.limit,\n cursor: params.cursor,\n })\n return {\n dids: res.dids as DidString[],\n cursor: parseString(res.cursor),\n }\n}\n\nconst skeletonV2 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n const res = await ctx.dataplane.searchActorsV2({\n params: {\n query: term,\n viewer: params.hydrateCtx.viewer ?? undefined,\n limit: params.limit,\n cursor: params.cursor,\n },\n })\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n cursor: parseString(res.pageInfo?.cursor),\n }\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useV2 =\n input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SearchV2Enable,\n ) || input.params.isV2Override\n const skeletonFn = useV2 ? skeletonV2 : skeletonV1\n return skeletonFn(input)\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateProfiles(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocks = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration } = inputs\n skeleton.dids = skeleton.dids.filter(\n (did) => !ctx.views.viewerBlockExists(did, hydration),\n )\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profile(did, hydration),\n )\n return {\n actors,\n cursor: skeleton.cursor,\n }\n}\n\ntype Context = {\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n searchClient?: Client\n}\n\ntype Params = app.bsky.actor.searchActors.$Params & {\n hydrateCtx: HydrateCtx\n isV2Override: boolean\n}\n\ntype Skeleton = {\n dids: DidString[]\n hitsTotal?: number\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=searchActorsTypeahead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchActorsTypeahead.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActorsTypeahead.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAcnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqCvD"}
1
+ {"version":3,"file":"searchActorsTypeahead.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActorsTypeahead.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAcxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqCvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"searchActorsTypeahead.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActorsTypeahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,qBAAqB,GAAG,cAAc,CAC1C,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE;QAC/C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB;QAC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AAA;AAED,MAAM,YAAY,GAAG,CACnB,MAAsD,EACtD,EAAE;IACF,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC3C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/C,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CACvC,CAAA;IACD,OAAO;QACL,MAAM;KACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport { Client, DidString } from '@atproto/lex'\nimport { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { DataPlaneClient } from '../../../../data-plane/index.js'\nimport { HydrateCtx, Hydrator } 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 { Views } from '../../../../views/index.js'\nimport { resHeaders, resolveSearchV2Override } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const searchActorsTypeahead = createPipeline(\n skeleton,\n hydration,\n noBlocks,\n presentation,\n )\n server.add(app.bsky.actor.searchActorsTypeahead, {\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({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const results = await searchActorsTypeahead(\n {\n ...params,\n hydrateCtx,\n isV2Override: resolveSearchV2Override(req, ctx.cfg),\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: results,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeletonV1 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n // @TODO\n // add typeahead option\n // add hits total\n\n if (ctx.searchClient) {\n const { actors } = await ctx.searchClient.call(\n app.bsky.unspecced.searchActorsSkeleton,\n {\n typeahead: true,\n q: term,\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n )\n return {\n dids: actors.map(({ did }) => did),\n }\n }\n\n const res = await ctx.dataplane.searchActors({\n term,\n limit: params.limit,\n })\n return {\n dids: res.dids as DidString[],\n }\n}\n\nconst skeletonV2 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n const res = await ctx.dataplane.searchActorsTypeahead({\n params: {\n query: term,\n viewer: params.hydrateCtx.viewer ?? undefined,\n limit: params.limit,\n },\n })\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n }\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useV2 =\n input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SearchV2Enable,\n ) || input.params.isV2Override\n const skeletonFn = useV2 ? skeletonV2 : skeletonV1\n return skeletonFn(input)\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateProfilesBasic(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocks = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration, params } = inputs\n skeleton.dids = skeleton.dids.filter((did) => {\n const actor = hydration.actors?.get(did)\n if (!actor) return false\n // Always display exact matches so that users can find profiles that they have blocked\n const term = (params.q ?? params.term ?? '').toLowerCase()\n const isExactMatch = actor.handle?.toLowerCase() === term\n return isExactMatch || !ctx.views.viewerBlockExists(did, hydration)\n })\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileBasic(did, hydration),\n )\n return {\n actors,\n }\n}\n\ntype Context = {\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n searchClient?: Client\n}\n\ntype Params = app.bsky.actor.searchActorsTypeahead.$Params & {\n hydrateCtx: HydrateCtx\n isV2Override: boolean\n}\n\ntype Skeleton = {\n dids: DidString[]\n}\n"]}
1
+ {"version":3,"file":"searchActorsTypeahead.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/actor/searchActorsTypeahead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAM5C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAKL,cAAc,GACf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAEtE,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,qBAAqB,GAAG,cAAc,CAC1C,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,CACb,CAAA;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE;QAC/C,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;gBAClD,QAAQ;gBACR,MAAM;gBACN,QAAQ,EAAE,GAA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H,CAAC,CAAA","sourcesContent":["import { mapDefined } from '@atproto/common'\nimport type { Client, DidString } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport type { DataPlaneClient } from '../../../../data-plane/index.js'\nimport type { HydrateCtx, Hydrator } 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 { Views } from '../../../../views/index.js'\nimport { resHeaders, resolveSearchV2Override } from '../../../util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const searchActorsTypeahead = createPipeline(\n skeleton,\n hydration,\n noBlocks,\n presentation,\n )\n server.add(app.bsky.actor.searchActorsTypeahead, {\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({\n labelers,\n viewer,\n features: ctx.featureGatesClient.scope(\n ctx.featureGatesClient.parseUserContextFromHandler({\n viewer,\n req,\n }),\n ),\n })\n const results = await searchActorsTypeahead(\n {\n ...params,\n hydrateCtx,\n isV2Override: resolveSearchV2Override(req, ctx.cfg),\n },\n ctx,\n )\n return {\n encoding: 'application/json',\n body: results,\n headers: resHeaders({ labelers: hydrateCtx.labelers }),\n }\n },\n })\n}\n\nconst skeletonV1 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n // @TODO\n // add typeahead option\n // add hits total\n\n if (ctx.searchClient) {\n const { actors } = await ctx.searchClient.call(\n app.bsky.unspecced.searchActorsSkeleton,\n {\n typeahead: true,\n q: term,\n limit: params.limit,\n viewer: params.hydrateCtx.viewer ?? undefined,\n },\n )\n return {\n dids: actors.map(({ did }) => did),\n }\n }\n\n const res = await ctx.dataplane.searchActors({\n term,\n limit: params.limit,\n })\n return {\n dids: res.dids as DidString[],\n }\n}\n\nconst skeletonV2 = async (\n inputs: SkeletonFnInput<Context, Params>,\n): Promise<Skeleton> => {\n const { ctx, params } = inputs\n const term = params.q ?? params.term ?? ''\n\n const res = await ctx.dataplane.searchActorsTypeahead({\n params: {\n query: term,\n viewer: params.hydrateCtx.viewer ?? undefined,\n limit: params.limit,\n },\n })\n return {\n dids: res.actors.map(({ did }) => did as DidString),\n }\n}\n\nconst skeleton = async (input: SkeletonFnInput<Context, Params>) => {\n const useV2 =\n input.params.hydrateCtx.features.checkGate(\n input.params.hydrateCtx.features.Gate.SearchV2Enable,\n ) || input.params.isV2Override\n const skeletonFn = useV2 ? skeletonV2 : skeletonV1\n return skeletonFn(input)\n}\n\nconst hydration = async (\n inputs: HydrationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, params, skeleton } = inputs\n return ctx.hydrator.hydrateProfilesBasic(skeleton.dids, params.hydrateCtx)\n}\n\nconst noBlocks = (inputs: RulesFnInput<Context, Params, Skeleton>) => {\n const { ctx, skeleton, hydration, params } = inputs\n skeleton.dids = skeleton.dids.filter((did) => {\n const actor = hydration.actors?.get(did)\n if (!actor) return false\n // Always display exact matches so that users can find profiles that they have blocked\n const term = (params.q ?? params.term ?? '').toLowerCase()\n const isExactMatch = actor.handle?.toLowerCase() === term\n return isExactMatch || !ctx.views.viewerBlockExists(did, hydration)\n })\n return skeleton\n}\n\nconst presentation = (\n inputs: PresentationFnInput<Context, Params, Skeleton>,\n) => {\n const { ctx, skeleton, hydration } = inputs\n const actors = mapDefined(skeleton.dids, (did) =>\n ctx.views.profileBasic(did, hydration),\n )\n return {\n actors,\n }\n}\n\ntype Context = {\n dataplane: DataPlaneClient\n hydrator: Hydrator\n views: Views\n searchClient?: Client\n}\n\ntype Params = app.bsky.actor.searchActorsTypeahead.$Params & {\n hydrateCtx: HydrateCtx\n isV2Override: boolean\n}\n\ntype Skeleton = {\n dids: DidString[]\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=begin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"begin.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,MAAM,EACP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAkHvD"}
1
+ {"version":3,"file":"begin.d.ts","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAmBxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAkHvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"begin.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAE1B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,MAAM,uBAAu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AAI;QACjE,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED,KAAK,UAAU,uBAAuB,CACpC,GAAe,EACf,QAAgB;IAEhB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC;YACxC,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,yBAAyB,EAAE,CAAC,QAAQ,CAAC;YACrC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;SAC7B,CAAC,CAAA;QAEF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC","sourcesContent":["import crypto from 'node:crypto'\nimport { isEmailValid } from '@hapi/address'\nimport { isDisposableEmail } from 'disposable-email-domains-js'\nimport { getAgeAssuranceRegionConfig } from '@atproto/api'\nimport {\n InvalidRequestError,\n MethodNotImplementedError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\ntype InputSchema = app.bsky.ageassurance.begin.$InputBody\nimport { app } from '../../../../lexicons/index.js'\nimport { httpLogger as log } from '../../../../logger.js'\nimport { ActorInfo } from '../../../../proto/bsky_pb.js'\nimport { AGE_ASSURANCE_CONFIG } from '../../../age-assurance/const.js'\nimport {\n KWS_SUPPORTED_LANGUAGES,\n KWS_V2_COUNTRIES,\n} from '../../../age-assurance/kws/const.js'\nimport {\n KWSExternalPayloadTooLargeError,\n KWSExternalPayloadVersion,\n serializeKWSExternalPayloadV2,\n} from '../../../age-assurance/kws/external-payload.js'\nimport { createEvent } from '../../../age-assurance/stash.js'\nimport { createLocationString } from '../../../age-assurance/util.js'\nimport { getClientUa } from '../../../kws/util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(app.bsky.ageassurance.begin, {\n auth: ctx.authVerifier.standard,\n handler: async ({ auth, input, req }) => {\n if (!ctx.kwsClient) {\n throw new MethodNotImplementedError(\n 'This service is not configured to support age assurance.',\n )\n }\n\n const actorDid = auth.credentials.iss\n const actorInfo = await getAgeVerificationState(ctx, actorDid)\n const existingStatus = actorInfo?.ageAssuranceStatus?.status\n const existingAccess = actorInfo?.ageAssuranceStatus?.access\n\n if (existingStatus === 'blocked') {\n throw new InvalidRequestError(\n `Cannot initiate age assurance flow from current state: ${existingStatus}`,\n 'InvalidInitiation',\n )\n }\n\n const attemptId = crypto.randomUUID()\n const { email, language, countryCode, regionCode } = validateInput(\n input.body,\n )\n\n let externalPayload: string\n try {\n externalPayload = serializeKWSExternalPayloadV2({\n version: KWSExternalPayloadVersion.V2,\n actorDid,\n attemptId,\n countryCode,\n regionCode,\n })\n } catch (err) {\n if (err instanceof KWSExternalPayloadTooLargeError) {\n log.error({ err, actorDid }, err.message)\n throw new InvalidRequestError(\n 'Age Assurance flow failed because DID is too long',\n 'DidTooLong',\n )\n }\n throw err\n }\n\n /*\n * Determine if age assurance config exists for this region. The calling\n * application should already have checked for this, so this is just a\n * safeguard.\n */\n const region = getAgeAssuranceRegionConfig(AGE_ASSURANCE_CONFIG, {\n countryCode,\n regionCode,\n })\n if (!region) {\n const message = 'Age Assurance is not required in this region'\n log.error({ actorDid, countryCode, regionCode }, message)\n throw new InvalidRequestError(message, 'RegionNotSupported')\n }\n\n const location = createLocationString(countryCode, regionCode)\n\n if (KWS_V2_COUNTRIES.has(region.countryCode)) {\n // `age-verified` flow\n await ctx.kwsClient.sendAgeVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n } else {\n // `adult-verified` flow is what we've been using prior to `age-verified`\n await ctx.kwsClient.sendAdultVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n }\n\n // If we have existing status/access for this region, retain it.\n const nextStatus =\n existingStatus && existingStatus !== 'unknown'\n ? existingStatus\n : 'pending'\n const nextAccess =\n existingAccess && existingAccess !== 'unknown'\n ? existingAccess\n : 'unknown'\n\n const event = await createEvent(ctx, actorDid, {\n attemptId,\n email,\n // Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.\n initIp: req.ip,\n initUa: getClientUa(req),\n status: nextStatus,\n access: nextAccess,\n countryCode,\n regionCode,\n })\n\n return {\n encoding: 'application/json',\n body: {\n lastInitiatedAt: event.createdAt,\n status: nextStatus,\n access: nextAccess,\n },\n }\n },\n })\n}\n\nfunction validateInput({ email, language, ...rest }: InputSchema): InputSchema {\n if (!isEmailValid(email) || isDisposableEmail(email)) {\n throw new InvalidRequestError(\n 'This email address is not supported, please use a different email.',\n 'InvalidEmail',\n )\n }\n\n return {\n email,\n language: KWS_SUPPORTED_LANGUAGES.has(language) ? language : 'en',\n ...rest,\n }\n}\n\nasync function getAgeVerificationState(\n ctx: AppContext,\n actorDid: string,\n): Promise<ActorInfo | undefined> {\n try {\n const res = await ctx.dataplane.getActors({\n dids: [actorDid],\n returnAgeAssuranceForDids: [actorDid],\n skipCacheForDids: [actorDid],\n })\n\n return res.actors[0]\n } catch (err) {\n return undefined\n }\n}\n"]}
1
+ {"version":3,"file":"begin.js","sourceRoot":"","sources":["../../../../../src/api/app/bsky/ageassurance/begin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAE1B,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,+BAA+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,SAAS,CAAC,SAAS,CAAC;YACxC,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,yBAAyB,EAAE,CAAC,QAAQ,CAAC;YACrC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;SAC7B,CAAC,CAAA;QAEF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC","sourcesContent":["import crypto from 'node:crypto'\nimport { isEmailValid } from '@hapi/address'\nimport { isDisposableEmail } from 'disposable-email-domains-js'\nimport { getAgeAssuranceRegionConfig } from '@atproto/api'\nimport {\n InvalidRequestError,\n MethodNotImplementedError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\ntype InputSchema = app.bsky.ageassurance.begin.$InputBody\nimport { app } from '../../../../lexicons/index.js'\nimport { httpLogger as log } from '../../../../logger.js'\nimport type { ActorInfo } from '../../../../proto/bsky_pb.js'\nimport { AGE_ASSURANCE_CONFIG } from '../../../age-assurance/const.js'\nimport {\n KWS_SUPPORTED_LANGUAGES,\n KWS_V2_COUNTRIES,\n} from '../../../age-assurance/kws/const.js'\nimport {\n KWSExternalPayloadTooLargeError,\n KWSExternalPayloadVersion,\n serializeKWSExternalPayloadV2,\n} from '../../../age-assurance/kws/external-payload.js'\nimport { createEvent } from '../../../age-assurance/stash.js'\nimport { createLocationString } from '../../../age-assurance/util.js'\nimport { getClientUa } from '../../../kws/util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(app.bsky.ageassurance.begin, {\n auth: ctx.authVerifier.standard,\n handler: async ({ auth, input, req }) => {\n if (!ctx.kwsClient) {\n throw new MethodNotImplementedError(\n 'This service is not configured to support age assurance.',\n )\n }\n\n const actorDid = auth.credentials.iss\n const actorInfo = await getAgeVerificationState(ctx, actorDid)\n const existingStatus = actorInfo?.ageAssuranceStatus?.status\n const existingAccess = actorInfo?.ageAssuranceStatus?.access\n\n if (existingStatus === 'blocked') {\n throw new InvalidRequestError(\n `Cannot initiate age assurance flow from current state: ${existingStatus}`,\n 'InvalidInitiation',\n )\n }\n\n const attemptId = crypto.randomUUID()\n const { email, language, countryCode, regionCode } = validateInput(\n input.body,\n )\n\n let externalPayload: string\n try {\n externalPayload = serializeKWSExternalPayloadV2({\n version: KWSExternalPayloadVersion.V2,\n actorDid,\n attemptId,\n countryCode,\n regionCode,\n })\n } catch (err) {\n if (err instanceof KWSExternalPayloadTooLargeError) {\n log.error({ err, actorDid }, err.message)\n throw new InvalidRequestError(\n 'Age Assurance flow failed because DID is too long',\n 'DidTooLong',\n )\n }\n throw err\n }\n\n /*\n * Determine if age assurance config exists for this region. The calling\n * application should already have checked for this, so this is just a\n * safeguard.\n */\n const region = getAgeAssuranceRegionConfig(AGE_ASSURANCE_CONFIG, {\n countryCode,\n regionCode,\n })\n if (!region) {\n const message = 'Age Assurance is not required in this region'\n log.error({ actorDid, countryCode, regionCode }, message)\n throw new InvalidRequestError(message, 'RegionNotSupported')\n }\n\n const location = createLocationString(countryCode, regionCode)\n\n if (KWS_V2_COUNTRIES.has(region.countryCode)) {\n // `age-verified` flow\n await ctx.kwsClient.sendAgeVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n } else {\n // `adult-verified` flow is what we've been using prior to `age-verified`\n await ctx.kwsClient.sendAdultVerifiedFlowEmail({\n location,\n email,\n externalPayload,\n language,\n })\n }\n\n // If we have existing status/access for this region, retain it.\n const nextStatus =\n existingStatus && existingStatus !== 'unknown'\n ? existingStatus\n : 'pending'\n const nextAccess =\n existingAccess && existingAccess !== 'unknown'\n ? existingAccess\n : 'unknown'\n\n const event = await createEvent(ctx, actorDid, {\n attemptId,\n email,\n // Assumes `app.set('trust proxy', ...)` configured with `true` or specific values.\n initIp: req.ip,\n initUa: getClientUa(req),\n status: nextStatus,\n access: nextAccess,\n countryCode,\n regionCode,\n })\n\n return {\n encoding: 'application/json',\n body: {\n lastInitiatedAt: event.createdAt,\n status: nextStatus,\n access: nextAccess,\n },\n }\n },\n })\n}\n\nfunction validateInput({ email, language, ...rest }: InputSchema): InputSchema {\n if (!isEmailValid(email) || isDisposableEmail(email)) {\n throw new InvalidRequestError(\n 'This email address is not supported, please use a different email.',\n 'InvalidEmail',\n )\n }\n\n return {\n email,\n language: KWS_SUPPORTED_LANGUAGES.has(language) ? language : 'en',\n ...rest,\n }\n}\n\nasync function getAgeVerificationState(\n ctx: AppContext,\n actorDid: string,\n): Promise<ActorInfo | undefined> {\n try {\n const res = await ctx.dataplane.getActors({\n dids: [actorDid],\n returnAgeAssuranceForDids: [actorDid],\n skipCacheForDids: [actorDid],\n })\n\n return res.actors[0]\n } catch (err) {\n return undefined\n }\n}\n"]}