@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
@@ -113,7 +113,33 @@ export const schemaDict = {
113
113
  defs: {
114
114
  main: {
115
115
  type: 'procedure',
116
- description: 'Delete an account.',
116
+ description: 'Delete a user account with a token and password.',
117
+ input: {
118
+ encoding: 'application/json',
119
+ schema: {
120
+ type: 'object',
121
+ required: ['did', 'password', 'token'],
122
+ properties: {
123
+ did: {
124
+ type: 'string',
125
+ },
126
+ password: {
127
+ type: 'string',
128
+ },
129
+ token: {
130
+ type: 'string',
131
+ },
132
+ },
133
+ },
134
+ },
135
+ errors: [
136
+ {
137
+ name: 'ExpiredToken',
138
+ },
139
+ {
140
+ name: 'InvalidToken',
141
+ },
142
+ ],
117
143
  },
118
144
  },
119
145
  },
@@ -127,6 +153,16 @@ export const schemaDict = {
127
153
  },
128
154
  },
129
155
  },
156
+ ComAtprotoAccountRequestDelete: {
157
+ lexicon: 1,
158
+ id: 'com.atproto.account.requestDelete',
159
+ defs: {
160
+ main: {
161
+ type: 'procedure',
162
+ description: 'Initiate a user account deletion via email.',
163
+ },
164
+ },
165
+ },
130
166
  ComAtprotoAccountRequestPasswordReset: {
131
167
  lexicon: 1,
132
168
  id: 'com.atproto.account.requestPasswordReset',
@@ -182,6 +218,78 @@ export const schemaDict = {
182
218
  },
183
219
  },
184
220
  },
