@atproto/api 0.0.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +44 -6
  2. package/dist/agent.d.ts +22 -0
  3. package/dist/client/index.d.ts +63 -61
  4. package/dist/client/lexicons.d.ts +168 -22
  5. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +0 -7
  6. package/dist/client/types/com/atproto/account/delete.d.ts +14 -2
  7. package/dist/{src/client/types/com/atproto/account/delete.d.ts → client/types/com/atproto/account/requestDelete.d.ts} +0 -0
  8. package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
  9. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +13 -2
  10. package/dist/client/types/com/atproto/admin/record.d.ts +5 -2
  11. package/dist/client/types/com/atproto/admin/repo.d.ts +2 -2
  12. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -1
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +667 -368
  15. package/dist/index.js.map +4 -4
  16. package/dist/types.d.ts +33 -0
  17. package/package.json +1 -1
  18. package/src/agent.ts +305 -0
  19. package/src/client/index.ts +75 -63
  20. package/src/client/lexicons.ts +219 -49
  21. package/src/client/types/app/bsky/actor/getSuggestions.ts +0 -18
  22. package/src/client/types/com/atproto/account/delete.ts +21 -1
  23. package/src/client/types/com/atproto/account/requestDelete.ts +27 -0
  24. package/src/client/types/com/atproto/admin/blob.ts +84 -0
  25. package/src/client/types/com/atproto/admin/moderationAction.ts +29 -10
  26. package/src/client/types/com/atproto/admin/record.ts +5 -2
  27. package/src/client/types/com/atproto/admin/repo.ts +2 -2
  28. package/src/client/types/com/atproto/admin/takeModerationAction.ts +8 -0
  29. package/src/index.ts +3 -3
  30. package/src/types.ts +71 -0
  31. package/tests/_util.ts +26 -0
  32. package/tests/agent.test.ts +391 -0
  33. package/tests/errors.test.ts +4 -8
  34. package/tsconfig.build.tsbuildinfo +1 -1
  35. package/dist/src/client/index.d.ts +0 -474
  36. package/dist/src/client/lexicons.d.ts +0 -3036
  37. package/dist/src/client/schemas.d.ts +0 -17
  38. package/dist/src/client/types/app/bsky/actor/createScene.d.ts +0 -32
  39. package/dist/src/client/types/app/bsky/actor/getProfile.d.ts +0 -36
  40. package/dist/src/client/types/app/bsky/actor/getSuggestions.d.ts +0 -36
  41. package/dist/src/client/types/app/bsky/actor/profile.d.ts +0 -15
  42. package/dist/src/client/types/app/bsky/actor/ref.d.ts +0 -14
  43. package/dist/src/client/types/app/bsky/actor/search.d.ts +0 -32
  44. package/dist/src/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -28
  45. package/dist/src/client/types/app/bsky/actor/updateProfile.d.ts +0 -48
  46. package/dist/src/client/types/app/bsky/administration/moderationAction.d.ts +0 -16
  47. package/dist/src/client/types/app/bsky/administration/reverseModerationAction.d.ts +0 -22
  48. package/dist/src/client/types/app/bsky/administration/takeModerationAction.d.ts +0 -27
  49. package/dist/src/client/types/app/bsky/badge.d.ts +0 -22
  50. package/dist/src/client/types/app/bsky/badgeAccept.d.ts +0 -11
  51. package/dist/src/client/types/app/bsky/badgeOffer.d.ts +0 -11
  52. package/dist/src/client/types/app/bsky/declaration.d.ts +0 -6
  53. package/dist/src/client/types/app/bsky/embed/external.d.ts +0 -26
  54. package/dist/src/client/types/app/bsky/embed/images.d.ts +0 -23
  55. package/dist/src/client/types/app/bsky/feed/embed.d.ts +0 -36
  56. package/dist/src/client/types/app/bsky/feed/feedViewPost.d.ts +0 -26
  57. package/dist/src/client/types/app/bsky/feed/getAuthorFeed.d.ts +0 -22
  58. package/dist/src/client/types/app/bsky/feed/getPostThread.d.ts +0 -43
  59. package/dist/src/client/types/app/bsky/feed/getRepostedBy.d.ts +0 -35
  60. package/dist/src/client/types/app/bsky/feed/getTimeline.d.ts +0 -22
  61. package/dist/src/client/types/app/bsky/feed/getVotes.d.ts +0 -33
  62. package/dist/src/client/types/app/bsky/feed/mediaEmbed.d.ts +0 -15
  63. package/dist/src/client/types/app/bsky/feed/post.d.ts +0 -54
  64. package/dist/src/client/types/app/bsky/feed/repost.d.ts +0 -6
  65. package/dist/src/client/types/app/bsky/feed/setVote.d.ts +0 -25
  66. package/dist/src/client/types/app/bsky/feed/trend.d.ts +0 -6
  67. package/dist/src/client/types/app/bsky/feed/vote.d.ts +0 -7
  68. package/dist/src/client/types/app/bsky/follow.d.ts +0 -9
  69. package/dist/src/client/types/app/bsky/getAuthorFeed.d.ts +0 -56
  70. package/dist/src/client/types/app/bsky/getBadgeMembers.d.ts +0 -29
  71. package/dist/src/client/types/app/bsky/getHomeFeed.d.ts +0 -56
  72. package/dist/src/client/types/app/bsky/getLikedBy.d.ts +0 -29
  73. package/dist/src/client/types/app/bsky/getNotificationCount.d.ts +0 -16
  74. package/dist/src/client/types/app/bsky/getNotifications.d.ts +0 -33
  75. package/dist/src/client/types/app/bsky/getPostThread.d.ts +0 -55
  76. package/dist/src/client/types/app/bsky/getProfile.d.ts +0 -26
  77. package/dist/src/client/types/app/bsky/getRepostedBy.d.ts +0 -29
  78. package/dist/src/client/types/app/bsky/getTimeline.d.ts +0 -56
  79. package/dist/src/client/types/app/bsky/getUserFollowers.d.ts +0 -31
  80. package/dist/src/client/types/app/bsky/getUserFollows.d.ts +0 -31
  81. package/dist/src/client/types/app/bsky/getUsersSearch.d.ts +0 -26
  82. package/dist/src/client/types/app/bsky/getUsersTypeahead.d.ts +0 -22
  83. package/dist/src/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
  84. package/dist/src/client/types/app/bsky/graph/assertMember.d.ts +0 -1
  85. package/dist/src/client/types/app/bsky/graph/assertion.d.ts +0 -7
  86. package/dist/src/client/types/app/bsky/graph/confirmation.d.ts +0 -8
  87. package/dist/src/client/types/app/bsky/graph/follow.d.ts +0 -6
  88. package/dist/src/client/types/app/bsky/graph/getAssertions.d.ts +0 -43
  89. package/dist/src/client/types/app/bsky/graph/getFollowers.d.ts +0 -34
  90. package/dist/src/client/types/app/bsky/graph/getFollows.d.ts +0 -33
  91. package/dist/src/client/types/app/bsky/graph/getMembers.d.ts +0 -33
  92. package/dist/src/client/types/app/bsky/graph/getMemberships.d.ts +0 -33
  93. package/dist/src/client/types/app/bsky/invite.d.ts +0 -10
  94. package/dist/src/client/types/app/bsky/inviteAccept.d.ts +0 -14
  95. package/dist/src/client/types/app/bsky/like.d.ts +0 -10
  96. package/dist/src/client/types/app/bsky/mediaEmbed.d.ts +0 -15
  97. package/dist/src/client/types/app/bsky/notification/getCount.d.ts +0 -17
  98. package/dist/src/client/types/app/bsky/notification/list.d.ts +0 -32
  99. package/dist/src/client/types/app/bsky/notification/updateSeen.d.ts +0 -17
  100. package/dist/src/client/types/app/bsky/post.d.ts +0 -23
  101. package/dist/src/client/types/app/bsky/postNotificationsSeen.d.ts +0 -20
  102. package/dist/src/client/types/app/bsky/profile.d.ts +0 -5
  103. package/dist/src/client/types/app/bsky/repost.d.ts +0 -10
  104. package/dist/src/client/types/app/bsky/system/actorScene.d.ts +0 -1
  105. package/dist/src/client/types/app/bsky/system/actorUser.d.ts +0 -1
  106. package/dist/src/client/types/app/bsky/system/declRef.d.ts +0 -5
  107. package/dist/src/client/types/app/bsky/system/declaration.d.ts +0 -4
  108. package/dist/src/client/types/app/bsky/updateProfile.d.ts +0 -23
  109. package/dist/src/client/types/com/atproto/account/create.d.ts +0 -41
  110. package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
  111. package/dist/src/client/types/com/atproto/account/get.d.ts +0 -12
  112. package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
  113. package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +0 -24
  114. package/dist/src/client/types/com/atproto/blob/upload.d.ts +0 -19
  115. package/dist/src/client/types/com/atproto/createAccount.d.ts +0 -40
  116. package/dist/src/client/types/com/atproto/createInviteCode.d.ts +0 -20
  117. package/dist/src/client/types/com/atproto/createSession.d.ts +0 -24
  118. package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +0 -19
  119. package/dist/src/client/types/com/atproto/deleteAccount.d.ts +0 -20
  120. package/dist/src/client/types/com/atproto/deleteSession.d.ts +0 -17
  121. package/dist/src/client/types/com/atproto/getAccount.d.ts +0 -16
  122. package/dist/src/client/types/com/atproto/getAccountsConfig.d.ts +0 -17
  123. package/dist/src/client/types/com/atproto/getSession.d.ts +0 -17
  124. package/dist/src/client/types/com/atproto/handle/resolve.d.ts +0 -18
  125. package/dist/src/client/types/com/atproto/refreshSession.d.ts +0 -20
  126. package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +0 -39
  127. package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +0 -26
  128. package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +0 -19
  129. package/dist/src/client/types/com/atproto/repo/describe.d.ts +0 -22
  130. package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +0 -23
  131. package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +0 -30
  132. package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +0 -27
  133. package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +0 -5
  134. package/dist/src/client/types/com/atproto/repoBatchWrite.d.ts +0 -36
  135. package/dist/src/client/types/com/atproto/repoCreateRecord.d.ts +0 -24
  136. package/dist/src/client/types/com/atproto/repoDeleteRecord.d.ts +0 -18
  137. package/dist/src/client/types/com/atproto/repoDescribe.d.ts +0 -21
  138. package/dist/src/client/types/com/atproto/repoGetRecord.d.ts +0 -22
  139. package/dist/src/client/types/com/atproto/repoListRecords.d.ts +0 -27
  140. package/dist/src/client/types/com/atproto/repoPutRecord.d.ts +0 -25
  141. package/dist/src/client/types/com/atproto/requestAccountPasswordReset.d.ts +0 -19
  142. package/dist/src/client/types/com/atproto/resetAccountPassword.d.ts +0 -26
  143. package/dist/src/client/types/com/atproto/resolveHandle.d.ts +0 -17
  144. package/dist/src/client/types/com/atproto/resolveName.d.ts +0 -17
  145. package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -24
  146. package/dist/src/client/types/com/atproto/session/create.d.ts +0 -29
  147. package/dist/src/client/types/com/atproto/session/delete.d.ts +0 -13
  148. package/dist/src/client/types/com/atproto/session/get.d.ts +0 -18
  149. package/dist/src/client/types/com/atproto/session/refresh.d.ts +0 -24
  150. package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +0 -15
  151. package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +0 -18
  152. package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
  153. package/dist/src/client/types/com/atproto/syncGetRepo.d.ts +0 -15
  154. package/dist/src/client/types/com/atproto/syncGetRoot.d.ts +0 -17
  155. package/dist/src/client/types/com/atproto/syncUpdateRepo.d.ts +0 -15
  156. package/dist/src/index.d.ts +0 -4
  157. package/dist/src/schemas.d.ts +0 -19
  158. package/dist/src/session.d.ts +0 -42
  159. package/dist/src/types/app/bsky/badge.d.ts +0 -22
  160. package/dist/src/types/app/bsky/badgeAccept.d.ts +0 -11
  161. package/dist/src/types/app/bsky/badgeOffer.d.ts +0 -11
  162. package/dist/src/types/app/bsky/declaration.d.ts +0 -6
  163. package/dist/src/types/app/bsky/follow.d.ts +0 -9
  164. package/dist/src/types/app/bsky/getAuthorFeed.d.ts +0 -56
  165. package/dist/src/types/app/bsky/getBadgeMembers.d.ts +0 -29
  166. package/dist/src/types/app/bsky/getHomeFeed.d.ts +0 -56
  167. package/dist/src/types/app/bsky/getLikedBy.d.ts +0 -29
  168. package/dist/src/types/app/bsky/getNotificationCount.d.ts +0 -16
  169. package/dist/src/types/app/bsky/getNotifications.d.ts +0 -33
  170. package/dist/src/types/app/bsky/getPostThread.d.ts +0 -55
  171. package/dist/src/types/app/bsky/getProfile.d.ts +0 -42
  172. package/dist/src/types/app/bsky/getRepostedBy.d.ts +0 -29
  173. package/dist/src/types/app/bsky/getUserFollowers.d.ts +0 -31
  174. package/dist/src/types/app/bsky/getUserFollows.d.ts +0 -31
  175. package/dist/src/types/app/bsky/getUsersSearch.d.ts +0 -26
  176. package/dist/src/types/app/bsky/getUsersTypeahead.d.ts +0 -22
  177. package/dist/src/types/app/bsky/invite.d.ts +0 -10
  178. package/dist/src/types/app/bsky/inviteAccept.d.ts +0 -14
  179. package/dist/src/types/app/bsky/like.d.ts +0 -10
  180. package/dist/src/types/app/bsky/mediaEmbed.d.ts +0 -15
  181. package/dist/src/types/app/bsky/post.d.ts +0 -23
  182. package/dist/src/types/app/bsky/postNotificationsSeen.d.ts +0 -19
  183. package/dist/src/types/app/bsky/profile.d.ts +0 -11
  184. package/dist/src/types/app/bsky/repost.d.ts +0 -10
  185. package/dist/src/types/app/bsky/updateProfile.d.ts +0 -27
  186. package/dist/src/types/com/atproto/createAccount.d.ts +0 -39
  187. package/dist/src/types/com/atproto/createInviteCode.d.ts +0 -19
  188. package/dist/src/types/com/atproto/createSession.d.ts +0 -23
  189. package/dist/src/types/com/atproto/deleteAccount.d.ts +0 -19
  190. package/dist/src/types/com/atproto/deleteSession.d.ts +0 -16
  191. package/dist/src/types/com/atproto/getAccount.d.ts +0 -19
  192. package/dist/src/types/com/atproto/getAccountsConfig.d.ts +0 -17
  193. package/dist/src/types/com/atproto/getSession.d.ts +0 -17
  194. package/dist/src/types/com/atproto/refreshSession.d.ts +0 -19
  195. package/dist/src/types/com/atproto/repoBatchWrite.d.ts +0 -35
  196. package/dist/src/types/com/atproto/repoCreateRecord.d.ts +0 -23
  197. package/dist/src/types/com/atproto/repoDeleteRecord.d.ts +0 -15
  198. package/dist/src/types/com/atproto/repoDescribe.d.ts +0 -21
  199. package/dist/src/types/com/atproto/repoGetRecord.d.ts +0 -22
  200. package/dist/src/types/com/atproto/repoListRecords.d.ts +0 -27
  201. package/dist/src/types/com/atproto/repoPutRecord.d.ts +0 -24
  202. package/dist/src/types/com/atproto/requestAccountPasswordReset.d.ts +0 -18
  203. package/dist/src/types/com/atproto/resetAccountPassword.d.ts +0 -25
  204. package/dist/src/types/com/atproto/resolveName.d.ts +0 -17
  205. package/dist/src/types/com/atproto/syncGetRepo.d.ts +0 -15
  206. package/dist/src/types/com/atproto/syncGetRoot.d.ts +0 -17
  207. package/dist/src/types/com/atproto/syncUpdateRepo.d.ts +0 -14
  208. package/dist/tsconfig.build.tsbuildinfo +0 -1
  209. package/src/session.ts +0 -194
  210. package/tests/session.test.ts +0 -239
