@atproto/bsky 0.1.6 → 0.2.0

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 (283) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/api/app/bsky/actor/getProfile.js +1 -1
  3. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  4. package/dist/api/app/bsky/actor/getProfiles.js +1 -1
  5. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  6. package/dist/api/app/bsky/actor/getSuggestions.js +2 -2
  7. package/dist/api/app/bsky/actor/getSuggestions.js.map +1 -1
  8. package/dist/api/app/bsky/embed/getEmbedExternalView.d.ts.map +1 -1
  9. package/dist/api/app/bsky/embed/getEmbedExternalView.js +132 -53
  10. package/dist/api/app/bsky/embed/getEmbedExternalView.js.map +1 -1
  11. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  12. package/dist/api/app/bsky/feed/getAuthorFeed.js +4 -2
  13. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  14. package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js +2 -2
  15. package/dist/api/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
  16. package/dist/api/app/bsky/notification/constants.d.ts +4 -1
  17. package/dist/api/app/bsky/notification/constants.d.ts.map +1 -1
  18. package/dist/api/app/bsky/notification/constants.js +3 -0
  19. package/dist/api/app/bsky/notification/constants.js.map +1 -1
  20. package/dist/api/app/bsky/notification/getGroupedNotifications.js +19 -7
  21. package/dist/api/app/bsky/notification/getGroupedNotifications.js.map +1 -1
  22. package/dist/api/app/bsky/notification/grouping/spotlight.d.ts +1 -1
  23. package/dist/api/app/bsky/notification/grouping/spotlight.d.ts.map +1 -1
  24. package/dist/api/app/bsky/notification/grouping/spotlight.js +114 -80
  25. package/dist/api/app/bsky/notification/grouping/spotlight.js.map +1 -1
  26. package/dist/api/app/bsky/notification/listActivitySubscriptions.js +3 -2
  27. package/dist/api/app/bsky/notification/listActivitySubscriptions.js.map +1 -1
  28. package/dist/api/app/bsky/unspecced/getAtmosphereExploreTab.d.ts +4 -0
  29. package/dist/api/app/bsky/unspecced/getAtmosphereExploreTab.d.ts.map +1 -0
  30. package/dist/api/app/bsky/unspecced/getAtmosphereExploreTab.js +142 -0
  31. package/dist/api/app/bsky/unspecced/getAtmosphereExploreTab.js.map +1 -0
  32. package/dist/api/index.d.ts.map +1 -1
  33. package/dist/api/index.js +2 -0
  34. package/dist/api/index.js.map +1 -1
  35. package/dist/api/internal/bsky/actor/getProfiles.js +4 -1
  36. package/dist/api/internal/bsky/actor/getProfiles.js.map +1 -1
  37. package/dist/config.d.ts +4 -0
  38. package/dist/config.d.ts.map +1 -1
  39. package/dist/config.js +12 -0
  40. package/dist/config.js.map +1 -1
  41. package/dist/data-plane/server/indexing/index.d.ts +3 -1
  42. package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
  43. package/dist/data-plane/server/indexing/index.js +2 -0
  44. package/dist/data-plane/server/indexing/index.js.map +1 -1
  45. package/dist/data-plane/server/indexing/plugins/profile-link.d.ts +8 -0
  46. package/dist/data-plane/server/indexing/plugins/profile-link.d.ts.map +1 -0
  47. package/dist/data-plane/server/indexing/plugins/profile-link.js +30 -0
  48. package/dist/data-plane/server/indexing/plugins/profile-link.js.map +1 -0
  49. package/dist/data-plane/server/routes/records.d.ts.map +1 -1
  50. package/dist/data-plane/server/routes/records.js +1 -0
  51. package/dist/data-plane/server/routes/records.js.map +1 -1
  52. package/dist/hydration/actor.d.ts +4 -1
  53. package/dist/hydration/actor.d.ts.map +1 -1
  54. package/dist/hydration/actor.js +11 -0
  55. package/dist/hydration/actor.js.map +1 -1
  56. package/dist/hydration/external.d.ts +74 -70
  57. package/dist/hydration/external.d.ts.map +1 -1
  58. package/dist/hydration/external.js +79 -133
  59. package/dist/hydration/external.js.map +1 -1
  60. package/dist/hydration/hydrator.d.ts +57 -14
  61. package/dist/hydration/hydrator.d.ts.map +1 -1
  62. package/dist/hydration/hydrator.js +417 -105
  63. package/dist/hydration/hydrator.js.map +1 -1
  64. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +24 -0
  65. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
  66. package/dist/lexicons/app/bsky/actor/defs.defs.js +13 -0
  67. package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
  68. package/dist/lexicons/app/bsky/actor/link.d.ts +3 -0
  69. package/dist/lexicons/app/bsky/actor/link.d.ts.map +1 -0
  70. package/dist/lexicons/app/bsky/actor/link.defs.d.ts +105 -0
  71. package/dist/lexicons/app/bsky/actor/link.defs.d.ts.map +1 -0
  72. package/dist/lexicons/app/bsky/actor/link.defs.js +34 -0
  73. package/dist/lexicons/app/bsky/actor/link.defs.js.map +1 -0
  74. package/dist/lexicons/app/bsky/actor/link.js +6 -0
  75. package/dist/lexicons/app/bsky/actor/link.js.map +1 -0
  76. package/dist/lexicons/app/bsky/actor/profile.defs.d.ts +14 -0
  77. package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
  78. package/dist/lexicons/app/bsky/actor/profile.defs.js +3 -0
  79. package/dist/lexicons/app/bsky/actor/profile.defs.js.map +1 -1
  80. package/dist/lexicons/app/bsky/actor.d.ts +1 -0
  81. package/dist/lexicons/app/bsky/actor.d.ts.map +1 -1
  82. package/dist/lexicons/app/bsky/actor.js +1 -0
  83. package/dist/lexicons/app/bsky/actor.js.map +1 -1
  84. package/dist/lexicons/app/bsky/authFullApp.defs.d.ts.map +1 -1
  85. package/dist/lexicons/app/bsky/authFullApp.defs.js +1 -0
  86. package/dist/lexicons/app/bsky/authFullApp.defs.js.map +1 -1
  87. package/dist/lexicons/app/bsky/authManageProfile.defs.d.ts.map +1 -1
  88. package/dist/lexicons/app/bsky/authManageProfile.defs.js +1 -0
  89. package/dist/lexicons/app/bsky/authManageProfile.defs.js.map +1 -1
  90. package/dist/lexicons/app/bsky/embed/external.defs.d.ts +130 -0
  91. package/dist/lexicons/app/bsky/embed/external.defs.d.ts.map +1 -1
  92. package/dist/lexicons/app/bsky/embed/external.defs.js +135 -0
  93. package/dist/lexicons/app/bsky/embed/external.defs.js.map +1 -1
  94. package/dist/lexicons/app/bsky/embed/getEmbedExternalView.defs.d.ts +15 -3
  95. package/dist/lexicons/app/bsky/embed/getEmbedExternalView.defs.d.ts.map +1 -1
  96. package/dist/lexicons/app/bsky/embed/getEmbedExternalView.defs.js +18 -3
  97. package/dist/lexicons/app/bsky/embed/getEmbedExternalView.defs.js.map +1 -1
  98. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.d.ts +62 -3
  99. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.d.ts.map +1 -1
  100. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.js +53 -2
  101. package/dist/lexicons/app/bsky/notification/getGroupedNotifications.defs.js.map +1 -1
  102. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.d.ts +3 -0
  103. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.d.ts.map +1 -0
  104. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.defs.d.ts +103 -0
  105. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.defs.d.ts.map +1 -0
  106. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.defs.js +95 -0
  107. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.defs.js.map +1 -0
  108. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.js +6 -0
  109. package/dist/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.js.map +1 -0
  110. package/dist/lexicons/app/bsky/unspecced.d.ts +1 -0
  111. package/dist/lexicons/app/bsky/unspecced.d.ts.map +1 -1
  112. package/dist/lexicons/app/bsky/unspecced.js +1 -0
  113. package/dist/lexicons/app/bsky/unspecced.js.map +1 -1
  114. package/dist/lexicons/index.d.ts +2 -0
  115. package/dist/lexicons/index.d.ts.map +1 -1
  116. package/dist/lexicons/index.js +2 -0
  117. package/dist/lexicons/index.js.map +1 -1
  118. package/dist/lexicons/place/stream/badge/defs.d.ts +2 -0
  119. package/dist/lexicons/place/stream/badge/defs.d.ts.map +1 -0
  120. package/dist/lexicons/place/stream/badge/defs.defs.d.ts +131 -0
  121. package/dist/lexicons/place/stream/badge/defs.defs.d.ts.map +1 -0
  122. package/dist/lexicons/place/stream/badge/defs.defs.js +73 -0
  123. package/dist/lexicons/place/stream/badge/defs.defs.js.map +1 -0
  124. package/dist/lexicons/place/stream/badge/defs.js +5 -0
  125. package/dist/lexicons/place/stream/badge/defs.js.map +1 -0
  126. package/dist/lexicons/place/stream/badge.d.ts +2 -0
  127. package/dist/lexicons/place/stream/badge.d.ts.map +1 -0
  128. package/dist/lexicons/place/stream/badge.js +5 -0
  129. package/dist/lexicons/place/stream/badge.js.map +1 -0
  130. package/dist/lexicons/place/stream/chat/defs.d.ts +2 -0
  131. package/dist/lexicons/place/stream/chat/defs.d.ts.map +1 -0
  132. package/dist/lexicons/place/stream/chat/defs.defs.d.ts +44 -0
  133. package/dist/lexicons/place/stream/chat/defs.defs.d.ts.map +1 -0
  134. package/dist/lexicons/place/stream/chat/defs.defs.js +41 -0
  135. package/dist/lexicons/place/stream/chat/defs.defs.js.map +1 -0
  136. package/dist/lexicons/place/stream/chat/defs.js +5 -0
  137. package/dist/lexicons/place/stream/chat/defs.js.map +1 -0
  138. package/dist/lexicons/place/stream/chat/pinnedRecord.d.ts +3 -0
  139. package/dist/lexicons/place/stream/chat/pinnedRecord.d.ts.map +1 -0
  140. package/dist/lexicons/place/stream/chat/pinnedRecord.defs.d.ts +108 -0
  141. package/dist/lexicons/place/stream/chat/pinnedRecord.defs.d.ts.map +1 -0
  142. package/dist/lexicons/place/stream/chat/pinnedRecord.defs.js +31 -0
  143. package/dist/lexicons/place/stream/chat/pinnedRecord.defs.js.map +1 -0
  144. package/dist/lexicons/place/stream/chat/pinnedRecord.js +6 -0
  145. package/dist/lexicons/place/stream/chat/pinnedRecord.js.map +1 -0
  146. package/dist/lexicons/place/stream/chat/profile.d.ts +3 -0
  147. package/dist/lexicons/place/stream/chat/profile.d.ts.map +1 -0
  148. package/dist/lexicons/place/stream/chat/profile.defs.d.ts +143 -0
  149. package/dist/lexicons/place/stream/chat/profile.defs.d.ts.map +1 -0
  150. package/dist/lexicons/place/stream/chat/profile.defs.js +62 -0
  151. package/dist/lexicons/place/stream/chat/profile.defs.js.map +1 -0
  152. package/dist/lexicons/place/stream/chat/profile.js +6 -0
  153. package/dist/lexicons/place/stream/chat/profile.js.map +1 -0
  154. package/dist/lexicons/place/stream/chat.d.ts +4 -0
  155. package/dist/lexicons/place/stream/chat.d.ts.map +1 -0
  156. package/dist/lexicons/place/stream/chat.js +7 -0
  157. package/dist/lexicons/place/stream/chat.js.map +1 -0
  158. package/dist/lexicons/place/stream/defs.d.ts +2 -0
  159. package/dist/lexicons/place/stream/defs.d.ts.map +1 -0
  160. package/dist/lexicons/place/stream/defs.defs.d.ts +54 -0
  161. package/dist/lexicons/place/stream/defs.defs.d.ts.map +1 -0
  162. package/dist/lexicons/place/stream/defs.defs.js +40 -0
  163. package/dist/lexicons/place/stream/defs.defs.js.map +1 -0
  164. package/dist/lexicons/place/stream/defs.js +5 -0
  165. package/dist/lexicons/place/stream/defs.js.map +1 -0
  166. package/dist/lexicons/place/stream/livestream.d.ts +3 -0
  167. package/dist/lexicons/place/stream/livestream.d.ts.map +1 -0
  168. package/dist/lexicons/place/stream/livestream.defs.d.ts +312 -0
  169. package/dist/lexicons/place/stream/livestream.defs.d.ts.map +1 -0
  170. package/dist/lexicons/place/stream/livestream.defs.js +105 -0
  171. package/dist/lexicons/place/stream/livestream.defs.js.map +1 -0
  172. package/dist/lexicons/place/stream/livestream.js +6 -0
  173. package/dist/lexicons/place/stream/livestream.js.map +1 -0
  174. package/dist/lexicons/place/stream.d.ts +5 -0
  175. package/dist/lexicons/place/stream.d.ts.map +1 -0
  176. package/dist/lexicons/place/stream.js +8 -0
  177. package/dist/lexicons/place/stream.js.map +1 -0
  178. package/dist/lexicons/place.d.ts +2 -0
  179. package/dist/lexicons/place.d.ts.map +1 -0
  180. package/dist/lexicons/place.js +5 -0
  181. package/dist/lexicons/place.js.map +1 -0
  182. package/dist/lexicons/site/standard/document.defs.d.ts +127 -127
  183. package/dist/lexicons/site/standard/document.defs.d.ts.map +1 -1
  184. package/dist/lexicons/site/standard/document.defs.js +28 -28
  185. package/dist/lexicons/site/standard/document.defs.js.map +1 -1
  186. package/dist/lexicons/site/standard/graph/recommend.defs.d.ts +11 -11
  187. package/dist/lexicons/site/standard/graph/recommend.defs.d.ts.map +1 -1
  188. package/dist/lexicons/site/standard/graph/recommend.defs.js +1 -1
  189. package/dist/lexicons/site/standard/graph/recommend.defs.js.map +1 -1
  190. package/dist/lexicons/site/standard/publication.defs.d.ts +52 -52
  191. package/dist/lexicons/site/standard/publication.defs.d.ts.map +1 -1
  192. package/dist/lexicons/site/standard/publication.defs.js +6 -6
  193. package/dist/lexicons/site/standard/publication.defs.js.map +1 -1
  194. package/dist/lexicons/site/standard/theme/basic.defs.d.ts +14 -14
  195. package/dist/lexicons/site/standard/theme/basic.defs.d.ts.map +1 -1
  196. package/dist/lexicons/site/standard/theme/basic.defs.js +1 -1
  197. package/dist/lexicons/site/standard/theme/basic.defs.js.map +1 -1
  198. package/dist/lexicons/social/grain/defs.d.ts +2 -0
  199. package/dist/lexicons/social/grain/defs.d.ts.map +1 -0
  200. package/dist/lexicons/social/grain/defs.defs.d.ts +15 -0
  201. package/dist/lexicons/social/grain/defs.defs.d.ts.map +1 -0
  202. package/dist/lexicons/social/grain/defs.defs.js +14 -0
  203. package/dist/lexicons/social/grain/defs.defs.js.map +1 -0
  204. package/dist/lexicons/social/grain/defs.js +5 -0
  205. package/dist/lexicons/social/grain/defs.js.map +1 -0
  206. package/dist/lexicons/social/grain/favorite.d.ts +3 -0
  207. package/dist/lexicons/social/grain/favorite.d.ts.map +1 -0
  208. package/dist/lexicons/social/grain/favorite.defs.d.ts +72 -0
  209. package/dist/lexicons/social/grain/favorite.defs.d.ts.map +1 -0
  210. package/dist/lexicons/social/grain/favorite.defs.js +26 -0
  211. package/dist/lexicons/social/grain/favorite.defs.js.map +1 -0
  212. package/dist/lexicons/social/grain/favorite.js +6 -0
  213. package/dist/lexicons/social/grain/favorite.js.map +1 -0
  214. package/dist/lexicons/social/grain/gallery/item.d.ts +3 -0
  215. package/dist/lexicons/social/grain/gallery/item.d.ts.map +1 -0
  216. package/dist/lexicons/social/grain/gallery/item.defs.d.ts +94 -0
  217. package/dist/lexicons/social/grain/gallery/item.defs.d.ts.map +1 -0
  218. package/dist/lexicons/social/grain/gallery/item.defs.js +29 -0
  219. package/dist/lexicons/social/grain/gallery/item.defs.js.map +1 -0
  220. package/dist/lexicons/social/grain/gallery/item.js +6 -0
  221. package/dist/lexicons/social/grain/gallery/item.js.map +1 -0
  222. package/dist/lexicons/social/grain/gallery.d.ts +4 -0
  223. package/dist/lexicons/social/grain/gallery.d.ts.map +1 -0
  224. package/dist/lexicons/social/grain/gallery.defs.d.ts +98 -0
  225. package/dist/lexicons/social/grain/gallery.defs.d.ts.map +1 -0
  226. package/dist/lexicons/social/grain/gallery.defs.js +33 -0
  227. package/dist/lexicons/social/grain/gallery.defs.js.map +1 -0
  228. package/dist/lexicons/social/grain/gallery.js +7 -0
  229. package/dist/lexicons/social/grain/gallery.js.map +1 -0
  230. package/dist/lexicons/social/grain/photo.d.ts +3 -0
  231. package/dist/lexicons/social/grain/photo.d.ts.map +1 -0
  232. package/dist/lexicons/social/grain/photo.defs.d.ts +98 -0
  233. package/dist/lexicons/social/grain/photo.defs.d.ts.map +1 -0
  234. package/dist/lexicons/social/grain/photo.defs.js +31 -0
  235. package/dist/lexicons/social/grain/photo.defs.js.map +1 -0
  236. package/dist/lexicons/social/grain/photo.js +6 -0
  237. package/dist/lexicons/social/grain/photo.js.map +1 -0
  238. package/dist/lexicons/social/grain.d.ts +5 -0
  239. package/dist/lexicons/social/grain.d.ts.map +1 -0
  240. package/dist/lexicons/social/grain.js +8 -0
  241. package/dist/lexicons/social/grain.js.map +1 -0
  242. package/dist/lexicons/social.d.ts +2 -0
  243. package/dist/lexicons/social.d.ts.map +1 -0
  244. package/dist/lexicons/social.js +5 -0
  245. package/dist/lexicons/social.js.map +1 -0
  246. package/dist/proto/bsky_connect.d.ts +10 -1
  247. package/dist/proto/bsky_connect.d.ts.map +1 -1
  248. package/dist/proto/bsky_connect.js +10 -1
  249. package/dist/proto/bsky_connect.js.map +1 -1
  250. package/dist/proto/bsky_pb.d.ts +34 -0
  251. package/dist/proto/bsky_pb.d.ts.map +1 -1
  252. package/dist/proto/bsky_pb.js +60 -0
  253. package/dist/proto/bsky_pb.js.map +1 -1
  254. package/dist/telemetry/events.d.ts +30 -0
  255. package/dist/telemetry/events.d.ts.map +1 -1
  256. package/dist/telemetry/events.js +37 -0
  257. package/dist/telemetry/events.js.map +1 -1
  258. package/dist/util/external/index.d.ts +8 -0
  259. package/dist/util/external/index.d.ts.map +1 -0
  260. package/dist/util/external/index.js +50 -0
  261. package/dist/util/external/index.js.map +1 -0
  262. package/dist/util/{standard-site.d.ts → external/standard-site.d.ts} +30 -4
  263. package/dist/util/external/standard-site.d.ts.map +1 -0
  264. package/dist/util/{standard-site.js → external/standard-site.js} +73 -4
  265. package/dist/util/external/standard-site.js.map +1 -0
  266. package/dist/views/external.d.ts +8 -0
  267. package/dist/views/external.d.ts.map +1 -0
  268. package/dist/views/external.js +260 -0
  269. package/dist/views/external.js.map +1 -0
  270. package/dist/views/index.d.ts +12 -6
  271. package/dist/views/index.d.ts.map +1 -1
  272. package/dist/views/index.js +89 -42
  273. package/dist/views/index.js.map +1 -1
  274. package/dist/views/profile-link-rules.d.ts +10 -0
  275. package/dist/views/profile-link-rules.d.ts.map +1 -0
  276. package/dist/views/profile-link-rules.js +48 -0
  277. package/dist/views/profile-link-rules.js.map +1 -0
  278. package/dist/views/types.d.ts +3 -0
  279. package/dist/views/types.d.ts.map +1 -1
  280. package/dist/views/types.js.map +1 -1
  281. package/package.json +4 -4
  282. package/dist/util/standard-site.d.ts.map +0 -1
  283. package/dist/util/standard-site.js.map +0 -1
