@atproto/pds 0.5.15 → 0.5.17

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 (619) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/account-manager/account-manager.d.ts +13 -13
  3. package/dist/account-manager/account-manager.d.ts.map +1 -1
  4. package/dist/account-manager/account-manager.js +1 -1
  5. package/dist/account-manager/account-manager.js.map +1 -1
  6. package/dist/account-manager/db/index.d.ts +1 -1
  7. package/dist/account-manager/db/index.d.ts.map +1 -1
  8. package/dist/account-manager/db/index.js.map +1 -1
  9. package/dist/account-manager/db/migrations/001-init.d.ts +1 -1
  10. package/dist/account-manager/db/migrations/001-init.d.ts.map +1 -1
  11. package/dist/account-manager/db/migrations/001-init.js.map +1 -1
  12. package/dist/account-manager/db/migrations/002-account-deactivation.d.ts +1 -1
  13. package/dist/account-manager/db/migrations/002-account-deactivation.d.ts.map +1 -1
  14. package/dist/account-manager/db/migrations/002-account-deactivation.js.map +1 -1
  15. package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts +1 -1
  16. package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts.map +1 -1
  17. package/dist/account-manager/db/migrations/003-privileged-app-passwords.js.map +1 -1
  18. package/dist/account-manager/db/migrations/004-oauth.d.ts +1 -1
  19. package/dist/account-manager/db/migrations/004-oauth.d.ts.map +1 -1
  20. package/dist/account-manager/db/migrations/004-oauth.js.map +1 -1
  21. package/dist/account-manager/db/migrations/005-oauth-account-management.d.ts +3 -3
  22. package/dist/account-manager/db/migrations/005-oauth-account-management.d.ts.map +1 -1
  23. package/dist/account-manager/db/migrations/005-oauth-account-management.js.map +1 -1
  24. package/dist/account-manager/db/migrations/006-oauth-permission-sets.d.ts +1 -1
  25. package/dist/account-manager/db/migrations/006-oauth-permission-sets.d.ts.map +1 -1
  26. package/dist/account-manager/db/migrations/006-oauth-permission-sets.js.map +1 -1
  27. package/dist/account-manager/db/migrations/007-lexicon-failures-index.d.ts +1 -1
  28. package/dist/account-manager/db/migrations/007-lexicon-failures-index.d.ts.map +1 -1
  29. package/dist/account-manager/db/migrations/007-lexicon-failures-index.js.map +1 -1
  30. package/dist/account-manager/db/schema/account-device.d.ts +2 -2
  31. package/dist/account-manager/db/schema/account-device.d.ts.map +1 -1
  32. package/dist/account-manager/db/schema/account-device.js.map +1 -1
  33. package/dist/account-manager/db/schema/account.d.ts +2 -2
  34. package/dist/account-manager/db/schema/account.d.ts.map +1 -1
  35. package/dist/account-manager/db/schema/account.js.map +1 -1
  36. package/dist/account-manager/db/schema/actor.d.ts +2 -2
  37. package/dist/account-manager/db/schema/actor.d.ts.map +1 -1
  38. package/dist/account-manager/db/schema/actor.js.map +1 -1
  39. package/dist/account-manager/db/schema/app-password.d.ts +1 -1
  40. package/dist/account-manager/db/schema/app-password.d.ts.map +1 -1
  41. package/dist/account-manager/db/schema/app-password.js.map +1 -1
  42. package/dist/account-manager/db/schema/authorization-request.d.ts +4 -4
  43. package/dist/account-manager/db/schema/authorization-request.d.ts.map +1 -1
  44. package/dist/account-manager/db/schema/authorization-request.js.map +1 -1
  45. package/dist/account-manager/db/schema/authorized-client.d.ts +4 -4
  46. package/dist/account-manager/db/schema/authorized-client.d.ts.map +1 -1
  47. package/dist/account-manager/db/schema/authorized-client.js.map +1 -1
  48. package/dist/account-manager/db/schema/device.d.ts +3 -3
  49. package/dist/account-manager/db/schema/device.d.ts.map +1 -1
  50. package/dist/account-manager/db/schema/device.js.map +1 -1
  51. package/dist/account-manager/db/schema/email-token.d.ts +1 -1
  52. package/dist/account-manager/db/schema/email-token.d.ts.map +1 -1
  53. package/dist/account-manager/db/schema/email-token.js.map +1 -1
  54. package/dist/account-manager/db/schema/index.d.ts +14 -14
  55. package/dist/account-manager/db/schema/index.d.ts.map +1 -1
  56. package/dist/account-manager/db/schema/index.js.map +1 -1
  57. package/dist/account-manager/db/schema/invite-code.d.ts +1 -1
  58. package/dist/account-manager/db/schema/invite-code.d.ts.map +1 -1
  59. package/dist/account-manager/db/schema/invite-code.js.map +1 -1
  60. package/dist/account-manager/db/schema/lexicon.d.ts +2 -2
  61. package/dist/account-manager/db/schema/lexicon.d.ts.map +1 -1
  62. package/dist/account-manager/db/schema/lexicon.js.map +1 -1
  63. package/dist/account-manager/db/schema/repo-root.d.ts +1 -1
  64. package/dist/account-manager/db/schema/repo-root.d.ts.map +1 -1
  65. package/dist/account-manager/db/schema/repo-root.js.map +1 -1
  66. package/dist/account-manager/db/schema/token.d.ts +4 -4
  67. package/dist/account-manager/db/schema/token.d.ts.map +1 -1
  68. package/dist/account-manager/db/schema/token.js.map +1 -1
  69. package/dist/account-manager/db/schema/used-refresh-token.d.ts +2 -2
  70. package/dist/account-manager/db/schema/used-refresh-token.d.ts.map +1 -1
  71. package/dist/account-manager/db/schema/used-refresh-token.js.map +1 -1
  72. package/dist/account-manager/helpers/account-device.d.ts +2 -2
  73. package/dist/account-manager/helpers/account-device.d.ts.map +1 -1
  74. package/dist/account-manager/helpers/account-device.js.map +1 -1
  75. package/dist/account-manager/helpers/account.d.ts +3 -3
  76. package/dist/account-manager/helpers/account.d.ts.map +1 -1
  77. package/dist/account-manager/helpers/account.js.map +1 -1
  78. package/dist/account-manager/helpers/auth.d.ts +3 -3
  79. package/dist/account-manager/helpers/auth.d.ts.map +1 -1
  80. package/dist/account-manager/helpers/auth.js.map +1 -1
  81. package/dist/account-manager/helpers/authorization-request.d.ts +5 -5
  82. package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -1
  83. package/dist/account-manager/helpers/authorization-request.js.map +1 -1
  84. package/dist/account-manager/helpers/authorized-client.d.ts +2 -2
  85. package/dist/account-manager/helpers/authorized-client.d.ts.map +1 -1
  86. package/dist/account-manager/helpers/authorized-client.js.map +1 -1
  87. package/dist/account-manager/helpers/device.d.ts +3 -3
  88. package/dist/account-manager/helpers/device.d.ts.map +1 -1
  89. package/dist/account-manager/helpers/device.js.map +1 -1
  90. package/dist/account-manager/helpers/email-token.d.ts +2 -2
  91. package/dist/account-manager/helpers/email-token.d.ts.map +1 -1
  92. package/dist/account-manager/helpers/email-token.js.map +1 -1
  93. package/dist/account-manager/helpers/invite.d.ts +3 -3
  94. package/dist/account-manager/helpers/invite.d.ts.map +1 -1
  95. package/dist/account-manager/helpers/invite.js +1 -1
  96. package/dist/account-manager/helpers/invite.js.map +1 -1
  97. package/dist/account-manager/helpers/lexicon.d.ts +2 -2
  98. package/dist/account-manager/helpers/lexicon.d.ts.map +1 -1
  99. package/dist/account-manager/helpers/lexicon.js +1 -1
  100. package/dist/account-manager/helpers/lexicon.js.map +1 -1
  101. package/dist/account-manager/helpers/password.d.ts +3 -3
  102. package/dist/account-manager/helpers/password.d.ts.map +1 -1
  103. package/dist/account-manager/helpers/password.js.map +1 -1
  104. package/dist/account-manager/helpers/repo.d.ts +2 -2
  105. package/dist/account-manager/helpers/repo.d.ts.map +1 -1
  106. package/dist/account-manager/helpers/repo.js.map +1 -1
  107. package/dist/account-manager/helpers/token.d.ts +4 -4
  108. package/dist/account-manager/helpers/token.d.ts.map +1 -1
  109. package/dist/account-manager/helpers/token.js.map +1 -1
  110. package/dist/account-manager/helpers/used-refresh-token.d.ts +2 -2
  111. package/dist/account-manager/helpers/used-refresh-token.d.ts.map +1 -1
  112. package/dist/account-manager/helpers/used-refresh-token.js.map +1 -1
  113. package/dist/account-manager/oauth-store.d.ts +10 -10
  114. package/dist/account-manager/oauth-store.d.ts.map +1 -1
  115. package/dist/account-manager/oauth-store.js +3 -3
  116. package/dist/account-manager/oauth-store.js.map +1 -1
  117. package/dist/account-manager/scope-reference-getter.d.ts +4 -4
  118. package/dist/account-manager/scope-reference-getter.d.ts.map +1 -1
  119. package/dist/account-manager/scope-reference-getter.js +1 -1
  120. package/dist/account-manager/scope-reference-getter.js.map +1 -1
  121. package/dist/actor-store/actor-store-reader.d.ts +3 -3
  122. package/dist/actor-store/actor-store-reader.d.ts.map +1 -1
  123. package/dist/actor-store/actor-store-reader.js.map +1 -1
  124. package/dist/actor-store/actor-store-resources.d.ts +2 -2
  125. package/dist/actor-store/actor-store-resources.d.ts.map +1 -1
  126. package/dist/actor-store/actor-store-resources.js.map +1 -1
  127. package/dist/actor-store/actor-store-transactor.d.ts +3 -3
  128. package/dist/actor-store/actor-store-transactor.d.ts.map +1 -1
  129. package/dist/actor-store/actor-store-transactor.js.map +1 -1
  130. package/dist/actor-store/actor-store.d.ts +4 -4
  131. package/dist/actor-store/actor-store.d.ts.map +1 -1
  132. package/dist/actor-store/actor-store.js.map +1 -1
  133. package/dist/actor-store/blob/reader.d.ts +6 -6
  134. package/dist/actor-store/blob/reader.d.ts.map +1 -1
  135. package/dist/actor-store/blob/reader.js.map +1 -1
  136. package/dist/actor-store/blob/transactor.d.ts +8 -8
  137. package/dist/actor-store/blob/transactor.d.ts.map +1 -1
  138. package/dist/actor-store/blob/transactor.js.map +1 -1
  139. package/dist/actor-store/db/index.d.ts +1 -1
  140. package/dist/actor-store/db/index.d.ts.map +1 -1
  141. package/dist/actor-store/db/index.js.map +1 -1
  142. package/dist/actor-store/db/migrations/001-init.d.ts +1 -1
  143. package/dist/actor-store/db/migrations/001-init.d.ts.map +1 -1
  144. package/dist/actor-store/db/migrations/001-init.js.map +1 -1
  145. package/dist/actor-store/db/schema/account-pref.d.ts +1 -1
  146. package/dist/actor-store/db/schema/account-pref.d.ts.map +1 -1
  147. package/dist/actor-store/db/schema/account-pref.js.map +1 -1
  148. package/dist/actor-store/db/schema/index.d.ts +7 -7
  149. package/dist/actor-store/db/schema/index.d.ts.map +1 -1
  150. package/dist/actor-store/db/schema/index.js.map +1 -1
  151. package/dist/actor-store/migrate.d.ts +1 -1
  152. package/dist/actor-store/migrate.d.ts.map +1 -1
  153. package/dist/actor-store/migrate.js.map +1 -1
  154. package/dist/actor-store/preference/reader.d.ts +2 -2
  155. package/dist/actor-store/preference/reader.d.ts.map +1 -1
  156. package/dist/actor-store/preference/reader.js.map +1 -1
  157. package/dist/actor-store/preference/transactor.d.ts +2 -2
  158. package/dist/actor-store/preference/transactor.d.ts.map +1 -1
  159. package/dist/actor-store/preference/transactor.js.map +1 -1
  160. package/dist/actor-store/record/reader.d.ts +5 -5
  161. package/dist/actor-store/record/reader.d.ts.map +1 -1
  162. package/dist/actor-store/record/reader.js.map +1 -1
  163. package/dist/actor-store/record/transactor.d.ts +5 -5
  164. package/dist/actor-store/record/transactor.d.ts.map +1 -1
  165. package/dist/actor-store/record/transactor.js.map +1 -1
  166. package/dist/actor-store/repo/reader.d.ts +3 -3
  167. package/dist/actor-store/repo/reader.d.ts.map +1 -1
  168. package/dist/actor-store/repo/reader.js.map +1 -1
  169. package/dist/actor-store/repo/sql-repo-reader.d.ts +3 -3
  170. package/dist/actor-store/repo/sql-repo-reader.d.ts.map +1 -1
  171. package/dist/actor-store/repo/sql-repo-reader.js.map +1 -1
  172. package/dist/actor-store/repo/sql-repo-transactor.d.ts +3 -3
  173. package/dist/actor-store/repo/sql-repo-transactor.d.ts.map +1 -1
  174. package/dist/actor-store/repo/sql-repo-transactor.js.map +1 -1
  175. package/dist/actor-store/repo/transactor.d.ts +7 -7
  176. package/dist/actor-store/repo/transactor.d.ts.map +1 -1
  177. package/dist/actor-store/repo/transactor.js +1 -1
  178. package/dist/actor-store/repo/transactor.js.map +1 -1
  179. package/dist/api/app/bsky/actor/getPreferences.d.ts +2 -2
  180. package/dist/api/app/bsky/actor/getPreferences.d.ts.map +1 -1
  181. package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
  182. package/dist/api/app/bsky/actor/getProfile.d.ts +2 -2
  183. package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
  184. package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
  185. package/dist/api/app/bsky/actor/getProfiles.d.ts +2 -2
  186. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  187. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  188. package/dist/api/app/bsky/actor/index.d.ts +2 -2
  189. package/dist/api/app/bsky/actor/index.d.ts.map +1 -1
  190. package/dist/api/app/bsky/actor/index.js.map +1 -1
  191. package/dist/api/app/bsky/actor/putPreferences.d.ts +2 -2
  192. package/dist/api/app/bsky/actor/putPreferences.d.ts.map +1 -1
  193. package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
  194. package/dist/api/app/bsky/feed/getActorLikes.d.ts +2 -2
  195. package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
  196. package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
  197. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +2 -2
  198. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  199. package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
  200. package/dist/api/app/bsky/feed/getFeed.d.ts +2 -2
  201. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  202. package/dist/api/app/bsky/feed/getFeed.js +1 -1
  203. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  204. package/dist/api/app/bsky/feed/getPostThread.d.ts +2 -2
  205. package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
  206. package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
  207. package/dist/api/app/bsky/feed/getTimeline.d.ts +2 -2
  208. package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
  209. package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
  210. package/dist/api/app/bsky/feed/index.d.ts +2 -2
  211. package/dist/api/app/bsky/feed/index.d.ts.map +1 -1
  212. package/dist/api/app/bsky/feed/index.js.map +1 -1
  213. package/dist/api/app/bsky/index.d.ts +2 -2
  214. package/dist/api/app/bsky/index.d.ts.map +1 -1
  215. package/dist/api/app/bsky/index.js.map +1 -1
  216. package/dist/api/app/bsky/notification/index.d.ts +2 -2
  217. package/dist/api/app/bsky/notification/index.d.ts.map +1 -1
  218. package/dist/api/app/bsky/notification/index.js.map +1 -1
  219. package/dist/api/app/bsky/notification/registerPush.d.ts +2 -2
  220. package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
  221. package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
  222. package/dist/api/app/bsky/notification/unregisterPush.d.ts +2 -2
  223. package/dist/api/app/bsky/notification/unregisterPush.d.ts.map +1 -1
  224. package/dist/api/app/bsky/notification/unregisterPush.js.map +1 -1
  225. package/dist/api/app/bsky/util/resolver.d.ts +1 -1
  226. package/dist/api/app/bsky/util/resolver.d.ts.map +1 -1
  227. package/dist/api/app/bsky/util/resolver.js +1 -1
  228. package/dist/api/app/bsky/util/resolver.js.map +1 -1
  229. package/dist/api/com/atproto/admin/deleteAccount.d.ts +2 -2
  230. package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
  231. package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
  232. package/dist/api/com/atproto/admin/disableAccountInvites.d.ts +2 -2
  233. package/dist/api/com/atproto/admin/disableAccountInvites.d.ts.map +1 -1
  234. package/dist/api/com/atproto/admin/disableAccountInvites.js.map +1 -1
  235. package/dist/api/com/atproto/admin/disableInviteCodes.d.ts +2 -2
  236. package/dist/api/com/atproto/admin/disableInviteCodes.d.ts.map +1 -1
  237. package/dist/api/com/atproto/admin/disableInviteCodes.js.map +1 -1
  238. package/dist/api/com/atproto/admin/enableAccountInvites.d.ts +2 -2
  239. package/dist/api/com/atproto/admin/enableAccountInvites.d.ts.map +1 -1
  240. package/dist/api/com/atproto/admin/enableAccountInvites.js.map +1 -1
  241. package/dist/api/com/atproto/admin/getAccountInfo.d.ts +2 -2
  242. package/dist/api/com/atproto/admin/getAccountInfo.d.ts.map +1 -1
  243. package/dist/api/com/atproto/admin/getAccountInfo.js.map +1 -1
  244. package/dist/api/com/atproto/admin/getAccountInfos.d.ts +2 -2
  245. package/dist/api/com/atproto/admin/getAccountInfos.d.ts.map +1 -1
  246. package/dist/api/com/atproto/admin/getAccountInfos.js.map +1 -1
  247. package/dist/api/com/atproto/admin/getInviteCodes.d.ts +3 -3
  248. package/dist/api/com/atproto/admin/getInviteCodes.d.ts.map +1 -1
  249. package/dist/api/com/atproto/admin/getInviteCodes.js.map +1 -1
  250. package/dist/api/com/atproto/admin/getSubjectStatus.d.ts +2 -2
  251. package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
  252. package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
  253. package/dist/api/com/atproto/admin/index.d.ts +2 -2
  254. package/dist/api/com/atproto/admin/index.d.ts.map +1 -1
  255. package/dist/api/com/atproto/admin/index.js.map +1 -1
  256. package/dist/api/com/atproto/admin/sendEmail.d.ts +2 -2
  257. package/dist/api/com/atproto/admin/sendEmail.d.ts.map +1 -1
  258. package/dist/api/com/atproto/admin/sendEmail.js.map +1 -1
  259. package/dist/api/com/atproto/admin/updateAccountEmail.d.ts +2 -2
  260. package/dist/api/com/atproto/admin/updateAccountEmail.d.ts.map +1 -1
  261. package/dist/api/com/atproto/admin/updateAccountEmail.js.map +1 -1
  262. package/dist/api/com/atproto/admin/updateAccountHandle.d.ts +2 -2
  263. package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
  264. package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
  265. package/dist/api/com/atproto/admin/updateAccountPassword.d.ts +2 -2
  266. package/dist/api/com/atproto/admin/updateAccountPassword.d.ts.map +1 -1
  267. package/dist/api/com/atproto/admin/updateAccountPassword.js.map +1 -1
  268. package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts +2 -2
  269. package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
  270. package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
  271. package/dist/api/com/atproto/admin/util.d.ts +4 -4
  272. package/dist/api/com/atproto/admin/util.d.ts.map +1 -1
  273. package/dist/api/com/atproto/admin/util.js.map +1 -1
  274. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.d.ts +2 -2
  275. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.d.ts.map +1 -1
  276. package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js.map +1 -1
  277. package/dist/api/com/atproto/identity/index.d.ts +2 -2
  278. package/dist/api/com/atproto/identity/index.d.ts.map +1 -1
  279. package/dist/api/com/atproto/identity/index.js.map +1 -1
  280. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts +2 -2
  281. package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
  282. package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
  283. package/dist/api/com/atproto/identity/resolveHandle.d.ts +2 -2
  284. package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
  285. package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
  286. package/dist/api/com/atproto/identity/signPlcOperation.d.ts +2 -2
  287. package/dist/api/com/atproto/identity/signPlcOperation.d.ts.map +1 -1
  288. package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
  289. package/dist/api/com/atproto/identity/submitPlcOperation.d.ts +2 -2
  290. package/dist/api/com/atproto/identity/submitPlcOperation.d.ts.map +1 -1
  291. package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
  292. package/dist/api/com/atproto/identity/updateHandle.d.ts +2 -2
  293. package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
  294. package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
  295. package/dist/api/com/atproto/index.d.ts +2 -2
  296. package/dist/api/com/atproto/index.d.ts.map +1 -1
  297. package/dist/api/com/atproto/index.js.map +1 -1
  298. package/dist/api/com/atproto/moderation/createReport.d.ts +2 -2
  299. package/dist/api/com/atproto/moderation/createReport.d.ts.map +1 -1
  300. package/dist/api/com/atproto/moderation/createReport.js.map +1 -1
  301. package/dist/api/com/atproto/moderation/index.d.ts +2 -2
  302. package/dist/api/com/atproto/moderation/index.d.ts.map +1 -1
  303. package/dist/api/com/atproto/moderation/index.js.map +1 -1
  304. package/dist/api/com/atproto/repo/applyWrites.d.ts +2 -2
  305. package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
  306. package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
  307. package/dist/api/com/atproto/repo/createRecord.d.ts +2 -2
  308. package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
  309. package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
  310. package/dist/api/com/atproto/repo/deleteRecord.d.ts +2 -2
  311. package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
  312. package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
  313. package/dist/api/com/atproto/repo/describeRepo.d.ts +2 -2
  314. package/dist/api/com/atproto/repo/describeRepo.d.ts.map +1 -1
  315. package/dist/api/com/atproto/repo/describeRepo.js.map +1 -1
  316. package/dist/api/com/atproto/repo/getRecord.d.ts +2 -2
  317. package/dist/api/com/atproto/repo/getRecord.d.ts.map +1 -1
  318. package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
  319. package/dist/api/com/atproto/repo/importRepo.d.ts +2 -2
  320. package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
  321. package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
  322. package/dist/api/com/atproto/repo/index.d.ts +2 -2
  323. package/dist/api/com/atproto/repo/index.d.ts.map +1 -1
  324. package/dist/api/com/atproto/repo/index.js.map +1 -1
  325. package/dist/api/com/atproto/repo/listMissingBlobs.d.ts +2 -2
  326. package/dist/api/com/atproto/repo/listMissingBlobs.d.ts.map +1 -1
  327. package/dist/api/com/atproto/repo/listMissingBlobs.js.map +1 -1
  328. package/dist/api/com/atproto/repo/listRecords.d.ts +2 -2
  329. package/dist/api/com/atproto/repo/listRecords.d.ts.map +1 -1
  330. package/dist/api/com/atproto/repo/listRecords.js.map +1 -1
  331. package/dist/api/com/atproto/repo/putRecord.d.ts +2 -2
  332. package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
  333. package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
  334. package/dist/api/com/atproto/repo/uploadBlob.d.ts +2 -2
  335. package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
  336. package/dist/api/com/atproto/repo/uploadBlob.js +9 -2
  337. package/dist/api/com/atproto/repo/uploadBlob.js.map +1 -1
  338. package/dist/api/com/atproto/server/activateAccount.d.ts +2 -2
  339. package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
  340. package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
  341. package/dist/api/com/atproto/server/checkAccountStatus.d.ts +2 -2
  342. package/dist/api/com/atproto/server/checkAccountStatus.d.ts.map +1 -1
  343. package/dist/api/com/atproto/server/checkAccountStatus.js.map +1 -1
  344. package/dist/api/com/atproto/server/confirmEmail.d.ts +2 -2
  345. package/dist/api/com/atproto/server/confirmEmail.d.ts.map +1 -1
  346. package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
  347. package/dist/api/com/atproto/server/createAccount.d.ts +2 -2
  348. package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
  349. package/dist/api/com/atproto/server/createAccount.js +1 -1
  350. package/dist/api/com/atproto/server/createAccount.js.map +1 -1
  351. package/dist/api/com/atproto/server/createAppPassword.d.ts +2 -2
  352. package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
  353. package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
  354. package/dist/api/com/atproto/server/createInviteCode.d.ts +2 -2
  355. package/dist/api/com/atproto/server/createInviteCode.d.ts.map +1 -1
  356. package/dist/api/com/atproto/server/createInviteCode.js.map +1 -1
  357. package/dist/api/com/atproto/server/createInviteCodes.d.ts +2 -2
  358. package/dist/api/com/atproto/server/createInviteCodes.d.ts.map +1 -1
  359. package/dist/api/com/atproto/server/createInviteCodes.js.map +1 -1
  360. package/dist/api/com/atproto/server/createSession.d.ts +2 -2
  361. package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
  362. package/dist/api/com/atproto/server/createSession.js +1 -1
  363. package/dist/api/com/atproto/server/createSession.js.map +1 -1
  364. package/dist/api/com/atproto/server/deactivateAccount.d.ts +2 -2
  365. package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
  366. package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
  367. package/dist/api/com/atproto/server/deleteAccount.d.ts +2 -2
  368. package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
  369. package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
  370. package/dist/api/com/atproto/server/deleteSession.d.ts +2 -2
  371. package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
  372. package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
  373. package/dist/api/com/atproto/server/describeServer.d.ts +2 -2
  374. package/dist/api/com/atproto/server/describeServer.d.ts.map +1 -1
  375. package/dist/api/com/atproto/server/describeServer.js.map +1 -1
  376. package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts +2 -2
  377. package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts.map +1 -1
  378. package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
  379. package/dist/api/com/atproto/server/getServiceAuth.d.ts +2 -2
  380. package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
  381. package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
  382. package/dist/api/com/atproto/server/getSession.d.ts +2 -2
  383. package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
  384. package/dist/api/com/atproto/server/getSession.js +1 -1
  385. package/dist/api/com/atproto/server/getSession.js.map +1 -1
  386. package/dist/api/com/atproto/server/index.d.ts +2 -2
  387. package/dist/api/com/atproto/server/index.d.ts.map +1 -1
  388. package/dist/api/com/atproto/server/index.js.map +1 -1
  389. package/dist/api/com/atproto/server/listAppPasswords.d.ts +2 -2
  390. package/dist/api/com/atproto/server/listAppPasswords.d.ts.map +1 -1
  391. package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
  392. package/dist/api/com/atproto/server/refreshSession.d.ts +2 -2
  393. package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
  394. package/dist/api/com/atproto/server/refreshSession.js +1 -1
  395. package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
  396. package/dist/api/com/atproto/server/requestAccountDelete.d.ts +2 -2
  397. package/dist/api/com/atproto/server/requestAccountDelete.d.ts.map +1 -1
  398. package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
  399. package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts +3 -3
  400. package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts.map +1 -1
  401. package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
  402. package/dist/api/com/atproto/server/requestEmailUpdate.d.ts +3 -3
  403. package/dist/api/com/atproto/server/requestEmailUpdate.d.ts.map +1 -1
  404. package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
  405. package/dist/api/com/atproto/server/requestPasswordReset.d.ts +2 -2
  406. package/dist/api/com/atproto/server/requestPasswordReset.d.ts.map +1 -1
  407. package/dist/api/com/atproto/server/requestPasswordReset.js.map +1 -1
  408. package/dist/api/com/atproto/server/reserveSigningKey.d.ts +2 -2
  409. package/dist/api/com/atproto/server/reserveSigningKey.d.ts.map +1 -1
  410. package/dist/api/com/atproto/server/reserveSigningKey.js.map +1 -1
  411. package/dist/api/com/atproto/server/resetPassword.d.ts +2 -2
  412. package/dist/api/com/atproto/server/resetPassword.d.ts.map +1 -1
  413. package/dist/api/com/atproto/server/resetPassword.js.map +1 -1
  414. package/dist/api/com/atproto/server/revokeAppPassword.d.ts +2 -2
  415. package/dist/api/com/atproto/server/revokeAppPassword.d.ts.map +1 -1
  416. package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
  417. package/dist/api/com/atproto/server/updateEmail.d.ts +2 -2
  418. package/dist/api/com/atproto/server/updateEmail.d.ts.map +1 -1
  419. package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
  420. package/dist/api/com/atproto/server/util.d.ts +4 -4
  421. package/dist/api/com/atproto/server/util.d.ts.map +1 -1
  422. package/dist/api/com/atproto/server/util.js.map +1 -1
  423. package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts +2 -2
  424. package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts.map +1 -1
  425. package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
  426. package/dist/api/com/atproto/sync/deprecated/getHead.d.ts +2 -2
  427. package/dist/api/com/atproto/sync/deprecated/getHead.d.ts.map +1 -1
  428. package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
  429. package/dist/api/com/atproto/sync/getBlob.d.ts +2 -2
  430. package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
  431. package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
  432. package/dist/api/com/atproto/sync/getBlocks.d.ts +2 -2
  433. package/dist/api/com/atproto/sync/getBlocks.d.ts.map +1 -1
  434. package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
  435. package/dist/api/com/atproto/sync/getLatestCommit.d.ts +2 -2
  436. package/dist/api/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
  437. package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
  438. package/dist/api/com/atproto/sync/getRecord.d.ts +2 -2
  439. package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
  440. package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
  441. package/dist/api/com/atproto/sync/getRepo.d.ts +3 -3
  442. package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
  443. package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
  444. package/dist/api/com/atproto/sync/getRepoStatus.d.ts +2 -2
  445. package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -1
  446. package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
  447. package/dist/api/com/atproto/sync/index.d.ts +2 -2
  448. package/dist/api/com/atproto/sync/index.d.ts.map +1 -1
  449. package/dist/api/com/atproto/sync/index.js.map +1 -1
  450. package/dist/api/com/atproto/sync/listBlobs.d.ts +2 -2
  451. package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
  452. package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
  453. package/dist/api/com/atproto/sync/listRepos.d.ts +3 -3
  454. package/dist/api/com/atproto/sync/listRepos.d.ts.map +1 -1
  455. package/dist/api/com/atproto/sync/listRepos.js +1 -1
  456. package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
  457. package/dist/api/com/atproto/sync/subscribeRepos.d.ts +2 -2
  458. package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
  459. package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
  460. package/dist/api/com/atproto/sync/util.d.ts +3 -3
  461. package/dist/api/com/atproto/sync/util.d.ts.map +1 -1
  462. package/dist/api/com/atproto/sync/util.js.map +1 -1
  463. package/dist/api/com/atproto/temp/checkSignupQueue.d.ts +2 -2
  464. package/dist/api/com/atproto/temp/checkSignupQueue.d.ts.map +1 -1
  465. package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
  466. package/dist/api/com/atproto/temp/index.d.ts +2 -2
  467. package/dist/api/com/atproto/temp/index.d.ts.map +1 -1
  468. package/dist/api/com/atproto/temp/index.js.map +1 -1
  469. package/dist/api/index.d.ts +2 -2
  470. package/dist/api/index.d.ts.map +1 -1
  471. package/dist/api/index.js.map +1 -1
  472. package/dist/api/proxy.d.ts +2 -2
  473. package/dist/api/proxy.d.ts.map +1 -1
  474. package/dist/api/proxy.js.map +1 -1
  475. package/dist/auth-output.d.ts +3 -3
  476. package/dist/auth-output.d.ts.map +1 -1
  477. package/dist/auth-output.js.map +1 -1
  478. package/dist/auth-routes.d.ts +1 -1
  479. package/dist/auth-routes.d.ts.map +1 -1
  480. package/dist/auth-routes.js +4 -2
  481. package/dist/auth-routes.js.map +1 -1
  482. package/dist/auth-verifier.d.ts +11 -11
  483. package/dist/auth-verifier.d.ts.map +1 -1
  484. package/dist/auth-verifier.js +2 -2
  485. package/dist/auth-verifier.js.map +1 -1
  486. package/dist/basic-routes.d.ts +1 -1
  487. package/dist/basic-routes.d.ts.map +1 -1
  488. package/dist/basic-routes.js.map +1 -1
  489. package/dist/config/config.d.ts +4 -3
  490. package/dist/config/config.d.ts.map +1 -1
  491. package/dist/config/config.js +1 -0
  492. package/dist/config/config.js.map +1 -1
  493. package/dist/config/env.d.ts +1 -0
  494. package/dist/config/env.d.ts.map +1 -1
  495. package/dist/config/env.js +1 -0
  496. package/dist/config/env.js.map +1 -1
  497. package/dist/config/secrets.d.ts +1 -1
  498. package/dist/config/secrets.d.ts.map +1 -1
  499. package/dist/config/secrets.js.map +1 -1
  500. package/dist/context.d.ts +8 -8
  501. package/dist/context.d.ts.map +1 -1
  502. package/dist/context.js +4 -2
  503. package/dist/context.js.map +1 -1
  504. package/dist/crawlers.d.ts +1 -1
  505. package/dist/crawlers.d.ts.map +1 -1
  506. package/dist/crawlers.js.map +1 -1
  507. package/dist/db/db.js.map +1 -1
  508. package/dist/db/migrator.d.ts +2 -2
  509. package/dist/db/migrator.d.ts.map +1 -1
  510. package/dist/db/migrator.js.map +1 -1
  511. package/dist/db/pagination.d.ts +2 -2
  512. package/dist/db/pagination.d.ts.map +1 -1
  513. package/dist/db/pagination.js.map +1 -1
  514. package/dist/db/tables/moderation.d.ts +2 -2
  515. package/dist/db/tables/moderation.d.ts.map +1 -1
  516. package/dist/db/tables/moderation.js.map +1 -1
  517. package/dist/db/util.d.ts +1 -1
  518. package/dist/db/util.d.ts.map +1 -1
  519. package/dist/db/util.js.map +1 -1
  520. package/dist/did-cache/db/index.d.ts +1 -1
  521. package/dist/did-cache/db/index.d.ts.map +1 -1
  522. package/dist/did-cache/db/index.js.map +1 -1
  523. package/dist/did-cache/db/migrations.d.ts +1 -1
  524. package/dist/did-cache/db/migrations.d.ts.map +1 -1
  525. package/dist/did-cache/db/migrations.js.map +1 -1
  526. package/dist/did-cache/index.d.ts +2 -2
  527. package/dist/did-cache/index.d.ts.map +1 -1
  528. package/dist/did-cache/index.js.map +1 -1
  529. package/dist/disk-blobstore.d.ts +3 -3
  530. package/dist/disk-blobstore.d.ts.map +1 -1
  531. package/dist/disk-blobstore.js.map +1 -1
  532. package/dist/error.d.ts +1 -1
  533. package/dist/error.d.ts.map +1 -1
  534. package/dist/error.js +1 -1
  535. package/dist/error.js.map +1 -1
  536. package/dist/image/image-url-builder.d.ts +1 -1
  537. package/dist/image/image-url-builder.d.ts.map +1 -1
  538. package/dist/image/image-url-builder.js.map +1 -1
  539. package/dist/index.d.ts +5 -5
  540. package/dist/index.d.ts.map +1 -1
  541. package/dist/index.js +1 -0
  542. package/dist/index.js.map +1 -1
  543. package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +1 -1
  544. package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
  545. package/dist/logger.d.ts +1 -1
  546. package/dist/logger.d.ts.map +1 -1
  547. package/dist/logger.js.map +1 -1
  548. package/dist/mailer/index.d.ts +2 -2
  549. package/dist/mailer/index.d.ts.map +1 -1
  550. package/dist/mailer/index.js.map +1 -1
  551. package/dist/mailer/moderation.d.ts +2 -2
  552. package/dist/mailer/moderation.d.ts.map +1 -1
  553. package/dist/mailer/moderation.js.map +1 -1
  554. package/dist/pipethrough.d.ts +7 -7
  555. package/dist/pipethrough.d.ts.map +1 -1
  556. package/dist/pipethrough.js.map +1 -1
  557. package/dist/read-after-write/types.d.ts +4 -4
  558. package/dist/read-after-write/types.d.ts.map +1 -1
  559. package/dist/read-after-write/types.js.map +1 -1
  560. package/dist/read-after-write/util.d.ts +5 -5
  561. package/dist/read-after-write/util.d.ts.map +1 -1
  562. package/dist/read-after-write/util.js.map +1 -1
  563. package/dist/read-after-write/viewer.d.ts +7 -7
  564. package/dist/read-after-write/viewer.d.ts.map +1 -1
  565. package/dist/read-after-write/viewer.js +1 -1
  566. package/dist/read-after-write/viewer.js.map +1 -1
  567. package/dist/repo/prepare.d.ts +4 -4
  568. package/dist/repo/prepare.d.ts.map +1 -1
  569. package/dist/repo/prepare.js.map +1 -1
  570. package/dist/repo/types.d.ts +3 -3
  571. package/dist/repo/types.d.ts.map +1 -1
  572. package/dist/repo/types.js.map +1 -1
  573. package/dist/scripts/publish-identity.d.ts +2 -2
  574. package/dist/scripts/publish-identity.d.ts.map +1 -1
  575. package/dist/scripts/publish-identity.js.map +1 -1
  576. package/dist/scripts/rebuild-repo.d.ts +4 -4
  577. package/dist/scripts/rebuild-repo.d.ts.map +1 -1
  578. package/dist/scripts/rebuild-repo.js.map +1 -1
  579. package/dist/scripts/rotate-keys.d.ts +6 -6
  580. package/dist/scripts/rotate-keys.d.ts.map +1 -1
  581. package/dist/scripts/rotate-keys.js.map +1 -1
  582. package/dist/scripts/sequencer-recovery/index.d.ts +1 -1
  583. package/dist/scripts/sequencer-recovery/index.d.ts.map +1 -1
  584. package/dist/scripts/sequencer-recovery/index.js.map +1 -1
  585. package/dist/scripts/sequencer-recovery/recoverer.d.ts +4 -4
  586. package/dist/scripts/sequencer-recovery/recoverer.d.ts.map +1 -1
  587. package/dist/scripts/sequencer-recovery/recoverer.js.map +1 -1
  588. package/dist/scripts/sequencer-recovery/recovery-db.d.ts +1 -1
  589. package/dist/scripts/sequencer-recovery/recovery-db.d.ts.map +1 -1
  590. package/dist/scripts/sequencer-recovery/recovery-db.js.map +1 -1
  591. package/dist/scripts/sequencer-recovery/repair-repos.d.ts +1 -1
  592. package/dist/scripts/sequencer-recovery/repair-repos.d.ts.map +1 -1
  593. package/dist/scripts/sequencer-recovery/repair-repos.js.map +1 -1
  594. package/dist/sequencer/db/index.d.ts +1 -1
  595. package/dist/sequencer/db/index.d.ts.map +1 -1
  596. package/dist/sequencer/db/index.js.map +1 -1
  597. package/dist/sequencer/db/migrations/001-init.d.ts +1 -1
  598. package/dist/sequencer/db/migrations/001-init.d.ts.map +1 -1
  599. package/dist/sequencer/db/migrations/001-init.js.map +1 -1
  600. package/dist/sequencer/db/schema.d.ts +1 -1
  601. package/dist/sequencer/db/schema.d.ts.map +1 -1
  602. package/dist/sequencer/db/schema.js.map +1 -1
  603. package/dist/sequencer/events.d.ts +3 -3
  604. package/dist/sequencer/events.d.ts.map +1 -1
  605. package/dist/sequencer/events.js.map +1 -1
  606. package/dist/sequencer/outbox.d.ts +1 -1
  607. package/dist/sequencer/outbox.d.ts.map +1 -1
  608. package/dist/sequencer/outbox.js.map +1 -1
  609. package/dist/sequencer/sequencer.d.ts +5 -5
  610. package/dist/sequencer/sequencer.d.ts.map +1 -1
  611. package/dist/sequencer/sequencer.js.map +1 -1
  612. package/dist/util/compression.js.map +1 -1
  613. package/dist/util/http.d.ts +1 -1
  614. package/dist/util/http.d.ts.map +1 -1
  615. package/dist/util/http.js.map +1 -1
  616. package/dist/well-known.d.ts +1 -1
  617. package/dist/well-known.d.ts.map +1 -1
  618. package/dist/well-known.js.map +1 -1
  619. package/package.json +25 -25