221
+ ComAtprotoAdminBlob: {
222
+ lexicon: 1,
223
+ id: 'com.atproto.admin.blob',
224
+ defs: {
225
+ view: {
226
+ type: 'object',
227
+ required: ['cid', 'mimeType', 'size', 'createdAt'],
228
+ properties: {
229
+ cid: {
230
+ type: 'string',
231
+ },
232
+ mimeType: {
233
+ type: 'string',
234
+ },
235
+ size: {
236
+ type: 'integer',
237
+ },
238
+ createdAt: {
239
+ type: 'datetime',
240
+ },
241
+ details: {
242
+ type: 'union',
243
+ refs: [
244
+ 'lex:com.atproto.admin.blob#imageDetails',
245
+ 'lex:com.atproto.admin.blob#videoDetails',
246
+ ],
247
+ },
248
+ moderation: {
249
+ type: 'ref',
250
+ ref: 'lex:com.atproto.admin.blob#moderation',
251
+ },
252
+ },
253
+ },
254
+ imageDetails: {
255
+ type: 'object',
256
+ required: ['width', 'height'],
257
+ properties: {
258
+ width: {
259
+ type: 'integer',
260
+ },
261
+ height: {
262
+ type: 'integer',
263
+ },
264
+ },
265
+ },
266
+ videoDetails: {
267
+ type: 'object',
268
+ required: ['width', 'height', 'length'],
269
+ properties: {
270
+ width: {
271
+ type: 'integer',
272
+ },
273
+ height: {
274
+ type: 'integer',
275
+ },
276
+ length: {
277
+ type: 'integer',
278
+ },
279
+ },
280
+ },
281
+ moderation: {
282
+ type: 'object',
283
+ required: [],
284
+ properties: {
285
+ currentAction: {
286
+ type: 'ref',
287
+ ref: 'lex:com.atproto.admin.moderationAction#viewCurrent',
288
+ },
289
+ },
290
+ },
291
+ },
292
+ },
185
293
  ComAtprotoAdminGetModerationAction: {
186
294
  lexicon: 1,
187
295
  id: 'com.atproto.admin.getModerationAction',
@@ -394,6 +502,7 @@ export const schemaDict = {
394
502
  'id',
395
503
  'action',
396
504
  'subject',
505
+ 'subjectBlobCids',
397
506
  'reason',
398
507
  'createdBy',
399
508
  'createdAt',
@@ -404,12 +513,8 @@ export const schemaDict = {
404
513
  type: 'integer',
405
514
  },
406
515
  action: {
407
- type: 'string',
408
- knownValues: [
409
- 'com.atproto.admin.moderationAction#takedown',
410
- 'com.atproto.admin.moderationAction#flag',
411
- 'com.atproto.admin.moderationAction#acknowledge',
412
- ],
516
+ type: 'ref',
517
+ ref: 'lex:com.atproto.admin.moderationAction#actionType',
413
518
  },
414
519
  subject: {
415
520
  type: 'union',
@@ -418,6 +523,12 @@ export const schemaDict = {
418
523
  'lex:com.atproto.repo.strongRef',
419
524
  ],
420
525
  },
526
+ subjectBlobCids: {
527
+ type: 'array',
528
+ items: {
529
+ type: 'string',
530
+ },
531
+ },
421
532
  reason: {
422
533
  type: 'string',
423
534
  },
@@ -445,6 +556,7 @@ export const schemaDict = {
445
556
  'id',
446
557
  'action',
447
558
  'subject',
559
+ 'subjectBlobs',
448
560
  'reason',
449
561
  'createdBy',
450
562
  'createdAt',
@@ -455,12 +567,8 @@ export const schemaDict = {
455
567
  type: 'integer',
456
568
  },
457
569
  action: {
458
- type: 'string',
459
- knownValues: [
460
- 'com.atproto.admin.moderationAction#takedown',
461
- 'com.atproto.admin.moderationAction#flag',
462
- 'com.atproto.admin.moderationAction#acknowledge',
463
- ],
570
+ type: 'ref',
571
+ ref: 'lex:com.atproto.admin.moderationAction#actionType',
464
572
  },
465
573
  subject: {
466
574
  type: 'union',
@@ -469,6 +577,13 @@ export const schemaDict = {
469
577
  'lex:com.atproto.admin.record#view',
470
578
  ],
471
579
  },
580
+ subjectBlobs: {
581
+ type: 'array',
582
+ items: {
583
+ type: 'ref',
584
+ ref: 'lex:com.atproto.admin.blob#view',
585
+ },
586
+ },
472
587
  reason: {
473
588
  type: 'string',
474
589
  },
@@ -491,6 +606,19 @@ export const schemaDict = {
491
606
  },
492
607
  },
493
608
  },
609
+ viewCurrent: {
610
+ type: 'object',
611
+ required: ['id', 'action'],
612
+ properties: {
613
+ id: {
614
+ type: 'integer',
615
+ },
616
+ action: {
617
+ type: 'ref',
618
+ ref: 'lex:com.atproto.admin.moderationAction#actionType',
619
+ },
620
+ },
621
+ },
494
622
  reversal: {
495
623
  type: 'object',
496
624
  required: ['reason', 'createdBy', 'createdAt'],
@@ -506,6 +634,14 @@ export const schemaDict = {
506
634
  },
507
635
  },
508
636
  },