@@ -0,0 +1,260 @@
1
+ import { MINUTE } from '@atproto/common';
2
+ import { getBlobCidString, isAtUriString, isDidString, } from '@atproto/lex';
3
+ import { AtUri, normalizeDatetimeAlways } from '@atproto/syntax';
4
+ import { app, com, place, site, social } from '../lexicons/index.js';
5
+ import { estimateReadingTimeMinutes } from '../util/external/standard-site.js';
6
+ import { uriToDid } from '../util/uris.js';
7
+ export const LIVESTREAM_HEARTBEAT_WINDOW_MS = 2 * MINUTE;
8
+ /** Build a modality view from validated, available records in hydration state. */
9
+ export function externalRecordView(views, uri, state, now) {
10
+ const info = availableRecord(views, uri, state);
11
+ if (!info)
12
+ return;
13
+ const { record } = info;
14
+ if (site.standard.document.$matches(record)) {
15
+ let publisher;
16
+ let base = record.site;
17
+ const refs = [uri];
18
+ if (isAtUriString(record.site)) {
19
+ publisher = publicationView(views, record.site, state);
20
+ if (!publisher)
21
+ return;
22
+ base = publisher.uri;
23
+ refs.push(record.site);
24
+ }
25
+ const url = httpUri(record.path
26
+ ? `${base.replace(/\/$/, '')}/${record.path.replace(/^\//, '')}`
27
+ : base);
28
+ if (!url || !record.title)
29
+ return;
30
+ return app.bsky.embed.external.viewArticle.$build({
31
+ ...commonFields(views, refs, state),
32
+ uri: url,
33
+ title: record.title,
34
+ description: record.description ?? '',
35
+ createdAt: record.publishedAt,
36
+ updatedAt: record.updatedAt,
37
+ image: record.coverImage
38
+ ? views.imgUriBuilder.getPresetUri('feed_thumbnail', uriToDid(uri), getBlobCidString(record.coverImage))
39
+ : undefined,
40
+ publisher,
41
+ readingTime: record.textContent
42
+ ? estimateReadingTimeMinutes(record.textContent)
43
+ : undefined,
44
+ likeCount: backlinkCount(uri, site.standard.graph.recommend.$type, state),
45
+ likers: backlinkProfiles(views, uri, state, 'recommend'),
46
+ });
47
+ }
48
+ if (site.standard.publication.$matches(record)) {
49
+ return publicationView(views, uri, state);
50
+ }
51
+ if (social.grain.gallery.$matches(record)) {
52
+ const links = (state.externalRecordBacklinks?.get(uri) ?? []).flatMap((linkUri) => {
53
+ const link = availableRecord(views, linkUri, state)?.record;
54
+ if (!social.grain.gallery.item.$matches(link) ||
55
+ link.gallery !== uri ||
56
+ uriToDid(linkUri) !== uriToDid(uri)) {
57
+ return [];
58
+ }
59
+ return [{ uri: linkUri, record: link }];
60
+ });
61
+ links.sort((a, b) => (a.record.position ?? 0) - (b.record.position ?? 0) ||
62
+ compareStrings(a.uri, b.uri));
63
+ const refs = [uri];
64
+ const seenPhotos = new Set();
65
+ const items = [];
66
+ for (const link of links) {
67
+ const photoUri = link.record.item;
68
+ if (seenPhotos.has(photoUri))
69
+ continue;
70
+ const photo = availableRecord(views, photoUri, state)?.record;
71
+ if (!social.grain.photo.$matches(photo))
72
+ continue;
73
+ seenPhotos.add(photoUri);
74
+ refs.push(link.uri, photoUri);
75
+ items.push(app.bsky.embed.external.viewGalleryImage.$build({
76
+ thumbnail: views.imgUriBuilder.getPresetUri('feed_thumbnail', uriToDid(photoUri), getBlobCidString(photo.photo)),
77
+ fullsize: views.imgUriBuilder.getPresetUri('feed_fullsize', uriToDid(photoUri), getBlobCidString(photo.photo)),
78
+ alt: photo.alt,
79
+ aspectRatio: photo.aspectRatio
80
+ ? {
81
+ width: photo.aspectRatio.width,
82
+ height: photo.aspectRatio.height,
83
+ }
84
+ : undefined,
85
+ }));
86
+ }
87
+ return app.bsky.embed.external.viewGallery.$build({
88
+ ...commonFields(views, refs, state),
89
+ uri,
90
+ title: record.title,
91
+ description: record.description ?? '',
92
+ createdAt: record.createdAt,
93
+ items,
94
+ likeCount: backlinkCount(uri, social.grain.favorite.$type, state),
95
+ likers: backlinkProfiles(views, uri, state, 'favorite'),
96
+ });
97
+ }
98
+ if (place.stream.livestream.$matches(record)) {
99
+ const lastSeen = record.lastSeenAt ? Date.parse(record.lastSeenAt) : NaN;
100
+ // @NOTE The window applies on both sides of now to tolerate clock skew, so
101
+ // a future heartbeat counts as live for at most twice the window.
102
+ const fresh = Math.abs(now - lastSeen) < LIVESTREAM_HEARTBEAT_WINDOW_MS;
103
+ return app.bsky.embed.external.viewLivestream.$build({
104
+ ...commonFields(views, [uri], state),
105
+ uri: httpUri(record.canonicalUrl) ?? httpUri(record.url) ?? uri,
106
+ title: record.title,
107
+ description: '',
108
+ createdAt: record.createdAt,
109
+ image: record.thumb
110
+ ? views.imgUriBuilder.getPresetUri('feed_thumbnail', uriToDid(uri), getBlobCidString(record.thumb))
111
+ : undefined,
112
+ active: !record.endedAt && fresh,
113
+ startedAt: record.createdAt,
114
+ endedAt: record.endedAt,
115
+ });
116
+ }
117
+ }
118
+ function publicationView(views, uri, state) {
119
+ const record = availableRecord(views, uri, state)?.record;
120
+ if (!site.standard.publication.$matches(record))
121
+ return;
122
+ const url = httpUri(record.url);
123
+ if (!url || !record.name)
124
+ return;
125
+ return app.bsky.embed.external.viewArticlePublication.$build({
126
+ ...commonFields(views, [uri], state),
127
+ uri: url,
128
+ title: record.name,
129
+ description: record.description ?? '',
130
+ logo: record.icon
131
+ ? views.imgUriBuilder.getPresetUri('avatar', uriToDid(uri), getBlobCidString(record.icon))
132
+ : undefined,
133
+ theme: record.basicTheme
134
+ ? app.bsky.embed.external.viewArticlePublicationTheme.$build({
135
+ background: hexColor(record.basicTheme.background),
136
+ foreground: hexColor(record.basicTheme.foreground),
137
+ accent: hexColor(record.basicTheme.accent),
138
+ accentForeground: hexColor(record.basicTheme.accentForeground),
139
+ })
140
+ : undefined,
141
+ subscriptionCount: backlinkCount(uri, site.standard.graph.subscription.$type, state),
142
+ subscribers: backlinkProfiles(views, uri, state, 'subscription'),
143
+ });
144
+ }
145
+ function availableRecord(views, uri, state) {
146
+ const info = state.externalRecords?.get(uri);
147
+ if (!info)
148
+ return;
149
+ const parsed = new AtUri(uri);
150
+ if (!isDidString(parsed.host) || parsed.collection !== info.record.$type)
151
+ return;
152
+ // @NOTE Actor hydration nulls unavailable accounts (missing and tombstoned
153
+ // ones even with includeTakedowns). Absent entries just weren't hydrated.
154
+ if (state.actors?.get(parsed.host) === null)
155
+ return;
156
+ if (views.viewerBlockExists(parsed.host, state))
157
+ return;
158
+ if (!views.viewerSeesNeedsReview({ uri }, state))
159
+ return;
160
+ if (!state.ctx?.includeTakedowns &&
161
+ (info.takedownRef ||
162
+ state.labels?.get(uri)?.isTakendown ||
163
+ views.actorIsNoHosted(parsed.host, state))) {
164
+ return;
165
+ }
166
+ return info;
167
+ }
168
+ function commonFields(views, uris, state) {
169
+ const refs = [...new Set(uris)];
170
+ const dids = [...new Set(refs.map(uriToDid))];
171
+ return {
172
+ associatedRefs: refs.map((uri) => com.atproto.repo.strongRef.$build({
173
+ uri,
174
+ cid: state.externalRecords.get(uri).cid,
175
+ })),
176
+ associatedProfiles: dids.flatMap((did) => {
177
+ const profile = views.profileBasic(did, state);
178
+ return profile ? [profile] : [];
179
+ }),
180
+ labels: refs.flatMap((uri) => recordLabels(uri, state.externalRecords.get(uri), state)),
181
+ };
182
+ }
183
+ function recordLabels(uri, info, state) {
184
+ const labels = state.labels?.getBySubject(uri) ?? [];
185
+ const selfLabels = info.record.labels;
186
+ if (!com.atproto.label.defs.selfLabels.$matches(selfLabels))
187
+ return labels;
188
+ const createdAt = info.record.createdAt ?? info.record.publishedAt;
189
+ const cts = typeof createdAt === 'string'
190
+ ? normalizeDatetimeAlways(createdAt)
191
+ : '1970-01-01T00:00:00.000Z';
192
+ return [
193
+ ...labels,
194
+ ...selfLabels.values.map(({ val }) => ({
195
+ src: uriToDid(uri),
196
+ uri,
197
+ cid: info.cid,
198
+ val,
199
+ cts,
200
+ })),
201
+ ];
202
+ }
203
+ function backlinkCount(uri, collection, state) {
204
+ const counts = state.externalRecordBacklinkCounts?.get(uri);
205
+ if (!counts)
206
+ return;
207
+ const count = counts[collection] ?? 0;
208
+ return Number.isSafeInteger(count) && count >= 0 ? count : undefined;
209
+ }
210
+ function backlinkProfiles(views, uri, state, kind) {
211
+ const backlinks = state.externalRecordBacklinks?.get(uri);
212
+ if (!backlinks)
213
+ return;
214
+ const dids = new Set();
215
+ for (const backlink of backlinks) {
216
+ const record = availableRecord(views, backlink, state)?.record;
217
+ const matches = kind === 'recommend'
218
+ ? site.standard.graph.recommend.$matches(record) &&
219
+ record.document === uri
220
+ : kind === 'subscription'
221
+ ? site.standard.graph.subscription.$matches(record) &&
222
+ record.publication === uri
223
+ : social.grain.favorite.$matches(record) && record.subject === uri;
224
+ if (matches)
225
+ dids.add(uriToDid(backlink));
226
+ }
227
+ const profiles = [];
228
+ for (const did of [...dids].sort(compareStrings)) {
229
+ const profile = views.profileBasic(did, state);
230
+ if (profile)
231
+ profiles.push(profile);
232
+ if (profiles.length === 3)
233
+ break;
234
+ }
235
+ return profiles;
236
+ }
237
+ function hexColor(color) {
238
+ if (site.standard.theme.color.rgb.$matches(color)) {
239
+ return `#${[color.r, color.g, color.b].map(hexByte).join('')}`;
240
+ }
241
+ }
242
+ function hexByte(value) {
243
+ return value.toString(16).padStart(2, '0');
244
+ }
245
+ function httpUri(value) {
246
+ if (!value)
247
+ return;
248
+ try {
249
+ const url = new URL(value);
250
+ if (url.protocol === 'http:' || url.protocol === 'https:')
251
+ return url.href;
252
+ }
253
+ catch {
254
+ return;
255
+ }
256
+ }
257
+ function compareStrings(a, b) {
258
+ return a < b ? -1 : a > b ? 1 : 0;
259
+ }
260
+ //# sourceMappingURL=external.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external.js","sourceRoot":"","sources":["../../src/views/external.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAML,gBAAgB,EAChB,aAAa,EACb,WAAW,GACZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGhE,OAAO,EAAE,GAAG,E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,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAA;IAChE,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AAC5C,CAAC;AAED,SAAS,OAAO,CAAC,KAAyB;IACxC,IAAI,CAAC,KAAK;QAAE,OAAM;IAClB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvD,OAAO,GAAG,CAAC,IAAiB,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAM;IACR,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,CAAS,EAAE,CAAS;IAC1C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACnC,CAAC","sourcesContent":["import { MINUTE } from '@atproto/common'\nimport {\n type $Typed,\n type AtUriString,\n type DidString,\n type NsidString,\n type UriString,\n getBlobCidString,\n isAtUriString,\n isDidString,\n} from '@atproto/lex'\nimport { AtUri, normalizeDatetimeAlways } from '@atproto/syntax'\nimport type { ExternalRecord } from '../hydration/external.js'\nimport type { HydrationState } from '../hydration/hydrator.js'\nimport { app, com, place, site, social } from '../lexicons/index.js'\nimport { estimateReadingTimeMinutes } from '../util/external/standard-site.js'\nimport { uriToDid } from '../util/uris.js'\nimport type { Views } from './index.js'\nimport type { ExternalRecordView, Label, ProfileViewBasic } from './types.js'\n\nexport const LIVESTREAM_HEARTBEAT_WINDOW_MS = 2 * MINUTE\n\n/** Build a modality view from validated, available records in hydration state. */\nexport function externalRecordView(\n views: Views,\n uri: AtUriString,\n state: HydrationState,\n now: number,\n): $Typed<ExternalRecordView> | undefined {\n const info = availableRecord(views, uri, state)\n if (!info) return\n const { record } = info\n\n if (site.standard.document.$matches(record)) {\n let publisher:\n $Typed<app.bsky.embed.external.ViewArticlePublication> | undefined\n let base = record.site\n const refs = [uri]\n if (isAtUriString(record.site)) {\n publisher = publicationView(views, record.site, state)\n if (!publisher) return\n base = publisher.uri\n refs.push(record.site)\n }\n const url = httpUri(\n record.path\n ? `${base.replace(/\\/$/, '')}/${record.path.replace(/^\\//, '')}`\n : base,\n )\n if (!url || !record.title) return\n return app.bsky.embed.external.viewArticle.$build({\n ...commonFields(views, refs, state),\n uri: url,\n title: record.title,\n description: record.description ?? '',\n createdAt: record.publishedAt,\n updatedAt: record.updatedAt,\n image: record.coverImage\n ? views.imgUriBuilder.getPresetUri(\n 'feed_thumbnail',\n uriToDid(uri),\n getBlobCidString(record.coverImage),\n )\n : undefined,\n publisher,\n readingTime: record.textContent\n ? estimateReadingTimeMinutes(record.textContent)\n : undefined,\n likeCount: backlinkCount(uri, site.standard.graph.recommend.$type, state),\n likers: backlinkProfiles(views, uri, state, 'recommend'),\n })\n }\n\n if (site.standard.publication.$matches(record)) {\n return publicationView(views, uri, state)\n }\n\n if (social.grain.gallery.$matches(record)) {\n const links = (state.externalRecordBacklinks?.get(uri) ?? []).flatMap(\n (linkUri) => {\n const link = availableRecord(views, linkUri, state)?.record\n if (\n !social.grain.gallery.item.$matches(link) ||\n link.gallery !== uri ||\n uriToDid(linkUri) !== uriToDid(uri)\n ) {\n return []\n }\n return [{ uri: linkUri, record: link }]\n },\n )\n links.sort(\n (a, b) =>\n (a.record.position ?? 0) - (b.record.position ?? 0) ||\n compareStrings(a.uri, b.uri),\n )\n\n const refs = [uri]\n const seenPhotos = new Set<AtUriString>()\n const items: $Typed<app.bsky.embed.external.ViewGalleryImage>[] = []\n for (const link of links) {\n const photoUri = link.record.item\n if (seenPhotos.has(photoUri)) continue\n const photo = availableRecord(views, photoUri, state)?.record\n if (!social.grain.photo.$matches(photo)) continue\n seenPhotos.add(photoUri)\n refs.push(link.uri, photoUri)\n items.push(\n app.bsky.embed.external.viewGalleryImage.$build({\n thumbnail: views.imgUriBuilder.getPresetUri(\n 'feed_thumbnail',\n uriToDid(photoUri),\n getBlobCidString(photo.photo),\n ),\n fullsize: views.imgUriBuilder.getPresetUri(\n 'feed_fullsize',\n uriToDid(photoUri),\n getBlobCidString(photo.photo),\n ),\n alt: photo.alt,\n aspectRatio: photo.aspectRatio\n ? {\n width: photo.aspectRatio.width,\n height: photo.aspectRatio.height,\n }\n : undefined,\n }),\n )\n }\n return app.bsky.embed.external.viewGallery.$build({\n ...commonFields(views, refs, state),\n uri,\n title: record.title,\n description: record.description ?? '',\n createdAt: record.createdAt,\n items,\n likeCount: backlinkCount(uri, social.grain.favorite.$type, state),\n likers: backlinkProfiles(views, uri, state, 'favorite'),\n })\n }\n\n if (place.stream.livestream.$matches(record)) {\n const lastSeen = record.lastSeenAt ? Date.parse(record.lastSeenAt) : NaN\n // @NOTE The window applies on both sides of now to tolerate clock skew, so\n // a future heartbeat counts as live for at most twice the window.\n const fresh = Math.abs(now - lastSeen) < LIVESTREAM_HEARTBEAT_WINDOW_MS\n return app.bsky.embed.external.viewLivestream.$build({\n ...commonFields(views, [uri], state),\n uri: httpUri(record.canonicalUrl) ?? httpUri(record.url) ?? uri,\n title: record.title,\n description: '',\n createdAt: record.createdAt,\n image: record.thumb\n ? views.imgUriBuilder.getPresetUri(\n 'feed_thumbnail',\n uriToDid(uri),\n getBlobCidString(record.thumb),\n )\n : undefined,\n active: !record.endedAt && fresh,\n startedAt: record.createdAt,\n endedAt: record.endedAt,\n })\n }\n}\n\nfunction publicationView(\n views: Views,\n uri: AtUriString,\n state: HydrationState,\n): $Typed<app.bsky.embed.external.ViewArticlePublication> | undefined {\n const record = availableRecord(views, uri, state)?.record\n if (!site.standard.publication.$matches(record)) return\n const url = httpUri(record.url)\n if (!url || !record.name) return\n return app.bsky.embed.external.viewArticlePublication.$build({\n ...commonFields(views, [uri], state),\n uri: url,\n title: record.name,\n description: record.description ?? '',\n logo: record.icon\n ? views.imgUriBuilder.getPresetUri(\n 'avatar',\n uriToDid(uri),\n getBlobCidString(record.icon),\n )\n : undefined,\n theme: record.basicTheme\n ? app.bsky.embed.external.viewArticlePublicationTheme.$build({\n background: hexColor(record.basicTheme.background),\n foreground: hexColor(record.basicTheme.foreground),\n accent: hexColor(record.basicTheme.accent),\n accentForeground: hexColor(record.basicTheme.accentForeground),\n })\n : undefined,\n subscriptionCount: backlinkCount(\n uri,\n site.standard.graph.subscription.$type,\n state,\n ),\n subscribers: backlinkProfiles(views, uri, state, 'subscription'),\n })\n}\n\nfunction availableRecord(\n views: Views,\n uri: AtUriString,\n state: HydrationState,\n): ExternalRecord | undefined {\n const info = state.externalRecords?.get(uri)\n if (!info) return\n const parsed = new AtUri(uri)\n if (!isDidString(parsed.host) || parsed.collection !== info.record.$type)\n return\n // @NOTE Actor hydration nulls unavailable accounts (missing and tombstoned\n // ones even with includeTakedowns). Absent entries just weren't hydrated.\n if (state.actors?.get(parsed.host) === null) return\n if (views.viewerBlockExists(parsed.host, state)) return\n if (!views.viewerSeesNeedsReview({ uri }, state)) return\n if (\n !state.ctx?.includeTakedowns &&\n (info.takedownRef ||\n state.labels?.get(uri)?.isTakendown ||\n views.actorIsNoHosted(parsed.host, state))\n ) {\n return\n }\n return info\n}\n\nfunction commonFields(\n views: Views,\n uris: AtUriString[],\n state: HydrationState,\n) {\n const refs = [...new Set(uris)]\n const dids = [...new Set(refs.map(uriToDid))]\n return {\n associatedRefs: refs.map((uri) =>\n com.atproto.repo.strongRef.$build({\n uri,\n cid: state.externalRecords!.get(uri)!.cid,\n }),\n ),\n associatedProfiles: dids.flatMap((did) => {\n const profile = views.profileBasic(did, state)\n return profile ? [profile] : []\n }),\n labels: refs.flatMap((uri) =>\n recordLabels(uri, state.externalRecords!.get(uri)!, state),\n ),\n }\n}\n\nfunction recordLabels(\n uri: AtUriString,\n info: ExternalRecord,\n state: HydrationState,\n): Label[] {\n const labels = state.labels?.getBySubject(uri) ?? []\n const selfLabels = info.record.labels\n if (!com.atproto.label.defs.selfLabels.$matches(selfLabels)) return labels\n const createdAt = info.record.createdAt ?? info.record.publishedAt\n const cts =\n typeof createdAt === 'string'\n ? normalizeDatetimeAlways(createdAt)\n : '1970-01-01T00:00:00.000Z'\n return [\n ...labels,\n ...selfLabels.values.map(({ val }) => ({\n src: uriToDid(uri),\n uri,\n cid: info.cid,\n val,\n cts,\n })),\n ]\n}\n\nfunction backlinkCount(\n uri: AtUriString,\n collection: NsidString,\n state: HydrationState,\n): number | undefined {\n const counts = state.externalRecordBacklinkCounts?.get(uri)\n if (!counts) return\n const count = counts[collection] ?? 0\n return Number.isSafeInteger(count) && count >= 0 ? count : undefined\n}\n\nfunction backlinkProfiles(\n views: Views,\n uri: AtUriString,\n state: HydrationState,\n kind: 'recommend' | 'subscription' | 'favorite',\n): ProfileViewBasic[] | undefined {\n const backlinks = state.externalRecordBacklinks?.get(uri)\n if (!backlinks) return\n const dids = new Set<DidString>()\n for (const backlink of backlinks) {\n const record = availableRecord(views, backlink, state)?.record\n const matches =\n kind === 'recommend'\n ? site.standard.graph.recommend.$matches(record) &&\n record.document === uri\n : kind === 'subscription'\n ? site.standard.graph.subscription.$matches(record) &&\n record.publication === uri\n : social.grain.favorite.$matches(record) && record.subject === uri\n if (matches) dids.add(uriToDid(backlink))\n }\n const profiles: ProfileViewBasic[] = []\n for (const did of [...dids].sort(compareStrings)) {\n const profile = views.profileBasic(did, state)\n if (profile) profiles.push(profile)\n if (profiles.length === 3) break\n }\n return profiles\n}\n\nfunction hexColor(\n color: site.standard.theme.basic.Main['background'],\n): string | undefined {\n if (site.standard.theme.color.rgb.$matches(color)) {\n return `#${[color.r, color.g, color.b].map(hexByte).join('')}`\n }\n}\n\nfunction hexByte(value: number): string {\n return value.toString(16).padStart(2, '0')\n}\n\nfunction httpUri(value: string | undefined): UriString | undefined {\n if (!value) return\n try {\n const url = new URL(value)\n if (url.protocol === 'http:' || url.protocol === 'https:')\n return url.href as UriString\n } catch {\n return\n }\n}\n\nfunction compareStrings(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n"]}
@@ -9,8 +9,11 @@ import type { Label } from '../hydration/label.js';
9
9
  import type { ImageUriBuilder } from '../image/uri.js';