package/dist/index.js CHANGED
@@ -120,18 +120,22 @@ __export(src_exports, {
120
120
  AppBskySystemDeclaration: () => declaration_exports,
121
121
  AppNS: () => AppNS,
122
122
  AssertionRecord: () => AssertionRecord,
123
+ AtpAgent: () => AtpAgent,
124
+ AtpBaseClient: () => AtpBaseClient,
125
+ AtpServiceClient: () => AtpServiceClient,
123
126
  AtprotoNS: () => AtprotoNS,
124
127
  BlobNS: () => BlobNS,
125
128
  BskyNS: () => BskyNS,
126
129
  COM_ATPROTO_ADMIN: () => COM_ATPROTO_ADMIN,
127
130
  COM_ATPROTO_REPORT: () => COM_ATPROTO_REPORT,
128
- Client: () => Client2,
129
131
  ComAtprotoAccountCreate: () => create_exports,
130
132
  ComAtprotoAccountCreateInviteCode: () => createInviteCode_exports,
131
133
  ComAtprotoAccountDelete: () => delete_exports,
132
134
  ComAtprotoAccountGet: () => get_exports,
135
+ ComAtprotoAccountRequestDelete: () => requestDelete_exports,
133
136
  ComAtprotoAccountRequestPasswordReset: () => requestPasswordReset_exports,
134
137
  ComAtprotoAccountResetPassword: () => resetPassword_exports,
138
+ ComAtprotoAdminBlob: () => blob_exports2,
135
139
  ComAtprotoAdminGetModerationAction: () => getModerationAction_exports,
136
140
  ComAtprotoAdminGetModerationActions: () => getModerationActions_exports,
137
141
  ComAtprotoAdminGetModerationReport: () => getModerationReport_exports,
@@ -186,17 +190,11 @@ __export(src_exports, {
186
190
  ReportNS: () => ReportNS,
187
191
  RepostRecord: () => RepostRecord,
188
192
  ServerNS: () => ServerNS,
189
- ServiceClient: () => ServiceClient2,
190
- SessionClient: () => SessionClient,
191
- SessionManager: () => SessionManager,
192
193
  SessionNS: () => SessionNS,
193
- SessionServiceClient: () => SessionServiceClient,
194
- SessionXrpcServiceClient: () => SessionXrpcServiceClient,
195
194
  SyncNS: () => SyncNS,
196
195
  SystemNS: () => SystemNS,
197
196
  VoteRecord: () => VoteRecord,
198
- default: () => client_default,
199
- sessionClient: () => session_default
197
+ default: () => AtpAgent
200
198
  });
201
199
  module.exports = __toCommonJS(src_exports);
202
200
 
@@ -4430,7 +4428,33 @@ var schemaDict = {
4430
4428
  defs: {
4431
4429
  main: {
4432
4430
  type: "procedure",
4433
- description: "Delete an account."
4431
+ description: "Delete a user account with a token and password.",
4432
+ input: {
4433
+ encoding: "application/json",
4434
+ schema: {
4435
+ type: "object",
4436
+ required: ["did", "password", "token"],
4437
+ properties: {
4438
+ did: {
4439
+ type: "string"
4440
+ },
4441
+ password: {
4442
+ type: "string"
4443
+ },
4444
+ token: {
4445
+ type: "string"
4446
+ }
4447
+ }
4448
+ }
4449
+ },
4450
+ errors: [
4451
+ {
4452
+ name: "ExpiredToken"
4453
+ },
4454
+ {
4455
+ name: "InvalidToken"
4456
+ }
4457
+ ]
4434
4458
  }
4435
4459
  }
4436
4460
  },
@@ -4444,6 +4468,16 @@ var schemaDict = {
4444
4468
  }
4445
4469
  }
4446
4470
  },
4471
+ ComAtprotoAccountRequestDelete: {
4472
+ lexicon: 1,
4473
+ id: "com.atproto.account.requestDelete",
4474
+ defs: {
4475
+ main: {
4476
+ type: "procedure",
4477
+ description: "Initiate a user account deletion via email."
4478
+ }
4479
+ }
4480
+ },
4447
4481
  ComAtprotoAccountRequestPasswordReset: {
4448
4482
  lexicon: 1,
4449
4483
  id: "com.atproto.account.requestPasswordReset",
@@ -4499,6 +4533,78 @@ var schemaDict = {
4499
4533
  }
4500
4534
  }
4501
4535
  },
4536
+ ComAtprotoAdminBlob: {
4537
+ lexicon: 1,
4538
+ id: "com.atproto.admin.blob",
4539
+ defs: {
4540
+ view: {
4541
+ type: "object",
4542
+ required: ["cid", "mimeType", "size", "createdAt"],
4543
+ properties: {
4544
+ cid: {
4545
+ type: "string"
4546
+ },
4547
+ mimeType: {
4548
+ type: "string"
4549
+ },
4550
+ size: {
4551
+ type: "integer"
4552
+ },
4553
+ createdAt: {
4554
+ type: "datetime"
4555
+ },
4556
+ details: {
4557
+ type: "union",
4558
+ refs: [
4559
+ "lex:com.atproto.admin.blob#imageDetails",
4560
+ "lex:com.atproto.admin.blob#videoDetails"
4561
+ ]
4562
+ },
4563
+ moderation: {
4564
+ type: "ref",
4565
+ ref: "lex:com.atproto.admin.blob#moderation"
4566
+ }
4567
+ }
4568
+ },
4569
+ imageDetails: {
4570
+ type: "object",
4571
+ required: ["width", "height"],
4572
+ properties: {
4573
+ width: {
4574
+ type: "integer"
4575
+ },
4576
+ height: {
4577
+ type: "integer"
4578
+ }
4579
+ }
4580
+ },
4581
+ videoDetails: {
4582
+ type: "object",
4583
+ required: ["width", "height", "length"],
4584
+ properties: {
4585
+ width: {
4586
+ type: "integer"
4587
+ },
4588
+ height: {
4589
+ type: "integer"
4590
+ },
4591
+ length: {
4592
+ type: "integer"
4593
+ }
4594
+ }
4595
+ },
4596
+ moderation: {
4597
+ type: "object",
4598
+ required: [],
4599
+ properties: {
4600
+ currentAction: {
4601
+ type: "ref",
4602
+ ref: "lex:com.atproto.admin.moderationAction#viewCurrent"
4603
+ }
4604
+ }
4605
+ }
4606
+ }
4607
+ },
4502
4608
  ComAtprotoAdminGetModerationAction: {
4503
4609
  lexicon: 1,
4504
4610
  id: "com.atproto.admin.getModerationAction",
@@ -4711,6 +4817,7 @@ var schemaDict = {
4711
4817
  "id",
4712
4818
  "action",
4713
4819
  "subject",
4820
+ "subjectBlobCids",
4714
4821
  "reason",
4715
4822
  "createdBy",
4716
4823
  "createdAt",
@@ -4721,12 +4828,8 @@ var schemaDict = {
4721
4828
  type: "integer"
4722
4829
  },
4723
4830
  action: {
4724
- type: "string",
4725
- knownValues: [
4726
- "com.atproto.admin.moderationAction#takedown",
4727
- "com.atproto.admin.moderationAction#flag",
4728
- "com.atproto.admin.moderationAction#acknowledge"
4729
- ]
4831
+ type: "ref",
4832
+ ref: "lex:com.atproto.admin.moderationAction#actionType"
4730
4833
  },
4731
4834
  subject: {
4732
4835
  type: "union",
@@ -4735,6 +4838,12 @@ var schemaDict = {
4735
4838
  "lex:com.atproto.repo.strongRef"
4736
4839
  ]
4737
4840
  },
4841
+ subjectBlobCids: {
4842
+ type: "array",
4843
+ items: {
4844
+ type: "string"
4845
+ }
4846
+ },
4738
4847
  reason: {
4739
4848
  type: "string"
4740
4849
  },
@@ -4762,6 +4871,7 @@ var schemaDict = {
4762
4871
  "id",
4763
4872
  "action",
4764
4873
  "subject",
4874
+ "subjectBlobs",
4765
4875
  "reason",
4766
4876
  "createdBy",
4767
4877
  "createdAt",
@@ -4772,12 +4882,8 @@ var schemaDict = {
4772
4882
  type: "integer"
4773
4883
  },
4774
4884
  action: {
4775
- type: "string",
4776
- knownValues: [
4777
- "com.atproto.admin.moderationAction#takedown",
4778
- "com.atproto.admin.moderationAction#flag",
4779
- "com.atproto.admin.moderationAction#acknowledge"
4780
- ]
4885
+ type: "ref",
4886
+ ref: "lex:com.atproto.admin.moderationAction#actionType"
4781
4887
  },
4782
4888
  subject: {
4783
4889
  type: "union",
@@ -4786,6 +4892,13 @@ var schemaDict = {
4786
4892
  "lex:com.atproto.admin.record#view"
4787
4893
  ]
4788
4894
  },
4895
+ subjectBlobs: {
4896
+ type: "array",
4897
+ items: {
4898
+ type: "ref",
4899
+ ref: "lex:com.atproto.admin.blob#view"
4900
+ }
4901
+ },
4789
4902
  reason: {
4790
4903
  type: "string"
4791
4904
  },
@@ -4808,6 +4921,19 @@ var schemaDict = {
4808
4921
  }
4809
4922
  }
4810
4923
  },
4924
+ viewCurrent: {
4925
+ type: "object",
4926
+ required: ["id", "action"],
4927
+ properties: {
4928
+ id: {
4929
+ type: "integer"
4930
+ },
4931
+ action: {
4932
+ type: "ref",
4933
+ ref: "lex:com.atproto.admin.moderationAction#actionType"
4934
+ }
4935
+ }
4936
+ },
4811
4937
  reversal: {
4812
4938
  type: "object",
4813
4939
  required: ["reason", "createdBy", "createdAt"],
@@ -4823,6 +4949,14 @@ var schemaDict = {
4823
4949
  }
4824
4950
  }
4825
4951
  },
