@atproto/pds 0.4.28 → 0.4.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/account-manager/helpers/account.d.ts +20 -1
  3. package/dist/account-manager/helpers/account.d.ts.map +1 -1
  4. package/dist/account-manager/helpers/account.js +32 -7
  5. package/dist/account-manager/helpers/account.js.map +1 -1
  6. package/dist/account-manager/index.d.ts +7 -2
  7. package/dist/account-manager/index.d.ts.map +1 -1
  8. package/dist/account-manager/index.js +24 -8
  9. package/dist/account-manager/index.js.map +1 -1
  10. package/dist/api/app/bsky/actor/getPreferences.js +1 -1
  11. package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
  12. package/dist/api/app/bsky/actor/getProfile.js +1 -1
  13. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  14. package/dist/api/app/bsky/actor/getProfiles.js +1 -1
  15. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  16. package/dist/api/app/bsky/actor/putPreferences.js +1 -1
  17. package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
  18. package/dist/api/app/bsky/feed/getActorLikes.js +1 -1
  19. package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
  20. package/dist/api/app/bsky/feed/getAuthorFeed.js +1 -1
  21. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  22. package/dist/api/app/bsky/feed/getFeed.js +1 -1
  23. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  24. package/dist/api/app/bsky/feed/getPostThread.js +1 -1
  25. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  26. package/dist/api/app/bsky/feed/getTimeline.js +1 -1
  27. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  28. package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
  29. package/dist/api/app/bsky/notification/registerPush.js +4 -1
  30. package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
  31. package/dist/api/chat/index.js +14 -14
  32. package/dist/api/chat/index.js.map +1 -1
  33. package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
  34. package/dist/api/com/atproto/admin/deleteAccount.js +4 -2
  35. package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
  36. package/dist/api/com/atproto/admin/getAccountInfo.d.ts.map +1 -1
  37. package/dist/api/com/atproto/admin/getAccountInfo.js +1 -0
  38. package/dist/api/com/atproto/admin/getAccountInfo.js.map +1 -1
  39. package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  40. package/dist/api/com/atproto/admin/getSubjectStatus.js +4 -3
  41. package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
  42. package/dist/api/com/atproto/admin/updateAccountHandle.js +1 -1
  43. package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
  44. package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
  45. package/dist/api/com/atproto/admin/updateSubjectStatus.js +2 -0
  46. package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
  47. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js +1 -1
  48. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js.map +1 -1
  49. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +1 -1
  50. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  51. package/dist/api/com/atproto/identity/signPlcOperation.js +1 -1
  52. package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
  53. package/dist/api/com/atproto/identity/submitPlcOperation.d.ts.map +1 -1
  54. package/dist/api/com/atproto/identity/submitPlcOperation.js +1 -1
  55. package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
  56. package/dist/api/com/atproto/identity/updateHandle.js +2 -2
  57. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  58. package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
  59. package/dist/api/com/atproto/repo/applyWrites.js +4 -1
  60. package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
  61. package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
  62. package/dist/api/com/atproto/repo/createRecord.js +4 -1
  63. package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
  64. package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
  65. package/dist/api/com/atproto/repo/deleteRecord.js +4 -1
  66. package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
  67. package/dist/api/com/atproto/repo/describeRepo.d.ts.map +1 -1
  68. package/dist/api/com/atproto/repo/describeRepo.js +2 -4
  69. package/dist/api/com/atproto/repo/describeRepo.js.map +1 -1
  70. package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
  71. package/dist/api/com/atproto/repo/importRepo.js +3 -1
  72. package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
  73. package/dist/api/com/atproto/repo/listMissingBlobs.js +1 -1
  74. package/dist/api/com/atproto/repo/listMissingBlobs.js.map +1 -1
  75. package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
  76. package/dist/api/com/atproto/repo/putRecord.js +4 -1
  77. package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
  78. package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
  79. package/dist/api/com/atproto/repo/uploadBlob.js +3 -1
  80. package/dist/api/com/atproto/repo/uploadBlob.js.map +1 -1
  81. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  82. package/dist/api/com/atproto/server/activateAccount.js +3 -2
  83. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  84. package/dist/api/com/atproto/server/checkAccountStatus.js +1 -1
  85. package/dist/api/com/atproto/server/checkAccountStatus.js.map +1 -1
  86. package/dist/api/com/atproto/server/confirmEmail.js +1 -1
  87. package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
  88. package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
  89. package/dist/api/com/atproto/server/createAccount.js +4 -2
  90. package/dist/api/com/atproto/server/createAccount.js.map +1 -1
  91. package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
  92. package/dist/api/com/atproto/server/createAppPassword.js +3 -1
  93. package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
  94. package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
  95. package/dist/api/com/atproto/server/createSession.js +2 -0
  96. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  97. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  98. package/dist/api/com/atproto/server/deactivateAccount.js +3 -1
  99. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  100. package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
  101. package/dist/api/com/atproto/server/deleteAccount.js +4 -3
  102. package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
  103. package/dist/api/com/atproto/server/getAccountInviteCodes.js +1 -1
  104. package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
  105. package/dist/api/com/atproto/server/getServiceAuth.js +1 -1
  106. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  107. package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
  108. package/dist/api/com/atproto/server/getSession.js +7 -2
  109. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  110. package/dist/api/com/atproto/server/listAppPasswords.js +1 -1
  111. package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
  112. package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
  113. package/dist/api/com/atproto/server/refreshSession.js +2 -0
  114. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  115. package/dist/api/com/atproto/server/requestAccountDelete.js +1 -1
  116. package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
  117. package/dist/api/com/atproto/server/requestEmailConfirmation.js +1 -1
  118. package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
  119. package/dist/api/com/atproto/server/requestEmailUpdate.js +1 -1
  120. package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
  121. package/dist/api/com/atproto/server/revokeAppPassword.js +1 -1
  122. package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
  123. package/dist/api/com/atproto/server/updateEmail.js +1 -1
  124. package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
  125. package/dist/api/com/atproto/server/util.d.ts +1 -0
  126. package/dist/api/com/atproto/server/util.d.ts.map +1 -1
  127. package/dist/api/com/atproto/server/util.js +9 -6
  128. package/dist/api/com/atproto/server/util.js.map +1 -1
  129. package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts.map +1 -1
  130. package/dist/api/com/atproto/sync/deprecated/getCheckout.js +2 -8
  131. package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
  132. package/dist/api/com/atproto/sync/deprecated/getHead.d.ts.map +1 -1
  133. package/dist/api/com/atproto/sync/deprecated/getHead.js +2 -7
  134. package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
  135. package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
  136. package/dist/api/com/atproto/sync/getBlob.js +3 -6
  137. package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
  138. package/dist/api/com/atproto/sync/getBlocks.d.ts.map +1 -1
  139. package/dist/api/com/atproto/sync/getBlocks.js +2 -7
  140. package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
  141. package/dist/api/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  142. package/dist/api/com/atproto/sync/getLatestCommit.js +2 -7
  143. package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
  144. package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
  145. package/dist/api/com/atproto/sync/getRecord.js +2 -7
  146. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  147. package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
  148. package/dist/api/com/atproto/sync/getRepo.js +2 -7
  149. package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
  150. package/dist/api/com/atproto/sync/getRepoStatus.d.ts +4 -0
  151. package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
  152. package/dist/api/com/atproto/sync/getRepoStatus.js +28 -0
  153. package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -0
  154. package/dist/api/com/atproto/sync/index.d.ts.map +1 -1
  155. package/dist/api/com/atproto/sync/index.js +2 -0
  156. package/dist/api/com/atproto/sync/index.js.map +1 -1
  157. package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
  158. package/dist/api/com/atproto/sync/listBlobs.js +2 -8
  159. package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
  160. package/dist/api/com/atproto/sync/listRepos.d.ts.map +1 -1
  161. package/dist/api/com/atproto/sync/listRepos.js +13 -8
  162. package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
  163. package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  164. package/dist/api/com/atproto/sync/subscribeRepos.js +8 -0
  165. package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
  166. package/dist/api/com/atproto/sync/util.d.ts +4 -0
  167. package/dist/api/com/atproto/sync/util.d.ts.map +1 -0
  168. package/dist/api/com/atproto/sync/util.js +25 -0
  169. package/dist/api/com/atproto/sync/util.js.map +1 -0
  170. package/dist/api/com/atproto/temp/checkSignupQueue.d.ts.map +1 -1
  171. package/dist/api/com/atproto/temp/checkSignupQueue.js +4 -1
  172. package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
  173. package/dist/auth-verifier.d.ts +13 -7
  174. package/dist/auth-verifier.d.ts.map +1 -1
  175. package/dist/auth-verifier.js +29 -46
  176. package/dist/auth-verifier.js.map +1 -1
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +3 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/lexicon/index.d.ts +2 -0
  182. package/dist/lexicon/index.d.ts.map +1 -1
  183. package/dist/lexicon/index.js +4 -0
  184. package/dist/lexicon/index.js.map +1 -1
  185. package/dist/lexicon/lexicons.d.ts +145 -0
  186. package/dist/lexicon/lexicons.d.ts.map +1 -1
  187. package/dist/lexicon/lexicons.js +225 -4
  188. package/dist/lexicon/lexicons.js.map +1 -1
  189. package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +1 -1
  190. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +1 -0
  191. package/dist/lexicon/types/com/atproto/admin/defs.d.ts.map +1 -1
  192. package/dist/lexicon/types/com/atproto/admin/defs.js.map +1 -1
  193. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +1 -0
  194. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  195. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +3 -0
  196. package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
  197. package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -0
  198. package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
  199. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +3 -0
  200. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
  201. package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +1 -0
  202. package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts.map +1 -1
  203. package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +1 -0
  204. package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
  205. package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +1 -1
  206. package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  207. package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +1 -0
  208. package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts.map +1 -1
  209. package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +1 -0
  210. package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts.map +1 -1
  211. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts +42 -0
  212. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
  213. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js +3 -0
  214. package/dist/lexicon/types/com/atproto/sync/getRepoStatus.js.map +1 -0
  215. package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +1 -0
  216. package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
  217. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +3 -0
  218. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts.map +1 -1
  219. package/dist/lexicon/types/com/atproto/sync/listRepos.js.map +1 -1
  220. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +19 -4
  221. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  222. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +11 -1
  223. package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
  224. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
  225. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
  226. package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
  227. package/dist/pipethrough.d.ts.map +1 -1
  228. package/dist/pipethrough.js +17 -14
  229. package/dist/pipethrough.js.map +1 -1
  230. package/dist/scripts/index.d.ts +4 -0
  231. package/dist/scripts/index.d.ts.map +1 -0
  232. package/dist/scripts/index.js +8 -0
  233. package/dist/scripts/index.js.map +1 -0
  234. package/dist/scripts/rebuild-repo.d.ts +3 -0
  235. package/dist/scripts/rebuild-repo.d.ts.map +1 -0
  236. package/dist/scripts/rebuild-repo.js +121 -0
  237. package/dist/scripts/rebuild-repo.js.map +1 -0
  238. package/dist/sequencer/db/schema.d.ts +1 -1
  239. package/dist/sequencer/db/schema.d.ts.map +1 -1
  240. package/dist/sequencer/events.d.ts +27 -2
  241. package/dist/sequencer/events.d.ts.map +1 -1
  242. package/dist/sequencer/events.js +35 -2
  243. package/dist/sequencer/events.js.map +1 -1
  244. package/dist/sequencer/sequencer.d.ts +8 -6
  245. package/dist/sequencer/sequencer.d.ts.map +1 -1
  246. package/dist/sequencer/sequencer.js +22 -9
  247. package/dist/sequencer/sequencer.js.map +1 -1
  248. package/package.json +4 -4
  249. package/src/account-manager/helpers/account.ts +38 -6
  250. package/src/account-manager/index.ts +21 -8
  251. package/src/api/app/bsky/actor/getPreferences.ts +1 -1
  252. package/src/api/app/bsky/actor/getProfile.ts +1 -1
  253. package/src/api/app/bsky/actor/getProfiles.ts +1 -1
  254. package/src/api/app/bsky/actor/putPreferences.ts +1 -1
  255. package/src/api/app/bsky/feed/getActorLikes.ts +1 -1
  256. package/src/api/app/bsky/feed/getAuthorFeed.ts +1 -1
  257. package/src/api/app/bsky/feed/getFeed.ts +1 -1
  258. package/src/api/app/bsky/feed/getPostThread.ts +1 -1
  259. package/src/api/app/bsky/feed/getTimeline.ts +1 -1
  260. package/src/api/app/bsky/notification/registerPush.ts +4 -1
  261. package/src/api/chat/index.ts +14 -14
  262. package/src/api/com/atproto/admin/deleteAccount.ts +7 -2
  263. package/src/api/com/atproto/admin/getAccountInfo.ts +1 -0
  264. package/src/api/com/atproto/admin/getSubjectStatus.ts +4 -3
  265. package/src/api/com/atproto/admin/updateAccountHandle.ts +1 -1
  266. package/src/api/com/atproto/admin/updateSubjectStatus.ts +2 -0
  267. package/src/api/com/atproto/identity/getRecommendedDidCredentials.ts +1 -1
  268. package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +1 -1
  269. package/src/api/com/atproto/identity/signPlcOperation.ts +1 -1
  270. package/src/api/com/atproto/identity/submitPlcOperation.ts +2 -1
  271. package/src/api/com/atproto/identity/updateHandle.ts +2 -2
  272. package/src/api/com/atproto/repo/applyWrites.ts +4 -1
  273. package/src/api/com/atproto/repo/createRecord.ts +4 -1
  274. package/src/api/com/atproto/repo/deleteRecord.ts +4 -1
  275. package/src/api/com/atproto/repo/describeRepo.ts +2 -4
  276. package/src/api/com/atproto/repo/importRepo.ts +3 -1
  277. package/src/api/com/atproto/repo/listMissingBlobs.ts +1 -1
  278. package/src/api/com/atproto/repo/putRecord.ts +4 -1
  279. package/src/api/com/atproto/repo/uploadBlob.ts +3 -1
  280. package/src/api/com/atproto/server/activateAccount.ts +3 -2
  281. package/src/api/com/atproto/server/checkAccountStatus.ts +1 -1
  282. package/src/api/com/atproto/server/confirmEmail.ts +1 -1
  283. package/src/api/com/atproto/server/createAccount.ts +6 -3
  284. package/src/api/com/atproto/server/createAppPassword.ts +3 -1
  285. package/src/api/com/atproto/server/createSession.ts +2 -0
  286. package/src/api/com/atproto/server/deactivateAccount.ts +3 -1
  287. package/src/api/com/atproto/server/deleteAccount.ts +7 -3
  288. package/src/api/com/atproto/server/getAccountInviteCodes.ts +1 -1
  289. package/src/api/com/atproto/server/getServiceAuth.ts +1 -1
  290. package/src/api/com/atproto/server/getSession.ts +7 -2
  291. package/src/api/com/atproto/server/listAppPasswords.ts +1 -1
  292. package/src/api/com/atproto/server/refreshSession.ts +2 -0
  293. package/src/api/com/atproto/server/requestAccountDelete.ts +1 -1
  294. package/src/api/com/atproto/server/requestEmailConfirmation.ts +1 -1
  295. package/src/api/com/atproto/server/requestEmailUpdate.ts +1 -1
  296. package/src/api/com/atproto/server/revokeAppPassword.ts +1 -1
  297. package/src/api/com/atproto/server/updateEmail.ts +1 -1
  298. package/src/api/com/atproto/server/util.ts +12 -5
  299. package/src/api/com/atproto/sync/deprecated/getCheckout.ts +6 -8
  300. package/src/api/com/atproto/sync/deprecated/getHead.ts +7 -10
  301. package/src/api/com/atproto/sync/getBlob.ts +8 -6
  302. package/src/api/com/atproto/sync/getBlocks.ts +6 -7
  303. package/src/api/com/atproto/sync/getLatestCommit.ts +7 -10
  304. package/src/api/com/atproto/sync/getRecord.ts +7 -7
  305. package/src/api/com/atproto/sync/getRepo.ts +6 -7
  306. package/src/api/com/atproto/sync/getRepoStatus.ts +31 -0
  307. package/src/api/com/atproto/sync/index.ts +2 -0
  308. package/src/api/com/atproto/sync/listBlobs.ts +6 -8
  309. package/src/api/com/atproto/sync/listRepos.ts +13 -8
  310. package/src/api/com/atproto/sync/subscribeRepos.ts +7 -0
  311. package/src/api/com/atproto/sync/util.ts +36 -0
  312. package/src/api/com/atproto/temp/checkSignupQueue.ts +4 -1
  313. package/src/auth-verifier.ts +62 -47
  314. package/src/index.ts +1 -0
  315. package/src/lexicon/index.ts +12 -0
  316. package/src/lexicon/lexicons.ts +236 -7
  317. package/src/lexicon/types/chat/bsky/convo/defs.ts +1 -1
  318. package/src/lexicon/types/com/atproto/admin/defs.ts +1 -0
  319. package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +1 -0
  320. package/src/lexicon/types/com/atproto/server/createSession.ts +3 -0
  321. package/src/lexicon/types/com/atproto/server/getSession.ts +3 -0
  322. package/src/lexicon/types/com/atproto/server/refreshSession.ts +3 -0
  323. package/src/lexicon/types/com/atproto/sync/getBlob.ts +6 -0
  324. package/src/lexicon/types/com/atproto/sync/getBlocks.ts +6 -0
  325. package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +1 -1
  326. package/src/lexicon/types/com/atproto/sync/getRecord.ts +6 -0
  327. package/src/lexicon/types/com/atproto/sync/getRepo.ts +1 -0
  328. package/src/lexicon/types/com/atproto/sync/getRepoStatus.ts +52 -0
  329. package/src/lexicon/types/com/atproto/sync/listBlobs.ts +1 -0
  330. package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -0
  331. package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +30 -3
  332. package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
  333. package/src/pipethrough.ts +5 -4
  334. package/src/scripts/index.ts +5 -0
  335. package/src/scripts/rebuild-repo.ts +143 -0
  336. package/src/sequencer/db/schema.ts +1 -0
  337. package/src/sequencer/events.ts +47 -0
  338. package/src/sequencer/sequencer.ts +35 -14
  339. package/tests/account-deactivation.test.ts +67 -12
  340. package/tests/account-deletion.test.ts +10 -2
  341. package/tests/auth.test.ts +3 -0
  342. package/tests/moderation.test.ts +2 -2
  343. package/tests/proxied/notif.test.ts +1 -0
  344. package/tests/sequencer.test.ts +2 -2
  345. package/tests/sync/list.test.ts +1 -0
  346. package/tests/sync/subscribe-repos.test.ts +224 -40
  347. package/tests/sync/sync.test.ts +48 -4