10
10
  import { app } from '../lexicons/index.js';
11
11
  import type { Notification } from '../proto/bsky_pb.js';
12
- import { type ActivitySubscription, type BlockedPost, type BookmarkView, type Embed, type EmbedView, type ExternalEmbed, type ExternalEmbedSourceView, type ExternalEmbedView, type FeedViewPost, type FollowRecord, type GalleryEmbed, type GalleryEmbedView, type GeneratorView, type GetPostThreadV2QueryParams, type ImagesEmbed, type ImagesEmbedView, type KnownFollowers, type KnownLikers, type LabelerRecord, type LabelerView, type LabelerViewDetailed, type LikeRecord, type ListItemView, type ListView, type ListViewBasic, type MaybePostView, type NotFoundPost, type NotificationRecordDeleted, type NotificationView, type PostEmbedView, type PostRecord, type PostView, type ProfileAssociatedActivitySubscription, type ProfileAssociatedChat, type ProfileRecord, type ProfileView, type ProfileViewBasic, type ProfileViewDetailed, type ProfileViewer, type ReasonPin, type ReasonRepost, type RecordEmbed, type RecordEmbedView, type RecordWithMedia, type RecordWithMediaView, type ReplyRef, type RepostRecord, type StarterPackView, type StarterPackViewBasic, type StatusView, type ThreadItem, type ThreadOtherItem, type ThreadViewPost, type ThreadgateView, type VerificationRecord, type VerificationState, type VideoEmbed, type VideoEmbedView } from './types.js';
12
+ import { type ActivitySubscription, type BlockedPost, type BookmarkView, type Embed, type EmbedView, type ExternalEmbed, type ExternalEmbedSourceView, type ExternalEmbedView, type ExternalRecordView, type FeedViewPost, type FollowRecord, type GalleryEmbed, type GalleryEmbedView, type GeneratorView, type GetPostThreadV2QueryParams, type ImagesEmbed, type ImagesEmbedView, type KnownFollowers, type KnownLikers, type LabelerRecord, type LabelerView, type LabelerViewDetailed, type LikeRecord, type ListItemView, type ListView, type ListViewBasic, type MaybePostView, type NotFoundPost, type NotificationRecordDeleted, type NotificationView, type PostEmbedView, type PostRecord, type PostView, type ProfileAssociatedActivitySubscription, type ProfileAssociatedChat, type ProfileLinkView, type ProfileRecord, type ProfileView, type ProfileViewBasic, type ProfileViewDetailed, type ProfileViewer, type ReasonPin, type ReasonRepost, type RecordEmbed, type RecordEmbedView, type RecordWithMedia, type RecordWithMediaView, type ReplyRef, type RepostRecord, type StarterPackView, type StarterPackViewBasic, type StatusView, type ThreadItem, type ThreadOtherItem, type ThreadViewPost, type ThreadgateView, type VerificationRecord, type VerificationState, type VideoEmbed, type VideoEmbedView } from './types.js';
13
13
  import { type VideoUriBuilder } from './util.js';