@@ -1 +1 @@
1
- {"version":3,"file":"submitPlcOperation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyDvD"}
1
+ {"version":3,"file":"submitPlcOperation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyDvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"submitPlcOperation.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names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E,GAAG,EAAE,SAAS,EAAE,EACvB,wCAAwC,CACzC,CAAA;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import * as plc from '@did-plc/lib'\nimport { check } from '@atproto/common'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { httpLogger as log } from '../../../../logger.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.identity.submitPlcOperation, {\n auth: ctx.authVerifier.authorization({\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: '*' })\n },\n }),\n handler: async ({ auth, input }) => {\n const requester = auth.credentials.did\n const op = input.body.operation\n\n if (!check.is(op, plc.def.operation)) {\n throw new InvalidRequestError('Invalid operation')\n }\n\n const rotationKey =\n ctx.cfg.entryway?.plcRotationKey ?? ctx.plcRotationKey.did()\n if (!op.rotationKeys.includes(rotationKey)) {\n throw new InvalidRequestError(\n \"Rotation keys do not include server's rotation key\",\n )\n }\n if (op.services['atproto_pds']?.type !== 'AtprotoPersonalDataServer') {\n throw new InvalidRequestError('Incorrect type on atproto_pds service')\n }\n if (op.services['atproto_pds']?.endpoint !== ctx.cfg.service.publicUrl) {\n throw new InvalidRequestError(\n 'Incorrect endpoint on atproto_pds service',\n )\n }\n const signingKey = await ctx.actorStore.keypair(requester)\n if (op.verificationMethods['atproto'] !== signingKey.did()) {\n throw new InvalidRequestError('Incorrect signing key')\n }\n const account = await ctx.accountManager.getAccount(requester, {\n includeDeactivated: true,\n })\n if (\n account?.handle &&\n op.alsoKnownAs.at(0) !== `at://${account.handle}`\n ) {\n throw new InvalidRequestError('Incorrect handle in alsoKnownAs')\n }\n\n await ctx.plcClient.sendOperation(requester, op)\n await ctx.sequencer.sequenceIdentity(requester)\n\n try {\n await ctx.idResolver.did.resolve(requester, true)\n } catch (err) {\n log.error(\n { err, did: requester },\n 'failed to refresh did after plc update',\n )\n }\n },\n })\n}\n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AAA;YACnD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,KAAK,CACP,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EACvB,wCAAwC,CACzC,CAAA;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import * as plc from '@did-plc/lib'\nimport { check } from '@atproto/common'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { httpLogger as log } from '../../../../logger.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.identity.submitPlcOperation, {\n auth: ctx.authVerifier.authorization({\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: '*' })\n },\n }),\n handler: async ({ auth, input }) => {\n const requester = auth.credentials.did\n const op = input.body.operation\n\n if (!check.is(op, plc.def.operation)) {\n throw new InvalidRequestError('Invalid operation')\n }\n\n const rotationKey =\n ctx.cfg.entryway?.plcRotationKey ?? ctx.plcRotationKey.did()\n if (!op.rotationKeys.includes(rotationKey)) {\n throw new InvalidRequestError(\n \"Rotation keys do not include server's rotation key\",\n )\n }\n if (op.services['atproto_pds']?.type !== 'AtprotoPersonalDataServer') {\n throw new InvalidRequestError('Incorrect type on atproto_pds service')\n }\n if (op.services['atproto_pds']?.endpoint !== ctx.cfg.service.publicUrl) {\n throw new InvalidRequestError(\n 'Incorrect endpoint on atproto_pds service',\n )\n }\n const signingKey = await ctx.actorStore.keypair(requester)\n if (op.verificationMethods['atproto'] !== signingKey.did()) {\n throw new InvalidRequestError('Incorrect signing key')\n }\n const account = await ctx.accountManager.getAccount(requester, {\n includeDeactivated: true,\n })\n if (\n account?.handle &&\n op.alsoKnownAs.at(0) !== `at://${account.handle}`\n ) {\n throw new InvalidRequestError('Incorrect handle in alsoKnownAs')\n }\n\n await ctx.plcClient.sendOperation(requester, op)\n await ctx.sequencer.sequenceIdentity(requester)\n\n try {\n await ctx.idResolver.did.resolve(requester, true)\n } catch (err) {\n log.error(\n { err, did: requester },\n 'failed to refresh did after plc update',\n )\n }\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=updateHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateHandle.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2DvD"}
1
+ {"version":3,"file":"updateHandle.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2DvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"updateHandle.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAI7C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YA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F,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5C,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACjC,MAAM,GAAG,CAAC,cAAc,CAAC,YAAY,CACnC,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAClB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, MINUTE } from '@atproto/common'\nimport { MethodRateLimit, Server } from '@atproto/xrpc-server'\nimport { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: 'handle' })\n },\n })\n\n const rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: 5 * MINUTE,\n points: 10,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: DAY,\n points: 50,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.identity.updateHandle.$lxm,\n )\n\n // The full flow is:\n // -> entryway(identity.updateHandle) [update handle, submit plc op]\n // -> pds(admin.updateAccountHandle) [track handle, sequence handle update]\n await entrywayClient.xrpc(com.atproto.identity.updateHandle, {\n headers,\n body: {\n handle: input.body.handle,\n // @ts-expect-error \"did\" is not in the schema\n did: auth.credentials.did,\n },\n })\n },\n })\n } else {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input }) => {\n await ctx.accountManager.updateHandle(\n auth.credentials.did,\n input.body.handle,\n )\n },\n })\n }\n}\n"]}
1
+ {"version":3,"file":"updateHandle.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAI7C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;YACzB,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAChD,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,SAAS,GAAgD;QAC7D;YACE,UAAU,EAAE,CAAC,GAAG,MAAM;YACtB,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;SAC5C;QACD;YACE,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;SAC5C;KACF,CAAA;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5C,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;gBACtC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAC/C,GAAG,EACH,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CACvC,CAAA;gBAED,oBAAoB;gBACpB,oEAAoE;gBACpE,4EAA4E;gBAC5E,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;oBAC3D,OAAO;oBACP,IAAI,EAAE;wBACJ,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM;wBACzB,8CAA8C;wBAC9C,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG;qBAC1B;iBACF,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5C,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACjC,MAAM,GAAG,CAAC,cAAc,CAAC,YAAY,CACnC,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAClB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, MINUTE } from '@atproto/common'\nimport type { MethodRateLimit, Server } from '@atproto/xrpc-server'\nimport type { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: 'handle' })\n },\n })\n\n const rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: 5 * MINUTE,\n points: 10,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: DAY,\n points: 50,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.identity.updateHandle.$lxm,\n )\n\n // The full flow is:\n // -> entryway(identity.updateHandle) [update handle, submit plc op]\n // -> pds(admin.updateAccountHandle) [track handle, sequence handle update]\n await entrywayClient.xrpc(com.atproto.identity.updateHandle, {\n headers,\n body: {\n handle: input.body.handle,\n // @ts-expect-error \"did\" is not in the schema\n did: auth.credentials.did,\n },\n })\n },\n })\n } else {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input }) => {\n await ctx.accountManager.updateHandle(\n auth.credentials.did,\n input.body.handle,\n )\n },\n })\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAShD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAQvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AASrD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAQvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AACpC,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAC9C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../context.js'\nimport admin from './admin/index.js'\nimport identity from './identity/index.js'\nimport moderation from './moderation/index.js'\nimport repo from './repo/index.js'\nimport serverMethods from './server/index.js'\nimport sync from './sync/index.js'\nimport temp from './temp/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n admin(server, ctx)\n identity(server, ctx)\n moderation(server, ctx)\n repo(server, ctx)\n serverMethods(server, ctx)\n sync(server, ctx)\n temp(server, ctx)\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AACpC,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAC9C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../context.js'\nimport admin from './admin/index.js'\nimport identity from './identity/index.js'\nimport moderation from './moderation/index.js'\nimport repo from './repo/index.js'\nimport serverMethods from './server/index.js'\nimport sync from './sync/index.js'\nimport temp from './temp/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n admin(server, ctx)\n identity(server, ctx)\n moderation(server, ctx)\n repo(server, ctx)\n serverMethods(server, ctx)\n sync(server, ctx)\n temp(server, ctx)\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=createReport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
1
+ {"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACpD,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { xrpc } from '@atproto/lex'\nimport { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return xrpc(url, com.atproto.moderation.createReport, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
1
+ {"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACpD,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { xrpc } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return xrpc(url, com.atproto.moderation.createReport, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAEvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAEvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport createReport from './createReport.js'\n\nexport default function (server: Server, ctx: AppContext) {\n createReport(server, ctx)\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport createReport from './createReport.js'\n\nexport default function (server: Server, ctx: AppContext) {\n createReport(server, ctx)\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=applyWrites.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,MAAM,EACP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AA8BnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuKvD"}
1
+ {"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AA8BxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuKvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAElB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,GAGN,EAAE,EAAE;IACH,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,CAAC,CAAA;QACb,CAAC;aAAM,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,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K,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { WriteOpAction } from '@atproto/repo'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n PreparedWrite,\n prepareCreate,\n prepareDelete,\n prepareUpdate,\n} from '../../../../repo/index.js'\n\nconst ratelimitPoints = ({\n input,\n}: {\n input: com.atproto.repo.applyWrites.$Input\n}) => {\n let points = 0\n for (const op of input.body.writes) {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(op)) {\n points += 3\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(op)) {\n points += 2\n } else {\n points += 1\n }\n }\n return points\n}\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.applyWrites, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it is based on the request body\n },\n }),\n\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n ],\n\n opts: {\n jsonLimit: 1_000_000,\n },\n\n handler: async ({ input, auth }) => {\n const { repo, validate, swapCommit, writes } = input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n // Verify permission of every unique \"action\" / \"collection\" pair\n if (auth.credentials.type === 'oauth') {\n // @NOTE Unlike \"importRepo\", we do not require \"action\" = \"*\" here.\n for (const [action, collections] of [\n [\n 'create',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.create.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'update',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.update.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'delete',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.delete.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n ] as const) {\n for (const collection of collections) {\n auth.credentials.permissions.assertRepo({ action, collection })\n }\n }\n }\n\n // @NOTE should preserve order of ts.writes for final use in response\n let preparedWrites: PreparedWrite[]\n try {\n preparedWrites = await Promise.all(\n writes.map(async (write, i) => {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(write)) {\n return prepareCreate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(write)) {\n return prepareUpdate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.delete.$isTypeOf(write)) {\n return prepareDelete({\n did,\n collection: write.collection,\n rkey: write.rkey,\n })\n } else {\n throw new InvalidRequestError(\n `Action not supported: ${write['$type']}`,\n )\n }\n }),\n )\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const commit = await actorTxn.repo\n .processWrites(preparedWrites, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n results: preparedWrites.map(writeToOutputResult),\n },\n }\n },\n })\n}\n\nconst writeToOutputResult = (write: PreparedWrite) => {\n switch (write.action) {\n case WriteOpAction.Create:\n return com.atproto.repo.applyWrites.createResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Update:\n return com.atproto.repo.applyWrites.updateResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Delete:\n return com.atproto.repo.applyWrites.deleteResult.$build({})\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n"]}
1
+ {"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+B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AC,MAAM,EAAE,CAAC;QACrB,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC;gBACtD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC;gBACtD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { WriteOpAction } from '@atproto/repo'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n type PreparedWrite,\n prepareCreate,\n prepareDelete,\n prepareUpdate,\n} from '../../../../repo/index.js'\n\nconst ratelimitPoints = ({\n input,\n}: {\n input: com.atproto.repo.applyWrites.$Input\n}) => {\n let points = 0\n for (const op of input.body.writes) {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(op)) {\n points += 3\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(op)) {\n points += 2\n } else {\n points += 1\n }\n }\n return points\n}\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.applyWrites, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it is based on the request body\n },\n }),\n\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n ],\n\n opts: {\n jsonLimit: 1_000_000,\n },\n\n handler: async ({ input, auth }) => {\n const { repo, validate, swapCommit, writes } = input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n // Verify permission of every unique \"action\" / \"collection\" pair\n if (auth.credentials.type === 'oauth') {\n // @NOTE Unlike \"importRepo\", we do not require \"action\" = \"*\" here.\n for (const [action, collections] of [\n [\n 'create',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.create.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'update',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.update.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'delete',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.delete.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n ] as const) {\n for (const collection of collections) {\n auth.credentials.permissions.assertRepo({ action, collection })\n }\n }\n }\n\n // @NOTE should preserve order of ts.writes for final use in response\n let preparedWrites: PreparedWrite[]\n try {\n preparedWrites = await Promise.all(\n writes.map(async (write, i) => {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(write)) {\n return prepareCreate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(write)) {\n return prepareUpdate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.delete.$isTypeOf(write)) {\n return prepareDelete({\n did,\n collection: write.collection,\n rkey: write.rkey,\n })\n } else {\n throw new InvalidRequestError(\n `Action not supported: ${write['$type']}`,\n )\n }\n }),\n )\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const commit = await actorTxn.repo\n .processWrites(preparedWrites, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n results: preparedWrites.map(writeToOutputResult),\n },\n }\n },\n })\n}\n\nconst writeToOutputResult = (write: PreparedWrite) => {\n switch (write.action) {\n case WriteOpAction.Create:\n return com.atproto.repo.applyWrites.createResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Update:\n return com.atproto.repo.applyWrites.updateResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Delete:\n return com.atproto.repo.applyWrites.deleteResult.$build({})\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=createRecord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,MAAM,EACP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4HvD"}
1
+ {"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4HvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,i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B,CAChC,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;oBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;oBACzB,MAAM,EAAE;wBACN,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;wBAC1B,GAAG,EAAE,MAAM,CAAC,GAAG;qBAChB;oBACD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;iBACzC;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { InvalidRecordKeyError } from '@atproto/syntax'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n PreparedCreate,\n prepareCreate,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.createRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n ],\n opts: {\n jsonLimit: 1_000_000,\n },\n handler: async ({ input, auth }) => {\n const { repo, collection, rkey, record, swapCommit, validate } =\n input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'create',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n let write: PreparedCreate\n try {\n write = await prepareCreate({\n did,\n collection,\n record,\n rkey,\n validate,\n })\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n if (err instanceof InvalidRecordKeyError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const backlinkConflicts =\n validate !== false\n ? await actorTxn.record.getBacklinkConflicts(\n write.uri,\n write.record,\n )\n : []\n const backlinkDeletions = backlinkConflicts.map((uri) =>\n prepareDelete({\n did: uri.did,\n collection: uri.collectionSafe,\n rkey: uri.rkeySafe,\n }),\n )\n const writes = [...backlinkDeletions, write]\n const commit = await actorTxn.repo\n .processWrites(writes, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n }\n throw err\n })\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n uri: write.uri.toString(),\n cid: write.cid.toString(),\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n validationStatus: write.validationStatus,\n },\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"createRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"A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EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,EAC9C,+BAA+B,CAChC,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;oBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;oBACzB,MAAM,EAAE;wBACN,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;wBAC1B,GAAG,EAAE,MAAM,CAAC,GAAG;qBAChB;oBACD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;iBACzC;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { InvalidRecordKeyError } from '@atproto/syntax'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n type PreparedCreate,\n prepareCreate,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.createRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n ],\n opts: {\n jsonLimit: 1_000_000,\n },\n handler: async ({ input, auth }) => {\n const { repo, collection, rkey, record, swapCommit, validate } =\n input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'create',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n let write: PreparedCreate\n try {\n write = await prepareCreate({\n did,\n collection,\n record,\n rkey,\n validate,\n })\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n if (err instanceof InvalidRecordKeyError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const backlinkConflicts =\n validate !== false\n ? await actorTxn.record.getBacklinkConflicts(\n write.uri,\n write.record,\n )\n : []\n const backlinkDeletions = backlinkConflicts.map((uri) =>\n prepareDelete({\n did: uri.did,\n collection: uri.collectionSafe,\n rkey: uri.rkeySafe,\n }),\n )\n const writes = [...backlinkDeletions, write]\n const commit = await actorTxn.repo\n .processWrites(writes, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n }\n throw err\n })\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n uri: write.uri.toString(),\n cid: write.cid.toString(),\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n validationStatus: write.validationStatus,\n },\n }\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=deleteRecord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EACP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AASnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0GvD"}
1
+ {"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AASxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0GvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"deleteRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAA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MAAM,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;gBAC/C,OAAO,MAAM,CAAA;YACf,CAAC,CAAC,CAAA;YAEF,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,MAAM,GAAG,CAAC,cAAc;qBACrB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;qBAC3C,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBACb,QAAQ,CAAC,KAAK,CACZ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,EAC9C,+BAA+B,CAChC,CAAA;gBACH,CAAC,CAAC,CAAA;YACN,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,MAAM,EAAE,MAAM;wBACZ,CAAC,CAAC;4BACE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;4BAC1B,GAAG,EAAE,MAAM,CAAC,GAAG;yBAChB;wBACH,CAAC,CAAC,SAAS;iBACd;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.deleteRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n ],\n handler: async ({ input: { body }, auth }) => {\n const { repo, collection, rkey, swapCommit, swapRecord } = body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n // We can't compute permissions based on the request payload (\"input\") in\n // the 'auth' phase, so we do it here.\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'delete',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n const swapRecordCid = swapRecord ? parseCid(swapRecord) : undefined\n\n const write = prepareDelete({\n did,\n collection,\n rkey,\n swapCid: swapRecordCid,\n })\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const record = await actorTxn.record.getRecord(write.uri, null, true)\n if (!record) {\n return null // No-op if record already doesn't exist\n }\n\n const commit = await actorTxn.repo\n .processWrites([write], swapCommitCid)\n .catch((err) => {\n if (\n err instanceof BadCommitSwapError ||\n err instanceof BadRecordSwapError\n ) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n if (commit !== null) {\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: commit\n ? {\n cid: commit.cid.toString(),\n rev: commit.rev,\n }\n : undefined,\n },\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"deleteRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;QACxC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,wEAAwE;YACxE,uEAAuE;YACvE,0EAA0E;YAC1E,yEAAyE;YACzE,uEAAuE;YACvE,6CAA6C;YAE7C,uBAAuB;YACvB,0BAA0B;YAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,2DAA2D;YAC7D,CAAC;SACF,CAAC;QACF,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;gBAC3C,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;aACpB;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;gBAC3C,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;aACpB;SACF;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAA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QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.deleteRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n ],\n handler: async ({ input: { body }, auth }) => {\n const { repo, collection, rkey, swapCommit, swapRecord } = body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n // We can't compute permissions based on the request payload (\"input\") in\n // the 'auth' phase, so we do it here.\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'delete',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n const swapRecordCid = swapRecord ? parseCid(swapRecord) : undefined\n\n const write = prepareDelete({\n did,\n collection,\n rkey,\n swapCid: swapRecordCid,\n })\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const record = await actorTxn.record.getRecord(write.uri, null, true)\n if (!record) {\n return null // No-op if record already doesn't exist\n }\n\n const commit = await actorTxn.repo\n .processWrites([write], swapCommitCid)\n .catch((err) => {\n if (\n err instanceof BadCommitSwapError ||\n err instanceof BadRecordSwapError\n ) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n if (commit !== null) {\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: commit\n ? {\n cid: commit.cid.toString(),\n rev: commit.rev,\n }\n : undefined,\n },\n }\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=describeRepo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"describeRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmCvD"}
1
+ {"version":3,"file":"describeRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OA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ACnE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,CAC/B,CAAA;QAED,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,cAAc,CAAiB;gBAC1D,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,uEAAuE;gBACvE,MAAM;gBACN,WAAW;gBACX,eAAe;aAChB;SACF,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC","sourcesContent":["import * as id from '@atproto/identity'\nimport { HandleString, INVALID_HANDLE } from '@atproto/syntax'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { assertRepoAvailability } from '../sync/util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(\n com.atproto.repo.describeRepo,\n async ({ params }): Promise<com.atproto.repo.describeRepo.$Output> => {\n const { repo } = params\n\n const account = await assertRepoAvailability(ctx, repo, false)\n\n let didDoc: id.DidDocument\n try {\n didDoc = await ctx.idResolver.did.ensureResolve(account.did)\n } catch (err) {\n throw new InvalidRequestError(`Could not resolve DID: ${err}`)\n }\n\n const handle = id.getHandle(didDoc)\n const handleIsCorrect = handle === account.handle\n\n const collections = await ctx.actorStore.read(account.did, (store) =>\n store.record.listCollections(),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n handle: (account.handle ?? INVALID_HANDLE) as HandleString,\n did: account.did,\n // @ts-expect-error https://github.com/bluesky-social/atproto/pull/4406\n didDoc,\n collections,\n handleIsCorrect,\n },\n }\n },\n )\n}\n"]}
1
+ {"version":3,"file":"describeRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAqB,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EA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,CACF,CAAA;AACH,CAAC","sourcesContent":["import * as id from '@atproto/identity'\nimport { type HandleString, INVALID_HANDLE } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { assertRepoAvailability } from '../sync/util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(\n com.atproto.repo.describeRepo,\n async ({ params }): Promise<com.atproto.repo.describeRepo.$Output> => {\n const { repo } = params\n\n const account = await assertRepoAvailability(ctx, repo, false)\n\n let didDoc: id.DidDocument\n try {\n didDoc = await ctx.idResolver.did.ensureResolve(account.did)\n } catch (err) {\n throw new InvalidRequestError(`Could not resolve DID: ${err}`)\n }\n\n const handle = id.getHandle(didDoc)\n const handleIsCorrect = handle === account.handle\n\n const collections = await ctx.actorStore.read(account.did, (store) =>\n store.record.listCollections(),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n handle: (account.handle ?? INVALID_HANDLE) as HandleString,\n did: account.did,\n // @ts-expect-error https://github.com/bluesky-social/atproto/pull/4406\n didDoc,\n collections,\n handleIsCorrect,\n },\n }\n },\n )\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=getRecord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
1
+ {"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;QAC9C,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAEzD,8DAA8D;QAC9D,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;YACxC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACtD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,CACzC,CAAA;YACD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;gBAC3C,MAAM,IAAI,mBAAmB,CAC3B,4BAA4B,GAAG,EAAE,EACjC,gBAAgB,CACjB,CAAA;YACH,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,GAAG;oBACH,GAAG,EAAE,MAAM,CAAC,GAAG;oBACf,KAAK,EAAE,MAAM,CAAC,KAAK;iBACpB;aACF,CAAA;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACzB,MAAM,IAAI,mBAAmB,CAAC,yBAAyB,CAAC,CAAA;QAC1D,CAAC;QAED,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { atUri } from '@atproto/lex'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { pipethrough } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.getRecord, async ({ req, params }) => {\n const { repo, collection, rkey, cid } = params\n const did = await ctx.accountManager.getDidForActor(repo)\n\n // fetch from pds if available, if not then fetch from appview\n if (did) {\n const uri = atUri(did, collection, rkey)\n const record = await ctx.actorStore.read(did, (store) =>\n store.record.getRecord(uri, cid ?? null),\n )\n if (!record || record.takedownRef !== null) {\n throw new InvalidRequestError(\n `Could not locate record: ${uri}`,\n 'RecordNotFound',\n )\n }\n return {\n encoding: 'application/json' as const,\n body: {\n uri,\n cid: record.cid,\n value: record.value,\n },\n }\n }\n\n if (!ctx.cfg.bskyAppView) {\n throw new InvalidRequestError(`Could not locate record`)\n }\n\n return pipethrough(ctx, req)\n })\n}\n"]}
1
+ {"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../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AAA;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACzB,MAAM,IAAI,mBAAmB,CAAC,yBAAyB,CAAC,CAAA;QAC1D,CAAC;QAED,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { atUri } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { pipethrough } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.getRecord, async ({ req, params }) => {\n const { repo, collection, rkey, cid } = params\n const did = await ctx.accountManager.getDidForActor(repo)\n\n // fetch from pds if available, if not then fetch from appview\n if (did) {\n const uri = atUri(did, collection, rkey)\n const record = await ctx.actorStore.read(did, (store) =>\n store.record.getRecord(uri, cid ?? null),\n )\n if (!record || record.takedownRef !== null) {\n throw new InvalidRequestError(\n `Could not locate record: ${uri}`,\n 'RecordNotFound',\n )\n }\n return {\n encoding: 'application/json' as const,\n body: {\n uri,\n cid: record.cid,\n value: record.value,\n },\n }\n }\n\n if (!ctx.cfg.bskyAppView) {\n throw new InvalidRequestError(`Could not locate record`)\n }\n\n return pipethrough(ctx, req)\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=importRepo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"importRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqFvD"}
1
+ {"version":3,"file":"importRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqFvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"importRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE;QACtC,IAAI,EAAE;YACJ,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa;SACzC;QACD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE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,CACJ,CAAA;wBACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC5B,YAAY,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CACjE,CAAA;wBACD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,WAAW,CAAC,CAAA;oBAChE,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { TID } from '@atproto/common'\nimport { LexMap, enumBlobRefs } from '@atproto/lex-data'\nimport {\n BlockMap,\n WriteOpAction,\n getAndParseRecord,\n readCarStream,\n verifyDiff,\n} from '@atproto/repo'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.importRepo, {\n opts: {\n blobLimit: ctx.cfg.service.maxImportSize,\n },\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'repo', action: 'manage' })\n },\n }),\n handler: async ({ input, auth }) => {\n if (!ctx.cfg.service.acceptingImports) {\n throw new InvalidRequestError('Service is not accepting repo imports')\n }\n\n const { did } = auth.credentials\n\n // @NOTE process as much as we can before the transaction, in particular\n // the reading of the body stream.\n const { roots, blocks } = await readCarStream(input.body)\n if (roots.length !== 1) {\n await blocks.dump()\n throw new InvalidRequestError('expected one root')\n }\n\n const blockMap = new BlockMap()\n for await (const block of blocks) {\n blockMap.set(block.cid, block.bytes)\n }\n\n await ctx.actorStore.transact(did, async (store) => {\n const now = new Date().toISOString()\n const rev = TID.nextStr()\n const did = store.repo.did\n\n const currRepo = await store.repo.maybeLoadRepo()\n const diff = await verifyDiff(\n currRepo,\n blockMap,\n roots[0],\n undefined,\n undefined,\n { ensureLeaves: false },\n )\n diff.commit.rev = rev\n await store.repo.storage.applyCommit(diff.commit, currRepo === null)\n\n // @NOTE There is no point in performing the following concurrently\n // since better-sqlite3 is synchronous.\n for (const write of diff.writes) {\n const uri = AtUri.make(did, write.collection, write.rkey)\n if (write.action === WriteOpAction.Delete) {\n await store.record.deleteRecord(uri)\n } else {\n let parsedRecord: LexMap\n try {\n // @NOTE getAndParseRecord returns a promise for historical\n // reasons but it's internal processing is actually synchronous.\n const parsed = await getAndParseRecord(blockMap, write.cid)\n parsedRecord = parsed.record\n } catch {\n throw new InvalidRequestError(\n `Could not parse record at '${write.collection}/${write.rkey}'`,\n )\n }\n\n await store.record.indexRecord(\n uri,\n write.cid,\n parsedRecord,\n write.action,\n rev,\n now,\n )\n const recordBlobs = Array.from(\n enumBlobRefs(parsedRecord, { allowLegacy: true, strict: false }),\n )\n await store.repo.blob.insertBlobs(uri.toString(), recordBlobs)\n }\n }\n })\n },\n })\n}\n"]}
1
+ {"version":3,"file":"importRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAe,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MA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AC;wBAAC,MAAM,CAAC;4BACP,MAAM,IAAI,mBAAmB,CAC3B,8BAA8B,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,GAAG,CAChE,CAAA;wBACH,CAAC;wBAED,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAC5B,GAAG,EACH,KAAK,CAAC,GAAG,EACT,YAAY,EACZ,KAAK,CAAC,MAAM,EACZ,GAAG,EACH,GAAG,CACJ,CAAA;wBACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC5B,YAAY,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CACjE,CAAA;wBACD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,WAAW,CAAC,CAAA;oBAChE,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { TID } from '@atproto/common'\nimport { type LexMap, enumBlobRefs } from '@atproto/lex-data'\nimport {\n BlockMap,\n WriteOpAction,\n getAndParseRecord,\n readCarStream,\n verifyDiff,\n} from '@atproto/repo'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.importRepo, {\n opts: {\n blobLimit: ctx.cfg.service.maxImportSize,\n },\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'repo', action: 'manage' })\n },\n }),\n handler: async ({ input, auth }) => {\n if (!ctx.cfg.service.acceptingImports) {\n throw new InvalidRequestError('Service is not accepting repo imports')\n }\n\n const { did } = auth.credentials\n\n // @NOTE process as much as we can before the transaction, in particular\n // the reading of the body stream.\n const { roots, blocks } = await readCarStream(input.body)\n if (roots.length !== 1) {\n await blocks.dump()\n throw new InvalidRequestError('expected one root')\n }\n\n const blockMap = new BlockMap()\n for await (const block of blocks) {\n blockMap.set(block.cid, block.bytes)\n }\n\n await ctx.actorStore.transact(did, async (store) => {\n const now = new Date().toISOString()\n const rev = TID.nextStr()\n const did = store.repo.did\n\n const currRepo = await store.repo.maybeLoadRepo()\n const diff = await verifyDiff(\n currRepo,\n blockMap,\n roots[0],\n undefined,\n undefined,\n { ensureLeaves: false },\n )\n diff.commit.rev = rev\n await store.repo.storage.applyCommit(diff.commit, currRepo === null)\n\n // @NOTE There is no point in performing the following concurrently\n // since better-sqlite3 is synchronous.\n for (const write of diff.writes) {\n const uri = AtUri.make(did, write.collection, write.rkey)\n if (write.action === WriteOpAction.Delete) {\n await store.record.deleteRecord(uri)\n } else {\n let parsedRecord: LexMap\n try {\n // @NOTE getAndParseRecord returns a promise for historical\n // reasons but it's internal processing is actually synchronous.\n const parsed = await getAndParseRecord(blockMap, write.cid)\n parsedRecord = parsed.record\n } catch {\n throw new InvalidRequestError(\n `Could not parse record at '${write.collection}/${write.rkey}'`,\n )\n }\n\n await store.record.indexRecord(\n uri,\n write.cid,\n parsedRecord,\n write.action,\n rev,\n now,\n )\n const recordBlobs = Array.from(\n enumBlobRefs(parsedRecord, { allowLegacy: true, strict: false }),\n )\n await store.repo.blob.insertBlobs(uri.toString(), recordBlobs)\n }\n }\n })\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAYnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAWvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAYxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAWvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport applyWrites from './applyWrites.js'\nimport createRecord from './createRecord.js'\nimport deleteRecord from './deleteRecord.js'\nimport describeRepo from './describeRepo.js'\nimport getRecord from './getRecord.js'\nimport importRepo from './importRepo.js'\nimport listMissingBlobs from './listMissingBlobs.js'\nimport listRecords from './listRecords.js'\nimport putRecord from './putRecord.js'\nimport uploadBlob from './uploadBlob.js'\n\nexport default function (server: Server, ctx: AppContext) {\n applyWrites(server, ctx)\n createRecord(server, ctx)\n deleteRecord(server, ctx)\n describeRepo(server, ctx)\n getRecord(server, ctx)\n listRecords(server, ctx)\n putRecord(server, ctx)\n uploadBlob(server, ctx)\n listMissingBlobs(server, ctx)\n importRepo(server, ctx)\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport applyWrites from './applyWrites.js'\nimport createRecord from './createRecord.js'\nimport deleteRecord from './deleteRecord.js'\nimport describeRepo from './describeRepo.js'\nimport getRecord from './getRecord.js'\nimport importRepo from './importRepo.js'\nimport listMissingBlobs from './listMissingBlobs.js'\nimport listRecords from './listRecords.js'\nimport putRecord from './putRecord.js'\nimport uploadBlob from './uploadBlob.js'\n\nexport default function (server: Server, ctx: AppContext) {\n applyWrites(server, ctx)\n createRecord(server, ctx)\n deleteRecord(server, ctx)\n describeRepo(server, ctx)\n getRecord(server, ctx)\n listRecords(server, ctx)\n putRecord(server, ctx)\n uploadBlob(server, ctx)\n listMissingBlobs(server, ctx)\n importRepo(server, ctx)\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import type { Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=listMissingBlobs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"listMissingBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwBvD"}
1
+ {"version":3,"file":"listMissingBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwBvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"listMissingBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC5C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,SAAS,EAAE,GAAG,EAAE;gBACd,eAAe;YACjB,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;YAEhC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACrD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CACpD,CAAA;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;oBACL,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;iBAC1B;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listMissingBlobs, {\n auth: ctx.authVerifier.authorization({\n authorize: () => {\n // always allow\n },\n }),\n handler: async ({ auth, params }) => {\n const { did } = auth.credentials\n const { limit, cursor } = params\n\n const blobs = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.listMissingBlobs({ limit, cursor }),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n blobs,\n cursor: blobs.at(-1)?.cid,\n },\n }\n },\n })\n}\n"]}
1
+ {"version":3,"file":"listMissingBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC5C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,SAAS,EAAE,GAAG,EAAE;gBACd,eAAe;YACjB,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;YAEhC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACrD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CACpD,CAAA;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;oBACL,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;iBAC1B;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listMissingBlobs, {\n auth: ctx.authVerifier.authorization({\n authorize: () => {\n // always allow\n },\n }),\n handler: async ({ auth, params }) => {\n const { did } = auth.credentials\n const { limit, cursor } = params\n\n const blobs = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.listMissingBlobs({ limit, cursor }),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n blobs,\n cursor: blobs.at(-1)?.cid,\n },\n }\n },\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=listRecords.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"listRecords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA8BvD"}
1
+ {"version":3,"file":"listRecords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA8BvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"listRecords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAU,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,CAAA;QAExE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,mBAAmB,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAA;QAC/D,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACvD,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC;YACpC,UAAU;YACV,KAAK;YACL,OAAO;YACP,MAAM;SACP,CAAC,CACH,CAAA;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAExD,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,OAAO;gBACP,iFAAiF;gBACjF,MAAM,EAAE,OAAO,EAAE,IAAI;aACtB;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listRecords, async ({ params }) => {\n const { repo, collection, limit = 50, cursor, reverse = false } = params\n\n const did = await ctx.accountManager.getDidForActor(repo)\n if (!did) {\n throw new InvalidRequestError(`Could not find repo: ${repo}`)\n }\n\n const records = await ctx.actorStore.read(did, (store) =>\n store.record.listRecordsForCollection({\n collection,\n limit,\n reverse,\n cursor,\n }),\n )\n\n const lastRecord = records.at(-1)\n const lastUri = lastRecord && new AtUri(lastRecord?.uri)\n\n return {\n encoding: 'application/json' as const,\n body: {\n records,\n // Paginate with `before` by default, paginate with `after` when using `reverse`.\n cursor: lastUri?.rkey,\n },\n }\n })\n}\n"]}
1
+ {"version":3,"file":"listRecords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,CAAA;QAExE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,mBAAmB,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAA;QAC/D,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACvD,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC;YACpC,UAAU;YACV,KAAK;YACL,OAAO;YACP,MAAM;SACP,CAAC,CACH,CAAA;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAExD,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,OAAO;gBACP,iFAAiF;gBACjF,MAAM,EAAE,OAAO,EAAE,IAAI;aACtB;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listRecords, async ({ params }) => {\n const { repo, collection, limit = 50, cursor, reverse = false } = params\n\n const did = await ctx.accountManager.getDidForActor(repo)\n if (!did) {\n throw new InvalidRequestError(`Could not find repo: ${repo}`)\n }\n\n const records = await ctx.actorStore.read(did, (store) =>\n store.record.listRecordsForCollection({\n collection,\n limit,\n reverse,\n cursor,\n }),\n )\n\n const lastRecord = records.at(-1)\n const lastUri = lastRecord && new AtUri(lastRecord?.uri)\n\n return {\n encoding: 'application/json' as const,\n body: {\n records,\n // Paginate with `before` by default, paginate with `after` when using `reverse`.\n cursor: lastUri?.rkey,\n },\n }\n })\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Server } from '@atproto/xrpc-server';
2
- import { AppContext } from '../../../../context.js';
1
+ import { type Server } from '@atproto/xrpc-server';
2
+ import type { AppContext } from '../../../../context.js';
3
3
  export default function (server: Server, ctx: AppContext): void;
4
4
  //# sourceMappingURL=putRecord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,MAAM,EACP,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAanD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4JvD"}
1
+ {"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4JvD"}