@atproto/api 0.11.0-next → 0.11.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 (377) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +41 -58
  3. package/definitions/labels.json +3 -60
  4. package/dist/agent.d.ts +11 -5
  5. package/dist/bsky-agent.d.ts +5 -3
  6. package/dist/client/lexicons.d.ts +34 -3
  7. package/dist/client/types/app/bsky/actor/defs.d.ts +7 -7
  8. package/dist/client/types/app/bsky/feed/defs.d.ts +1 -0
  9. package/dist/client/types/app/bsky/graph/defs.d.ts +3 -0
  10. package/dist/client/types/com/atproto/label/defs.d.ts +2 -0
  11. package/dist/const.d.ts +1 -1
  12. package/dist/index.js +581 -204
  13. package/dist/index.js.map +3 -3
  14. package/dist/mocker.d.ts +2 -1
  15. package/dist/moderation/const/labels.d.ts +3 -3
  16. package/dist/moderation/decision.d.ts +2 -0
  17. package/dist/moderation/index.d.ts +1 -0
  18. package/dist/moderation/mutewords.d.ts +8 -0
  19. package/dist/moderation/subjects/feed-generator.d.ts +1 -1
  20. package/dist/moderation/subjects/user-list.d.ts +1 -1
  21. package/dist/moderation/types.d.ts +22 -6
  22. package/dist/moderation/util.d.ts +3 -3
  23. package/dist/types.d.ts +3 -4
  24. package/docs/moderation.md +204 -95
  25. package/package.json +9 -9
  26. package/scripts/code/labels.mjs +2 -2
  27. package/src/agent.ts +61 -16
  28. package/src/bsky-agent.ts +190 -71
  29. package/src/client/lexicons.ts +37 -5
  30. package/src/client/types/app/bsky/actor/defs.ts +11 -11
  31. package/src/client/types/app/bsky/feed/defs.ts +1 -0
  32. package/src/client/types/app/bsky/graph/defs.ts +3 -0
  33. package/src/client/types/com/atproto/label/defs.ts +4 -0
  34. package/src/const.ts +1 -1
  35. package/src/mocker.ts +4 -0
  36. package/src/moderation/const/labels.ts +9 -72
  37. package/src/moderation/decision.ts +82 -36
  38. package/src/moderation/index.ts +5 -24
  39. package/src/moderation/mutewords.ts +125 -0
  40. package/src/moderation/subjects/feed-generator.ts +18 -4
  41. package/src/moderation/subjects/notification.ts +7 -1
  42. package/src/moderation/subjects/post.ts +260 -1
  43. package/src/moderation/subjects/user-list.ts +38 -4
  44. package/src/moderation/types.ts +51 -12
  45. package/src/moderation/util.ts +33 -16
  46. package/src/types.ts +7 -3
  47. package/tests/agent.test.ts +71 -5
  48. package/tests/bsky-agent.test.ts +150 -217
  49. package/tests/moderation-behaviors.test.ts +5 -60
  50. package/tests/moderation-custom-labels.test.ts +46 -71
  51. package/tests/moderation-mutewords.test.ts +691 -0
  52. package/tests/moderation-prefs.test.ts +157 -92
  53. package/tests/moderation-quoteposts.test.ts +277 -0
  54. package/tests/moderation.test.ts +302 -38
  55. package/tests/util/moderation-behavior.ts +3 -1
  56. package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
  57. package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
  58. package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
  59. package/dist/client/types/app/bsky/actor/searchActor.d.ts +0 -22
  60. package/dist/client/types/app/bsky/actor/searchActorTypeahead.d.ts +0 -20
  61. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
  62. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -47
  63. package/dist/client/types/app/bsky/feed/bookmarkFeed.d.ts +0 -17
  64. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
  65. package/dist/client/types/app/bsky/feed/getBookmarkedFeeds.d.ts +0 -21
  66. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +0 -21
  67. package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
  68. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
  69. package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
  70. package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
  71. package/dist/client/types/app/bsky/feed/unbookmarkFeed.d.ts +0 -17
  72. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +0 -17
  73. package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
  74. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
  75. package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
  76. package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
  77. package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
  78. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
  79. package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
  80. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
  81. package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
  82. package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
  83. package/dist/client/types/app/bsky/moderation/defs.d.ts +0 -41
  84. package/dist/client/types/app/bsky/moderation/getService.d.ts +0 -16
  85. package/dist/client/types/app/bsky/moderation/getServices.d.ts +0 -23
  86. package/dist/client/types/app/bsky/moderation/service.d.ts +0 -14
  87. package/dist/client/types/app/bsky/notification/getCount.d.ts +0 -17
  88. package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
  89. package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
  90. package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
  91. package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
  92. package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
  93. package/dist/client/types/app/bsky/unspecced/applyLabels.d.ts +0 -18
  94. package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +0 -22
  95. package/dist/client/types/app/bsky/unspecced/getTimelineSkeleton.d.ts +0 -24
  96. package/dist/client/types/com/atproto/account/create.d.ts +0 -41
  97. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
  98. package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
  99. package/dist/client/types/com/atproto/account/get.d.ts +0 -12
  100. package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
  101. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
  102. package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
  103. package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
  104. package/dist/client/types/com/atproto/admin/createCommunicationTemplate.d.ts +0 -23
  105. package/dist/client/types/com/atproto/admin/deleteCommunicationTemplate.d.ts +0 -17
  106. package/dist/client/types/com/atproto/admin/emitModerationEvent.d.ts +0 -33
  107. package/dist/client/types/com/atproto/admin/getInviteCodeUsage.d.ts +0 -29
  108. package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +0 -16
  109. package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +0 -22
  110. package/dist/client/types/com/atproto/admin/getModerationEvent.d.ts +0 -16
  111. package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +0 -16
  112. package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +0 -28
  113. package/dist/client/types/com/atproto/admin/getRecord.d.ts +0 -20
  114. package/dist/client/types/com/atproto/admin/getRepo.d.ts +0 -19
  115. package/dist/client/types/com/atproto/admin/getSubjectState.d.ts +0 -26
  116. package/dist/client/types/com/atproto/admin/getUserAccountInfo.d.ts +0 -16
  117. package/dist/client/types/com/atproto/admin/listCommunicationTemplates.d.ts +0 -18
  118. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
  119. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
  120. package/dist/client/types/com/atproto/admin/queryModerationEvents.d.ts +0 -35
  121. package/dist/client/types/com/atproto/admin/queryModerationStatuses.d.ts +0 -37
  122. package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +0 -24
  123. package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
  124. package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
  125. package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +0 -22
  126. package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +0 -22
  127. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +0 -23
  128. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +0 -34
  129. package/dist/client/types/com/atproto/admin/updateCommunicationTemplate.d.ts +0 -25
  130. package/dist/client/types/com/atproto/admin/updateSubjectState.d.ts +0 -32
  131. package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
  132. package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
  133. package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
  134. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
  135. package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
  136. package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +0 -24
  137. package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
  138. package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
  139. package/dist/client/types/com/atproto/repo/uploadRepo.d.ts +0 -19
  140. package/dist/client/types/com/atproto/report/create.d.ts +0 -39
  141. package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
  142. package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
  143. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
  144. package/dist/client/types/com/atproto/server/getUserInviteCodes.d.ts +0 -31
  145. package/dist/client/types/com/atproto/session/create.d.ts +0 -29
  146. package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
  147. package/dist/client/types/com/atproto/session/get.d.ts +0 -18
  148. package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
  149. package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +0 -20
  150. package/dist/client/types/com/atproto/sync/getCurrent.d.ts +0 -22
  151. package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -21
  152. package/dist/client/types/com/atproto/sync/importRepo.d.ts +0 -16
  153. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
  154. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
  155. package/dist/client/types/com/atproto/temp/importRepo.d.ts +0 -16
  156. package/dist/client/types/com/atproto/temp/pushBlob.d.ts +0 -15
  157. package/dist/client/types/com/atproto/temp/transferAccount.d.ts +0 -48
  158. package/dist/client/types/com/atproto/temp/upgradeRepoVersion.d.ts +0 -18
  159. package/dist/moderation/accumulator.d.ts +0 -16
  160. package/dist/moderation/const/label-groups.d.ts +0 -2
  161. package/dist/moderation/subjects/quoted-post.d.ts +0 -6
  162. package/dist/session.d.ts +0 -42
  163. package/dist/src/client/index.d.ts +0 -462
  164. package/dist/src/client/lexicons.d.ts +0 -2910
  165. package/dist/src/client/schemas.d.ts +0 -17
  166. package/dist/src/client/types/app/bsky/actor/createScene.d.ts +0 -32
  167. package/dist/src/client/types/app/bsky/actor/getProfile.d.ts +0 -36
  168. package/dist/src/client/types/app/bsky/actor/getSuggestions.d.ts +0 -36
  169. package/dist/src/client/types/app/bsky/actor/profile.d.ts +0 -15
  170. package/dist/src/client/types/app/bsky/actor/ref.d.ts +0 -14
  171. package/dist/src/client/types/app/bsky/actor/search.d.ts +0 -32
  172. package/dist/src/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -28
  173. package/dist/src/client/types/app/bsky/actor/updateProfile.d.ts +0 -48
  174. package/dist/src/client/types/app/bsky/badge.d.ts +0 -22
  175. package/dist/src/client/types/app/bsky/badgeAccept.d.ts +0 -11
  176. package/dist/src/client/types/app/bsky/badgeOffer.d.ts +0 -11
  177. package/dist/src/client/types/app/bsky/declaration.d.ts +0 -6
  178. package/dist/src/client/types/app/bsky/embed/external.d.ts +0 -26
  179. package/dist/src/client/types/app/bsky/embed/images.d.ts +0 -23
  180. package/dist/src/client/types/app/bsky/feed/embed.d.ts +0 -36
  181. package/dist/src/client/types/app/bsky/feed/feedViewPost.d.ts +0 -26
  182. package/dist/src/client/types/app/bsky/feed/getAuthorFeed.d.ts +0 -22
  183. package/dist/src/client/types/app/bsky/feed/getPostThread.d.ts +0 -43
  184. package/dist/src/client/types/app/bsky/feed/getRepostedBy.d.ts +0 -35
  185. package/dist/src/client/types/app/bsky/feed/getTimeline.d.ts +0 -22
  186. package/dist/src/client/types/app/bsky/feed/getVotes.d.ts +0 -33
  187. package/dist/src/client/types/app/bsky/feed/mediaEmbed.d.ts +0 -18
  188. package/dist/src/client/types/app/bsky/feed/post.d.ts +0 -54
  189. package/dist/src/client/types/app/bsky/feed/repost.d.ts +0 -6
  190. package/dist/src/client/types/app/bsky/feed/setVote.d.ts +0 -25
  191. package/dist/src/client/types/app/bsky/feed/trend.d.ts +0 -6
  192. package/dist/src/client/types/app/bsky/feed/vote.d.ts +0 -7
  193. package/dist/src/client/types/app/bsky/follow.d.ts +0 -9
  194. package/dist/src/client/types/app/bsky/getAuthorFeed.d.ts +0 -56
  195. package/dist/src/client/types/app/bsky/getBadgeMembers.d.ts +0 -29
  196. package/dist/src/client/types/app/bsky/getHomeFeed.d.ts +0 -56
  197. package/dist/src/client/types/app/bsky/getLikedBy.d.ts +0 -29
  198. package/dist/src/client/types/app/bsky/getNotificationCount.d.ts +0 -16
  199. package/dist/src/client/types/app/bsky/getNotifications.d.ts +0 -33
  200. package/dist/src/client/types/app/bsky/getPostThread.d.ts +0 -55
  201. package/dist/src/client/types/app/bsky/getProfile.d.ts +0 -26
  202. package/dist/src/client/types/app/bsky/getRepostedBy.d.ts +0 -29
  203. package/dist/src/client/types/app/bsky/getTimeline.d.ts +0 -56
  204. package/dist/src/client/types/app/bsky/getUserFollowers.d.ts +0 -31
  205. package/dist/src/client/types/app/bsky/getUserFollows.d.ts +0 -31
  206. package/dist/src/client/types/app/bsky/getUsersSearch.d.ts +0 -26
  207. package/dist/src/client/types/app/bsky/getUsersTypeahead.d.ts +0 -22
  208. package/dist/src/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
  209. package/dist/src/client/types/app/bsky/graph/assertMember.d.ts +0 -1
  210. package/dist/src/client/types/app/bsky/graph/assertion.d.ts +0 -7
  211. package/dist/src/client/types/app/bsky/graph/confirmation.d.ts +0 -8
  212. package/dist/src/client/types/app/bsky/graph/follow.d.ts +0 -6
  213. package/dist/src/client/types/app/bsky/graph/getAssertions.d.ts +0 -43
  214. package/dist/src/client/types/app/bsky/graph/getFollowers.d.ts +0 -34
  215. package/dist/src/client/types/app/bsky/graph/getFollows.d.ts +0 -33
  216. package/dist/src/client/types/app/bsky/graph/getMembers.d.ts +0 -33
  217. package/dist/src/client/types/app/bsky/graph/getMemberships.d.ts +0 -33
  218. package/dist/src/client/types/app/bsky/invite.d.ts +0 -10
  219. package/dist/src/client/types/app/bsky/inviteAccept.d.ts +0 -14
  220. package/dist/src/client/types/app/bsky/like.d.ts +0 -10
  221. package/dist/src/client/types/app/bsky/mediaEmbed.d.ts +0 -15
  222. package/dist/src/client/types/app/bsky/notification/getCount.d.ts +0 -17
  223. package/dist/src/client/types/app/bsky/notification/list.d.ts +0 -32
  224. package/dist/src/client/types/app/bsky/notification/updateSeen.d.ts +0 -17
  225. package/dist/src/client/types/app/bsky/post.d.ts +0 -23
  226. package/dist/src/client/types/app/bsky/postNotificationsSeen.d.ts +0 -20
  227. package/dist/src/client/types/app/bsky/profile.d.ts +0 -5
  228. package/dist/src/client/types/app/bsky/repost.d.ts +0 -10
  229. package/dist/src/client/types/app/bsky/system/actorScene.d.ts +0 -1
  230. package/dist/src/client/types/app/bsky/system/actorUser.d.ts +0 -1
  231. package/dist/src/client/types/app/bsky/system/declRef.d.ts +0 -5
  232. package/dist/src/client/types/app/bsky/system/declaration.d.ts +0 -4
  233. package/dist/src/client/types/app/bsky/updateProfile.d.ts +0 -23
  234. package/dist/src/client/types/com/atproto/account/create.d.ts +0 -41
  235. package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
  236. package/dist/src/client/types/com/atproto/account/delete.d.ts +0 -13
  237. package/dist/src/client/types/com/atproto/account/get.d.ts +0 -12
  238. package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
  239. package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +0 -24
  240. package/dist/src/client/types/com/atproto/blob/upload.d.ts +0 -19
  241. package/dist/src/client/types/com/atproto/createAccount.d.ts +0 -40
  242. package/dist/src/client/types/com/atproto/createInviteCode.d.ts +0 -20
  243. package/dist/src/client/types/com/atproto/createSession.d.ts +0 -24
  244. package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +0 -19
  245. package/dist/src/client/types/com/atproto/deleteAccount.d.ts +0 -20
  246. package/dist/src/client/types/com/atproto/deleteSession.d.ts +0 -17
  247. package/dist/src/client/types/com/atproto/getAccount.d.ts +0 -16
  248. package/dist/src/client/types/com/atproto/getAccountsConfig.d.ts +0 -17
  249. package/dist/src/client/types/com/atproto/getSession.d.ts +0 -17
  250. package/dist/src/client/types/com/atproto/handle/resolve.d.ts +0 -18
  251. package/dist/src/client/types/com/atproto/refreshSession.d.ts +0 -20
  252. package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +0 -39
  253. package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +0 -26
  254. package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +0 -19
  255. package/dist/src/client/types/com/atproto/repo/describe.d.ts +0 -22
  256. package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +0 -23
  257. package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +0 -30
  258. package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +0 -27
  259. package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +0 -5
  260. package/dist/src/client/types/com/atproto/repoBatchWrite.d.ts +0 -36
  261. package/dist/src/client/types/com/atproto/repoCreateRecord.d.ts +0 -24
  262. package/dist/src/client/types/com/atproto/repoDeleteRecord.d.ts +0 -18
  263. package/dist/src/client/types/com/atproto/repoDescribe.d.ts +0 -21
  264. package/dist/src/client/types/com/atproto/repoGetRecord.d.ts +0 -22
  265. package/dist/src/client/types/com/atproto/repoListRecords.d.ts +0 -27
  266. package/dist/src/client/types/com/atproto/repoPutRecord.d.ts +0 -25
  267. package/dist/src/client/types/com/atproto/requestAccountPasswordReset.d.ts +0 -19
  268. package/dist/src/client/types/com/atproto/resetAccountPassword.d.ts +0 -26
  269. package/dist/src/client/types/com/atproto/resolveHandle.d.ts +0 -17
  270. package/dist/src/client/types/com/atproto/resolveName.d.ts +0 -17
  271. package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -24
  272. package/dist/src/client/types/com/atproto/session/create.d.ts +0 -26
  273. package/dist/src/client/types/com/atproto/session/delete.d.ts +0 -13
  274. package/dist/src/client/types/com/atproto/session/get.d.ts +0 -18
  275. package/dist/src/client/types/com/atproto/session/refresh.d.ts +0 -21
  276. package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +0 -15
  277. package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +0 -18
  278. package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
  279. package/dist/src/client/types/com/atproto/syncGetRepo.d.ts +0 -15
  280. package/dist/src/client/types/com/atproto/syncGetRoot.d.ts +0 -17
  281. package/dist/src/client/types/com/atproto/syncUpdateRepo.d.ts +0 -15
  282. package/dist/src/index.d.ts +0 -4
  283. package/dist/src/schemas.d.ts +0 -19
  284. package/dist/src/session.d.ts +0 -42
  285. package/dist/src/types/app/bsky/acceptedBadge.d.ts +0 -10
  286. package/dist/src/types/app/bsky/badge.d.ts +0 -22
  287. package/dist/src/types/app/bsky/badgeAccept.d.ts +0 -11
  288. package/dist/src/types/app/bsky/badgeOffer.d.ts +0 -11
  289. package/dist/src/types/app/bsky/declaration.d.ts +0 -6
  290. package/dist/src/types/app/bsky/follow.d.ts +0 -9
  291. package/dist/src/types/app/bsky/getAuthorFeed.d.ts +0 -56
  292. package/dist/src/types/app/bsky/getBadgeMembers.d.ts +0 -29
  293. package/dist/src/types/app/bsky/getHomeFeed.d.ts +0 -56
  294. package/dist/src/types/app/bsky/getLikedBy.d.ts +0 -29
  295. package/dist/src/types/app/bsky/getNotificationCount.d.ts +0 -16
  296. package/dist/src/types/app/bsky/getNotifications.d.ts +0 -33
  297. package/dist/src/types/app/bsky/getPostThread.d.ts +0 -55
  298. package/dist/src/types/app/bsky/getProfile.d.ts +0 -42
  299. package/dist/src/types/app/bsky/getRepostedBy.d.ts +0 -29
  300. package/dist/src/types/app/bsky/getUserFollowers.d.ts +0 -31
  301. package/dist/src/types/app/bsky/getUserFollows.d.ts +0 -31
  302. package/dist/src/types/app/bsky/getUsersSearch.d.ts +0 -26
  303. package/dist/src/types/app/bsky/getUsersTypeahead.d.ts +0 -22
  304. package/dist/src/types/app/bsky/invite.d.ts +0 -10
  305. package/dist/src/types/app/bsky/inviteAccept.d.ts +0 -14
  306. package/dist/src/types/app/bsky/like.d.ts +0 -10
  307. package/dist/src/types/app/bsky/mediaEmbed.d.ts +0 -15
  308. package/dist/src/types/app/bsky/post.d.ts +0 -23
  309. package/dist/src/types/app/bsky/postNotificationsSeen.d.ts +0 -19
  310. package/dist/src/types/app/bsky/profile.d.ts +0 -11
  311. package/dist/src/types/app/bsky/repost.d.ts +0 -10
  312. package/dist/src/types/app/bsky/updateProfile.d.ts +0 -27
  313. package/dist/src/types/com/atproto/createAccount.d.ts +0 -39
  314. package/dist/src/types/com/atproto/createInviteCode.d.ts +0 -19
  315. package/dist/src/types/com/atproto/createSession.d.ts +0 -23
  316. package/dist/src/types/com/atproto/deleteAccount.d.ts +0 -19
  317. package/dist/src/types/com/atproto/deleteSession.d.ts +0 -16
  318. package/dist/src/types/com/atproto/getAccount.d.ts +0 -19
  319. package/dist/src/types/com/atproto/getAccountsConfig.d.ts +0 -17
  320. package/dist/src/types/com/atproto/getSession.d.ts +0 -17
  321. package/dist/src/types/com/atproto/refreshSession.d.ts +0 -19
  322. package/dist/src/types/com/atproto/repoBatchWrite.d.ts +0 -35
  323. package/dist/src/types/com/atproto/repoCreateRecord.d.ts +0 -23
  324. package/dist/src/types/com/atproto/repoDeleteRecord.d.ts +0 -15
  325. package/dist/src/types/com/atproto/repoDescribe.d.ts +0 -21
  326. package/dist/src/types/com/atproto/repoGetRecord.d.ts +0 -22
  327. package/dist/src/types/com/atproto/repoListRecords.d.ts +0 -27
  328. package/dist/src/types/com/atproto/repoPutRecord.d.ts +0 -24
  329. package/dist/src/types/com/atproto/requestAccountPasswordReset.d.ts +0 -18
  330. package/dist/src/types/com/atproto/resetAccountPassword.d.ts +0 -25
  331. package/dist/src/types/com/atproto/resolveName.d.ts +0 -17
  332. package/dist/src/types/com/atproto/syncGetRepo.d.ts +0 -15
  333. package/dist/src/types/com/atproto/syncGetRoot.d.ts +0 -17
  334. package/dist/src/types/com/atproto/syncUpdateRepo.d.ts +0 -14
  335. package/dist/src/types/todo/adx/createAccount.d.ts +0 -36
  336. package/dist/src/types/todo/adx/createInviteCode.d.ts +0 -19
  337. package/dist/src/types/todo/adx/createSession.d.ts +0 -22
  338. package/dist/src/types/todo/adx/deleteAccount.d.ts +0 -19
  339. package/dist/src/types/todo/adx/deleteSession.d.ts +0 -19
  340. package/dist/src/types/todo/adx/getAccount.d.ts +0 -19
  341. package/dist/src/types/todo/adx/getAccountsConfig.d.ts +0 -17
  342. package/dist/src/types/todo/adx/getSession.d.ts +0 -17
  343. package/dist/src/types/todo/adx/repoBatchWrite.d.ts +0 -34
  344. package/dist/src/types/todo/adx/repoCreateRecord.d.ts +0 -22
  345. package/dist/src/types/todo/adx/repoDeleteRecord.d.ts +0 -15
  346. package/dist/src/types/todo/adx/repoDescribe.d.ts +0 -21
  347. package/dist/src/types/todo/adx/repoGetRecord.d.ts +0 -20
  348. package/dist/src/types/todo/adx/repoListRecords.d.ts +0 -25
  349. package/dist/src/types/todo/adx/repoPutRecord.d.ts +0 -23
  350. package/dist/src/types/todo/adx/requestAccountPasswordReset.d.ts +0 -18
  351. package/dist/src/types/todo/adx/resetAccountPassword.d.ts +0 -25
  352. package/dist/src/types/todo/adx/resolveName.d.ts +0 -17
  353. package/dist/src/types/todo/adx/syncGetRepo.d.ts +0 -15
  354. package/dist/src/types/todo/adx/syncGetRoot.d.ts +0 -17
  355. package/dist/src/types/todo/adx/syncUpdateRepo.d.ts +0 -14
  356. package/dist/src/types/todo/social/badge.d.ts +0 -23
  357. package/dist/src/types/todo/social/follow.d.ts +0 -5
  358. package/dist/src/types/todo/social/getAuthorFeed.d.ts +0 -55
  359. package/dist/src/types/todo/social/getFeed.d.ts +0 -55
  360. package/dist/src/types/todo/social/getHomeFeed.d.ts +0 -55
  361. package/dist/src/types/todo/social/getLikedBy.d.ts +0 -26
  362. package/dist/src/types/todo/social/getNotificationCount.d.ts +0 -16
  363. package/dist/src/types/todo/social/getNotifications.d.ts +0 -31
  364. package/dist/src/types/todo/social/getPostThread.d.ts +0 -54
  365. package/dist/src/types/todo/social/getProfile.d.ts +0 -40
  366. package/dist/src/types/todo/social/getRepostedBy.d.ts +0 -26
  367. package/dist/src/types/todo/social/getUserFollowers.d.ts +0 -30
  368. package/dist/src/types/todo/social/getUserFollows.d.ts +0 -30
  369. package/dist/src/types/todo/social/like.d.ts +0 -5
  370. package/dist/src/types/todo/social/mediaEmbed.d.ts +0 -15
  371. package/dist/src/types/todo/social/post.d.ts +0 -18
  372. package/dist/src/types/todo/social/postNotificationsSeen.d.ts +0 -19
  373. package/dist/src/types/todo/social/profile.d.ts +0 -10
  374. package/dist/src/types/todo/social/repost.d.ts +0 -5
  375. package/docs/labels.md +0 -108
  376. package/scripts/docs/labels.mjs +0 -87
  377. package/scripts/generate-docs.mjs +0 -3