14
+ type ProfileViewOptions = {
15
+ includeKnownFollowers?: boolean;
16
+ };
14
17
  export declare class Views {
15
18
  private opts;
16
19
  imgUriBuilder: ImageUriBuilder;
@@ -46,12 +49,12 @@ export declare class Views {
46
49
  uri?: AtUriString;
47
50
  }, state: HydrationState): boolean;
48
51
  replyIsHiddenByThreadgate(replyUri: AtUriString, rootPostUri: AtUriString, state: HydrationState): boolean;
49
- profileDetailed(did: DidString, state: HydrationState): Un$Typed<ProfileViewDetailed> | undefined;
50
- profile(did: DidString, state: HydrationState): Un$Typed<ProfileView> | undefined;
51
- profileBasic(did: DidString, state: HydrationState): Un$Typed<ProfileViewBasic> | undefined;
52
+ profileDetailed(did: DidString, state: HydrationState, opts?: ProfileViewOptions): Un$Typed<ProfileViewDetailed> | undefined;
53
+ profileLinks(did: DidString, state: HydrationState): ProfileLinkView[] | undefined;
54
+ profile(did: DidString, state: HydrationState, opts?: ProfileViewOptions): Un$Typed<ProfileView> | undefined;
55
+ profileBasic(did: DidString, state: HydrationState, opts?: ProfileViewOptions): Un$Typed<ProfileViewBasic> | undefined;
52
56
  profileAssociatedChat(actor: Actor): ProfileAssociatedChat | undefined;