4952
+ actionType: {
4953
+ type: "string",
4954
+ knownValues: [
4955
+ "com.atproto.admin.moderationAction#takedown",
4956
+ "com.atproto.admin.moderationAction#flag",
4957
+ "com.atproto.admin.moderationAction#acknowledge"
4958
+ ]
4959
+ },
4826
4960
  takedown: {
4827
4961
  type: "token",
4828
4962
  description: "Moderation action type: Takedown. Indicates that content should not be served by the PDS."
@@ -4934,7 +5068,15 @@ var schemaDict = {
4934
5068
  defs: {
4935
5069
  view: {
4936
5070
  type: "object",
4937
- required: ["uri", "cid", "value", "indexedAt", "moderation", "repo"],
5071
+ required: [
5072
+ "uri",
5073
+ "cid",
5074
+ "value",
5075
+ "blobCids",
5076
+ "indexedAt",
5077
+ "moderation",
5078
+ "repo"
5079
+ ],
4938
5080
  properties: {
4939
5081
  uri: {
4940
5082
  type: "string"
@@ -4945,6 +5087,12 @@ var schemaDict = {
4945
5087
  value: {
4946
5088
  type: "unknown"
4947
5089
  },
5090
+ blobCids: {
5091
+ type: "array",
5092
+ items: {
5093
+ type: "string"
5094
+ }
5095
+ },
4948
5096
  indexedAt: {
4949
5097
  type: "string"
4950
5098
  },
@@ -4960,7 +5108,15 @@ var schemaDict = {
4960
5108
  },
4961
5109
  viewDetail: {
4962
5110
  type: "object",
4963
- required: ["uri", "cid", "value", "indexedAt", "moderation", "repo"],
5111
+ required: [
5112
+ "uri",
5113
+ "cid",
5114
+ "value",
5115
+ "blobs",
5116
+ "indexedAt",
5117
+ "moderation",
5118
+ "repo"
5119
+ ],
4964
5120
  properties: {
4965
5121
  uri: {
4966
5122
  type: "string"
@@ -4971,6 +5127,13 @@ var schemaDict = {
4971
5127
  value: {
4972
5128
  type: "unknown"
4973
5129
  },
5130
+ blobs: {
5131
+ type: "array",
5132
+ items: {
5133
+ type: "ref",
5134
+ ref: "lex:com.atproto.admin.blob#view"
5135
+ }
5136
+ },
4974
5137
  indexedAt: {
4975
5138
  type: "string"
4976
5139
  },
@@ -4988,8 +5151,9 @@ var schemaDict = {
4988
5151
  type: "object",
4989
5152
  required: [],
4990
5153
  properties: {
4991
- takedownId: {
4992
- type: "integer"
5154
+ currentAction: {
5155
+ type: "ref",
5156
+ ref: "lex:com.atproto.admin.moderationAction#viewCurrent"
4993
5157
  }
4994
5158
  }
4995
5159
  },
@@ -4997,6 +5161,10 @@ var schemaDict = {
4997
5161
  type: "object",
4998
5162
  required: ["actions", "reports"],
4999
5163
  properties: {
5164
+ currentAction: {
5165
+ type: "ref",
5166
+ ref: "lex:com.atproto.admin.moderationAction#viewCurrent"
5167
+ },
5000
5168
  actions: {
5001
5169
  type: "array",
5002
5170
  items: {
@@ -5010,9 +5178,6 @@ var schemaDict = {
5010
5178
  type: "ref",
5011
5179
  ref: "lex:com.atproto.admin.moderationReport#view"
5012
5180
  }
5013
- },
5014
- takedownId: {
5015
- type: "integer"
5016
5181
  }
5017
5182
  }
5018
5183
  }
@@ -5105,8 +5270,9 @@ var schemaDict = {
5105
5270
  type: "object",
5106
5271
  required: [],
5107
5272
  properties: {
5108
- takedownId: {
5109
- type: "integer"
5273
+ currentAction: {
5274
+ type: "ref",
5275
+ ref: "lex:com.atproto.admin.moderationAction#viewCurrent"
5110
5276
  }
5111
5277
  }
5112
5278
  },
@@ -5114,6 +5280,10 @@ var schemaDict = {
5114
5280
  type: "object",
5115
5281
  required: ["actions", "reports"],
5116
5282
  properties: {
5283
+ currentAction: {
5284
+ type: "ref",
5285
+ ref: "lex:com.atproto.admin.moderationAction#viewCurrent"
5286
+ },
5117
5287
  actions: {
5118
5288
  type: "array",
5119
5289
  items: {
@@ -5127,9 +5297,6 @@ var schemaDict = {
5127
5297
  type: "ref",
5128
5298
  ref: "lex:com.atproto.admin.moderationReport#view"
5129
5299
  }
5130
- },
5131
- takedownId: {
5132
- type: "integer"
5133
5300
  }
5134
5301
  }
5135
5302
  }
@@ -5282,6 +5449,12 @@ var schemaDict = {
5282
5449
  "lex:com.atproto.repo.recordRef"
5283
5450
  ]
5284
5451
  },
5452
+ subjectBlobCids: {
5453
+ type: "array",
5454
+ items: {
5455
+ type: "string"
5456
+ }
5457
+ },
5285
5458
  reason: {
5286
5459
  type: "string"
5287
5460
  },
@@ -5297,7 +5470,12 @@ var schemaDict = {
5297
5470
  type: "ref",
5298
5471
  ref: "lex:com.atproto.admin.moderationAction#view"
5299
5472
  }
5300
- }
5473
+ },
5474
+ errors: [
5475
+ {
5476
+ name: "SubjectHasAction"
5477
+ }
5478
+ ]
5301
5479
  }
5302
5480
  }
5303
5481
  },
@@ -6445,18 +6623,6 @@ var schemaDict = {
6445
6623
  },
6446
6624
  indexedAt: {
6447
6625
  type: "datetime"
6448
- },
6449
- myState: {
6450
- type: "ref",
6451
- ref: "lex:app.bsky.actor.getSuggestions#myState"
6452
- }
6453
- }
6454
- },
6455
- myState: {
6456
- type: "object",
6457
- properties: {
6458
- follow: {
6459
- type: "string"
6460
6626
  }
6461
6627
  }
6462
6628
  }
@@ -6484,16 +6650,16 @@ var schemaDict = {
6484
6650
  avatar: {
6485
6651
  type: "image",
6486
6652
  accept: ["image/png", "image/jpeg"],
6487
- maxWidth: 1e3,
6488
- maxHeight: 1e3,
6489
- maxSize: 3e5
6653
+ maxWidth: 2e3,
6654
+ maxHeight: 2e3,
6655
+ maxSize: 1e6
6490
6656
  },
6491
6657
  banner: {
6492
6658
  type: "image",
6493
6659
  accept: ["image/png", "image/jpeg"],
6494
- maxWidth: 3e3,
6495
- maxHeight: 1e3,
6496
- maxSize: 5e5
6660
+ maxWidth: 6e3,
6661
+ maxHeight: 2e3,
6662
+ maxSize: 1e6
6497
6663
  }
6498
6664
  }
6499
6665
  }
@@ -6795,9 +6961,9 @@ var schemaDict = {
6795
6961
  thumb: {
6796
6962
  type: "image",
6797
6963
  accept: ["image/*"],
6798
- maxWidth: 1e3,
6799
- maxHeight: 1e3,
6800
- maxSize: 3e5
6964
+ maxWidth: 2e3,
6965
+ maxHeight: 2e3,
6966
+ maxSize: 1e6
6801
6967
  }
6802
6968
  }
6803
6969
  },
@@ -6857,9 +7023,9 @@ var schemaDict = {
6857
7023
  image: {
6858
7024
  type: "image",
6859
7025
  accept: ["image/*"],
6860
- maxWidth: 1e3,
6861
- maxHeight: 1e3,
6862
- maxSize: 3e5
7026
+ maxWidth: 2e3,
7027
+ maxHeight: 2e3,
7028
+ maxSize: 1e6
6863
7029
  },
6864
7030
  alt: {
6865
7031
  type: "string"
@@ -8146,10 +8312,26 @@ function toKnownErr2(e) {
8146
8312
  // src/client/types/com/atproto/account/delete.ts
8147
8313
  var delete_exports = {};
8148
8314
  __export(delete_exports, {
8315
+ ExpiredTokenError: () => ExpiredTokenError,
8316
+ InvalidTokenError: () => InvalidTokenError,
8149
8317
  toKnownErr: () => toKnownErr3
8150
8318
  });
8319
+ var ExpiredTokenError = class extends XRPCError {
8320
+ constructor(src) {
8321
+ super(src.status, src.error, src.message);
8322
+ }
8323
+ };
8324
+ var InvalidTokenError = class extends XRPCError {
8325
+ constructor(src) {
8326
+ super(src.status, src.error, src.message);
8327
+ }
8328
+ };
8151
8329
  function toKnownErr3(e) {
8152
8330
  if (e instanceof XRPCError) {
8331
+ if (e.error === "ExpiredToken")
8332
+ return new ExpiredTokenError(e);
8333
+ if (e.error === "InvalidToken")
8334
+ return new InvalidTokenError(e);
8153
8335
  }
8154
8336
  return e;
8155
8337
  }
@@ -8165,12 +8347,23 @@ function toKnownErr4(e) {
8165
8347
  return e;
8166
8348
  }
8167
8349
 
8350
+ // src/client/types/com/atproto/account/requestDelete.ts
8351
+ var requestDelete_exports = {};
8352
+ __export(requestDelete_exports, {
8353
+ toKnownErr: () => toKnownErr5
8354
+ });
8355
+ function toKnownErr5(e) {
8356
+ if (e instanceof XRPCError) {
8357
+ }
8358
+ return e;
8359
+ }
8360
+
8168
8361
  // src/client/types/com/atproto/account/requestPasswordReset.ts
8169
8362
  var requestPasswordReset_exports = {};
8170
8363
  __export(requestPasswordReset_exports, {
8171
- toKnownErr: () => toKnownErr5
8364
+ toKnownErr: () => toKnownErr6
8172
8365
  });
8173
- function toKnownErr5(e) {
8366
+ function toKnownErr6(e) {
8174
8367
  if (e instanceof XRPCError) {
8175
8368
  }
8176
8369
  return e;
@@ -8179,26 +8372,26 @@ function toKnownErr5(e) {
8179
8372
  // src/client/types/com/atproto/account/resetPassword.ts
8180
8373
  var resetPassword_exports = {};
8181
8374
  __export(resetPassword_exports, {
8182
- ExpiredTokenError: () => ExpiredTokenError,
8183
- InvalidTokenError: () => InvalidTokenError,
8184
- toKnownErr: () => toKnownErr6
8375
+ ExpiredTokenError: () => ExpiredTokenError2,
8376
+ InvalidTokenError: () => InvalidTokenError2,
8377
+ toKnownErr: () => toKnownErr7
8185
8378
  });
8186
- var ExpiredTokenError = class extends XRPCError {
8379
+ var ExpiredTokenError2 = class extends XRPCError {
8187
8380
  constructor(src) {
8188
8381
  super(src.status, src.error, src.message);
8189
8382
  }
8190
8383
  };
8191
- var InvalidTokenError = class extends XRPCError {
8384
+ var InvalidTokenError2 = class extends XRPCError {
8192
8385
  constructor(src) {
8193
8386
  super(src.status, src.error, src.message);
8194
8387
  }
8195
8388
  };
8196
- function toKnownErr6(e) {
8389
+ function toKnownErr7(e) {
8197
8390
  if (e instanceof XRPCError) {
8198
8391
  if (e.error === "ExpiredToken")
8199
- return new ExpiredTokenError(e);
8392
+ return new ExpiredTokenError2(e);
8200
8393
  if (e.error === "InvalidToken")
8201
- return new InvalidTokenError(e);
8394
+ return new InvalidTokenError2(e);
8202
8395
  }
8203
8396
  return e;
8204
8397
  }
@@ -8206,9 +8399,9 @@ function toKnownErr6(e) {
8206
8399
  // src/client/types/com/atproto/admin/getModerationAction.ts
8207
8400
  var getModerationAction_exports = {};
8208
8401
  __export(getModerationAction_exports, {
8209
- toKnownErr: () => toKnownErr7
8402
+ toKnownErr: () => toKnownErr8
8210
8403
  });
8211
- function toKnownErr7(e) {
8404
+ function toKnownErr8(e) {
8212
8405
  if (e instanceof XRPCError) {
8213
8406
  }
8214
8407
  return e;
@@ -8217,9 +8410,9 @@ function toKnownErr7(e) {
8217
8410
  // src/client/types/com/atproto/admin/getModerationActions.ts
8218
8411
  var getModerationActions_exports = {};
8219
8412
  __export(getModerationActions_exports, {
8220
- toKnownErr: () => toKnownErr8
8413
+ toKnownErr: () => toKnownErr9
8221
8414
  });
8222
- function toKnownErr8(e) {
8415
+ function toKnownErr9(e) {
8223
8416
  if (e instanceof XRPCError) {
8224
8417
  }
8225
8418
  return e;
@@ -8228,9 +8421,9 @@ function toKnownErr8(e) {
8228
8421
  // src/client/types/com/atproto/admin/getModerationReport.ts
8229
8422
  var getModerationReport_exports = {};
8230
8423
  __export(getModerationReport_exports, {
8231
- toKnownErr: () => toKnownErr9
8424
+ toKnownErr: () => toKnownErr10
8232
8425
  });
8233
- function toKnownErr9(e) {
8426
+ function toKnownErr10(e) {
8234
8427
  if (e instanceof XRPCError) {
8235
8428
  }
8236
8429
  return e;
@@ -8239,9 +8432,9 @@ function toKnownErr9(e) {
8239
8432
  // src/client/types/com/atproto/admin/getModerationReports.ts
8240
8433
  var getModerationReports_exports = {};
8241
8434
  __export(getModerationReports_exports, {
8242
- toKnownErr: () => toKnownErr10
8435
+ toKnownErr: () => toKnownErr11
8243
8436
  });
8244
- function toKnownErr10(e) {
8437
+ function toKnownErr11(e) {
8245
8438
  if (e instanceof XRPCError) {
8246
8439
  }
8247
8440
  return e;
@@ -8250,9 +8443,9 @@ function toKnownErr10(e) {
8250
8443
  // src/client/types/com/atproto/admin/getRecord.ts
8251
8444
  var getRecord_exports = {};
8252
8445
  __export(getRecord_exports, {
8253
- toKnownErr: () => toKnownErr11
8446
+ toKnownErr: () => toKnownErr12
8254
8447
  });
8255
- function toKnownErr11(e) {
8448
+ function toKnownErr12(e) {
8256
8449
  if (e instanceof XRPCError) {
8257
8450
  }
8258
8451
  return e;
@@ -8261,9 +8454,9 @@ function toKnownErr11(e) {
8261
8454
  // src/client/types/com/atproto/admin/getRepo.ts
8262
8455
  var getRepo_exports = {};
8263
8456
  __export(getRepo_exports, {
8264
- toKnownErr: () => toKnownErr12
8457
+ toKnownErr: () => toKnownErr13
8265
8458
  });
8266
- function toKnownErr12(e) {
8459
+ function toKnownErr13(e) {
8267
8460
  if (e instanceof XRPCError) {
8268
8461
  }
8269
8462
  return e;
@@ -8272,9 +8465,9 @@ function toKnownErr12(e) {
8272
8465
  // src/client/types/com/atproto/admin/resolveModerationReports.ts
8273
8466
  var resolveModerationReports_exports = {};
8274
8467
  __export(resolveModerationReports_exports, {
8275
- toKnownErr: () => toKnownErr13
8468
+ toKnownErr: () => toKnownErr14
8276
8469
  });
8277
- function toKnownErr13(e) {
8470
+ function toKnownErr14(e) {
8278
8471
  if (e instanceof XRPCError) {
8279
8472
  }
8280
8473
  return e;
@@ -8283,9 +8476,9 @@ function toKnownErr13(e) {
8283
8476
  // src/client/types/com/atproto/admin/reverseModerationAction.ts
8284
8477
  var reverseModerationAction_exports = {};
8285
8478
  __export(reverseModerationAction_exports, {
8286
- toKnownErr: () => toKnownErr14
8479
+ toKnownErr: () => toKnownErr15
8287
8480
  });
8288
- function toKnownErr14(e) {
8481
+ function toKnownErr15(e) {
8289
8482
  if (e instanceof XRPCError) {
8290
8483
  }
8291
8484
  return e;
@@ -8294,9 +8487,9 @@ function toKnownErr14(e) {
8294
8487
  // src/client/types/com/atproto/admin/searchRepos.ts
8295
8488
  var searchRepos_exports = {};
8296
8489
  __export(searchRepos_exports, {
8297
- toKnownErr: () => toKnownErr15
8490
+ toKnownErr: () => toKnownErr16
8298
8491
  });
8299
- function toKnownErr15(e) {
8492
+ function toKnownErr16(e) {
8300
8493
  if (e instanceof XRPCError) {
8301
8494
  }
8302
8495
  return e;
@@ -8305,10 +8498,18 @@ function toKnownErr15(e) {
8305
8498
  // src/client/types/com/atproto/admin/takeModerationAction.ts
8306
8499
  var takeModerationAction_exports = {};
8307
8500
  __export(takeModerationAction_exports, {
8308
- toKnownErr: () => toKnownErr16
8501
+ SubjectHasActionError: () => SubjectHasActionError,
8502
+ toKnownErr: () => toKnownErr17
8309
8503
  });
8310
- function toKnownErr16(e) {
8504
+ var SubjectHasActionError = class extends XRPCError {
8505
+ constructor(src) {
8506
+ super(src.status, src.error, src.message);
8507
+ }
8508
+ };
8509
+ function toKnownErr17(e) {
8311
8510
  if (e instanceof XRPCError) {
8511
+ if (e.error === "SubjectHasAction")
8512
+ return new SubjectHasActionError(e);
8312
8513
  }
8313
8514
  return e;
8314
8515
  }
@@ -8316,9 +8517,9 @@ function toKnownErr16(e) {
8316
8517
  // src/client/types/com/atproto/blob/upload.ts
8317
8518
  var upload_exports = {};
8318
8519
  __export(upload_exports, {
8319
- toKnownErr: () => toKnownErr17
8520
+ toKnownErr: () => toKnownErr18
8320
8521
  });
8321
- function toKnownErr17(e) {
8522
+ function toKnownErr18(e) {
8322
8523
  if (e instanceof XRPCError) {
8323
8524
  }
8324
8525
  return e;
@@ -8327,9 +8528,9 @@ function toKnownErr17(e) {
8327
8528
  // src/client/types/com/atproto/handle/resolve.ts
8328
8529
  var resolve_exports = {};
8329
8530
  __export(resolve_exports, {
8330
- toKnownErr: () => toKnownErr18
8531
+ toKnownErr: () => toKnownErr19
8331
8532
  });
8332
- function toKnownErr18(e) {
8533
+ function toKnownErr19(e) {
8333
8534
  if (e instanceof XRPCError) {
8334
8535
  }
8335
8536
  return e;
@@ -8341,7 +8542,7 @@ __export(batchWrite_exports, {
8341
8542
  isCreate: () => isCreate,
8342
8543
  isDelete: () => isDelete,
8343
8544
  isUpdate: () => isUpdate,
8344
- toKnownErr: () => toKnownErr19,
8545
+ toKnownErr: () => toKnownErr20,
8345
8546
  validateCreate: () => validateCreate,
8346
8547
  validateDelete: () => validateDelete,
8347
8548
  validateUpdate: () => validateUpdate
@@ -8356,7 +8557,7 @@ function hasProp2(data, prop) {
8356
8557
  }
8357
8558
 
8358
8559
  // src/client/types/com/atproto/repo/batchWrite.ts
8359
- function toKnownErr19(e) {
8560
+ function toKnownErr20(e) {
8360
8561
  if (e instanceof XRPCError) {
8361
8562
  }
8362
8563
  return e;
@@ -8383,9 +8584,9 @@ function validateDelete(v) {
8383
8584
  // src/client/types/com/atproto/repo/createRecord.ts
8384
8585
  var createRecord_exports = {};
8385
8586
  __export(createRecord_exports, {
8386
- toKnownErr: () => toKnownErr20
8587
+ toKnownErr: () => toKnownErr21
8387
8588
  });
8388
- function toKnownErr20(e) {
8589
+ function toKnownErr21(e) {
8389
8590
  if (e instanceof XRPCError) {
8390
8591
  }
8391
8592
  return e;
@@ -8394,9 +8595,9 @@ function toKnownErr20(e) {
8394
8595
  // src/client/types/com/atproto/repo/deleteRecord.ts
8395
8596
  var deleteRecord_exports = {};
8396
8597
  __export(deleteRecord_exports, {
8397
- toKnownErr: () => toKnownErr21
8598
+ toKnownErr: () => toKnownErr22
8398
8599
  });
8399
- function toKnownErr21(e) {
8600
+ function toKnownErr22(e) {
8400
8601
  if (e instanceof XRPCError) {
8401
8602
  }
8402
8603
  return e;
@@ -8405,9 +8606,9 @@ function toKnownErr21(e) {
8405
8606
  // src/client/types/com/atproto/repo/describe.ts
8406
8607
  var describe_exports = {};
8407
8608
  __export(describe_exports, {
8408
- toKnownErr: () => toKnownErr22
8609
+ toKnownErr: () => toKnownErr23
8409
8610
  });
8410
- function toKnownErr22(e) {
8611
+ function toKnownErr23(e) {
8411
8612
  if (e instanceof XRPCError) {
8412
8613
  }
8413
8614
  return e;
@@ -8416,9 +8617,9 @@ function toKnownErr22(e) {
8416
8617
  // src/client/types/com/atproto/repo/getRecord.ts
8417
8618
  var getRecord_exports2 = {};
8418
8619
  __export(getRecord_exports2, {
8419
- toKnownErr: () => toKnownErr23
8620
+ toKnownErr: () => toKnownErr24
8420
8621
  });
8421
- function toKnownErr23(e) {
8622
+ function toKnownErr24(e) {
8422
8623
  if (e instanceof XRPCError) {
8423
8624
  }
8424
8625
  return e;
@@ -8428,10 +8629,10 @@ function toKnownErr23(e) {
8428
8629
  var listRecords_exports = {};
8429
8630
  __export(listRecords_exports, {
8430
8631
  isRecord: () => isRecord,
8431
- toKnownErr: () => toKnownErr24,
8632
+ toKnownErr: () => toKnownErr25,
8432
8633
  validateRecord: () => validateRecord
8433
8634
  });
8434
- function toKnownErr24(e) {
8635
+ function toKnownErr25(e) {
8435
8636
  if (e instanceof XRPCError) {
8436
8637
  }
8437
8638
  return e;
@@ -8446,9 +8647,9 @@ function validateRecord(v) {
8446
8647
  // src/client/types/com/atproto/repo/putRecord.ts
8447
8648
  var putRecord_exports = {};
8448
8649
  __export(putRecord_exports, {
8449
- toKnownErr: () => toKnownErr25
8650
+ toKnownErr: () => toKnownErr26
8450
8651
  });
8451
- function toKnownErr25(e) {
8652
+ function toKnownErr26(e) {
8452
8653
  if (e instanceof XRPCError) {
8453
8654
  }
8454
8655
  return e;
@@ -8457,9 +8658,9 @@ function toKnownErr25(e) {
8457
8658
  // src/client/types/com/atproto/report/create.ts
8458
8659
  var create_exports2 = {};
8459
8660
  __export(create_exports2, {
8460
- toKnownErr: () => toKnownErr26
8661
+ toKnownErr: () => toKnownErr27
8461
8662
  });
8462
- function toKnownErr26(e) {
8663
+ function toKnownErr27(e) {
8463
8664
  if (e instanceof XRPCError) {
8464
8665
  }
8465
8666
  return e;
@@ -8469,10 +8670,10 @@ function toKnownErr26(e) {
8469
8670
  var getAccountsConfig_exports = {};
8470
8671
  __export(getAccountsConfig_exports, {
8471
8672
  isLinks: () => isLinks,
8472
- toKnownErr: () => toKnownErr27,
8673
+ toKnownErr: () => toKnownErr28,
8473
8674
  validateLinks: () => validateLinks
8474
8675
  });
8475
- function toKnownErr27(e) {
8676
+ function toKnownErr28(e) {
8476
8677
  if (e instanceof XRPCError) {
8477
8678
  }
8478
8679
  return e;
@@ -8488,14 +8689,14 @@ function validateLinks(v) {
8488
8689
  var create_exports3 = {};
8489
8690
  __export(create_exports3, {
8490
8691
  AccountTakedownError: () => AccountTakedownError,
8491
- toKnownErr: () => toKnownErr28
8692
+ toKnownErr: () => toKnownErr29
8492
8693
  });
8493
8694
  var AccountTakedownError = class extends XRPCError {
8494
8695
  constructor(src) {
8495
8696
  super(src.status, src.error, src.message);
8496
8697
  }
8497
8698
  };
8498
- function toKnownErr28(e) {
8699
+ function toKnownErr29(e) {
8499
8700
  if (e instanceof XRPCError) {
8500
8701
  if (e.error === "AccountTakedown")
8501
8702
  return new AccountTakedownError(e);
@@ -8506,9 +8707,9 @@ function toKnownErr28(e) {
8506
8707
  // src/client/types/com/atproto/session/delete.ts
8507
8708
  var delete_exports2 = {};
8508
8709
  __export(delete_exports2, {
8509
- toKnownErr: () => toKnownErr29
8710
+ toKnownErr: () => toKnownErr30
8510
8711
  });
8511
- function toKnownErr29(e) {
8712
+ function toKnownErr30(e) {
8512
8713
  if (e instanceof XRPCError) {
8513
8714
  }
8514
8715
  return e;
@@ -8517,9 +8718,9 @@ function toKnownErr29(e) {
8517
8718
  // src/client/types/com/atproto/session/get.ts
8518
8719
  var get_exports2 = {};
8519
8720
  __export(get_exports2, {
8520
- toKnownErr: () => toKnownErr30
8721
+ toKnownErr: () => toKnownErr31
8521
8722
  });
8522
- function toKnownErr30(e) {
8723
+ function toKnownErr31(e) {
8523
8724
  if (e instanceof XRPCError) {
8524
8725
  }
8525
8726
  return e;
@@ -8529,14 +8730,14 @@ function toKnownErr30(e) {
8529
8730
  var refresh_exports = {};
8530
8731
  __export(refresh_exports, {
8531
8732
  AccountTakedownError: () => AccountTakedownError2,
8532
- toKnownErr: () => toKnownErr31
8733
+ toKnownErr: () => toKnownErr32
8533
8734
  });
8534
8735
  var AccountTakedownError2 = class extends XRPCError {
8535
8736
  constructor(src) {
8536
8737
  super(src.status, src.error, src.message);
8537
8738
  }
8538
8739
  };
8539
- function toKnownErr31(e) {
8740
+ function toKnownErr32(e) {
8540
8741
  if (e instanceof XRPCError) {
8541
8742
  if (e.error === "AccountTakedown")
8542
8743
  return new AccountTakedownError2(e);
@@ -8547,9 +8748,9 @@ function toKnownErr31(e) {
8547
8748
  // src/client/types/com/atproto/sync/getCheckout.ts
8548
8749
  var getCheckout_exports = {};
8549
8750
  __export(getCheckout_exports, {
8550
- toKnownErr: () => toKnownErr32
8751
+ toKnownErr: () => toKnownErr33
8551
8752
  });
8552
- function toKnownErr32(e) {
8753
+ function toKnownErr33(e) {
8553
8754
  if (e instanceof XRPCError) {
8554
8755
  }
8555
8756
  return e;
@@ -8558,9 +8759,9 @@ function toKnownErr32(e) {
8558
8759
  // src/client/types/com/atproto/sync/getCommitPath.ts
8559
8760
  var getCommitPath_exports = {};
8560
8761
  __export(getCommitPath_exports, {
8561
- toKnownErr: () => toKnownErr33
8762
+ toKnownErr: () => toKnownErr34
8562
8763
  });
8563
- function toKnownErr33(e) {
8764
+ function toKnownErr34(e) {
8564
8765
  if (e instanceof XRPCError) {
8565
8766
  }
8566
8767
  return e;
@@ -8569,9 +8770,9 @@ function toKnownErr33(e) {
8569
8770
  // src/client/types/com/atproto/sync/getHead.ts
8570
8771
  var getHead_exports = {};
8571
8772
  __export(getHead_exports, {
8572
- toKnownErr: () => toKnownErr34
8773
+ toKnownErr: () => toKnownErr35
8573
8774
  });
8574
- function toKnownErr34(e) {
8775
+ function toKnownErr35(e) {
8575
8776
  if (e instanceof XRPCError) {
8576
8777
  }
8577
8778
  return e;
@@ -8580,9 +8781,9 @@ function toKnownErr34(e) {
8580
8781
  // src/client/types/com/atproto/sync/getRecord.ts
8581
8782
  var getRecord_exports3 = {};
8582
8783
  __export(getRecord_exports3, {
8583
- toKnownErr: () => toKnownErr35
8784
+ toKnownErr: () => toKnownErr36
8584
8785
  });
8585
- function toKnownErr35(e) {
8786
+ function toKnownErr36(e) {
8586
8787
  if (e instanceof XRPCError) {
8587
8788
  }
8588
8789
  return e;
@@ -8591,9 +8792,9 @@ function toKnownErr35(e) {
8591
8792
  // src/client/types/com/atproto/sync/getRepo.ts
8592
8793
  var getRepo_exports2 = {};
8593
8794
  __export(getRepo_exports2, {
8594
- toKnownErr: () => toKnownErr36
8795
+ toKnownErr: () => toKnownErr37
8595
8796
  });
8596
- function toKnownErr36(e) {
8797
+ function toKnownErr37(e) {
8597
8798
  if (e instanceof XRPCError) {
8598
8799
  }
8599
8800
  return e;
@@ -8603,10 +8804,10 @@ function toKnownErr36(e) {
8603
8804
  var getProfile_exports = {};
8604
8805
  __export(getProfile_exports, {
8605
8806
  isMyState: () => isMyState,
8606
- toKnownErr: () => toKnownErr37,
8807
+ toKnownErr: () => toKnownErr38,
8607
8808
  validateMyState: () => validateMyState
8608
8809
  });
8609
- function toKnownErr37(e) {
8810
+ function toKnownErr38(e) {
8610
8811
  if (e instanceof XRPCError) {
8611
8812
  }
8612
8813
  return e;
@@ -8622,12 +8823,10 @@ function validateMyState(v) {
8622
8823
  var getSuggestions_exports = {};
8623
8824
  __export(getSuggestions_exports, {
8624
8825
  isActor: () => isActor,
8625
- isMyState: () => isMyState2,
8626
- toKnownErr: () => toKnownErr38,
8627
- validateActor: () => validateActor,
8628
- validateMyState: () => validateMyState2
8826
+ toKnownErr: () => toKnownErr39,
8827
+ validateActor: () => validateActor
8629
8828
  });
8630
- function toKnownErr38(e) {
8829
+ function toKnownErr39(e) {
8631
8830
  if (e instanceof XRPCError) {
8632
8831
  }
8633
8832
  return e;
@@ -8638,21 +8837,15 @@ function isActor(v) {
8638
8837
  function validateActor(v) {
8639
8838
  return lexicons.validate("app.bsky.actor.getSuggestions#actor", v);
8640
8839
  }
8641
- function isMyState2(v) {
8642
- return isObj2(v) && hasProp2(v, "$type") && v.$type === "app.bsky.actor.getSuggestions#myState";
8643
- }
8644
- function validateMyState2(v) {
8645
- return lexicons.validate("app.bsky.actor.getSuggestions#myState", v);
8646
- }
8647
8840
 
8648
8841
  // src/client/types/app/bsky/actor/search.ts
8649
8842
  var search_exports = {};
8650
8843
  __export(search_exports, {
8651
8844
  isUser: () => isUser,
8652
- toKnownErr: () => toKnownErr39,
8845
+ toKnownErr: () => toKnownErr40,
8653
8846
  validateUser: () => validateUser
8654
8847
  });
8655
- function toKnownErr39(e) {
8848
+ function toKnownErr40(e) {
8656
8849
  if (e instanceof XRPCError) {
8657
8850
  }
8658
8851
  return e;
@@ -8668,10 +8861,10 @@ function validateUser(v) {
8668
8861
  var searchTypeahead_exports = {};
8669
8862
  __export(searchTypeahead_exports, {
8670
8863
  isUser: () => isUser2,
8671
- toKnownErr: () => toKnownErr40,
8864
+ toKnownErr: () => toKnownErr41,
8672
8865
  validateUser: () => validateUser2
8673
8866
  });
8674
- function toKnownErr40(e) {
8867
+ function toKnownErr41(e) {
8675
8868
  if (e instanceof XRPCError) {
8676
8869
  }
8677
8870
  return e;
@@ -8690,7 +8883,7 @@ __export(updateProfile_exports, {
8690
8883
  InvalidBlobError: () => InvalidBlobError,
8691
8884
  InvalidImageDimensionsError: () => InvalidImageDimensionsError,
8692
8885
  InvalidMimeTypeError: () => InvalidMimeTypeError,
8693
- toKnownErr: () => toKnownErr41
8886
+ toKnownErr: () => toKnownErr42
8694
8887
  });
8695
8888
  var InvalidBlobError = class extends XRPCError {
8696
8889
  constructor(src) {
@@ -8712,7 +8905,7 @@ var InvalidImageDimensionsError = class extends XRPCError {
8712
8905
  super(src.status, src.error, src.message);
8713
8906
  }
8714
8907
  };
8715
- function toKnownErr41(e) {
8908
+ function toKnownErr42(e) {
8716
8909
  if (e instanceof XRPCError) {
8717
8910
  if (e.error === "InvalidBlob")
8718
8911
  return new InvalidBlobError(e);
@@ -8729,9 +8922,9 @@ function toKnownErr41(e) {
8729
8922
  // src/client/types/app/bsky/feed/getAuthorFeed.ts
8730
8923
  var getAuthorFeed_exports = {};
8731
8924
  __export(getAuthorFeed_exports, {
8732
- toKnownErr: () => toKnownErr42
8925
+ toKnownErr: () => toKnownErr43
8733
8926
  });
8734
- function toKnownErr42(e) {
8927
+ function toKnownErr43(e) {
8735
8928
  if (e instanceof XRPCError) {
8736
8929
  }
8737
8930
  return e;
@@ -8743,7 +8936,7 @@ __export(getPostThread_exports, {
8743
8936
  NotFoundError: () => NotFoundError,
8744
8937
  isNotFoundPost: () => isNotFoundPost,
8745
8938
  isThreadViewPost: () => isThreadViewPost,
8746
- toKnownErr: () => toKnownErr43,
8939
+ toKnownErr: () => toKnownErr44,
8747
8940
  validateNotFoundPost: () => validateNotFoundPost,
8748
8941
  validateThreadViewPost: () => validateThreadViewPost
8749
8942
  });
@@ -8752,7 +8945,7 @@ var NotFoundError = class extends XRPCError {
8752
8945
  super(src.status, src.error, src.message);
8753
8946
  }
8754
8947
  };
8755
- function toKnownErr43(e) {
8948
+ function toKnownErr44(e) {
8756
8949
  if (e instanceof XRPCError) {
8757
8950
  if (e.error === "NotFound")
8758
8951
  return new NotFoundError(e);
@@ -8776,10 +8969,10 @@ function validateNotFoundPost(v) {
8776
8969
  var getRepostedBy_exports = {};
8777
8970
  __export(getRepostedBy_exports, {
8778
8971
  isRepostedBy: () => isRepostedBy,
8779
- toKnownErr: () => toKnownErr44,
8972
+ toKnownErr: () => toKnownErr45,
8780
8973
  validateRepostedBy: () => validateRepostedBy
8781
8974
  });
8782
- function toKnownErr44(e) {
8975
+ function toKnownErr45(e) {
8783
8976
  if (e instanceof XRPCError) {
8784
8977
  }
8785
8978
  return e;
@@ -8794,9 +8987,9 @@ function validateRepostedBy(v) {
8794
8987
  // src/client/types/app/bsky/feed/getTimeline.ts
8795
8988
  var getTimeline_exports = {};
8796
8989
  __export(getTimeline_exports, {
8797
- toKnownErr: () => toKnownErr45
8990
+ toKnownErr: () => toKnownErr46
8798
8991
  });
8799
- function toKnownErr45(e) {
8992
+ function toKnownErr46(e) {
8800
8993
  if (e instanceof XRPCError) {
8801
8994
  }
8802
8995
  return e;
@@ -8806,10 +8999,10 @@ function toKnownErr45(e) {
8806
8999
  var getVotes_exports = {};
8807
9000
  __export(getVotes_exports, {
8808
9001
  isVote: () => isVote,
8809
- toKnownErr: () => toKnownErr46,
9002
+ toKnownErr: () => toKnownErr47,
8810
9003
  validateVote: () => validateVote
8811
9004
  });
8812
- function toKnownErr46(e) {
9005
+ function toKnownErr47(e) {
8813
9006
  if (e instanceof XRPCError) {
8814
9007
  }
8815
9008
  return e;
@@ -8824,9 +9017,9 @@ function validateVote(v) {
8824
9017
  // src/client/types/app/bsky/feed/setVote.ts
8825
9018
  var setVote_exports = {};
8826
9019
  __export(setVote_exports, {
8827
- toKnownErr: () => toKnownErr47
9020
+ toKnownErr: () => toKnownErr48
8828
9021
  });
8829
- function toKnownErr47(e) {
9022
+ function toKnownErr48(e) {
8830
9023
  if (e instanceof XRPCError) {
8831
9024
  }
8832
9025
  return e;
@@ -8836,10 +9029,10 @@ function toKnownErr47(e) {
8836
9029
  var getFollowers_exports = {};
8837
9030
  __export(getFollowers_exports, {
8838
9031
  isFollower: () => isFollower,
8839
- toKnownErr: () => toKnownErr48,
9032
+ toKnownErr: () => toKnownErr49,
8840
9033
  validateFollower: () => validateFollower
8841
9034
  });
8842
- function toKnownErr48(e) {
9035
+ function toKnownErr49(e) {
8843
9036
  if (e instanceof XRPCError) {
8844
9037
  }
8845
9038
  return e;
@@ -8855,10 +9048,10 @@ function validateFollower(v) {
8855
9048
  var getFollows_exports = {};
8856
9049
  __export(getFollows_exports, {
8857
9050
  isFollow: () => isFollow,
8858
- toKnownErr: () => toKnownErr49,
9051
+ toKnownErr: () => toKnownErr50,
8859
9052
  validateFollow: () => validateFollow
8860
9053
  });
8861
- function toKnownErr49(e) {
9054
+ function toKnownErr50(e) {
8862
9055
  if (e instanceof XRPCError) {
8863
9056
  }
8864
9057
  return e;
@@ -8874,10 +9067,10 @@ function validateFollow(v) {
8874
9067
  var getMutes_exports = {};
8875
9068
  __export(getMutes_exports, {
8876
9069
  isMute: () => isMute,
8877
- toKnownErr: () => toKnownErr50,
9070
+ toKnownErr: () => toKnownErr51,
8878
9071
  validateMute: () => validateMute
8879
9072
  });
8880
- function toKnownErr50(e) {
9073
+ function toKnownErr51(e) {
8881
9074
  if (e instanceof XRPCError) {
8882
9075
  }
8883
9076
  return e;
@@ -8892,9 +9085,9 @@ function validateMute(v) {
8892
9085
  // src/client/types/app/bsky/graph/mute.ts
8893
9086
  var mute_exports = {};
8894
9087
  __export(mute_exports, {
8895
- toKnownErr: () => toKnownErr51
9088
+ toKnownErr: () => toKnownErr52
8896
9089
  });
8897
- function toKnownErr51(e) {
9090
+ function toKnownErr52(e) {
8898
9091
  if (e instanceof XRPCError) {
8899
9092
  }
8900
9093
  return e;
@@ -8903,9 +9096,9 @@ function toKnownErr51(e) {
8903
9096
  // src/client/types/app/bsky/graph/unmute.ts
8904
9097
  var unmute_exports = {};
8905
9098
  __export(unmute_exports, {
8906
- toKnownErr: () => toKnownErr52
9099
+ toKnownErr: () => toKnownErr53
8907
9100
  });
8908
- function toKnownErr52(e) {
9101
+ function toKnownErr53(e) {
8909
9102
  if (e instanceof XRPCError) {
8910
9103
  }
8911
9104
  return e;
@@ -8914,9 +9107,9 @@ function toKnownErr52(e) {
8914
9107
  // src/client/types/app/bsky/notification/getCount.ts
8915
9108
  var getCount_exports = {};
8916
9109
  __export(getCount_exports, {
8917
- toKnownErr: () => toKnownErr53
9110
+ toKnownErr: () => toKnownErr54
8918
9111
  });
8919
- function toKnownErr53(e) {
9112
+ function toKnownErr54(e) {
8920
9113
  if (e instanceof XRPCError) {
8921
9114
  }
8922
9115
  return e;
@@ -8926,10 +9119,10 @@ function toKnownErr53(e) {
8926
9119
  var list_exports = {};
8927
9120
  __export(list_exports, {
8928
9121
  isNotification: () => isNotification,
8929
- toKnownErr: () => toKnownErr54,
9122
+ toKnownErr: () => toKnownErr55,
8930
9123
  validateNotification: () => validateNotification
8931
9124
  });
8932
- function toKnownErr54(e) {
9125
+ function toKnownErr55(e) {
8933
9126
  if (e instanceof XRPCError) {
8934
9127
  }
8935
9128
  return e;
@@ -8944,14 +9137,51 @@ function validateNotification(v) {
8944
9137
  // src/client/types/app/bsky/notification/updateSeen.ts
8945
9138
  var updateSeen_exports = {};
8946
9139
  __export(updateSeen_exports, {
8947
- toKnownErr: () => toKnownErr55
9140
+ toKnownErr: () => toKnownErr56
8948
9141
  });
8949
- function toKnownErr55(e) {
9142
+ function toKnownErr56(e) {
8950
9143
  if (e instanceof XRPCError) {
8951
9144
  }
8952
9145
  return e;
8953
9146
  }
8954
9147
 
9148
+ // src/client/types/com/atproto/admin/blob.ts
9149
+ var blob_exports2 = {};
9150
+ __export(blob_exports2, {
9151
+ isImageDetails: () => isImageDetails,
9152
+ isModeration: () => isModeration,
9153
+ isVideoDetails: () => isVideoDetails,
9154
+ isView: () => isView,
9155
+ validateImageDetails: () => validateImageDetails,
9156
+ validateModeration: () => validateModeration,
9157
+ validateVideoDetails: () => validateVideoDetails,
9158
+ validateView: () => validateView
9159
+ });
9160
+ function isView(v) {
9161
+ return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.blob#view";
9162
+ }
9163
+ function validateView(v) {
9164
+ return lexicons.validate("com.atproto.admin.blob#view", v);
9165
+ }
9166
+ function isImageDetails(v) {
9167
+ return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.blob#imageDetails";
9168
+ }
9169
+ function validateImageDetails(v) {
9170
+ return lexicons.validate("com.atproto.admin.blob#imageDetails", v);
9171
+ }
9172
+ function isVideoDetails(v) {
9173
+ return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.blob#videoDetails";
9174
+ }
9175
+ function validateVideoDetails(v) {
9176
+ return lexicons.validate("com.atproto.admin.blob#videoDetails", v);
9177
+ }
9178
+ function isModeration(v) {
9179
+ return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.blob#moderation";
9180
+ }
9181
+ function validateModeration(v) {
9182
+ return lexicons.validate("com.atproto.admin.blob#moderation", v);
9183
+ }
9184
+
8955
9185
  // src/client/types/com/atproto/admin/moderationAction.ts
8956
9186
  var moderationAction_exports = {};
8957
9187
  __export(moderationAction_exports, {
@@ -8959,16 +9189,18 @@ __export(moderationAction_exports, {
8959
9189
  FLAG: () => FLAG,
8960
9190
  TAKEDOWN: () => TAKEDOWN,
8961
9191
  isReversal: () => isReversal,
8962
- isView: () => isView,
9192
+ isView: () => isView2,
9193
+ isViewCurrent: () => isViewCurrent,
8963
9194
  isViewDetail: () => isViewDetail,
8964
9195
  validateReversal: () => validateReversal,
8965
- validateView: () => validateView,
9196
+ validateView: () => validateView2,
9197
+ validateViewCurrent: () => validateViewCurrent,
8966
9198
  validateViewDetail: () => validateViewDetail
8967
9199
  });
8968
- function isView(v) {
9200
+ function isView2(v) {
8969
9201
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.moderationAction#view";
8970
9202
  }
8971
- function validateView(v) {
9203
+ function validateView2(v) {
8972
9204
  return lexicons.validate("com.atproto.admin.moderationAction#view", v);
8973
9205
  }
8974
9206
  function isViewDetail(v) {
@@ -8977,6 +9209,12 @@ function isViewDetail(v) {
8977
9209
  function validateViewDetail(v) {
8978
9210
  return lexicons.validate("com.atproto.admin.moderationAction#viewDetail", v);
8979
9211
  }
9212
+ function isViewCurrent(v) {
9213
+ return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.moderationAction#viewCurrent";
9214
+ }
9215
+ function validateViewCurrent(v) {
9216
+ return lexicons.validate("com.atproto.admin.moderationAction#viewCurrent", v);
9217
+ }
8980
9218
  function isReversal(v) {
8981
9219
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.moderationAction#reversal";
8982
9220
  }
@@ -8990,15 +9228,15 @@ var ACKNOWLEDGE = "com.atproto.admin.moderationAction#acknowledge";
8990
9228
  // src/client/types/com/atproto/admin/moderationReport.ts
8991
9229
  var moderationReport_exports = {};
8992
9230
  __export(moderationReport_exports, {
8993
- isView: () => isView2,
9231
+ isView: () => isView3,
8994
9232
  isViewDetail: () => isViewDetail2,
8995
- validateView: () => validateView2,
9233
+ validateView: () => validateView3,
8996
9234
  validateViewDetail: () => validateViewDetail2
8997
9235
  });
8998
- function isView2(v) {
9236
+ function isView3(v) {
8999
9237
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.moderationReport#view";
9000
9238
  }
9001
- function validateView2(v) {
9239
+ function validateView3(v) {
9002
9240
  return lexicons.validate("com.atproto.admin.moderationReport#view", v);
9003
9241
  }
9004
9242
  function isViewDetail2(v) {
@@ -9011,19 +9249,19 @@ function validateViewDetail2(v) {
9011
9249
  // src/client/types/com/atproto/admin/record.ts
9012
9250
  var record_exports = {};
9013
9251
  __export(record_exports, {
9014
- isModeration: () => isModeration,
9252
+ isModeration: () => isModeration2,
9015
9253
  isModerationDetail: () => isModerationDetail,
9016
- isView: () => isView3,
9254
+ isView: () => isView4,
9017
9255
  isViewDetail: () => isViewDetail3,
9018
- validateModeration: () => validateModeration,
9256
+ validateModeration: () => validateModeration2,
9019
9257
  validateModerationDetail: () => validateModerationDetail,
9020
- validateView: () => validateView3,
9258
+ validateView: () => validateView4,
9021
9259
  validateViewDetail: () => validateViewDetail3
9022
9260
  });
9023
- function isView3(v) {
9261
+ function isView4(v) {
9024
9262
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.record#view";
9025
9263
  }
9026
- function validateView3(v) {
9264
+ function validateView4(v) {
9027
9265
  return lexicons.validate("com.atproto.admin.record#view", v);
9028
9266
  }
9029
9267
  function isViewDetail3(v) {
@@ -9032,10 +9270,10 @@ function isViewDetail3(v) {
9032
9270
  function validateViewDetail3(v) {
9033
9271
  return lexicons.validate("com.atproto.admin.record#viewDetail", v);
9034
9272
  }
9035
- function isModeration(v) {
9273
+ function isModeration2(v) {
9036
9274
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.record#moderation";
9037
9275
  }
9038
- function validateModeration(v) {
9276
+ function validateModeration2(v) {
9039
9277
  return lexicons.validate("com.atproto.admin.record#moderation", v);
9040
9278
  }
9041
9279
  function isModerationDetail(v) {
@@ -9049,20 +9287,20 @@ function validateModerationDetail(v) {
9049
9287
  var repo_exports = {};
9050
9288
  __export(repo_exports, {
9051
9289
  isAccount: () => isAccount,
9052
- isModeration: () => isModeration2,
9290
+ isModeration: () => isModeration3,
9053
9291
  isModerationDetail: () => isModerationDetail2,
9054
- isView: () => isView4,
9292
+ isView: () => isView5,
9055
9293
  isViewDetail: () => isViewDetail4,
9056
9294
  validateAccount: () => validateAccount,
9057
- validateModeration: () => validateModeration2,
9295
+ validateModeration: () => validateModeration3,
9058
9296
  validateModerationDetail: () => validateModerationDetail2,
9059
- validateView: () => validateView4,
9297
+ validateView: () => validateView5,
9060
9298
  validateViewDetail: () => validateViewDetail4
9061
9299
  });
9062
- function isView4(v) {
9300
+ function isView5(v) {
9063
9301
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.repo#view";
9064
9302
  }
9065
- function validateView4(v) {
9303
+ function validateView5(v) {
9066
9304
  return lexicons.validate("com.atproto.admin.repo#view", v);
9067
9305
  }
9068
9306
  function isViewDetail4(v) {
@@ -9077,10 +9315,10 @@ function isAccount(v) {
9077
9315
  function validateAccount(v) {
9078
9316
  return lexicons.validate("com.atproto.admin.repo#account", v);
9079
9317
  }
9080
- function isModeration2(v) {
9318
+ function isModeration3(v) {
9081
9319
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.admin.repo#moderation";
9082
9320
  }
9083
- function validateModeration2(v) {
9321
+ function validateModeration3(v) {
9084
9322
  return lexicons.validate("com.atproto.admin.repo#moderation", v);
9085
9323
  }
9086
9324
  function isModerationDetail2(v) {
@@ -9319,13 +9557,13 @@ __export(post_exports, {
9319
9557
  isRecord: () => isRecord4,
9320
9558
  isReplyRef: () => isReplyRef2,
9321
9559
  isTextSlice: () => isTextSlice,
9322
- isView: () => isView5,
9560
+ isView: () => isView6,
9323
9561
  isViewerState: () => isViewerState2,
9324
9562
  validateEntity: () => validateEntity,
9325
9563
  validateRecord: () => validateRecord4,
9326
9564
  validateReplyRef: () => validateReplyRef2,
9327
9565
  validateTextSlice: () => validateTextSlice,
9328
- validateView: () => validateView5,
9566
+ validateView: () => validateView6,
9329
9567
  validateViewerState: () => validateViewerState2
9330
9568
  });
9331
9569
  function isRecord4(v) {
@@ -9352,10 +9590,10 @@ function isTextSlice(v) {
9352
9590
  function validateTextSlice(v) {
9353
9591
  return lexicons.validate("app.bsky.feed.post#textSlice", v);
9354
9592
  }
9355
- function isView5(v) {
9593
+ function isView6(v) {
9356
9594
  return isObj2(v) && hasProp2(v, "$type") && v.$type === "app.bsky.feed.post#view";
9357
9595
  }
9358
- function validateView5(v) {
9596
+ function validateView6(v) {
9359
9597
  return lexicons.validate("app.bsky.feed.post#view", v);
9360
9598
  }
9361
9599
  function isViewerState2(v) {
@@ -9494,18 +9732,16 @@ var APP_BSKY_GRAPH = {
9494
9732
  var APP_BSKY_SYSTEM = {
9495
9733
  ActorUser: "app.bsky.system.actorUser"
9496
9734
  };
9497
- var Client2 = class {
9735
+ var AtpBaseClient = class {
9498
9736
  constructor() {
9499
9737
  this.xrpc = new Client();
9500
9738
  this.xrpc.addLexicons(schemas);
9501
9739
  }
9502
9740
  service(serviceUri) {
9503
- return new ServiceClient2(this, this.xrpc.service(serviceUri));
9741
+ return new AtpServiceClient(this, this.xrpc.service(serviceUri));
9504
9742
  }
9505
9743
  };
9506
- var defaultInst2 = new Client2();
9507
- var client_default = defaultInst2;
9508
- var ServiceClient2 = class {
9744
+ var AtpServiceClient = class {
9509
9745
  constructor(baseClient, xrpcService) {
9510
9746
  this._baseClient = baseClient;
9511
9747
  this.xrpc = xrpcService;
@@ -9560,14 +9796,19 @@ var AccountNS = class {
9560
9796
  throw toKnownErr4(e);
9561
9797
  });
9562
9798
  }
9799
+ requestDelete(data, opts) {
9800
+ return this._service.xrpc.call("com.atproto.account.requestDelete", opts?.qp, data, opts).catch((e) => {
9801
+ throw toKnownErr5(e);
9802
+ });
9803
+ }
9563
9804
  requestPasswordReset(data, opts) {
9564
9805
  return this._service.xrpc.call("com.atproto.account.requestPasswordReset", opts?.qp, data, opts).catch((e) => {
9565
- throw toKnownErr5(e);
9806
+ throw toKnownErr6(e);
9566
9807
  });
9567
9808
  }
9568
9809
  resetPassword(data, opts) {
9569
9810
  return this._service.xrpc.call("com.atproto.account.resetPassword", opts?.qp, data, opts).catch((e) => {
9570
- throw toKnownErr6(e);
9811
+ throw toKnownErr7(e);
9571
9812
  });
9572
9813
  }
9573
9814
  };
@@ -9577,52 +9818,52 @@ var AdminNS = class {
9577
9818
  }
9578
9819
  getModerationAction(params2, opts) {
9579
9820
  return this._service.xrpc.call("com.atproto.admin.getModerationAction", params2, void 0, opts).catch((e) => {
9580
- throw toKnownErr7(e);
9821
+ throw toKnownErr8(e);
9581
9822
  });
9582
9823
  }
9583
9824
  getModerationActions(params2, opts) {
9584
9825
  return this._service.xrpc.call("com.atproto.admin.getModerationActions", params2, void 0, opts).catch((e) => {
9585
- throw toKnownErr8(e);
9826
+ throw toKnownErr9(e);
9586
9827
  });
9587
9828
  }
9588
9829
  getModerationReport(params2, opts) {
9589
9830
  return this._service.xrpc.call("com.atproto.admin.getModerationReport", params2, void 0, opts).catch((e) => {
9590
- throw toKnownErr9(e);
9831
+ throw toKnownErr10(e);
9591
9832
  });
9592
9833
  }
9593
9834
  getModerationReports(params2, opts) {
9594
9835
  return this._service.xrpc.call("com.atproto.admin.getModerationReports", params2, void 0, opts).catch((e) => {
9595
- throw toKnownErr10(e);
9836
+ throw toKnownErr11(e);
9596
9837
  });
9597
9838
  }
9598
9839
  getRecord(params2, opts) {
9599
9840
  return this._service.xrpc.call("com.atproto.admin.getRecord", params2, void 0, opts).catch((e) => {
9600
- throw toKnownErr11(e);
9841
+ throw toKnownErr12(e);
9601
9842
  });
9602
9843
  }
9603
9844
  getRepo(params2, opts) {
9604
9845
  return this._service.xrpc.call("com.atproto.admin.getRepo", params2, void 0, opts).catch((e) => {
9605
- throw toKnownErr12(e);
9846
+ throw toKnownErr13(e);
9606
9847
  });
9607
9848
  }
9608
9849
  resolveModerationReports(data, opts) {
9609
9850
  return this._service.xrpc.call("com.atproto.admin.resolveModerationReports", opts?.qp, data, opts).catch((e) => {
9610
- throw toKnownErr13(e);
9851
+ throw toKnownErr14(e);
9611
9852
  });
9612
9853
  }
9613
9854
  reverseModerationAction(data, opts) {
9614
9855
  return this._service.xrpc.call("com.atproto.admin.reverseModerationAction", opts?.qp, data, opts).catch((e) => {
9615
- throw toKnownErr14(e);
9856
+ throw toKnownErr15(e);
9616
9857
  });
9617
9858
  }
9618
9859
  searchRepos(params2, opts) {
9619
9860
  return this._service.xrpc.call("com.atproto.admin.searchRepos", params2, void 0, opts).catch((e) => {
9620
- throw toKnownErr15(e);
9861
+ throw toKnownErr16(e);
9621
9862
  });
9622
9863
  }
9623
9864
  takeModerationAction(data, opts) {
9624
9865
  return this._service.xrpc.call("com.atproto.admin.takeModerationAction", opts?.qp, data, opts).catch((e) => {
9625
- throw toKnownErr16(e);
9866
+ throw toKnownErr17(e);
9626
9867
  });
9627
9868
  }
9628
9869
  };
@@ -9632,7 +9873,7 @@ var BlobNS = class {
9632
9873
  }
9633
9874
  upload(data, opts) {
9634
9875
  return this._service.xrpc.call("com.atproto.blob.upload", opts?.qp, data, opts).catch((e) => {
9635
- throw toKnownErr17(e);
9876
+ throw toKnownErr18(e);
9636
9877
  });
9637
9878
  }
9638
9879
  };
@@ -9642,7 +9883,7 @@ var HandleNS = class {
9642
9883
  }
9643
9884
  resolve(params2, opts) {
9644
9885
  return this._service.xrpc.call("com.atproto.handle.resolve", params2, void 0, opts).catch((e) => {
9645
- throw toKnownErr18(e);
9886
+ throw toKnownErr19(e);
9646
9887
  });
9647
9888
  }
9648
9889
  };
@@ -9652,37 +9893,37 @@ var RepoNS = class {
9652
9893
  }
9653
9894
  batchWrite(data, opts) {
9654
9895
  return this._service.xrpc.call("com.atproto.repo.batchWrite", opts?.qp, data, opts).catch((e) => {
9655
- throw toKnownErr19(e);
9896
+ throw toKnownErr20(e);
9656
9897
  });
9657
9898
  }
9658
9899
  createRecord(data, opts) {
9659
9900
  return this._service.xrpc.call("com.atproto.repo.createRecord", opts?.qp, data, opts).catch((e) => {
9660
- throw toKnownErr20(e);
9901
+ throw toKnownErr21(e);
9661
9902
  });
9662
9903
  }
9663
9904
  deleteRecord(data, opts) {
9664
9905
  return this._service.xrpc.call("com.atproto.repo.deleteRecord", opts?.qp, data, opts).catch((e) => {
9665
- throw toKnownErr21(e);
9906
+ throw toKnownErr22(e);
9666
9907
  });
9667
9908
  }
9668
9909
  describe(params2, opts) {
9669
9910
  return this._service.xrpc.call("com.atproto.repo.describe", params2, void 0, opts).catch((e) => {
9670
- throw toKnownErr22(e);
9911
+ throw toKnownErr23(e);
9671
9912
  });
9672
9913
  }
9673
9914
  getRecord(params2, opts) {
9674
9915
  return this._service.xrpc.call("com.atproto.repo.getRecord", params2, void 0, opts).catch((e) => {
9675
- throw toKnownErr23(e);
9916
+ throw toKnownErr24(e);
9676
9917
  });
9677
9918
  }
9678
9919
  listRecords(params2, opts) {
9679
9920
  return this._service.xrpc.call("com.atproto.repo.listRecords", params2, void 0, opts).catch((e) => {
9680
- throw toKnownErr24(e);
9921
+ throw toKnownErr25(e);
9681
9922
  });
9682
9923
  }
9683
9924
  putRecord(data, opts) {
9684
9925
  return this._service.xrpc.call("com.atproto.repo.putRecord", opts?.qp, data, opts).catch((e) => {
9685
- throw toKnownErr25(e);
9926
+ throw toKnownErr26(e);
9686
9927
  });
9687
9928
  }
9688
9929
  };
@@ -9692,7 +9933,7 @@ var ReportNS = class {
9692
9933
  }
9693
9934
  create(data, opts) {
9694
9935
  return this._service.xrpc.call("com.atproto.report.create", opts?.qp, data, opts).catch((e) => {
9695
- throw toKnownErr26(e);
9936
+ throw toKnownErr27(e);
9696
9937
  });
9697
9938
  }
9698
9939
  };
@@ -9702,7 +9943,7 @@ var ServerNS = class {
9702
9943
  }
9703
9944
  getAccountsConfig(params2, opts) {
9704
9945
  return this._service.xrpc.call("com.atproto.server.getAccountsConfig", params2, void 0, opts).catch((e) => {
9705
- throw toKnownErr27(e);
9946
+ throw toKnownErr28(e);
9706
9947
  });
9707
9948
  }
9708
9949
  };
@@ -9712,22 +9953,22 @@ var SessionNS = class {
9712
9953
  }
9713
9954
  create(data, opts) {
9714
9955
  return this._service.xrpc.call("com.atproto.session.create", opts?.qp, data, opts).catch((e) => {
9715
- throw toKnownErr28(e);
9956
+ throw toKnownErr29(e);
9716
9957
  });
9717
9958
  }
9718
9959
  delete(data, opts) {
9719
9960
  return this._service.xrpc.call("com.atproto.session.delete", opts?.qp, data, opts).catch((e) => {
9720
- throw toKnownErr29(e);
9961
+ throw toKnownErr30(e);
9721
9962
  });
9722
9963
  }
9723
9964
  get(params2, opts) {
9724
9965
  return this._service.xrpc.call("com.atproto.session.get", params2, void 0, opts).catch((e) => {
9725
- throw toKnownErr30(e);
9966
+ throw toKnownErr31(e);
9726
9967
  });
9727
9968
  }
9728
9969
  refresh(data, opts) {
9729
9970
  return this._service.xrpc.call("com.atproto.session.refresh", opts?.qp, data, opts).catch((e) => {
9730
- throw toKnownErr31(e);
9971
+ throw toKnownErr32(e);
9731
9972
  });
9732
9973
  }
9733
9974
  };
@@ -9737,27 +9978,27 @@ var SyncNS = class {
9737
9978
  }
9738
9979
  getCheckout(params2, opts) {
9739
9980
  return this._service.xrpc.call("com.atproto.sync.getCheckout", params2, void 0, opts).catch((e) => {
9740
- throw toKnownErr32(e);
9981
+ throw toKnownErr33(e);
9741
9982
  });
9742
9983
  }
9743
9984
  getCommitPath(params2, opts) {
9744
9985
  return this._service.xrpc.call("com.atproto.sync.getCommitPath", params2, void 0, opts).catch((e) => {
9745
- throw toKnownErr33(e);
9986
+ throw toKnownErr34(e);
9746
9987
  });
9747
9988
  }
9748
9989
  getHead(params2, opts) {
9749
9990
  return this._service.xrpc.call("com.atproto.sync.getHead", params2, void 0, opts).catch((e) => {
9750
- throw toKnownErr34(e);
9991
+ throw toKnownErr35(e);
9751
9992
  });
9752
9993
  }
9753
9994
  getRecord(params2, opts) {
9754
9995
  return this._service.xrpc.call("com.atproto.sync.getRecord", params2, void 0, opts).catch((e) => {
9755
- throw toKnownErr35(e);
9996
+ throw toKnownErr36(e);
9756
9997
  });
9757
9998
  }
9758
9999
  getRepo(params2, opts) {
9759
10000
  return this._service.xrpc.call("com.atproto.sync.getRepo", params2, void 0, opts).catch((e) => {
9760
- throw toKnownErr36(e);
10001
+ throw toKnownErr37(e);
9761
10002
  });
9762
10003
  }
9763
10004
  };
@@ -9785,27 +10026,27 @@ var ActorNS = class {
9785
10026
  }
9786
10027
  getProfile(params2, opts) {
9787
10028
  return this._service.xrpc.call("app.bsky.actor.getProfile", params2, void 0, opts).catch((e) => {
9788
- throw toKnownErr37(e);
10029
+ throw toKnownErr38(e);
9789
10030
  });
9790
10031
  }
9791
10032
  getSuggestions(params2, opts) {
9792
10033
  return this._service.xrpc.call("app.bsky.actor.getSuggestions", params2, void 0, opts).catch((e) => {
9793
- throw toKnownErr38(e);
10034
+ throw toKnownErr39(e);
9794
10035
  });
9795
10036
  }
9796
10037
  search(params2, opts) {
9797
10038
  return this._service.xrpc.call("app.bsky.actor.search", params2, void 0, opts).catch((e) => {
9798
- throw toKnownErr39(e);
10039
+ throw toKnownErr40(e);
9799
10040
  });
9800
10041
  }
9801
10042
  searchTypeahead(params2, opts) {
9802
10043
  return this._service.xrpc.call("app.bsky.actor.searchTypeahead", params2, void 0, opts).catch((e) => {
9803
- throw toKnownErr40(e);
10044
+ throw toKnownErr41(e);
9804
10045
  });
9805
10046
  }
9806
10047
  updateProfile(data, opts) {
9807
10048
  return this._service.xrpc.call("app.bsky.actor.updateProfile", opts?.qp, data, opts).catch((e) => {
9808
- throw toKnownErr41(e);
10049
+ throw toKnownErr42(e);
9809
10050
  });
9810
10051
  }
9811
10052
  };
@@ -9860,32 +10101,32 @@ var FeedNS = class {
9860
10101
  }
9861
10102
  getAuthorFeed(params2, opts) {
9862
10103
  return this._service.xrpc.call("app.bsky.feed.getAuthorFeed", params2, void 0, opts).catch((e) => {
9863
- throw toKnownErr42(e);
10104
+ throw toKnownErr43(e);
9864
10105
  });
9865
10106
  }
9866
10107
  getPostThread(params2, opts) {
9867
10108
  return this._service.xrpc.call("app.bsky.feed.getPostThread", params2, void 0, opts).catch((e) => {
9868
- throw toKnownErr43(e);
10109
+ throw toKnownErr44(e);
9869
10110
  });
9870
10111
  }
9871
10112
  getRepostedBy(params2, opts) {
9872
10113
  return this._service.xrpc.call("app.bsky.feed.getRepostedBy", params2, void 0, opts).catch((e) => {
9873
- throw toKnownErr44(e);
10114
+ throw toKnownErr45(e);
9874
10115
  });
9875
10116
  }
9876
10117
  getTimeline(params2, opts) {
9877
10118
  return this._service.xrpc.call("app.bsky.feed.getTimeline", params2, void 0, opts).catch((e) => {
9878
- throw toKnownErr45(e);
10119
+ throw toKnownErr46(e);
9879
10120
  });
9880
10121
  }
9881
10122
  getVotes(params2, opts) {
9882
10123
  return this._service.xrpc.call("app.bsky.feed.getVotes", params2, void 0, opts).catch((e) => {
9883
- throw toKnownErr46(e);
10124
+ throw toKnownErr47(e);
9884
10125
  });
9885
10126
  }
9886
10127
  setVote(data, opts) {
9887
10128
  return this._service.xrpc.call("app.bsky.feed.setVote", opts?.qp, data, opts).catch((e) => {
9888
- throw toKnownErr47(e);
10129
+ throw toKnownErr48(e);
9889
10130
  });
9890
10131
  }
9891
10132
  };
@@ -10009,27 +10250,27 @@ var GraphNS = class {
10009
10250
  }
10010
10251
  getFollowers(params2, opts) {
10011
10252
  return this._service.xrpc.call("app.bsky.graph.getFollowers", params2, void 0, opts).catch((e) => {
10012
- throw toKnownErr48(e);
10253
+ throw toKnownErr49(e);
10013
10254
  });
10014
10255
  }
10015
10256
  getFollows(params2, opts) {
10016
10257
  return this._service.xrpc.call("app.bsky.graph.getFollows", params2, void 0, opts).catch((e) => {
10017
- throw toKnownErr49(e);
10258
+ throw toKnownErr50(e);
10018
10259
  });
10019
10260
  }
10020
10261
  getMutes(params2, opts) {
10021
10262
  return this._service.xrpc.call("app.bsky.graph.getMutes", params2, void 0, opts).catch((e) => {
10022
- throw toKnownErr50(e);
10263
+ throw toKnownErr51(e);
10023
10264
  });
10024
10265
  }
10025
10266
  mute(data, opts) {
10026
10267
  return this._service.xrpc.call("app.bsky.graph.mute", opts?.qp, data, opts).catch((e) => {
10027
- throw toKnownErr51(e);
10268
+ throw toKnownErr52(e);
10028
10269
  });
10029
10270
  }
10030
10271
  unmute(data, opts) {
10031
10272
  return this._service.xrpc.call("app.bsky.graph.unmute", opts?.qp, data, opts).catch((e) => {
10032
- throw toKnownErr52(e);
10273
+ throw toKnownErr53(e);
10033
10274
  });
10034
10275
  }
10035
10276
  };
@@ -10150,17 +10391,17 @@ var NotificationNS = class {
10150
10391
  }
10151
10392
  getCount(params2, opts) {
10152
10393
  return this._service.xrpc.call("app.bsky.notification.getCount", params2, void 0, opts).catch((e) => {
10153
- throw toKnownErr53(e);
10394
+ throw toKnownErr54(e);
10154
10395
  });
10155
10396
  }
10156
10397
  list(params2, opts) {
10157
10398
  return this._service.xrpc.call("app.bsky.notification.list", params2, void 0, opts).catch((e) => {
10158
- throw toKnownErr54(e);
10399
+ throw toKnownErr55(e);
10159
10400
  });
10160
10401
  }
10161
10402
  updateSeen(data, opts) {
10162
10403
  return this._service.xrpc.call("app.bsky.notification.updateSeen", opts?.qp, data, opts).catch((e) => {
10163
- throw toKnownErr55(e);
10404
+ throw toKnownErr56(e);
10164
10405
  });
10165
10406
  }
10166
10407
  };
@@ -10208,129 +10449,189 @@ var DeclarationRecord = class {
10208
10449
  }
10209
10450
  };
10210
10451
 
10211
- // src/session.ts
10212
- var import_events = __toESM(require("events"));
10213
- var CREATE_SESSION = "com.atproto.session.create";
10452
+ // src/agent.ts
10214
10453
  var REFRESH_SESSION = "com.atproto.session.refresh";
10215
- var DELETE_SESSION = "com.atproto.session.delete";
10216
- var CREATE_ACCOUNT = "com.atproto.account.create";
10217
- var SessionClient = class extends Client2 {
10218
- service(serviceUri) {
10219
- const xrpcService = new SessionXrpcServiceClient(this.xrpc, serviceUri);
10220
- return new SessionServiceClient(this, xrpcService);
10454
+ var _AtpAgent = class {
10455
+ static configure(opts) {
10456
+ _AtpAgent.fetch = opts.fetch;
10457
+ }
10458
+ constructor(opts) {
10459
+ this.service = opts.service instanceof URL ? opts.service : new URL(opts.service);
10460
+ this._persistSession = opts.persistSession;
10461
+ this._baseClient = new AtpBaseClient();
10462
+ this._baseClient.xrpc.fetch = this._fetch.bind(this);
10463
+ this.api = this._baseClient.service(opts.service);
10464
+ }
10465
+ get hasSession() {
10466
+ return !!this.session;
10221
10467
  }
10222
- };
10223
- var defaultInst3 = new SessionClient();
10224
- var session_default = defaultInst3;
10225
- var SessionServiceClient = class extends ServiceClient2 {
10226
- constructor(baseClient, xrpcService) {
10227
- super(baseClient, xrpcService);
10228
- this.sessionManager = this.xrpc.sessionManager;
10468
+ setPersistSessionHandler(handler) {
10469
+ this._persistSession = handler;
10229
10470
  }
10230
- };
10231
- var SessionXrpcServiceClient = class extends ServiceClient {
10232
- constructor(baseClient, serviceUri) {
10233
- super(baseClient, serviceUri);
10234
- this.sessionManager = new SessionManager();
10235
- this.sessionManager.on("session", () => {
10236
- const accessHeaders = this.sessionManager.accessHeaders();
10237
- if (accessHeaders) {
10238
- this.setHeader("authorization", accessHeaders.authorization);
10471
+ async createAccount(opts) {
10472
+ try {
10473
+ const res = await this.api.com.atproto.account.create({
10474
+ handle: opts.handle,
10475
+ password: opts.password,
10476
+ email: opts.email,
10477
+ inviteCode: opts.inviteCode
10478
+ });
10479
+ this.session = {
10480
+ accessJwt: res.data.accessJwt,
10481
+ refreshJwt: res.data.refreshJwt,
10482
+ handle: res.data.handle,
10483
+ did: res.data.did
10484
+ };
10485
+ return res;
10486
+ } catch (e) {
10487
+ this.session = void 0;
10488
+ throw e;
10489
+ } finally {
10490
+ if (this.session) {
10491
+ this._persistSession?.("create", this.session);
10239
10492
  } else {
10240
- this.unsetHeader("authorization");
10493
+ this._persistSession?.("create-failed", void 0);
10241
10494
  }
10242
- });
10243
- }
10244
- async call(methodNsid, params2, data, opts) {
10245
- const original = (overrideOpts) => super.call(methodNsid, params2, data, overrideOpts ?? opts);
10246
- if (opts?.headers?.authorization) {
10247
- return await original();
10248
- }
10249
- if (methodNsid === REFRESH_SESSION) {
10250
- return await this.refresh(opts);
10251
- }
10252
- await this.refreshing;
10253
- if (methodNsid === CREATE_SESSION || methodNsid === CREATE_ACCOUNT) {
10254
- const result = await original();
10255
- const { accessJwt, refreshJwt } = result.data;
10256
- this.sessionManager.set({ accessJwt, refreshJwt });
10257
- return result;
10258
- }
10259
- if (methodNsid === DELETE_SESSION) {
10260
- const result = await original({
10261
- ...opts,
10262
- headers: {
10263
- ...opts?.headers,
10264
- ...this.sessionManager.refreshHeaders()
10265
- }
10266
- });
10267
- this.sessionManager.unset();
10268
- return result;
10269
10495
  }
10496
+ }
10497
+ async login(opts) {
10270
10498
  try {
10271
- return await original();
10272
- } catch (err) {
10273
- if (err instanceof XRPCError && err.status === 400 /* InvalidRequest */ && err.error === "ExpiredToken" && this.sessionManager.active()) {
10274
- await this.refresh(opts);
10275
- return await original();
10499
+ const res = await this.api.com.atproto.session.create({
10500
+ identifier: opts.identifier,
10501
+ password: opts.password
10502
+ });
10503
+ this.session = {
10504
+ accessJwt: res.data.accessJwt,
10505
+ refreshJwt: res.data.refreshJwt,
10506
+ handle: res.data.handle,
10507
+ did: res.data.did
10508
+ };
10509
+ return res;
10510
+ } catch (e) {
10511
+ this.session = void 0;
10512
+ throw e;
10513
+ } finally {
10514
+ if (this.session) {
10515
+ this._persistSession?.("create", this.session);
10516
+ } else {
10517
+ this._persistSession?.("create-failed", void 0);
10276
10518
  }
10277
- throw err;
10278
10519
  }
10279
10520
  }
10280
- async refresh(opts) {
10281
- this.refreshing ?? (this.refreshing = this._refresh(opts));
10521
+ async resumeSession(session) {
10282
10522
  try {
10283
- return await this.refreshing;
10523
+ this.session = session;
10524
+ const res = await this.api.com.atproto.session.get();
10525
+ if (!res.success || res.data.did !== this.session.did) {
10526
+ throw new Error("Invalid session");
10527
+ }
10528
+ return res;
10529
+ } catch (e) {
10530
+ this.session = void 0;
10531
+ throw e;
10284
10532
  } finally {
10285
- this.refreshing = void 0;
10533
+ if (this.session) {
10534
+ this._persistSession?.("create", this.session);
10535
+ } else {
10536
+ this._persistSession?.("create-failed", void 0);
10537
+ }
10286
10538
  }
10287
10539
  }
10288
- async _refresh(opts) {
10289
- try {
10290
- const result = await super.call(REFRESH_SESSION, void 0, void 0, {
10291
- ...opts,
10292
- headers: {
10293
- ...opts?.headers,
10294
- ...this.sessionManager.refreshHeaders()
10295
- }
10296
- });
10297
- const { accessJwt, refreshJwt } = result.data;
10298
- this.sessionManager.set({ accessJwt, refreshJwt });
10299
- return result;
10300
- } catch (err) {
10301
- if (err instanceof XRPCError && err.status === 400 /* InvalidRequest */ && (err.error === "ExpiredToken" || err.error === "InvalidToken")) {
10302
- this.sessionManager.unset();
10303
- }
10304
- throw err;
10540
+ _addAuthHeader(reqHeaders) {
10541
+ if (!reqHeaders.authorization && this.session?.accessJwt) {
10542
+ return {
10543
+ ...reqHeaders,
10544
+ authorization: `Bearer ${this.session.accessJwt}`
10545
+ };
10305
10546
  }
10547
+ return reqHeaders;
10306
10548
  }
10307
- };
10308
- var SessionManager = class extends import_events.default {
10309
- get() {
10310
- return this.session;
10549
+ async _fetch(reqUri, reqMethod, reqHeaders, reqBody) {
10550
+ if (!_AtpAgent.fetch) {
10551
+ throw new Error("AtpAgent fetch() method not configured");
10552
+ }
10553
+ await this._refreshSessionPromise;
10554
+ let res = await _AtpAgent.fetch(
10555
+ reqUri,
10556
+ reqMethod,
10557
+ this._addAuthHeader(reqHeaders),
10558
+ reqBody
10559
+ );
10560
+ if (isErrorResponse(res, ["ExpiredToken"]) && this.session?.refreshJwt) {
10561
+ await this._refreshSession();
10562
+ res = await _AtpAgent.fetch(
10563
+ reqUri,
10564
+ reqMethod,
10565
+ this._addAuthHeader(reqHeaders),
10566
+ reqBody
10567
+ );
10568
+ }
10569
+ return res;
10311
10570
  }
10312
- set(session) {
10313
- this.session = session;
10314
- this.emit("session", session);
10571
+ async _refreshSession() {
10572
+ if (this._refreshSessionPromise) {
10573
+ return this._refreshSessionPromise;
10574
+ }
10575
+ this._refreshSessionPromise = this._refreshSessionInner();
10576
+ try {
10577
+ await this._refreshSessionPromise;
10578
+ } finally {
10579
+ this._refreshSessionPromise = void 0;
10580
+ }
10315
10581
  }
10316
- unset() {
10317
- this.session = void 0;
10318
- this.emit("session", void 0);
10582
+ async _refreshSessionInner() {
10583
+ if (!_AtpAgent.fetch) {
10584
+ throw new Error("AtpAgent fetch() method not configured");
10585
+ }
10586
+ if (!this.session?.refreshJwt) {
10587
+ return;
10588
+ }
10589
+ const url = new URL(this.service.origin);
10590
+ url.pathname = `/xrpc/${REFRESH_SESSION}`;
10591
+ const res = await _AtpAgent.fetch(
10592
+ url.toString(),
10593
+ "POST",
10594
+ {
10595
+ authorization: `Bearer ${this.session.refreshJwt}`
10596
+ },
10597
+ void 0
10598
+ );
10599
+ if (isErrorResponse(res, ["ExpiredToken", "InvalidToken"])) {
10600
+ this.session = void 0;
10601
+ this._persistSession?.("expired", void 0);
10602
+ } else if (isNewSessionObject(this._baseClient, res.body)) {
10603
+ this.session = {
10604
+ accessJwt: res.body.accessJwt,
10605
+ refreshJwt: res.body.refreshJwt,
10606
+ handle: res.body.handle,
10607
+ did: res.body.did
10608
+ };
10609
+ this._persistSession?.("update", this.session);
10610
+ }
10319
10611
  }
10320
- active() {
10321
- return !!this.session;
10612
+ };
10613
+ var AtpAgent = _AtpAgent;
10614
+ AtpAgent.fetch = defaultFetchHandler;
10615
+ function isErrorObject(v) {
10616
+ return errorResponseBody.safeParse(v).success;
10617
+ }
10618
+ function isErrorResponse(res, errorNames) {
10619
+ if (res.status !== 400) {
10620
+ return false;
10322
10621
  }
10323
- accessHeaders() {
10324
- return this.session && {
10325
- authorization: `Bearer ${this.session.accessJwt}`
10326
- };
10622
+ if (!isErrorObject(res.body)) {
10623
+ return false;
10327
10624
  }
10328
- refreshHeaders() {
10329
- return this.session && {
10330
- authorization: `Bearer ${this.session.refreshJwt}`
10331
- };
10625
+ return typeof res.body.error === "string" && errorNames.includes(res.body.error);
10626
+ }
10627
+ function isNewSessionObject(client, v) {
10628
+ try {
10629
+ client.xrpc.lex.assertValidXrpcOutput("com.atproto.session.refresh", v);
10630
+ return true;
10631
+ } catch {
10632
+ return false;
10332
10633
  }
10333
- };
10634
+ }
10334
10635
  // Annotate the CommonJS export names for ESM import in node:
10335
10636
  0 && (module.exports = {
10336
10637
  APP_BSKY_GRAPH,
@@ -10375,18 +10676,22 @@ var SessionManager = class extends import_events.default {
10375
10676
  AppBskySystemDeclaration,
10376
10677
  AppNS,
10377
10678
  AssertionRecord,
10679
+ AtpAgent,
10680
+ AtpBaseClient,
10681
+ AtpServiceClient,
10378
10682
  AtprotoNS,
10379
10683
  BlobNS,
10380
10684
  BskyNS,
10381
10685
  COM_ATPROTO_ADMIN,
10382
10686
  COM_ATPROTO_REPORT,
10383
- Client,
10384
10687
  ComAtprotoAccountCreate,
10385
10688
  ComAtprotoAccountCreateInviteCode,
10386
10689
  ComAtprotoAccountDelete,
10387
10690
  ComAtprotoAccountGet,
10691
+ ComAtprotoAccountRequestDelete,
10388
10692
  ComAtprotoAccountRequestPasswordReset,
10389
10693
  ComAtprotoAccountResetPassword,
10694
+ ComAtprotoAdminBlob,
10390
10695
  ComAtprotoAdminGetModerationAction,
10391
10696
  ComAtprotoAdminGetModerationActions,
10392
10697
  ComAtprotoAdminGetModerationReport,
@@ -10441,15 +10746,9 @@ var SessionManager = class extends import_events.default {
10441
10746
  ReportNS,
10442
10747
  RepostRecord,
10443
10748
  ServerNS,
10444
- ServiceClient,
10445
- SessionClient,
10446
- SessionManager,
10447
10749
  SessionNS,
10448
- SessionServiceClient,
10449
- SessionXrpcServiceClient,
10450
10750
  SyncNS,
10451
10751
  SystemNS,
10452
- VoteRecord,
10453
- sessionClient
10752
+ VoteRecord
10454
10753
  });
10455
10754
  //# sourceMappingURL=index.js.map