@@ -3,7 +3,6 @@ import {
3
3
  BskyAgent,
4
4
  ComAtprotoRepoPutRecord,
5
5
  AppBskyActorProfile,
6
- BSKY_MODSERVICE_DID,
7
6
  DEFAULT_LABEL_SETTINGS,
8
7
  } from '..'
9
8
 
@@ -34,6 +33,13 @@ describe('agent', () => {
34
33
  }
35
34
  }
36
35
 
36
+ it('clones correctly', () => {
37
+ const agent = new BskyAgent({ service: network.pds.url })
38
+ const agent2 = agent.clone()
39
+ expect(agent2 instanceof BskyAgent).toBeTruthy()
40
+ expect(agent.service).toEqual(agent2.service)
41
+ })
42
+
37
43
  it('upsertProfile correctly creates and updates profiles.', async () => {
38
44
  const agent = new BskyAgent({ service: network.pds.url })
39
45
 
@@ -224,17 +230,19 @@ describe('agent', () => {
224
230
  password: 'password',
225
231
  })
226
232
 
233
+ const DEFAULT_LABELERS = BskyAgent.appLabelers.map((did) => ({
234
+ did,
235
+ labels: {},
236
+ }))
237
+
227
238
  await expect(agent.getPreferences()).resolves.toStrictEqual({
228
239
  feeds: { pinned: undefined, saved: undefined },
229
240
  moderationPrefs: {
230
241
  adultContentEnabled: false,
231
242
  labels: DEFAULT_LABEL_SETTINGS,
232
- mods: [
233
- {
234
- did: BSKY_MODSERVICE_DID,
235
- labels: {},
236
- },
237
- ],
243
+ labelers: DEFAULT_LABELERS,
244
+ mutedWords: [],
245
+ hiddenPosts: [],
238
246
  },
239
247
  birthDate: undefined,
240
248
  feedViewPrefs: {
@@ -253,8 +261,6 @@ describe('agent', () => {
253
261
  interests: {
254
262
  tags: [],
255
263
  },
256
- mutedWords: [],
257
- hiddenPosts: [],
258
264
  })
259
265
 
260
266
  await agent.setAdultContentEnabled(true)
@@ -263,12 +269,9 @@ describe('agent', () => {
263
269
  moderationPrefs: {
264
270
  adultContentEnabled: true,
265
271
  labels: DEFAULT_LABEL_SETTINGS,
266
- mods: [
267
- {
268
- did: BSKY_MODSERVICE_DID,
269
- labels: {},
270
- },
271
- ],
272
+ labelers: DEFAULT_LABELERS,
273
+ mutedWords: [],
274
+ hiddenPosts: [],
272
275
  },
273
276
  birthDate: undefined,
274
277
  feedViewPrefs: {
@@ -287,8 +290,6 @@ describe('agent', () => {
287
290
  interests: {
288
291
  tags: [],
289
292
  },
290
- mutedWords: [],
291
- hiddenPosts: [],
292
293
  })
293
294
 
294
295
  await agent.setAdultContentEnabled(false)
@@ -297,12 +298,9 @@ describe('agent', () => {
297
298
  moderationPrefs: {
298
299
  adultContentEnabled: false,
299
300
  labels: DEFAULT_LABEL_SETTINGS,
300
- mods: [
301
- {
302
- did: BSKY_MODSERVICE_DID,
303
- labels: {},
304
- },
305
- ],
301
+ labelers: DEFAULT_LABELERS,
302
+ mutedWords: [],
303
+ hiddenPosts: [],
306
304
  },
307
305
  birthDate: undefined,
308
306
  feedViewPrefs: {
@@ -321,8 +319,6 @@ describe('agent', () => {
321
319
  interests: {
322
320
  tags: [],
323
321
  },
324
- mutedWords: [],
325
- hiddenPosts: [],
326
322
  })
327
323
 
328
324
  await agent.setContentLabelPref('misinfo', 'hide')
@@ -331,12 +327,9 @@ describe('agent', () => {
331
327
  moderationPrefs: {
332
328
  adultContentEnabled: false,
333
329
  labels: { ...DEFAULT_LABEL_SETTINGS, misinfo: 'hide' },
334
- mods: [
335
- {
336
- did: BSKY_MODSERVICE_DID,
337
- labels: {},
338
- },
339
- ],
330
+ labelers: DEFAULT_LABELERS,
331
+ mutedWords: [],
332
+ hiddenPosts: [],
340
333
  },
341
334
  birthDate: undefined,
342
335
  feedViewPrefs: {
@@ -355,8 +348,6 @@ describe('agent', () => {
355
348
  interests: {
356
349
  tags: [],
357
350
  },
358
- mutedWords: [],
359
- hiddenPosts: [],
360
351
  })
361
352
 
362
353
  await agent.setContentLabelPref('spam', 'ignore')
@@ -369,12 +360,9 @@ describe('agent', () => {
369
360
  misinfo: 'hide',
370
361
  spam: 'ignore',
371
362
  },
372
- mods: [
373
- {
374
- did: BSKY_MODSERVICE_DID,
375
- labels: {},
376
- },
377
- ],
363
+ labelers: DEFAULT_LABELERS,
364
+ mutedWords: [],
365
+ hiddenPosts: [],
378
366
  },
379
367
  birthDate: undefined,
380
368
  feedViewPrefs: {
@@ -393,8 +381,6 @@ describe('agent', () => {
393
381
  interests: {
394
382
  tags: [],
395
383
  },
396
- mutedWords: [],
397
- hiddenPosts: [],
398
384
  })
399
385
 
400
386
  await agent.addSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -410,12 +396,9 @@ describe('agent', () => {
410
396
  misinfo: 'hide',
411
397
  spam: 'ignore',
412
398
  },
413
- mods: [
414
- {
415
- did: BSKY_MODSERVICE_DID,
416
- labels: {},
417
- },
418
- ],
399
+ labelers: DEFAULT_LABELERS,
400
+ mutedWords: [],
401
+ hiddenPosts: [],
419
402
  },
420
403
  birthDate: undefined,
421
404
  feedViewPrefs: {
@@ -434,8 +417,6 @@ describe('agent', () => {
434
417
  interests: {
435
418
  tags: [],
436
419
  },
437
- mutedWords: [],
438
- hiddenPosts: [],
439
420
  })
440
421
 
441
422
  await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -451,12 +432,9 @@ describe('agent', () => {
451
432
  misinfo: 'hide',
452
433
  spam: 'ignore',
453
434
  },
454
- mods: [
455
- {
456
- did: BSKY_MODSERVICE_DID,
457
- labels: {},
458
- },
459
- ],
435
+ labelers: DEFAULT_LABELERS,
436
+ mutedWords: [],
437
+ hiddenPosts: [],
460
438
  },
461
439
  birthDate: undefined,
462
440
  feedViewPrefs: {
@@ -475,8 +453,6 @@ describe('agent', () => {
475
453
  interests: {
476
454
  tags: [],
477
455
  },
478
- mutedWords: [],
479
- hiddenPosts: [],
480
456
  })
481
457
 
482
458
  await agent.removePinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -492,12 +468,9 @@ describe('agent', () => {
492
468
  misinfo: 'hide',
493
469
  spam: 'ignore',
494
470
  },
495
- mods: [
496
- {
497
- did: BSKY_MODSERVICE_DID,
498
- labels: {},
499
- },
500
- ],
471
+ labelers: DEFAULT_LABELERS,
472
+ mutedWords: [],
473
+ hiddenPosts: [],
501
474
  },
502
475
  birthDate: undefined,
503
476
  feedViewPrefs: {
@@ -516,8 +489,6 @@ describe('agent', () => {
516
489
  interests: {
517
490
  tags: [],
518
491
  },
519
- mutedWords: [],
520
- hiddenPosts: [],
521
492
  })
522
493
 
523
494
  await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -533,12 +504,9 @@ describe('agent', () => {
533
504
  misinfo: 'hide',
534
505
  spam: 'ignore',
535
506
  },
536
- mods: [
537
- {
538
- did: BSKY_MODSERVICE_DID,
539
- labels: {},
540
- },
541
- ],
507
+ labelers: DEFAULT_LABELERS,
508
+ mutedWords: [],
509
+ hiddenPosts: [],
542
510
  },
543
511
  birthDate: undefined,
544
512
  feedViewPrefs: {
@@ -557,8 +525,6 @@ describe('agent', () => {
557
525
  interests: {
558
526
  tags: [],
559
527
  },
560
- mutedWords: [],
561
- hiddenPosts: [],
562
528
  })
563
529
 
564
530
  await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -574,12 +540,9 @@ describe('agent', () => {
574
540
  misinfo: 'hide',
575
541
  spam: 'ignore',
576
542
  },
577
- mods: [
578
- {
579
- did: BSKY_MODSERVICE_DID,
580
- labels: {},
581
- },
582
- ],
543
+ labelers: DEFAULT_LABELERS,
544
+ mutedWords: [],
545
+ hiddenPosts: [],
583
546
  },
584
547
  birthDate: undefined,
585
548
  feedViewPrefs: {
@@ -598,8 +561,6 @@ describe('agent', () => {
598
561
  interests: {
599
562
  tags: [],
600
563
  },
601
- mutedWords: [],
602
- hiddenPosts: [],
603
564
  })
604
565
 
605
566
  await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake2')
@@ -621,12 +582,9 @@ describe('agent', () => {
621
582
  misinfo: 'hide',
622
583
  spam: 'ignore',
623
584
  },
624
- mods: [
625
- {
626
- did: BSKY_MODSERVICE_DID,
627
- labels: {},
628
- },
629
- ],
585
+ labelers: DEFAULT_LABELERS,
586
+ mutedWords: [],
587
+ hiddenPosts: [],
630
588
  },
631
589
  birthDate: undefined,
632
590
  feedViewPrefs: {
@@ -645,8 +603,6 @@ describe('agent', () => {
645
603
  interests: {
646
604
  tags: [],
647
605
  },
648
- mutedWords: [],
649
- hiddenPosts: [],
650
606
  })
651
607
 
652
608
  await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -662,12 +618,9 @@ describe('agent', () => {
662
618
  misinfo: 'hide',
663
619
  spam: 'ignore',
664
620
  },
665
- mods: [
666
- {
667
- did: BSKY_MODSERVICE_DID,
668
- labels: {},
669
- },
670
- ],
621
+ labelers: DEFAULT_LABELERS,
622
+ mutedWords: [],
623
+ hiddenPosts: [],
671
624
  },
672
625
  birthDate: undefined,
673
626
  feedViewPrefs: {
@@ -686,8 +639,6 @@ describe('agent', () => {
686
639
  interests: {
687
640
  tags: [],
688
641
  },
689
- mutedWords: [],
690
- hiddenPosts: [],
691
642
  })
692
643
 
693
644
  await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
@@ -703,12 +654,9 @@ describe('agent', () => {
703
654
  misinfo: 'hide',
704
655
  spam: 'ignore',
705
656
  },
706
- mods: [
707
- {
708
- did: BSKY_MODSERVICE_DID,
709
- labels: {},
710
- },
711
- ],
657
+ labelers: DEFAULT_LABELERS,
658
+ mutedWords: [],
659
+ hiddenPosts: [],
712
660
  },
713
661
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
714
662
  feedViewPrefs: {
@@ -727,8 +675,6 @@ describe('agent', () => {
727
675
  interests: {
728
676
  tags: [],
729
677
  },
730
- mutedWords: [],
731
- hiddenPosts: [],
732
678
  })
733
679
 
734
680
  await agent.setFeedViewPrefs('home', { hideReplies: true })
@@ -744,12 +690,9 @@ describe('agent', () => {
744
690
  misinfo: 'hide',
745
691
  spam: 'ignore',
746
692
  },
747
- mods: [
748
- {
749
- did: BSKY_MODSERVICE_DID,
750
- labels: {},
751
- },
752
- ],
693
+ labelers: DEFAULT_LABELERS,
694
+ mutedWords: [],
695
+ hiddenPosts: [],
753
696
  },
754
697
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
755
698
  feedViewPrefs: {
@@ -768,8 +711,6 @@ describe('agent', () => {
768
711
  interests: {
769
712
  tags: [],
770
713
  },
771
- mutedWords: [],
772
- hiddenPosts: [],
773
714
  })
774
715
 
775
716
  await agent.setFeedViewPrefs('home', { hideReplies: false })
@@ -785,12 +726,9 @@ describe('agent', () => {
785
726
  misinfo: 'hide',
786
727
  spam: 'ignore',
787
728
  },
788
- mods: [
789
- {
790
- did: BSKY_MODSERVICE_DID,
791
- labels: {},
792
- },
793
- ],
729
+ labelers: DEFAULT_LABELERS,
730
+ mutedWords: [],
731
+ hiddenPosts: [],
794
732
  },
795
733
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
796
734
  feedViewPrefs: {
@@ -809,8 +747,6 @@ describe('agent', () => {
809
747
  interests: {
810
748
  tags: [],
811
749
  },
812
- mutedWords: [],
813
- hiddenPosts: [],
814
750
  })
815
751
 
816
752
  await agent.setFeedViewPrefs('other', { hideReplies: true })
@@ -826,12 +762,9 @@ describe('agent', () => {
826
762
  misinfo: 'hide',
827
763
  spam: 'ignore',
828
764
  },
829
- mods: [
830
- {
831
- did: BSKY_MODSERVICE_DID,
832
- labels: {},
833
- },
834
- ],
765
+ labelers: DEFAULT_LABELERS,
766
+ mutedWords: [],
767
+ hiddenPosts: [],
835
768
  },
836
769
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
837
770
  feedViewPrefs: {
@@ -857,8 +790,6 @@ describe('agent', () => {
857
790
  interests: {
858
791
  tags: [],
859
792
  },
860
- mutedWords: [],
861
- hiddenPosts: [],
862
793
  })
863
794
 
864
795
  await agent.setThreadViewPrefs({ sort: 'random' })
@@ -874,12 +805,9 @@ describe('agent', () => {
874
805
  misinfo: 'hide',
875
806
  spam: 'ignore',
876
807
  },
877
- mods: [
878
- {
879
- did: BSKY_MODSERVICE_DID,
880
- labels: {},
881
- },
882
- ],
808
+ labelers: DEFAULT_LABELERS,
809
+ mutedWords: [],
810
+ hiddenPosts: [],
883
811
  },
884
812
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
885
813
  feedViewPrefs: {
@@ -905,8 +833,6 @@ describe('agent', () => {
905
833
  interests: {
906
834
  tags: [],
907
835
  },
908
- mutedWords: [],
909
- hiddenPosts: [],
910
836
  })
911
837
 
912
838
  await agent.setThreadViewPrefs({ sort: 'oldest' })
@@ -922,12 +848,9 @@ describe('agent', () => {
922
848
  misinfo: 'hide',
923
849
  spam: 'ignore',
924
850
  },
925
- mods: [
926
- {
927
- did: BSKY_MODSERVICE_DID,
928
- labels: {},
929
- },
930
- ],
851
+ labelers: DEFAULT_LABELERS,
852
+ mutedWords: [],
853
+ hiddenPosts: [],
931
854
  },
932
855
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
933
856
  feedViewPrefs: {
@@ -953,8 +876,6 @@ describe('agent', () => {
953
876
  interests: {
954
877
  tags: [],
955
878
  },
956
- mutedWords: [],
957
- hiddenPosts: [],
958
879
  })
959
880
 
960
881
  await agent.setInterestsPref({ tags: ['foo', 'bar'] })
@@ -970,12 +891,9 @@ describe('agent', () => {
970
891
  misinfo: 'hide',
971
892
  spam: 'ignore',
972
893
  },
973
- mods: [
974
- {
975
- did: BSKY_MODSERVICE_DID,
976
- labels: {},
977
- },
978
- ],
894
+ labelers: DEFAULT_LABELERS,
895
+ mutedWords: [],
896
+ hiddenPosts: [],
979
897
  },
980
898
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
981
899
  feedViewPrefs: {
@@ -1001,8 +919,6 @@ describe('agent', () => {
1001
919
  interests: {
1002
920
  tags: ['foo', 'bar'],
1003
921
  },
1004
- mutedWords: [],
1005
- hiddenPosts: [],
1006
922
  })
1007
923
  })
1008
924
 
@@ -1038,18 +954,18 @@ describe('agent', () => {
1038
954
  visibility: 'warn',
1039
955
  },
1040
956
  {
1041
- $type: 'app.bsky.actor.defs#modsPref',
1042
- mods: [
957
+ $type: 'app.bsky.actor.defs#labelersPref',
958
+ labelers: [
1043
959
  {
1044
- did: BSKY_MODSERVICE_DID,
960
+ did: 'did:plc:first-labeler',
1045
961
  },
1046
962
  ],
1047
963
  },
1048
964
  {
1049
- $type: 'app.bsky.actor.defs#modsPref',
1050
- mods: [
965
+ $type: 'app.bsky.actor.defs#labelersPref',
966
+ labelers: [
1051
967
  {
1052
- did: BSKY_MODSERVICE_DID,
968
+ did: 'did:plc:first-labeler',
1053
969
  },
1054
970
  {
1055
971
  did: 'did:plc:other',
@@ -1133,9 +1049,10 @@ describe('agent', () => {
1133
1049
  ...DEFAULT_LABEL_SETTINGS,
1134
1050
  porn: 'warn',
1135
1051
  },
1136
- mods: [
1052
+ labelers: [
1053
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1137
1054
  {
1138
- did: BSKY_MODSERVICE_DID,
1055
+ did: 'did:plc:first-labeler',
1139
1056
  labels: {},
1140
1057
  },
1141
1058
  {
@@ -1143,6 +1060,8 @@ describe('agent', () => {
1143
1060
  labels: {},
1144
1061
  },
1145
1062
  ],
1063
+ mutedWords: [],
1064
+ hiddenPosts: [],
1146
1065
  },
1147
1066
  birthDate: new Date('2021-09-11T18:05:42.556Z'),
1148
1067
  feedViewPrefs: {
@@ -1161,8 +1080,6 @@ describe('agent', () => {
1161
1080
  interests: {
1162
1081
  tags: [],
1163
1082
  },
1164
- mutedWords: [],
1165
- hiddenPosts: [],
1166
1083
  })
1167
1084
 
1168
1085
  await agent.setAdultContentEnabled(false)
@@ -1177,9 +1094,10 @@ describe('agent', () => {
1177
1094
  ...DEFAULT_LABEL_SETTINGS,
1178
1095
  porn: 'warn',
1179
1096
  },
1180
- mods: [
1097
+ labelers: [
1098
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1181
1099
  {
1182
- did: BSKY_MODSERVICE_DID,
1100
+ did: 'did:plc:first-labeler',
1183
1101
  labels: {},
1184
1102
  },
1185
1103
  {
@@ -1187,6 +1105,8 @@ describe('agent', () => {
1187
1105
  labels: {},
1188
1106
  },
1189
1107
  ],
1108
+ mutedWords: [],
1109
+ hiddenPosts: [],
1190
1110
  },
1191
1111
  birthDate: new Date('2021-09-11T18:05:42.556Z'),
1192
1112
  feedViewPrefs: {
@@ -1205,8 +1125,6 @@ describe('agent', () => {
1205
1125
  interests: {
1206
1126
  tags: [],
1207
1127
  },
1208
- mutedWords: [],
1209
- hiddenPosts: [],
1210
1128
  })
1211
1129
 
1212
1130
  await agent.setContentLabelPref('porn', 'ignore')
@@ -1219,11 +1137,13 @@ describe('agent', () => {
1219
1137
  adultContentEnabled: false,
1220
1138
  labels: {
1221
1139
  ...DEFAULT_LABEL_SETTINGS,
1140
+ nsfw: 'ignore',
1222
1141
  porn: 'ignore',
1223
1142
  },
1224
- mods: [
1143
+ labelers: [
1144
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1225
1145
  {
1226
- did: BSKY_MODSERVICE_DID,
1146
+ did: 'did:plc:first-labeler',
1227
1147
  labels: {},
1228
1148
  },
1229
1149
  {
@@ -1231,6 +1151,8 @@ describe('agent', () => {
1231
1151
  labels: {},
1232
1152
  },
1233
1153
  ],
1154
+ mutedWords: [],
1155
+ hiddenPosts: [],
1234
1156
  },
1235
1157
  birthDate: new Date('2021-09-11T18:05:42.556Z'),
1236
1158
  feedViewPrefs: {
@@ -1249,11 +1171,9 @@ describe('agent', () => {
1249
1171
  interests: {
1250
1172
  tags: [],
1251
1173
  },
1252
- mutedWords: [],
1253
- hiddenPosts: [],
1254
1174
  })
1255
1175
 
1256
- await agent.removeModService('did:plc:other')
1176
+ await agent.removeLabeler('did:plc:other')
1257
1177
  await expect(agent.getPreferences()).resolves.toStrictEqual({
1258
1178
  feeds: {
1259
1179
  pinned: [],
@@ -1263,14 +1183,18 @@ describe('agent', () => {
1263
1183
  adultContentEnabled: false,
1264
1184
  labels: {
1265
1185
  ...DEFAULT_LABEL_SETTINGS,
1186
+ nsfw: 'ignore',
1266
1187
  porn: 'ignore',
1267
1188
  },
1268
- mods: [
1189
+ labelers: [
1190
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1269
1191
  {
1270
- did: BSKY_MODSERVICE_DID,
1192
+ did: 'did:plc:first-labeler',
1271
1193
  labels: {},
1272
1194
  },
1273
1195
  ],
1196
+ mutedWords: [],
1197
+ hiddenPosts: [],
1274
1198
  },
1275
1199
  birthDate: new Date('2021-09-11T18:05:42.556Z'),
1276
1200
  feedViewPrefs: {
@@ -1289,8 +1213,6 @@ describe('agent', () => {
1289
1213
  interests: {
1290
1214
  tags: [],
1291
1215
  },
1292
- mutedWords: [],
1293
- hiddenPosts: [],
1294
1216
  })
1295
1217
 
1296
1218
  await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
@@ -1303,14 +1225,18 @@ describe('agent', () => {
1303
1225
  adultContentEnabled: false,
1304
1226
  labels: {
1305
1227
  ...DEFAULT_LABEL_SETTINGS,
1228
+ nsfw: 'ignore',
1306
1229
  porn: 'ignore',
1307
1230
  },
1308
- mods: [
1231
+ labelers: [
1232
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1309
1233
  {
1310
- did: BSKY_MODSERVICE_DID,
1234
+ did: 'did:plc:first-labeler',
1311
1235
  labels: {},
1312
1236
  },
1313
1237
  ],
1238
+ mutedWords: [],
1239
+ hiddenPosts: [],
1314
1240
  },
1315
1241
  birthDate: new Date('2021-09-11T18:05:42.556Z'),
1316
1242
  feedViewPrefs: {
@@ -1329,8 +1255,6 @@ describe('agent', () => {
1329
1255
  interests: {
1330
1256
  tags: [],
1331
1257
  },
1332
- mutedWords: [],
1333
- hiddenPosts: [],
1334
1258
  })
1335
1259
 
1336
1260
  await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
@@ -1343,14 +1267,18 @@ describe('agent', () => {
1343
1267
  adultContentEnabled: false,
1344
1268
  labels: {
1345
1269
  ...DEFAULT_LABEL_SETTINGS,
1270
+ nsfw: 'ignore',
1346
1271
  porn: 'ignore',
1347
1272
  },
1348
- mods: [
1273
+ labelers: [
1274
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1349
1275
  {
1350
- did: BSKY_MODSERVICE_DID,
1276
+ did: 'did:plc:first-labeler',
1351
1277
  labels: {},
1352
1278
  },
1353
1279
  ],
1280
+ mutedWords: [],
1281
+ hiddenPosts: [],
1354
1282
  },
1355
1283
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
1356
1284
  feedViewPrefs: {
@@ -1369,8 +1297,6 @@ describe('agent', () => {
1369
1297
  interests: {
1370
1298
  tags: [],
1371
1299
  },
1372
- mutedWords: [],
1373
- hiddenPosts: [],
1374
1300
  })
1375
1301
 
1376
1302
  await agent.setFeedViewPrefs('home', {
@@ -1394,14 +1320,18 @@ describe('agent', () => {
1394
1320
  adultContentEnabled: false,
1395
1321
  labels: {
1396
1322
  ...DEFAULT_LABEL_SETTINGS,
1323
+ nsfw: 'ignore',
1397
1324
  porn: 'ignore',
1398
1325
  },
1399
- mods: [
1326
+ labelers: [
1327
+ ...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
1400
1328
  {
1401
- did: BSKY_MODSERVICE_DID,
1329
+ did: 'did:plc:first-labeler',
1402
1330
  labels: {},
1403
1331
  },
1404
1332
  ],
1333
+ mutedWords: [],
1334
+ hiddenPosts: [],
1405
1335
  },
1406
1336
  birthDate: new Date('2023-09-11T18:05:42.556Z'),
1407
1337
  feedViewPrefs: {
@@ -1420,8 +1350,6 @@ describe('agent', () => {
1420
1350
  interests: {
1421
1351
  tags: [],
1422
1352
  },
1423
- mutedWords: [],
1424
- hiddenPosts: [],
1425
1353
  })
1426
1354
 
1427
1355
  const res = await agent.app.bsky.actor.getPreferences()
@@ -1437,10 +1365,15 @@ describe('agent', () => {
1437
1365
  visibility: 'ignore',
1438
1366
  },
1439
1367
  {
1440
- $type: 'app.bsky.actor.defs#modsPref',
1441
- mods: [
1368
+ $type: 'app.bsky.actor.defs#contentLabelPref',
1369
+ label: 'nsfw',
1370
+ visibility: 'ignore',
1371
+ },
1372
+ {
1373
+ $type: 'app.bsky.actor.defs#labelersPref',
1374
+ labelers: [
1442
1375
  {
1443
- did: BSKY_MODSERVICE_DID,
1376
+ did: 'did:plc:first-labeler',
1444
1377
  },
1445
1378
  ],
1446
1379
  },
@@ -1496,7 +1429,7 @@ describe('agent', () => {
1496
1429
  await agent.upsertMutedWords(mutedWords)
1497
1430
  await agent.upsertMutedWords(mutedWords) // double
1498
1431
  await expect(agent.getPreferences()).resolves.toHaveProperty(
1499
- 'mutedWords',
1432
+ 'moderationPrefs.mutedWords',
1500
1433
  mutedWords,
1501
1434
  )
1502
1435
  })
@@ -1508,7 +1441,7 @@ describe('agent', () => {
1508
1441
  // is sanitized to `hashtag`
1509
1442
  await agent.upsertMutedWords([{ value: '#hashtag', targets: ['tag'] }])
1510
1443
 
1511
- const { mutedWords } = await agent.getPreferences()
1444
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1512
1445
 
1513
1446
  expect(mutedWords.find((m) => m.value === '#hashtag')).toBeFalsy()
1514
1447
  // merged with existing
@@ -1531,7 +1464,7 @@ describe('agent', () => {
1531
1464
  })
1532
1465
  await agent.updateMutedWord({ value: 'tag_then_none', targets: [] })
1533
1466
  await agent.updateMutedWord({ value: 'no_exist', targets: ['tag'] })
1534
- const { mutedWords } = await agent.getPreferences()
1467
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1535
1468
 
1536
1469
  expect(
1537
1470
  mutedWords.find((m) => m.value === 'tag_then_content'),
@@ -1556,7 +1489,7 @@ describe('agent', () => {
1556
1489
  value: '#just_a_tag',
1557
1490
  targets: ['tag', 'content'],
1558
1491
  })
1559
- const { mutedWords } = await agent.getPreferences()
1492
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1560
1493
  expect(mutedWords.find((m) => m.value === 'just_a_tag')).toStrictEqual({
1561
1494
  value: 'just_a_tag',
1562
1495
  targets: ['tag'],
@@ -1567,7 +1500,7 @@ describe('agent', () => {
1567
1500
  await agent.removeMutedWord({ value: 'tag_then_content', targets: [] })
1568
1501
  await agent.removeMutedWord({ value: 'tag_then_both', targets: [] })
1569
1502
  await agent.removeMutedWord({ value: 'tag_then_none', targets: [] })
1570
- const { mutedWords } = await agent.getPreferences()
1503
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1571
1504
 
1572
1505
  expect(
1573
1506
  mutedWords.find((m) => m.value === 'tag_then_content'),
@@ -1578,17 +1511,17 @@ describe('agent', () => {
1578
1511
 
1579
1512
  it('removeMutedWord with #, no match, no removal', async () => {
1580
1513
  await agent.removeMutedWord({ value: '#hashtag', targets: [] })
1581
- const { mutedWords } = await agent.getPreferences()
1514
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1582
1515
 
1583
1516
  // was inserted with #hashtag, but we don't sanitize on remove
1584
1517
  expect(mutedWords.find((m) => m.value === 'hashtag')).toBeTruthy()
1585
1518
  })
1586
1519
 
1587
1520
  it('single-hash #', async () => {
1588
- const prev = await agent.getPreferences()
1521
+ const prev = (await agent.getPreferences()).moderationPrefs
1589
1522
  const length = prev.mutedWords.length
1590
1523
  await agent.upsertMutedWords([{ value: '#', targets: [] }])
1591
- const end = await agent.getPreferences()
1524
+ const end = (await agent.getPreferences()).moderationPrefs
1592
1525
 
1593
1526
  // sanitized to empty string, not inserted
1594
1527
  expect(end.mutedWords.length).toEqual(length)
@@ -1596,65 +1529,65 @@ describe('agent', () => {
1596
1529
 
1597
1530
  it('multi-hash ##', async () => {
1598
1531
  await agent.upsertMutedWords([{ value: '##', targets: [] }])
1599
- const { mutedWords } = await agent.getPreferences()
1532
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1600
1533
 
1601
1534
  expect(mutedWords.find((m) => m.value === '#')).toBeTruthy()
1602
1535
  })
1603
1536
 
1604
1537
  it('multi-hash ##hashtag', async () => {
1605
1538
  await agent.upsertMutedWords([{ value: '##hashtag', targets: [] }])
1606
- const a = await agent.getPreferences()
1539
+ const a = (await agent.getPreferences()).moderationPrefs
1607
1540
 
1608
1541
  expect(a.mutedWords.find((w) => w.value === '#hashtag')).toBeTruthy()
1609
1542
 
1610
1543
  await agent.removeMutedWord({ value: '#hashtag', targets: [] })
1611
- const b = await agent.getPreferences()
1544
+ const b = (await agent.getPreferences()).moderationPrefs
1612
1545
 
1613
1546
  expect(b.mutedWords.find((w) => w.value === '#hashtag')).toBeFalsy()
1614
1547
  })
1615
1548
 
1616
1549
  it('hash emoji #️⃣', async () => {
1617
1550
  await agent.upsertMutedWords([{ value: '#️⃣', targets: [] }])
1618
- const { mutedWords } = await agent.getPreferences()
1551
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1619
1552
 
1620
1553
  expect(mutedWords.find((m) => m.value === '#️⃣')).toBeTruthy()
1621
1554
 
1622
1555
  await agent.removeMutedWord({ value: '#️⃣', targets: [] })
1623
- const end = await agent.getPreferences()
1556
+ const end = (await agent.getPreferences()).moderationPrefs
1624
1557
 
1625
1558
  expect(end.mutedWords.find((m) => m.value === '#️⃣')).toBeFalsy()
1626
1559
  })
1627
1560
 
1628
1561
  it('hash emoji ##️⃣', async () => {
1629
1562
  await agent.upsertMutedWords([{ value: '##️⃣', targets: [] }])
1630
- const { mutedWords } = await agent.getPreferences()
1563
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1631
1564
 
1632
1565
  expect(mutedWords.find((m) => m.value === '#️⃣')).toBeTruthy()
1633
1566
 
1634
1567
  await agent.removeMutedWord({ value: '#️⃣', targets: [] })
1635
- const end = await agent.getPreferences()
1568
+ const end = (await agent.getPreferences()).moderationPrefs
1636
1569
 
1637
1570
  expect(end.mutedWords.find((m) => m.value === '#️⃣')).toBeFalsy()
1638
1571
  })
1639
1572
 
1640
1573
  it('hash emoji ###️⃣', async () => {
1641
1574
  await agent.upsertMutedWords([{ value: '###️⃣', targets: [] }])
1642
- const { mutedWords } = await agent.getPreferences()
1575
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1643
1576
 
1644
1577
  expect(mutedWords.find((m) => m.value === '##️⃣')).toBeTruthy()
1645
1578
 
1646
1579
  await agent.removeMutedWord({ value: '##️⃣', targets: [] })
1647
- const end = await agent.getPreferences()
1580
+ const end = (await agent.getPreferences()).moderationPrefs
1648
1581
 
1649
1582
  expect(end.mutedWords.find((m) => m.value === '##️⃣')).toBeFalsy()
1650
1583
  })
1651
1584
 
1652
1585
  describe(`invalid characters`, () => {
1653
1586
  it('zero width space', async () => {
1654
- const prev = await agent.getPreferences()
1587
+ const prev = (await agent.getPreferences()).moderationPrefs
1655
1588
  const length = prev.mutedWords.length
1656
1589
  await agent.upsertMutedWords([{ value: '#​', targets: [] }])
1657
- const { mutedWords } = await agent.getPreferences()
1590
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1658
1591
 
1659
1592
  expect(mutedWords.length).toEqual(length)
1660
1593
  })
@@ -1663,7 +1596,7 @@ describe('agent', () => {
1663
1596
  await agent.upsertMutedWords([
1664
1597
  { value: 'test value\n with newline', targets: [] },
1665
1598
  ])
1666
- const { mutedWords } = await agent.getPreferences()
1599
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1667
1600
 
1668
1601
  expect(
1669
1602
  mutedWords.find((m) => m.value === 'test value with newline'),
@@ -1674,7 +1607,7 @@ describe('agent', () => {
1674
1607
  await agent.upsertMutedWords([
1675
1608
  { value: 'test value\n\r with newline', targets: [] },
1676
1609
  ])
1677
- const { mutedWords } = await agent.getPreferences()
1610
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1678
1611
 
1679
1612
  expect(
1680
1613
  mutedWords.find((m) => m.value === 'test value with newline'),
@@ -1683,14 +1616,14 @@ describe('agent', () => {
1683
1616
 
1684
1617
  it('empty space', async () => {
1685
1618
  await agent.upsertMutedWords([{ value: ' ', targets: [] }])
1686
- const { mutedWords } = await agent.getPreferences()
1619
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1687
1620
 
1688
1621
  expect(mutedWords.find((m) => m.value === ' ')).toBeFalsy()
1689
1622
  })
1690
1623
 
1691
1624
  it('leading/trailing space', async () => {
1692
1625
  await agent.upsertMutedWords([{ value: ' trim ', targets: [] }])
1693
- const { mutedWords } = await agent.getPreferences()
1626
+ const { mutedWords } = (await agent.getPreferences()).moderationPrefs
1694
1627
 
1695
1628
  expect(mutedWords.find((m) => m.value === 'trim')).toBeTruthy()
1696
1629
  })
@@ -1714,7 +1647,7 @@ describe('agent', () => {
1714
1647
  await agent.hidePost(postUri)
1715
1648
  await agent.hidePost(postUri) // double, should dedupe
1716
1649
  await expect(agent.getPreferences()).resolves.toHaveProperty(
1717
- 'hiddenPosts',
1650
+ 'moderationPrefs.hiddenPosts',
1718
1651
  [postUri],
1719
1652
  )
1720
1653
  })
@@ -1722,13 +1655,13 @@ describe('agent', () => {
1722
1655
  it('unhidePost', async () => {
1723
1656
  await agent.unhidePost(postUri)
1724
1657
  await expect(agent.getPreferences()).resolves.toHaveProperty(
1725
- 'hiddenPosts',
1658
+ 'moderationPrefs.hiddenPosts',
1726
1659
  [],
1727
1660
  )
1728
1661
  // no issues calling a second time
1729
1662
  await agent.unhidePost(postUri)
1730
1663
  await expect(agent.getPreferences()).resolves.toHaveProperty(
1731
- 'hiddenPosts',
1664
+ 'moderationPrefs.hiddenPosts',
1732
1665
  [],
1733
1666
  )
1734
1667
  })