53
57
  profileAssociatedActivitySubscription(actor: Actor): ProfileAssociatedActivitySubscription;
54
- profileKnownFollowers(did: DidString, state: HydrationState): ProfileView | undefined;
55
58
  profileViewer(did: DidString, state: HydrationState): ProfileViewer | undefined;
56
59
  profileViewerActivitySubscription(profileViewer: ProfileViewerState, did: DidString, state: HydrationState): ActivitySubscription | undefined;
57
60
  profileWebsite(did: DidString, state: HydrationState): UriString | undefined;
@@ -144,6 +147,8 @@ export declare class Views {
144
147
  galleryEmbed(did: DidString, embed: GalleryEmbed): $Typed<GalleryEmbedView>;
145
148
  private galleryItemView;
146
149
  private galleryImageView;
150
+ /** Build a supported record modality from generic record and backlink hydration. */
151
+ externalRecordView(uri: AtUriString, state: HydrationState, now?: number): $Typed<ExternalRecordView> | undefined;
147
152
  externalEmbed(did: DidString, embed: ExternalEmbed, state: HydrationState): $Typed<ExternalEmbedView>;
148
153
  /**
149
154
  * Read-path entry point: caller has the post's `external.associatedRefs[]`
@@ -170,7 +175,7 @@ export declare class Views {
170
175
  /**
171
176
  * Compose-path entry point: caller already knows which document and
172
177
  * publication backed the request and has them in hand (e.g. from
173
- * iterating the SS hydration maps directly). Skips the by-ref lookup
178
+ * `getStandardSiteRecordsForUri`). Skips the by-ref lookup
174
179
  * that `externalEmbedFromStandardSite` does. Used by
175
180
  * `getEmbedExternalView`.
176
181
  *
@@ -211,4 +216,5 @@ export declare class Views {
211
216
  indexedAt: Date;
212
217
  }): Date;
213
218
  }
219
+ export {};
214
220
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAGf,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,SAAS,EAGf,MAAM,iBAAiB,CAAA;AAKxB,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,mDAAmD,CAA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AAE,WAAW,EACpB,KAAK,EAAE,eAAe,EACtB,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAsBzC;IAED,iBAAiB,CACf,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,cAAc,GACpB,OAAO,GAAG,SAAS,CAqCrB;IAED,yBAAyB,CACvB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,cAAc,GACpB,OAAO,GAAG,SAAS,CAmBrB;IAED,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAOtE;IAED,YAAY,CACV,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,cAAc,GACpB,QAAQ,CAAC,gBAAgB,CAAC,GAAG,SAAS,CA4ExC;IAED,iBAAiB,CACf,KAAK,EAAE,iBAAiB,EACxB,KAAK,EAAE,cAAc,GACpB,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,KAAK,GAAG,SAAS,CAoKjE;IAED,SAAS,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,QAGrE;CACF"}
@@ -6,8 +6,10 @@ import { getSiteStandardRecordsFromHydrationMapsByRefs, } from '../hydration/ext
6
6
  import { getStarterPackUriFromFollow, parseString, } from '../hydration/util.js';
7
7
  import { app, site } from '../lexicons/index.js';
8
8
  import { viewsLogger } from '../logger.js';
9
- import { estimateReadingTimeMinutes, validateStandardSiteForUrl, } from '../util/standard-site.js';
9
+ import { estimateReadingTimeMinutes, validateStandardSiteRecordsForUrl, } from '../util/external/standard-site.js';
10
10
  import { postUriToPostgateUri, postUriToThreadgateUri, safePinnedPost, uriToDid, uriToDid as creatorFromUri, } from '../util/uris.js';
11
+ import { externalRecordView as externalRecordViewBase } from './external.js';
12
+ import { MAX_PROFILE_LINKS, isAllowedProfileLinkUrl, } from './profile-link-rules.js';
11
13
  import { sortTrimFlattenThreadTree, } from './threads-v2.js';
12
14
  import { isExternalEmbedType, isGalleryEmbedType, isGalleryImageEmbedType, isImagesEmbedType, isLabelerRecordType, isListRuleType, isPostRecordType, isPostViewType, isProfileRecordType, isRecordEmbedType, isRecordWithMediaType, isSelfLabelsType, isVideoEmbedType, } from './types.js';
13
15
  import { parsePostgate, parseThreadGate } from './util.js';
@@ -121,24 +123,17 @@ export class Views {
121
123
  const threadgate = state.threadgates?.get(threadgateUri);
122
124
  return !!threadgate?.record?.hiddenReplies?.includes(replyUri);
123
125
  }
124
- profileDetailed(did, state) {
126
+ profileDetailed(did, state, opts) {
125
127
  const actor = state.actors?.get(did);
126
128
  if (!actor)
127
129
  return;
128
- const baseView = this.profile(did, state);
130
+ const baseView = this.profile(did, state, opts);
129
131
  if (!baseView)
130
132
  return;
131
- const knownFollowers = this.knownFollowers(did, state);
132
133
  const profileAggs = state.profileAggs?.get(did);
133
134
  return {
134
135
  ...baseView,
135
136
  website: this.profileWebsite(did, state),
136
- viewer: baseView.viewer
137
- ? {
138
- ...baseView.viewer,
139
- knownFollowers,
140
- }
141
- : undefined,
142
137
  banner: actor.profile?.banner
143
138
  ? this.imgUriBuilder.getPresetUri('banner', did, getBlobCidString(actor.profile.banner))
144
139
  : undefined,
@@ -163,13 +158,39 @@ export class Views {
163
158
  ? this.starterPackBasic(actor.profile.joinedViaStarterPack.uri, state)
164
159
  : undefined,
165
160
  pinnedPost: safePinnedPost(actor.profile?.pinnedPost),
161
+ links: this.profileLinks(did, state),
166
162
  };
167
163
  }
168
- profile(did, state) {
164
+ profileLinks(did, state) {
165
+ const refs = state.actors?.get(did)?.profile?.links;
166
+ if (!refs?.length)
167
+ return;
168
+ const links = [];
169
+ for (const ref of refs.slice(0, MAX_PROFILE_LINKS)) {
170
+ // the batch may include other actors' links, so check the repo here too
171
+ if (uriToDid(ref.uri) !== did)
172
+ continue;
173
+ // missing when taken down, deleted, or invalid
174
+ const link = state.profileLinks?.get(ref.uri);
175
+ if (!link || !isAllowedProfileLinkUrl(link.record.url))
176
+ continue;
177
+ links.push({
178
+ uri: ref.uri,
179
+ cid: link.cid,
180
+ url: link.record.url,
181
+ title: link.record.title,
182
+ icon: link.record.icon
183
+ ? this.imgUriBuilder.getPresetUri('avatar', did, getBlobCidString(link.record.icon))
184
+ : undefined,
185
+ });
186
+ }
187
+ return links.length ? links : undefined;
188
+ }
189
+ profile(did, state, opts) {
169
190
  const actor = state.actors?.get(did);
170
191
  if (!actor)
171
192
  return;
172
- const basicView = this.profileBasic(did, state);
193
+ const basicView = this.profileBasic(did, state, opts);
173
194
  if (!basicView)
174
195
  return;
175
196
  return {
@@ -183,7 +204,7 @@ export class Views {
183
204
  : undefined,
184
205
  };
185
206
  }
186
- profileBasic(did, state) {
207
+ profileBasic(did, state, opts) {
187
208
  const actor = state.actors?.get(did);
188
209
  if (!actor)
189
210
  return;
@@ -197,6 +218,12 @@ export class Views {
197
218
  record: actor.profile,
198
219
  }),
199
220
  ];
221
+ const viewer = this.profileViewer(did, state);
222
+ const knownFollowers = viewer && (opts?.includeKnownFollowers ?? true)
223
+ ? this.knownFollowers(did, state)
224
+ : undefined;
225
+ if (viewer && knownFollowers)
226
+ viewer.knownFollowers = knownFollowers;
200
227
  return {
201
228
  did,
202
229
  handle: actor.handle ?? INVALID_HANDLE,
@@ -218,7 +245,7 @@ export class Views {
218
245
  }
219
246
  : undefined,
220
247
  },
221
- viewer: this.profileViewer(did, state),
248
+ viewer,
222
249
  labels,
223
250
  createdAt: actor.createdAt
224
251
  ? actor.createdAt.toISOString()
@@ -239,24 +266,6 @@ export class Views {
239
266
  profileAssociatedActivitySubscription(actor) {
240
267
  return { allowSubscriptions: actor.allowActivitySubscriptionsFrom };
241
268
  }
242
- profileKnownFollowers(did, state) {
243
- const actor = state.actors?.get(did);
244
- if (!actor)
245
- return;
246
- const baseView = this.profile(did, state);
247
- if (!baseView)
248
- return;
249
- const knownFollowers = this.knownFollowers(did, state);
250
- return {
251
- ...baseView,
252
- viewer: baseView.viewer
253
- ? {
254
- ...baseView.viewer,
255
- knownFollowers,
256
- }
257
- : undefined,
258
- };
259
- }
260
269
  profileViewer(did, state) {
261
270
  const viewer = state.profileViewers?.get(did);
262
271
  if (!viewer)
@@ -337,7 +346,10 @@ export class Views {
337
346
  if (this.actorIsNoHosted(subjectDid, state)) {
338
347
  return undefined;
339
348
  }
340
- return this.profileBasic(subjectDid, state);
349
+ // @NOTE Nested known-subject views must not recursively expand social proof.
350
+ return this.profileBasic(subjectDid, state, {
351
+ includeKnownFollowers: false,
352
+ });
341
353
  });
342
354
  return { count, [key]: subjects };
343
355
  }
@@ -1586,6 +1598,10 @@ export class Views {
1586
1598
  aspectRatio: item.aspectRatio,
1587
1599
  });
1588
1600
  }
1601
+ /** Build a supported record modality from generic record and backlink hydration. */
1602
+ externalRecordView(uri, state, now = Date.now()) {
1603
+ return externalRecordViewBase(this, uri, state, now);
1604
+ }
1589
1605
  externalEmbed(did, embed, state) {
1590
1606
  // Start from the post-author-supplied embed values, then spread the
1591
1607
  // SS-derived view on top so any field the hydrated doc/publication
@@ -1646,7 +1662,7 @@ export class Views {
1646
1662
  /**
1647
1663
  * Compose-path entry point: caller already knows which document and
1648
1664
  * publication backed the request and has them in hand (e.g. from
1649
- * iterating the SS hydration maps directly). Skips the by-ref lookup
1665
+ * `getStandardSiteRecordsForUri`). Skips the by-ref lookup
1650
1666
  * that `externalEmbedFromStandardSite` does. Used by
1651
1667
  * `getEmbedExternalView`.
1652
1668
  *
@@ -1671,15 +1687,16 @@ export class Views {
1671
1687
  // 2. The lookups guarantee structural agreement between doc and pub
1672
1688
  // — matching `site`/`uri`, no orphan doc claiming a missing
1673
1689
  // publication (see `getSiteStandardRecordsFromHydrationMapsByRefs`
1674
- // and `…ByDocumentUri` in `hydration/external.ts`).
1675
- // 3. `validateStandardSiteForUrl` below checks that the records back
1676
- // the URL the embed claims (see `util/standard-site.ts`).
1690
+ // in `hydration/external.ts`).
1691
+ // 3. `validateStandardSiteRecordsForUrl` below re-checks the doc/pub
1692
+ // relationship and that the records back the URL the embed claims
1693
+ // (see `util/external/standard-site.ts`).
1677
1694
  //
1678
1695
  // If any layer rejected, callers see `undefined` and fall back to the
1679
1696
  // bare embed rather than render partial / disagreeing enrichment.
1680
1697
  if (!document && !publication)
1681
1698
  return undefined;
1682
- if (!validateStandardSiteForUrl(document, publication, assumedUrl)) {
1699
+ if (!validateStandardSiteRecordsForUrl(document, publication, assumedUrl)) {
1683
1700
  viewsLogger.warn({
1684
1701
  documentUri: document?.ref.uri,
1685
1702
  publicationUri: publication?.ref.uri,
@@ -2074,13 +2091,43 @@ export class Views {
2074
2091
  break;
2075
2092
  }
2076
2093
  case NOTIFICATION_REASON.REPOST:
2077
- kind = defs.repostGroup.$build({
2078
- post: notif.reasonSubject,
2079
- items: actorItems,
2080
- });
2094
+ kind =
2095
+ group.kind === APPVIEW_NOTIFICATION_REASON.MULTI_POST_REPOST &&
2096
+ group.items.length > 1
2097
+ ? defs.multiPostRepostGroup.$build({
2098
+ actor: newestItem.actorDid,
2099
+ items: group.items.map((item) => ({
2100
+ post: item.raw.reasonSubject,
2101
+ })),
2102
+ })
2103
+ : defs.repostGroup.$build({
2104
+ post: notif.reasonSubject,
2105
+ items: actorItems,
2106
+ });
2081
2107
  break;
2082
2108
  case NOTIFICATION_REASON.LIKE_VIA_REPOST:
2083
2109
  case NOTIFICATION_REASON.REPOST_VIA_REPOST: {
2110
+ if ((group.kind ===
2111
+ APPVIEW_NOTIFICATION_REASON.MULTI_POST_LIKE_VIA_REPOST ||
2112
+ group.kind ===
2113
+ APPVIEW_NOTIFICATION_REASON.MULTI_POST_REPOST_VIA_REPOST) &&
2114
+ group.items.length > 1) {
2115
+ const items = mapDefined(group.items, (item) => {
2116
+ const viaRepost = item.raw.reasonSubject;
2117
+ const post = state.reposts?.get(viaRepost)?.record.subject.uri;
2118
+ if (!post)
2119
+ return;
2120
+ return { post, viaRepost };
2121
+ });
2122
+ if (items.length !== group.items.length)
2123
+ return;
2124
+ const fields = { actor: newestItem.actorDid, items };
2125
+ kind =
2126
+ notif.reason === NOTIFICATION_REASON.LIKE_VIA_REPOST
2127
+ ? defs.multiPostLikeViaRepostGroup.$build(fields)
2128
+ : defs.multiPostRepostViaRepostGroup.$build(fields);
2129
+ break;
2130
+ }
2084
2131
  const subjectUri = notif.reasonSubject;
2085
2132
  const originalPostUri = state.reposts?.get(subjectUri)?.record.subject.uri;
2086
2133
  if (!originalPostUri)