@@ -9,6 +9,8 @@ export type ActorAccount = ActorEntry & {
9
9
  email: string | null
10
10
  emailConfirmedAt: string | null
11
11
  invitesDisabled: 0 | 1 | null
12
+ active: boolean
13
+ status?: AccountStatus
12
14
  }
13
15
 
14
16
  export type AvailabilityFlags = {
@@ -16,6 +18,14 @@ export type AvailabilityFlags = {
16
18
  includeDeactivated?: boolean
17
19
  }
18
20
 
21
+ export enum AccountStatus {
22
+ Active = 'active',
23
+ Takendown = 'takendown',
24
+ Suspended = 'suspended',
25
+ Deleted = 'deleted',
26
+ Deactivated = 'deactivated',
27
+ }
28
+
19
29
  const selectAccountQB = (db: AccountDb, flags?: AvailabilityFlags) => {
20
30
  const { includeTakenDown = false, includeDeactivated = false } = flags ?? {}
21
31
  const { ref } = db.db.dynamic
@@ -53,7 +63,7 @@ export const getAccount = async (
53
63
  }
54
64
  })
55
65
  .executeTakeFirst()
56
- return found || null
66
+ return found ? { ...found, ...formatAccountStatus(found) } : null
57
67
  }
58
68
 
59
69
  export const getAccountByEmail = async (
@@ -64,7 +74,7 @@ export const getAccountByEmail = async (
64
74
  const found = await selectAccountQB(db, flags)
65
75
  .where('email', '=', email.toLowerCase())
66
76
  .executeTakeFirst()
67
- return found || null
77
+ return found ? { ...found, ...formatAccountStatus(found) } : null
68
78
  }
69
79
 
70
80
  export const registerActor = async (
@@ -196,19 +206,21 @@ export const setEmailConfirmedAt = async (
196
206
  )
197
207
  }
198
208
 
199
- export const getAccountTakedownStatus = async (
209
+ export const getAccountAdminStatus = async (
200
210
  db: AccountDb,
201
211
  did: string,
202
- ): Promise<StatusAttr | null> => {
212
+ ): Promise<{ takedown: StatusAttr; deactivated: StatusAttr } | null> => {
203
213
  const res = await db.db
204
214
  .selectFrom('actor')
205
- .select('takedownRef')
215
+ .select(['takedownRef', 'deactivatedAt'])
206
216
  .where('did', '=', did)
207
217
  .executeTakeFirst()
208
218
  if (!res) return null
209
- return res.takedownRef
219
+ const takedown = res.takedownRef
210
220
  ? { applied: true, ref: res.takedownRef }
211
221
  : { applied: false }
222
+ const deactivated = res.deactivatedAt ? { applied: true } : { applied: false }
223
+ return { takedown, deactivated }
212
224
  }
213
225
 
214
226
  export const updateAccountTakedownStatus = async (
@@ -251,3 +263,23 @@ export const activateAccount = async (db: AccountDb, did: string) => {
251
263
  .where('did', '=', did),
252
264
  )
253
265
  }
266
+
267
+ export const formatAccountStatus = (account: {
268
+ takedownRef: string | null
269
+ deactivatedAt: string | null
270
+ }): {
271
+ active: boolean
272
+ status?: AccountStatus
273
+ } => {
274
+ let status: AccountStatus | undefined = undefined
275
+ if (account.takedownRef) {
276
+ status = AccountStatus.Takendown
277
+ } else if (account.deactivatedAt) {
278
+ status = AccountStatus.Deactivated
279
+ }
280
+ const active = !status
281
+ return {
282
+ active,
283
+ status,
284
+ }
285
+ }
@@ -4,6 +4,7 @@ import { CID } from 'multiformats/cid'
4
4
  import { AccountDb, EmailTokenPurpose, getDb, getMigrator } from './db'
5
5
  import * as scrypt from './helpers/scrypt'
6
6
  import * as account from './helpers/account'
7
+ import { AccountStatus } from './helpers/account'
7
8
  import { ActorAccount } from './helpers/account'
8
9
  import * as repo from './helpers/repo'
9
10
  import * as auth from './helpers/auth'
@@ -13,6 +14,8 @@ import * as emailToken from './helpers/email-token'
13
14
  import { AuthScope } from '../auth-verifier'
14
15
  import { StatusAttr } from '../lexicon/types/com/atproto/admin/defs'
15
16
 
17
+ export { AccountStatus } from './helpers/account'
18
+
16
19
  export class AccountManager {
17
20
  db: AccountDb
18
21
 
@@ -51,12 +54,6 @@ export class AccountManager {
51
54
  return account.getAccountByEmail(this.db, email, flags)
52
55
  }
53
56
 
54
- // Repo exists and is not taken-down
55
- async isRepoAvailable(did: string) {
56
- const got = await this.getAccount(did)
57
- return !!got
58
- }
59
-
60
57
  async isAccountActivated(did: string): Promise<boolean> {
61
58
  const account = await this.getAccount(did, { includeDeactivated: true })
62
59
  if (!account) return false
@@ -71,6 +68,22 @@ export class AccountManager {
71
68
  return got?.did ?? null
72
69
  }
73
70
 
71
+ async getAccountStatus(handleOrDid: string): Promise<AccountStatus> {
72
+ const got = await this.getAccount(handleOrDid, {
73
+ includeDeactivated: true,
74
+ includeTakenDown: true,
75
+ })
76
+ if (!got) {
77
+ return AccountStatus.Deleted
78
+ } else if (got.takedownRef) {
79
+ return AccountStatus.Takendown
80
+ } else if (got.deactivatedAt) {
81
+ return AccountStatus.Deactivated
82
+ } else {
83
+ return AccountStatus.Active
84
+ }
85
+ }
86
+
74
87
  async createAccount(opts: {
75
88
  did: string
76
89
  handle: string
@@ -143,8 +156,8 @@ export class AccountManager {
143
156
  )
144
157
  }
145
158
 
146
- async getAccountTakedownStatus(did: string) {
147
- return account.getAccountTakedownStatus(this.db, did)
159
+ async getAccountAdminStatus(did: string) {
160
+ return account.getAccountAdminStatus(this.db, did)
148
161
  }
149
162
 
150
163
  async updateRepoRoot(did: string, cid: CID, rev: string) {
@@ -5,7 +5,7 @@ import { AuthScope } from '../../../../auth-verifier'
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  if (!ctx.cfg.bskyAppView) return
7
7
  server.app.bsky.actor.getPreferences({
8
- auth: ctx.authVerifier.access,
8
+ auth: ctx.authVerifier.accessStandard(),
9
9
  handler: async ({ auth }) => {
10
10
  const requester = auth.credentials.did
11
11
  let preferences = await ctx.actorStore.read(requester, (store) =>
@@ -14,7 +14,7 @@ export default function (server: Server, ctx: AppContext) {
14
14
  const { bskyAppView } = ctx.cfg
15
15
  if (!bskyAppView) return
16
16
  server.app.bsky.actor.getProfile({
17
- auth: ctx.authVerifier.access,
17
+ auth: ctx.authVerifier.accessStandard(),
18
18
  handler: async ({ req, auth }) => {
19
19
  const requester = auth.credentials.did
20
20
  const res = await pipethrough(ctx, req, requester)
@@ -14,7 +14,7 @@ export default function (server: Server, ctx: AppContext) {
14
14
  const { bskyAppView } = ctx.cfg
15
15
  if (!bskyAppView) return
16
16
  server.app.bsky.actor.getProfiles({
17
- auth: ctx.authVerifier.access,
17
+ auth: ctx.authVerifier.accessStandard(),
18
18
  handler: async ({ req, auth }) => {
19
19
  const requester = auth.credentials.did
20
20
 
@@ -6,7 +6,7 @@ import { AccountPreference } from '../../../../actor-store/preference/reader'
6
6
  export default function (server: Server, ctx: AppContext) {
7
7
  if (!ctx.cfg.bskyAppView) return
8
8
  server.app.bsky.actor.putPreferences({
9
- auth: ctx.authVerifier.accessCheckTakedown,
9
+ auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
10
10
  handler: async ({ auth, input }) => {
11
11
  const { preferences } = input.body
12
12
  const requester = auth.credentials.did
@@ -14,7 +14,7 @@ export default function (server: Server, ctx: AppContext) {
14
14
  const { bskyAppView } = ctx.cfg
15
15
  if (!bskyAppView) return
16
16
  server.app.bsky.feed.getActorLikes({
17
- auth: ctx.authVerifier.access,
17
+ auth: ctx.authVerifier.accessStandard(),
18
18
  handler: async ({ req, auth }) => {
19
19
  const requester = auth.credentials.did
20
20
  const res = await pipethrough(ctx, req, requester)
@@ -15,7 +15,7 @@ export default function (server: Server, ctx: AppContext) {
15
15
  const { bskyAppView } = ctx.cfg
16
16
  if (!bskyAppView) return
17
17
  server.app.bsky.feed.getAuthorFeed({
18
- auth: ctx.authVerifier.access,
18
+ auth: ctx.authVerifier.accessStandard(),
19
19
  handler: async ({ req, auth }) => {
20
20
  const requester = auth.credentials.did
21
21
  const res = await pipethrough(ctx, req, requester)
@@ -7,7 +7,7 @@ export default function (server: Server, ctx: AppContext) {
7
7
  const { bskyAppView } = ctx.cfg
8
8
  if (!appViewAgent || !bskyAppView) return
9
9
  server.app.bsky.feed.getFeed({
10
- auth: ctx.authVerifier.access,
10
+ auth: ctx.authVerifier.accessStandard(),
11
11
  handler: async ({ params, auth, req }) => {
12
12
  const requester = auth.credentials.did
13
13
 
@@ -29,7 +29,7 @@ export default function (server: Server, ctx: AppContext) {
29
29
  const { bskyAppView } = ctx.cfg
30
30
  if (!bskyAppView) return
31
31
  server.app.bsky.feed.getPostThread({
32
- auth: ctx.authVerifier.access,
32
+ auth: ctx.authVerifier.accessStandard(),
33
33
  handler: async ({ req, auth, params }) => {
34
34
  const requester = auth.credentials.did
35
35
 
@@ -14,7 +14,7 @@ export default function (server: Server, ctx: AppContext) {
14
14
  const { bskyAppView } = ctx.cfg
15
15
  if (!bskyAppView) return
16
16
  server.app.bsky.feed.getTimeline({
17
- auth: ctx.authVerifier.access,
17
+ auth: ctx.authVerifier.accessStandard(),
18
18
  handler: async ({ req, auth }) => {
19
19
  const requester = auth.credentials.did
20
20
  const res = await pipethrough(ctx, req, requester)
@@ -4,12 +4,15 @@ import { getNotif } from '@atproto/identity'
4
4
  import { InvalidRequestError } from '@atproto/xrpc-server'
5
5
  import { AtpAgent } from '@atproto/api'
6
6
  import { getDidDoc } from '../util/resolver'
7
+ import { AuthScope } from '../../../../auth-verifier'
7
8
 
8
9
  export default function (server: Server, ctx: AppContext) {
9
10
  const { appViewAgent } = ctx
10
11
  if (!appViewAgent) return
11
12
  server.app.bsky.notification.registerPush({
12
- auth: ctx.authVerifier.accessDeactived,
13
+ auth: ctx.authVerifier.accessStandard({
14
+ additional: [AuthScope.SignupQueued],
15
+ }),
13
16
  handler: async ({ auth, input }) => {
14
17
  const { serviceDid } = input.body
15
18
  const {
@@ -4,85 +4,85 @@ import { pipethrough, pipethroughProcedure } from '../../pipethrough'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  server.chat.bsky.actor.deleteAccount({
7
- auth: ctx.authVerifier.accessAppPassPrivileged,
7
+ auth: ctx.authVerifier.accessPrivileged(),
8
8
  handler: async ({ req, auth }) => {
9
9
  return pipethroughProcedure(ctx, req, auth.credentials.did)
10
10
  },
11
11
  })
12
12
  server.chat.bsky.actor.exportAccountData({
13
- auth: ctx.authVerifier.accessAppPassPrivileged,
13
+ auth: ctx.authVerifier.accessPrivileged(),
14
14
  handler: ({ req, auth }) => {
15
15
  return pipethrough(ctx, req, auth.credentials.did)
16
16
  },
17
17
  })
18
18
  server.chat.bsky.convo.deleteMessageForSelf({
19
- auth: ctx.authVerifier.accessAppPassPrivileged,
19
+ auth: ctx.authVerifier.accessPrivileged(),
20
20
  handler: ({ req, auth, input }) => {
21
21
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
22
22
  },
23
23
  })
24
24
  server.chat.bsky.convo.getConvo({
25
- auth: ctx.authVerifier.accessAppPassPrivileged,
25
+ auth: ctx.authVerifier.accessPrivileged(),
26
26
  handler: ({ req, auth }) => {
27
27
  return pipethrough(ctx, req, auth.credentials.did)
28
28
  },
29
29
  })
30
30
  server.chat.bsky.convo.getConvoForMembers({
31
- auth: ctx.authVerifier.accessAppPassPrivileged,
31
+ auth: ctx.authVerifier.accessPrivileged(),
32
32
  handler: ({ req, auth }) => {
33
33
  return pipethrough(ctx, req, auth.credentials.did)
34
34
  },
35
35
  })
36
36
  server.chat.bsky.convo.getLog({
37
- auth: ctx.authVerifier.accessAppPassPrivileged,
37
+ auth: ctx.authVerifier.accessPrivileged(),
38
38
  handler: ({ req, auth }) => {
39
39
  return pipethrough(ctx, req, auth.credentials.did)
40
40
  },
41
41
  })
42
42
  server.chat.bsky.convo.getMessages({
43
- auth: ctx.authVerifier.accessAppPassPrivileged,
43
+ auth: ctx.authVerifier.accessPrivileged(),
44
44
  handler: ({ req, auth }) => {
45
45
  return pipethrough(ctx, req, auth.credentials.did)
46
46
  },
47
47
  })
48
48
  server.chat.bsky.convo.leaveConvo({
49
- auth: ctx.authVerifier.accessAppPassPrivileged,
49
+ auth: ctx.authVerifier.accessPrivileged(),
50
50
  handler: ({ req, auth, input }) => {
51
51
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
52
52
  },
53
53
  })
54
54
  server.chat.bsky.convo.listConvos({
55
- auth: ctx.authVerifier.accessAppPassPrivileged,
55
+ auth: ctx.authVerifier.accessPrivileged(),
56
56
  handler: ({ req, auth }) => {
57
57
  return pipethrough(ctx, req, auth.credentials.did)
58
58
  },
59
59
  })
60
60
  server.chat.bsky.convo.muteConvo({
61
- auth: ctx.authVerifier.accessAppPassPrivileged,
61
+ auth: ctx.authVerifier.accessPrivileged(),
62
62
  handler: ({ req, auth, input }) => {
63
63
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
64
64
  },
65
65
  })
66
66
  server.chat.bsky.convo.sendMessage({
67
- auth: ctx.authVerifier.accessAppPassPrivileged,
67
+ auth: ctx.authVerifier.accessPrivileged(),
68
68
  handler: ({ req, auth, input }) => {
69
69
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
70
70
  },
71
71
  })
72
72
  server.chat.bsky.convo.sendMessageBatch({
73
- auth: ctx.authVerifier.accessAppPassPrivileged,
73
+ auth: ctx.authVerifier.accessPrivileged(),
74
74
  handler: ({ req, auth, input }) => {
75
75
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
76
76
  },
77
77
  })
78
78
  server.chat.bsky.convo.unmuteConvo({
79
- auth: ctx.authVerifier.accessAppPassPrivileged,
79
+ auth: ctx.authVerifier.accessPrivileged(),
80
80
  handler: ({ req, auth, input }) => {
81
81
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
82
82
  },
83
83
  })
84
84
  server.chat.bsky.convo.updateRead({
85
- auth: ctx.authVerifier.accessAppPassPrivileged,
85
+ auth: ctx.authVerifier.accessPrivileged(),
86
86
  handler: ({ req, auth, input }) => {
87
87
  return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
88
88
  },
@@ -1,5 +1,6 @@
1
1
  import { Server } from '../../../../lexicon'
2
2
  import AppContext from '../../../../context'
3
+ import { AccountStatus } from '../../../../account-manager'
3
4
 
4
5
  export default function (server: Server, ctx: AppContext) {
5
6
  server.com.atproto.admin.deleteAccount({
@@ -8,8 +9,12 @@ export default function (server: Server, ctx: AppContext) {
8
9
  const { did } = input.body
9
10
  await ctx.actorStore.destroy(did)
10
11
  await ctx.accountManager.deleteAccount(did)
11
- await ctx.sequencer.sequenceTombstone(did)
12
- await ctx.sequencer.deleteAllForUser(did)
12
+ const tombstoneSeq = await ctx.sequencer.sequenceTombstone(did)
13
+ const accountSeq = await ctx.sequencer.sequenceAccountEvt(
14
+ did,
15
+ AccountStatus.Deleted,
16
+ )
17
+ await ctx.sequencer.deleteAllForUser(did, [accountSeq, tombstoneSeq])
13
18
  },
14
19
  })
15
20
  }
@@ -32,6 +32,7 @@ export default function (server: Server, ctx: AppContext) {
32
32
  invitesDisabled: managesOwnInvites
33
33
  ? account.invitesDisabled === 1
34
34
  : undefined,
35
+ deactivatedAt: account.deactivatedAt ?? undefined,
35
36
  },
36
37
  }
37
38
  },
@@ -51,14 +51,15 @@ export default function (server: Server, ctx: AppContext) {
51
51
  }
52
52
  }
53
53
  } else if (did) {
54
- const takedown = await ctx.accountManager.getAccountTakedownStatus(did)
55
- if (takedown) {
54
+ const status = await ctx.accountManager.getAccountAdminStatus(did)
55
+ if (status) {
56
56
  body = {
57
57
  subject: {
58
58
  $type: 'com.atproto.admin.defs#repoRef',
59
59
  did: did,
60
60
  },
61
- takedown,
61
+ takedown: status.takedown,
62
+ deactivated: status.deactivated,
62
63
  }
63
64
  }
64
65
  } else {
@@ -45,7 +45,7 @@ export default function (server: Server, ctx: AppContext) {
45
45
 
46
46
  try {
47
47
  await ctx.sequencer.sequenceHandleUpdate(did, handle)
48
- await ctx.sequencer.sequenceIdentityEvt(did)
48
+ await ctx.sequencer.sequenceIdentityEvt(did, handle)
49
49
  } catch (err) {
50
50
  httpLogger.error(
51
51
  { err, did, handle },
@@ -17,6 +17,8 @@ export default function (server: Server, ctx: AppContext) {
17
17
  if (takedown) {
18
18
  if (isRepoRef(subject)) {
19
19
  await ctx.accountManager.takedownAccount(subject.did, takedown)
20
+ const status = await ctx.accountManager.getAccountStatus(subject.did)
21
+ await ctx.sequencer.sequenceAccountEvt(subject.did, status)
20
22
  } else if (isStrongRef(subject)) {
21
23
  const uri = new AtUri(subject.uri)
22
24
  await ctx.actorStore.transact(uri.hostname, (store) =>
@@ -3,7 +3,7 @@ import AppContext from '../../../../context'
3
3
 
4
4
  export default function (server: Server, ctx: AppContext) {
5
5
  server.com.atproto.identity.getRecommendedDidCredentials({
6
- auth: ctx.authVerifier.access,
6
+ auth: ctx.authVerifier.accessStandard(),
7
7
  handler: async ({ auth }) => {
8
8
  const requester = auth.credentials.did
9
9
  const signingKey = await ctx.actorStore.keypair(requester)
@@ -5,7 +5,7 @@ import { authPassthru } from '../../../proxy'
5
5
 
6
6
  export default function (server: Server, ctx: AppContext) {
7
7
  server.com.atproto.identity.requestPlcOperationSignature({
8
- auth: ctx.authVerifier.accessFull,
8
+ auth: ctx.authVerifier.accessFull(),
9
9
  handler: async ({ auth, req }) => {
10
10
  if (ctx.entrywayAgent) {
11
11
  await ctx.entrywayAgent.com.atproto.identity.requestPlcOperationSignature(
@@ -7,7 +7,7 @@ import { authPassthru, resultPassthru } from '../../../proxy'
7
7
 
8
8
  export default function (server: Server, ctx: AppContext) {
9
9
  server.com.atproto.identity.signPlcOperation({
10
- auth: ctx.authVerifier.accessFull,
10
+ auth: ctx.authVerifier.accessFull(),
11
11
  handler: async ({ auth, input, req }) => {
12
12
  if (ctx.entrywayAgent) {
13
13
  return resultPassthru(
@@ -7,7 +7,7 @@ import { httpLogger as log } from '../../../../logger'
7
7
 
8
8
  export default function (server: Server, ctx: AppContext) {
9
9
  server.com.atproto.identity.submitPlcOperation({
10
- auth: ctx.authVerifier.access,
10
+ auth: ctx.authVerifier.accessStandard(),
11
11
  handler: async ({ auth, input }) => {
12
12
  const requester = auth.credentials.did
13
13
  const op = input.body.operation
@@ -47,6 +47,7 @@ export default function (server: Server, ctx: AppContext) {
47
47
 
48
48
  await ctx.plcClient.sendOperation(requester, op)
49
49
  await ctx.sequencer.sequenceIdentityEvt(requester)
50
+
50
51
  try {
51
52
  await ctx.idResolver.did.resolve(requester, true)
52
53
  } catch (err) {
@@ -8,7 +8,7 @@ import { authPassthru } from '../../../proxy'
8
8
 
9
9
  export default function (server: Server, ctx: AppContext) {
10
10
  server.com.atproto.identity.updateHandle({
11
- auth: ctx.authVerifier.accessCheckTakedown,
11
+ auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
12
12
  rateLimit: [
13
13
  {
14
14
  durationMs: 5 * MINUTE,
@@ -57,7 +57,7 @@ export default function (server: Server, ctx: AppContext) {
57
57
 
58
58
  try {
59
59
  await ctx.sequencer.sequenceHandleUpdate(requester, handle)
60
- await ctx.sequencer.sequenceIdentityEvt(requester)
60
+ await ctx.sequencer.sequenceIdentityEvt(requester, handle)
61
61
  } catch (err) {
62
62
  httpLogger.error(
63
63
  { err, did: requester, handle },
@@ -31,7 +31,10 @@ const ratelimitPoints = ({ input }: { input: HandlerInput }) => {
31
31
 
32
32
  export default function (server: Server, ctx: AppContext) {
33
33
  server.com.atproto.repo.applyWrites({
34
- auth: ctx.authVerifier.accessCheckTakedown,
34
+ auth: ctx.authVerifier.accessStandard({
35
+ checkTakedown: true,
36
+ checkDeactivated: true,
37
+ }),
35
38
  rateLimit: [
36
39
  {
37
40
  name: 'repo-write-hour',
@@ -12,7 +12,10 @@ import AppContext from '../../../../context'
12
12
 
13
13
  export default function (server: Server, ctx: AppContext) {
14
14
  server.com.atproto.repo.createRecord({
15
- auth: ctx.authVerifier.accessCheckTakedown,
15
+ auth: ctx.authVerifier.accessStandard({
16
+ checkTakedown: true,
17
+ checkDeactivated: true,
18
+ }),
16
19
  rateLimit: [
17
20
  {
18
21
  name: 'repo-write-hour',
@@ -7,7 +7,10 @@ import { CID } from 'multiformats/cid'
7
7
 
8
8
  export default function (server: Server, ctx: AppContext) {
9
9
  server.com.atproto.repo.deleteRecord({
10
- auth: ctx.authVerifier.accessCheckTakedown,
10
+ auth: ctx.authVerifier.accessStandard({
11
+ checkTakedown: true,
12
+ checkDeactivated: true,
13
+ }),
11
14
  rateLimit: [
12
15
  {
13
16
  name: 'repo-write-hour',
@@ -3,15 +3,13 @@ import * as id from '@atproto/identity'
3
3
  import { Server } from '../../../../lexicon'
4
4
  import AppContext from '../../../../context'
5
5
  import { INVALID_HANDLE } from '@atproto/syntax'
6
+ import { assertRepoAvailability } from '../sync/util'
6
7
 
7
8
  export default function (server: Server, ctx: AppContext) {
8
9
  server.com.atproto.repo.describeRepo(async ({ params }) => {
9
10
  const { repo } = params
10
11
 
11
- const account = await ctx.accountManager.getAccount(repo)
12
- if (account === null) {
13
- throw new InvalidRequestError(`Could not find user: ${repo}`)
14
- }
12
+ const account = await assertRepoAvailability(ctx, repo, false)
15
13
 
16
14
  let didDoc
17
15
  try {
@@ -17,7 +17,9 @@ import { BlobRef, LexValue, RepoRecord } from '@atproto/lexicon'
17
17
 
18
18
  export default function (server: Server, ctx: AppContext) {
19
19
  server.com.atproto.repo.importRepo({
20
- auth: ctx.authVerifier.accessFull,
20
+ auth: ctx.authVerifier.accessFull({
21
+ checkTakedown: true,
22
+ }),
21
23
  handler: async ({ input, auth }) => {
22
24
  const did = auth.credentials.did
23
25
  if (!ctx.cfg.service.acceptingImports) {
@@ -3,7 +3,7 @@ import AppContext from '../../../../context'
3
3
 
4
4
  export default function (server: Server, ctx: AppContext) {
5
5
  server.com.atproto.repo.listMissingBlobs({
6
- auth: ctx.authVerifier.access,
6
+ auth: ctx.authVerifier.accessStandard(),
7
7
  handler: async ({ auth, params }) => {
8
8
  const did = auth.credentials.did
9
9
  const { limit, cursor } = params
@@ -19,7 +19,10 @@ import { ActorStoreTransactor } from '../../../../actor-store'
19
19
 
20
20
  export default function (server: Server, ctx: AppContext) {
21
21
  server.com.atproto.repo.putRecord({
22
- auth: ctx.authVerifier.accessCheckTakedown,
22
+ auth: ctx.authVerifier.accessStandard({
23
+ checkTakedown: true,
24
+ checkDeactivated: true,
25
+ }),
23
26
  rateLimit: [
24
27
  {
25
28
  name: 'repo-write-hour',
@@ -6,7 +6,9 @@ import { BlobMetadata } from '../../../../actor-store/blob/transactor'
6
6
 
7
7
  export default function (server: Server, ctx: AppContext) {
8
8
  server.com.atproto.repo.uploadBlob({
9
- auth: ctx.authVerifier.accessCheckTakedown,
9
+ auth: ctx.authVerifier.accessStandard({
10
+ checkTakedown: true,
11
+ }),
10
12
  rateLimit: {
11
13
  durationMs: DAY,
12
14
  points: 1000,
@@ -7,7 +7,7 @@ import { assertValidDidDocumentForService } from './util'
7
7
 
8
8
  export default function (server: Server, ctx: AppContext) {
9
9
  server.com.atproto.server.activateAccount({
10
- auth: ctx.authVerifier.accessFull,
10
+ auth: ctx.authVerifier.accessFull(),
11
11
  handler: async ({ auth }) => {
12
12
  const requester = auth.credentials.did
13
13
 
@@ -36,7 +36,8 @@ export default function (server: Server, ctx: AppContext) {
36
36
  })
37
37
 
38
38
  // @NOTE: we're over-emitting for now for backwards compatibility, can reduce this in the future
39
- await ctx.sequencer.sequenceIdentityEvt(requester)
39
+ const status = await ctx.accountManager.getAccountStatus(requester)
40
+ await ctx.sequencer.sequenceAccountEvt(requester, status)
40
41
  await ctx.sequencer.sequenceHandleUpdate(
41
42
  requester,
42
43
  account.handle ?? INVALID_HANDLE,
@@ -4,7 +4,7 @@ import { isValidDidDocForService } from './util'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
6
  server.com.atproto.server.checkAccountStatus({
7
- auth: ctx.authVerifier.access,
7
+ auth: ctx.authVerifier.accessStandard(),
8
8
  handler: async ({ auth }) => {
9
9
  const requester = auth.credentials.did
10
10
  const [
@@ -5,7 +5,7 @@ import { authPassthru } from '../../../proxy'
5
5
 
6
6
  export default function (server: Server, ctx: AppContext) {
7
7
  server.com.atproto.server.confirmEmail({
8
- auth: ctx.authVerifier.accessCheckTakedown,
8
+ auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
9
9
  handler: async ({ auth, input, req }) => {
10
10
  const did = auth.credentials.did
11
11