637
+ actionType: {
638
+ type: 'string',
639
+ knownValues: [
640
+ 'com.atproto.admin.moderationAction#takedown',
641
+ 'com.atproto.admin.moderationAction#flag',
642
+ 'com.atproto.admin.moderationAction#acknowledge',
643
+ ],
644
+ },
509
645
  takedown: {
510
646
  type: 'token',
511
647
  description:
@@ -620,7 +756,15 @@ export const schemaDict = {
620
756
  defs: {
621
757
  view: {
622
758
  type: 'object',
623
- required: ['uri', 'cid', 'value', 'indexedAt', 'moderation', 'repo'],
759
+ required: [
760
+ 'uri',
761
+ 'cid',
762
+ 'value',
763
+ 'blobCids',
764
+ 'indexedAt',
765
+ 'moderation',
766
+ 'repo',
767
+ ],
624
768
  properties: {
625
769
  uri: {
626
770
  type: 'string',
@@ -631,6 +775,12 @@ export const schemaDict = {
631
775
  value: {
632
776
  type: 'unknown',
633
777
  },
778
+ blobCids: {
779
+ type: 'array',
780
+ items: {
781
+ type: 'string',
782
+ },
783
+ },
634
784
  indexedAt: {
635
785
  type: 'string',
636
786
  },
@@ -646,7 +796,15 @@ export const schemaDict = {
646
796
  },
647
797
  viewDetail: {
648
798
  type: 'object',
649
- required: ['uri', 'cid', 'value', 'indexedAt', 'moderation', 'repo'],
799
+ required: [
800
+ 'uri',
801
+ 'cid',
802
+ 'value',
803
+ 'blobs',
804
+ 'indexedAt',
805
+ 'moderation',
806
+ 'repo',
807
+ ],
650
808
  properties: {
651
809
  uri: {
652
810
  type: 'string',
@@ -657,6 +815,13 @@ export const schemaDict = {
657
815
  value: {
658
816
  type: 'unknown',
659
817
  },
818
+ blobs: {
819
+ type: 'array',
820
+ items: {
821
+ type: 'ref',
822
+ ref: 'lex:com.atproto.admin.blob#view',
823
+ },
824
+ },
660
825
  indexedAt: {
661
826
  type: 'string',
662
827
  },
@@ -674,8 +839,9 @@ export const schemaDict = {
674
839
  type: 'object',
675
840
  required: [],
676
841
  properties: {
677
- takedownId: {
678
- type: 'integer',
842
+ currentAction: {
843
+ type: 'ref',
844
+ ref: 'lex:com.atproto.admin.moderationAction#viewCurrent',
679
845
  },
680
846
  },
681
847
  },
@@ -683,6 +849,10 @@ export const schemaDict = {
683
849
  type: 'object',
684
850
  required: ['actions', 'reports'],
685
851
  properties: {
852
+ currentAction: {
853
+ type: 'ref',
854
+ ref: 'lex:com.atproto.admin.moderationAction#viewCurrent',
855
+ },
686
856
  actions: {
687
857
  type: 'array',
688
858
  items: {
@@ -697,9 +867,6 @@ export const schemaDict = {
697
867
  ref: 'lex:com.atproto.admin.moderationReport#view',
698
868
  },
699
869
  },
700
- takedownId: {
701
- type: 'integer',
702
- },
703
870
  },
704
871
  },
705
872
  },
@@ -791,8 +958,9 @@ export const schemaDict = {
791
958
  type: 'object',
792
959
  required: [],
793
960
  properties: {
794
- takedownId: {
795
- type: 'integer',
961
+ currentAction: {
962
+ type: 'ref',
963
+ ref: 'lex:com.atproto.admin.moderationAction#viewCurrent',
796
964
  },
797
965
  },
798
966
  },
@@ -800,6 +968,10 @@ export const schemaDict = {
800
968
  type: 'object',
801
969
  required: ['actions', 'reports'],
802
970
  properties: {
971
+ currentAction: {
972
+ type: 'ref',
973
+ ref: 'lex:com.atproto.admin.moderationAction#viewCurrent',
974
+ },
803
975
  actions: {
804
976
  type: 'array',
805
977
  items: {
@@ -814,9 +986,6 @@ export const schemaDict = {
814
986
  ref: 'lex:com.atproto.admin.moderationReport#view',
815
987
  },
816
988
  },
817
- takedownId: {
818
- type: 'integer',
819
- },
820
989
  },
821
990
  },
822
991
  },
@@ -968,6 +1137,12 @@ export const schemaDict = {
968
1137
  'lex:com.atproto.repo.recordRef',
969
1138
  ],
970
1139
  },
1140
+ subjectBlobCids: {
1141
+ type: 'array',
1142
+ items: {
1143
+ type: 'string',
1144
+ },
1145
+ },
971
1146
  reason: {
972
1147
  type: 'string',
973
1148
  },
@@ -984,6 +1159,11 @@ export const schemaDict = {
984
1159
  ref: 'lex:com.atproto.admin.moderationAction#view',
985
1160
  },
986
1161
  },
1162
+ errors: [
1163
+ {
1164
+ name: 'SubjectHasAction',
1165
+ },
1166
+ ],
987
1167
  },
988
1168
  },
989
1169
  },
@@ -2142,18 +2322,6 @@ export const schemaDict = {
2142
2322
  indexedAt: {
2143
2323
  type: 'datetime',
2144
2324
  },
2145
- myState: {
2146
- type: 'ref',
2147
- ref: 'lex:app.bsky.actor.getSuggestions#myState',
2148
- },
2149
- },
2150
- },
2151
- myState: {
2152
- type: 'object',
2153
- properties: {
2154
- follow: {
2155
- type: 'string',
2156
- },
2157
2325
  },
2158
2326
  },
2159
2327
  },
@@ -2180,16 +2348,16 @@ export const schemaDict = {
2180
2348
  avatar: {
2181
2349
  type: 'image',
2182
2350
  accept: ['image/png', 'image/jpeg'],
2183
- maxWidth: 1000,
2184
- maxHeight: 1000,
2185
- maxSize: 300000,
2351
+ maxWidth: 2000,
2352
+ maxHeight: 2000,
2353
+ maxSize: 1000000,
2186
2354
  },
2187
2355
  banner: {
2188
2356
  type: 'image',
2189
2357
  accept: ['image/png', 'image/jpeg'],
2190
- maxWidth: 3000,
2191
- maxHeight: 1000,
2192
- maxSize: 500000,
2358
+ maxWidth: 6000,
2359
+ maxHeight: 2000,
2360
+ maxSize: 1000000,
2193
2361
  },
2194
2362
  },
2195
2363
  },
@@ -2492,9 +2660,9 @@ export const schemaDict = {
2492
2660
  thumb: {
2493
2661
  type: 'image',
2494
2662
  accept: ['image/*'],
2495
- maxWidth: 1000,
2496
- maxHeight: 1000,
2497
- maxSize: 300000,
2663
+ maxWidth: 2000,
2664
+ maxHeight: 2000,
2665
+ maxSize: 1000000,
2498
2666
  },
2499
2667
  },
2500
2668
  },
@@ -2554,9 +2722,9 @@ export const schemaDict = {
2554
2722
  image: {
2555
2723
  type: 'image',
2556
2724
  accept: ['image/*'],
2557
- maxWidth: 1000,
2558
- maxHeight: 1000,
2559
- maxSize: 300000,
2725
+ maxWidth: 2000,
2726
+ maxHeight: 2000,
2727
+ maxSize: 1000000,
2560
2728
  },
2561
2729
  alt: {
2562
2730
  type: 'string',
@@ -3796,9 +3964,11 @@ export const ids = {
3796
3964
  ComAtprotoAccountCreateInviteCode: 'com.atproto.account.createInviteCode',
3797
3965
  ComAtprotoAccountDelete: 'com.atproto.account.delete',
3798
3966
  ComAtprotoAccountGet: 'com.atproto.account.get',
3967
+ ComAtprotoAccountRequestDelete: 'com.atproto.account.requestDelete',
3799
3968
  ComAtprotoAccountRequestPasswordReset:
3800
3969
  'com.atproto.account.requestPasswordReset',
3801
3970
  ComAtprotoAccountResetPassword: 'com.atproto.account.resetPassword',
3971
+ ComAtprotoAdminBlob: 'com.atproto.admin.blob',
3802
3972
  ComAtprotoAdminGetModerationAction: 'com.atproto.admin.getModerationAction',
3803
3973
  ComAtprotoAdminGetModerationActions: 'com.atproto.admin.getModerationActions',
3804
3974
  ComAtprotoAdminGetModerationReport: 'com.atproto.admin.getModerationReport',
@@ -44,7 +44,6 @@ export interface Actor {
44
44
  description?: string
45
45
  avatar?: string
46
46
  indexedAt?: string
47
- myState?: MyState
48
47
  [k: string]: unknown
49
48
  }
50
49
 
@@ -59,20 +58,3 @@ export function isActor(v: unknown): v is Actor {
59
58
  export function validateActor(v: unknown): ValidationResult {
60
59
  return lexicons.validate('app.bsky.actor.getSuggestions#actor', v)
61
60
  }
62
-
63
- export interface MyState {
64
- follow?: string
65
- [k: string]: unknown
66
- }
67
-
68
- export function isMyState(v: unknown): v is MyState {
69
- return (
70
- isObj(v) &&
71
- hasProp(v, '$type') &&
72
- v.$type === 'app.bsky.actor.getSuggestions#myState'
73
- )
74
- }
75
-
76
- export function validateMyState(v: unknown): ValidationResult {
77
- return lexicons.validate('app.bsky.actor.getSuggestions#myState', v)
78
- }
@@ -8,11 +8,17 @@ import { lexicons } from '../../../../lexicons'
8
8
 
9
9
  export interface QueryParams {}
10
10
 
11
- export type InputSchema = undefined
11
+ export interface InputSchema {
12
+ did: string
13
+ password: string
14
+ token: string
15
+ [k: string]: unknown
16
+ }
12
17
 
13
18
  export interface CallOptions {
14
19
  headers?: Headers
15
20
  qp?: QueryParams
21
+ encoding: 'application/json'
16
22
  }
17
23
 
18
24
  export interface Response {
@@ -20,8 +26,22 @@ export interface Response {
20
26
  headers: Headers
21
27
  }
22
28
 
29
+ export class ExpiredTokenError extends XRPCError {
30
+ constructor(src: XRPCError) {
31
+ super(src.status, src.error, src.message)
32
+ }
33
+ }
34
+
35
+ export class InvalidTokenError extends XRPCError {
36
+ constructor(src: XRPCError) {
37
+ super(src.status, src.error, src.message)
38
+ }
39
+ }
40
+
23
41
  export function toKnownErr(e: any) {
24
42
  if (e instanceof XRPCError) {
43
+ if (e.error === 'ExpiredToken') return new ExpiredTokenError(e)
44
+ if (e.error === 'InvalidToken') return new InvalidTokenError(e)
25
45
  }
26
46
  return e
27
47
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+
9
+ export interface QueryParams {}
10
+
11
+ export type InputSchema = undefined
12
+
13
+ export interface CallOptions {
14
+ headers?: Headers
15
+ qp?: QueryParams
16
+ }
17
+
18
+ export interface Response {
19
+ success: boolean
20
+ headers: Headers
21
+ }
22
+
23
+ export function toKnownErr(e: any) {
24
+ if (e instanceof XRPCError) {
25
+ }
26
+ return e
27
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import * as ComAtprotoAdminModerationAction from './moderationAction'
8
+
9
+ export interface View {
10
+ cid: string
11
+ mimeType: string
12
+ size: number
13
+ createdAt: string
14
+ details?:
15
+ | ImageDetails
16
+ | VideoDetails
17
+ | { $type: string; [k: string]: unknown }
18
+ moderation?: Moderation
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export function isView(v: unknown): v is View {
23
+ return (
24
+ isObj(v) && hasProp(v, '$type') && v.$type === 'com.atproto.admin.blob#view'
25
+ )
26
+ }
27
+
28
+ export function validateView(v: unknown): ValidationResult {
29
+ return lexicons.validate('com.atproto.admin.blob#view', v)
30
+ }
31
+
32
+ export interface ImageDetails {
33
+ width: number
34
+ height: number
35
+ [k: string]: unknown
36
+ }
37
+
38
+ export function isImageDetails(v: unknown): v is ImageDetails {
39
+ return (
40
+ isObj(v) &&
41
+ hasProp(v, '$type') &&
42
+ v.$type === 'com.atproto.admin.blob#imageDetails'
43
+ )
44
+ }
45
+
46
+ export function validateImageDetails(v: unknown): ValidationResult {
47
+ return lexicons.validate('com.atproto.admin.blob#imageDetails', v)
48
+ }
49
+
50
+ export interface VideoDetails {
51
+ width: number
52
+ height: number
53
+ length: number
54
+ [k: string]: unknown
55
+ }
56
+
57
+ export function isVideoDetails(v: unknown): v is VideoDetails {
58
+ return (
59
+ isObj(v) &&
60
+ hasProp(v, '$type') &&
61
+ v.$type === 'com.atproto.admin.blob#videoDetails'
62
+ )
63
+ }
64
+
65
+ export function validateVideoDetails(v: unknown): ValidationResult {
66
+ return lexicons.validate('com.atproto.admin.blob#videoDetails', v)
67
+ }
68
+
69
+ export interface Moderation {
70
+ currentAction?: ComAtprotoAdminModerationAction.ViewCurrent
71
+ [k: string]: unknown
72
+ }
73
+
74
+ export function isModeration(v: unknown): v is Moderation {
75
+ return (
76
+ isObj(v) &&
77
+ hasProp(v, '$type') &&
78
+ v.$type === 'com.atproto.admin.blob#moderation'
79
+ )
80
+ }
81
+
82
+ export function validateModeration(v: unknown): ValidationResult {
83
+ return lexicons.validate('com.atproto.admin.blob#moderation', v)
84
+ }