@atproto/api 0.0.1

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 (153) hide show
  1. package/README.md +34 -0
  2. package/babel.config.js +3 -0
  3. package/build.js +22 -0
  4. package/dist/index.js +8724 -0
  5. package/dist/index.js.map +7 -0
  6. package/dist/src/client/index.d.ts +462 -0
  7. package/dist/src/client/lexicons.d.ts +2910 -0
  8. package/dist/src/client/schemas.d.ts +17 -0
  9. package/dist/src/client/types/app/bsky/actor/createScene.d.ts +32 -0
  10. package/dist/src/client/types/app/bsky/actor/getProfile.d.ts +36 -0
  11. package/dist/src/client/types/app/bsky/actor/getSuggestions.d.ts +36 -0
  12. package/dist/src/client/types/app/bsky/actor/profile.d.ts +15 -0
  13. package/dist/src/client/types/app/bsky/actor/ref.d.ts +14 -0
  14. package/dist/src/client/types/app/bsky/actor/search.d.ts +32 -0
  15. package/dist/src/client/types/app/bsky/actor/searchTypeahead.d.ts +28 -0
  16. package/dist/src/client/types/app/bsky/actor/updateProfile.d.ts +48 -0
  17. package/dist/src/client/types/app/bsky/embed/external.d.ts +26 -0
  18. package/dist/src/client/types/app/bsky/embed/images.d.ts +23 -0
  19. package/dist/src/client/types/app/bsky/feed/debug.d.ts +57 -0
  20. package/dist/src/client/types/app/bsky/feed/embed.d.ts +36 -0
  21. package/dist/src/client/types/app/bsky/feed/feedViewPost.d.ts +26 -0
  22. package/dist/src/client/types/app/bsky/feed/getAuthorFeed.d.ts +22 -0
  23. package/dist/src/client/types/app/bsky/feed/getLikedBy.d.ts +29 -0
  24. package/dist/src/client/types/app/bsky/feed/getPostThread.d.ts +43 -0
  25. package/dist/src/client/types/app/bsky/feed/getRepostedBy.d.ts +35 -0
  26. package/dist/src/client/types/app/bsky/feed/getTimeline.d.ts +22 -0
  27. package/dist/src/client/types/app/bsky/feed/getVotes.d.ts +33 -0
  28. package/dist/src/client/types/app/bsky/feed/like.d.ts +10 -0
  29. package/dist/src/client/types/app/bsky/feed/mediaEmbed.d.ts +18 -0
  30. package/dist/src/client/types/app/bsky/feed/post.d.ts +54 -0
  31. package/dist/src/client/types/app/bsky/feed/repost.d.ts +6 -0
  32. package/dist/src/client/types/app/bsky/feed/setVote.d.ts +25 -0
  33. package/dist/src/client/types/app/bsky/feed/trend.d.ts +6 -0
  34. package/dist/src/client/types/app/bsky/feed/vote.d.ts +7 -0
  35. package/dist/src/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
  36. package/dist/src/client/types/app/bsky/graph/assertMember.d.ts +1 -0
  37. package/dist/src/client/types/app/bsky/graph/assertion.d.ts +7 -0
  38. package/dist/src/client/types/app/bsky/graph/confirmation.d.ts +8 -0
  39. package/dist/src/client/types/app/bsky/graph/follow.d.ts +6 -0
  40. package/dist/src/client/types/app/bsky/graph/getAssertions.d.ts +43 -0
  41. package/dist/src/client/types/app/bsky/graph/getFollowers.d.ts +34 -0
  42. package/dist/src/client/types/app/bsky/graph/getFollows.d.ts +33 -0
  43. package/dist/src/client/types/app/bsky/graph/getMembers.d.ts +33 -0
  44. package/dist/src/client/types/app/bsky/graph/getMemberships.d.ts +33 -0
  45. package/dist/src/client/types/app/bsky/graph/invite.d.ts +10 -0
  46. package/dist/src/client/types/app/bsky/graph/inviteAccept.d.ts +14 -0
  47. package/dist/src/client/types/app/bsky/notification/getCount.d.ts +17 -0
  48. package/dist/src/client/types/app/bsky/notification/list.d.ts +32 -0
  49. package/dist/src/client/types/app/bsky/notification/updateSeen.d.ts +17 -0
  50. package/dist/src/client/types/app/bsky/system/actorScene.d.ts +1 -0
  51. package/dist/src/client/types/app/bsky/system/actorUser.d.ts +1 -0
  52. package/dist/src/client/types/app/bsky/system/declRef.d.ts +5 -0
  53. package/dist/src/client/types/app/bsky/system/declaration.d.ts +4 -0
  54. package/dist/src/client/types/com/atproto/account/create.d.ts +41 -0
  55. package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
  56. package/dist/src/client/types/com/atproto/account/delete.d.ts +13 -0
  57. package/dist/src/client/types/com/atproto/account/get.d.ts +12 -0
  58. package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
  59. package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +24 -0
  60. package/dist/src/client/types/com/atproto/blob/upload.d.ts +19 -0
  61. package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +22 -0
  62. package/dist/src/client/types/com/atproto/handle/resolve.d.ts +18 -0
  63. package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +39 -0
  64. package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +26 -0
  65. package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +19 -0
  66. package/dist/src/client/types/com/atproto/repo/describe.d.ts +22 -0
  67. package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +23 -0
  68. package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +30 -0
  69. package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +27 -0
  70. package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +5 -0
  71. package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +24 -0
  72. package/dist/src/client/types/com/atproto/session/create.d.ts +26 -0
  73. package/dist/src/client/types/com/atproto/session/delete.d.ts +13 -0
  74. package/dist/src/client/types/com/atproto/session/get.d.ts +18 -0
  75. package/dist/src/client/types/com/atproto/session/refresh.d.ts +21 -0
  76. package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +15 -0
  77. package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +18 -0
  78. package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
  79. package/dist/src/index.d.ts +4 -0
  80. package/dist/src/session.d.ts +42 -0
  81. package/dist/tsconfig.build.tsbuildinfo +1 -0
  82. package/jest.config.js +6 -0
  83. package/package.json +21 -0
  84. package/src/client/index.ts +1393 -0
  85. package/src/client/lexicons.ts +3041 -0
  86. package/src/client/types/app/bsky/actor/createScene.ts +52 -0
  87. package/src/client/types/app/bsky/actor/getProfile.ts +50 -0
  88. package/src/client/types/app/bsky/actor/getSuggestions.ts +51 -0
  89. package/src/client/types/app/bsky/actor/profile.ts +10 -0
  90. package/src/client/types/app/bsky/actor/ref.ts +19 -0
  91. package/src/client/types/app/bsky/actor/search.ts +46 -0
  92. package/src/client/types/app/bsky/actor/searchTypeahead.ts +42 -0
  93. package/src/client/types/app/bsky/actor/updateProfile.ts +69 -0
  94. package/src/client/types/app/bsky/embed/external.ts +28 -0
  95. package/src/client/types/app/bsky/embed/images.ts +25 -0
  96. package/src/client/types/app/bsky/feed/feedViewPost.ts +30 -0
  97. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +35 -0
  98. package/src/client/types/app/bsky/feed/getPostThread.ts +63 -0
  99. package/src/client/types/app/bsky/feed/getRepostedBy.ts +49 -0
  100. package/src/client/types/app/bsky/feed/getTimeline.ts +35 -0
  101. package/src/client/types/app/bsky/feed/getVotes.ts +47 -0
  102. package/src/client/types/app/bsky/feed/post.ts +64 -0
  103. package/src/client/types/app/bsky/feed/repost.ts +10 -0
  104. package/src/client/types/app/bsky/feed/setVote.ts +37 -0
  105. package/src/client/types/app/bsky/feed/trend.ts +10 -0
  106. package/src/client/types/app/bsky/feed/vote.ts +11 -0
  107. package/src/client/types/app/bsky/graph/assertCreator.ts +5 -0
  108. package/src/client/types/app/bsky/graph/assertMember.ts +5 -0
  109. package/src/client/types/app/bsky/graph/assertion.ts +11 -0
  110. package/src/client/types/app/bsky/graph/confirmation.ts +12 -0
  111. package/src/client/types/app/bsky/graph/follow.ts +10 -0
  112. package/src/client/types/app/bsky/graph/getAssertions.ts +58 -0
  113. package/src/client/types/app/bsky/graph/getFollowers.ts +48 -0
  114. package/src/client/types/app/bsky/graph/getFollows.ts +47 -0
  115. package/src/client/types/app/bsky/graph/getMembers.ts +47 -0
  116. package/src/client/types/app/bsky/graph/getMemberships.ts +47 -0
  117. package/src/client/types/app/bsky/notification/getCount.ts +29 -0
  118. package/src/client/types/app/bsky/notification/list.ts +55 -0
  119. package/src/client/types/app/bsky/notification/updateSeen.ts +28 -0
  120. package/src/client/types/app/bsky/system/actorScene.ts +5 -0
  121. package/src/client/types/app/bsky/system/actorUser.ts +5 -0
  122. package/src/client/types/app/bsky/system/declRef.ts +12 -0
  123. package/src/client/types/app/bsky/system/declaration.ts +10 -0
  124. package/src/client/types/com/atproto/account/create.ts +69 -0
  125. package/src/client/types/com/atproto/account/createInviteCode.ts +34 -0
  126. package/src/client/types/com/atproto/account/delete.ts +24 -0
  127. package/src/client/types/com/atproto/account/get.ts +23 -0
  128. package/src/client/types/com/atproto/account/requestPasswordReset.ts +28 -0
  129. package/src/client/types/com/atproto/account/resetPassword.ts +43 -0
  130. package/src/client/types/com/atproto/blob/upload.ts +31 -0
  131. package/src/client/types/com/atproto/handle/resolve.ts +32 -0
  132. package/src/client/types/com/atproto/repo/batchWrite.ts +55 -0
  133. package/src/client/types/com/atproto/repo/createRecord.ts +42 -0
  134. package/src/client/types/com/atproto/repo/deleteRecord.ts +33 -0
  135. package/src/client/types/com/atproto/repo/describe.ts +36 -0
  136. package/src/client/types/com/atproto/repo/getRecord.ts +40 -0
  137. package/src/client/types/com/atproto/repo/listRecords.ts +50 -0
  138. package/src/client/types/com/atproto/repo/putRecord.ts +44 -0
  139. package/src/client/types/com/atproto/repo/strongRef.ts +8 -0
  140. package/src/client/types/com/atproto/server/getAccountsConfig.ts +37 -0
  141. package/src/client/types/com/atproto/session/create.ts +38 -0
  142. package/src/client/types/com/atproto/session/delete.ts +24 -0
  143. package/src/client/types/com/atproto/session/get.ts +30 -0
  144. package/src/client/types/com/atproto/session/refresh.ts +33 -0
  145. package/src/client/types/com/atproto/sync/getRepo.ts +29 -0
  146. package/src/client/types/com/atproto/sync/getRoot.ts +32 -0
  147. package/src/client/types/com/atproto/sync/updateRepo.ts +28 -0
  148. package/src/index.ts +4 -0
  149. package/src/session.ts +194 -0
  150. package/tests/errors.test.ts +39 -0
  151. package/tests/session.test.ts +239 -0
  152. package/tsconfig.build.json +4 -0
  153. package/tsconfig.json +12 -0
@@ -0,0 +1,1393 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import {
5
+ Client as XrpcClient,
6
+ ServiceClient as XrpcServiceClient,
7
+ } from '@atproto/xrpc'
8
+ import { schemas } from './lexicons'
9
+ import * as ComAtprotoAccountCreate from './types/com/atproto/account/create'
10
+ import * as ComAtprotoAccountCreateInviteCode from './types/com/atproto/account/createInviteCode'
11
+ import * as ComAtprotoAccountDelete from './types/com/atproto/account/delete'
12
+ import * as ComAtprotoAccountGet from './types/com/atproto/account/get'
13
+ import * as ComAtprotoAccountRequestPasswordReset from './types/com/atproto/account/requestPasswordReset'
14
+ import * as ComAtprotoAccountResetPassword from './types/com/atproto/account/resetPassword'
15
+ import * as ComAtprotoBlobUpload from './types/com/atproto/blob/upload'
16
+ import * as ComAtprotoHandleResolve from './types/com/atproto/handle/resolve'
17
+ import * as ComAtprotoRepoBatchWrite from './types/com/atproto/repo/batchWrite'
18
+ import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord'
19
+ import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord'
20
+ import * as ComAtprotoRepoDescribe from './types/com/atproto/repo/describe'
21
+ import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
22
+ import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
23
+ import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
24
+ import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
25
+ import * as ComAtprotoServerGetAccountsConfig from './types/com/atproto/server/getAccountsConfig'
26
+ import * as ComAtprotoSessionCreate from './types/com/atproto/session/create'
27
+ import * as ComAtprotoSessionDelete from './types/com/atproto/session/delete'
28
+ import * as ComAtprotoSessionGet from './types/com/atproto/session/get'
29
+ import * as ComAtprotoSessionRefresh from './types/com/atproto/session/refresh'
30
+ import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
31
+ import * as ComAtprotoSyncGetRoot from './types/com/atproto/sync/getRoot'
32
+ import * as ComAtprotoSyncUpdateRepo from './types/com/atproto/sync/updateRepo'
33
+ import * as AppBskyActorCreateScene from './types/app/bsky/actor/createScene'
34
+ import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
35
+ import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions'
36
+ import * as AppBskyActorProfile from './types/app/bsky/actor/profile'
37
+ import * as AppBskyActorRef from './types/app/bsky/actor/ref'
38
+ import * as AppBskyActorSearch from './types/app/bsky/actor/search'
39
+ import * as AppBskyActorSearchTypeahead from './types/app/bsky/actor/searchTypeahead'
40
+ import * as AppBskyActorUpdateProfile from './types/app/bsky/actor/updateProfile'
41
+ import * as AppBskyEmbedExternal from './types/app/bsky/embed/external'
42
+ import * as AppBskyEmbedImages from './types/app/bsky/embed/images'
43
+ import * as AppBskyFeedFeedViewPost from './types/app/bsky/feed/feedViewPost'
44
+ import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
45
+ import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
46
+ import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
47
+ import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
48
+ import * as AppBskyFeedGetVotes from './types/app/bsky/feed/getVotes'
49
+ import * as AppBskyFeedPost from './types/app/bsky/feed/post'
50
+ import * as AppBskyFeedRepost from './types/app/bsky/feed/repost'
51
+ import * as AppBskyFeedSetVote from './types/app/bsky/feed/setVote'
52
+ import * as AppBskyFeedTrend from './types/app/bsky/feed/trend'
53
+ import * as AppBskyFeedVote from './types/app/bsky/feed/vote'
54
+ import * as AppBskyGraphAssertCreator from './types/app/bsky/graph/assertCreator'
55
+ import * as AppBskyGraphAssertMember from './types/app/bsky/graph/assertMember'
56
+ import * as AppBskyGraphAssertion from './types/app/bsky/graph/assertion'
57
+ import * as AppBskyGraphConfirmation from './types/app/bsky/graph/confirmation'
58
+ import * as AppBskyGraphFollow from './types/app/bsky/graph/follow'
59
+ import * as AppBskyGraphGetAssertions from './types/app/bsky/graph/getAssertions'
60
+ import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
61
+ import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
62
+ import * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers'
63
+ import * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships'
64
+ import * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount'
65
+ import * as AppBskyNotificationList from './types/app/bsky/notification/list'
66
+ import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
67
+ import * as AppBskySystemActorScene from './types/app/bsky/system/actorScene'
68
+ import * as AppBskySystemActorUser from './types/app/bsky/system/actorUser'
69
+ import * as AppBskySystemDeclRef from './types/app/bsky/system/declRef'
70
+ import * as AppBskySystemDeclaration from './types/app/bsky/system/declaration'
71
+
72
+ export * as ComAtprotoAccountCreate from './types/com/atproto/account/create'
73
+ export * as ComAtprotoAccountCreateInviteCode from './types/com/atproto/account/createInviteCode'
74
+ export * as ComAtprotoAccountDelete from './types/com/atproto/account/delete'
75
+ export * as ComAtprotoAccountGet from './types/com/atproto/account/get'
76
+ export * as ComAtprotoAccountRequestPasswordReset from './types/com/atproto/account/requestPasswordReset'
77
+ export * as ComAtprotoAccountResetPassword from './types/com/atproto/account/resetPassword'
78
+ export * as ComAtprotoBlobUpload from './types/com/atproto/blob/upload'
79
+ export * as ComAtprotoHandleResolve from './types/com/atproto/handle/resolve'
80
+ export * as ComAtprotoRepoBatchWrite from './types/com/atproto/repo/batchWrite'
81
+ export * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord'
82
+ export * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord'
83
+ export * as ComAtprotoRepoDescribe from './types/com/atproto/repo/describe'
84
+ export * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
85
+ export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
86
+ export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
87
+ export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
88
+ export * as ComAtprotoServerGetAccountsConfig from './types/com/atproto/server/getAccountsConfig'
89
+ export * as ComAtprotoSessionCreate from './types/com/atproto/session/create'
90
+ export * as ComAtprotoSessionDelete from './types/com/atproto/session/delete'
91
+ export * as ComAtprotoSessionGet from './types/com/atproto/session/get'
92
+ export * as ComAtprotoSessionRefresh from './types/com/atproto/session/refresh'
93
+ export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
94
+ export * as ComAtprotoSyncGetRoot from './types/com/atproto/sync/getRoot'
95
+ export * as ComAtprotoSyncUpdateRepo from './types/com/atproto/sync/updateRepo'
96
+ export * as AppBskyActorCreateScene from './types/app/bsky/actor/createScene'
97
+ export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
98
+ export * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions'
99
+ export * as AppBskyActorProfile from './types/app/bsky/actor/profile'
100
+ export * as AppBskyActorRef from './types/app/bsky/actor/ref'
101
+ export * as AppBskyActorSearch from './types/app/bsky/actor/search'
102
+ export * as AppBskyActorSearchTypeahead from './types/app/bsky/actor/searchTypeahead'
103
+ export * as AppBskyActorUpdateProfile from './types/app/bsky/actor/updateProfile'
104
+ export * as AppBskyEmbedExternal from './types/app/bsky/embed/external'
105
+ export * as AppBskyEmbedImages from './types/app/bsky/embed/images'
106
+ export * as AppBskyFeedFeedViewPost from './types/app/bsky/feed/feedViewPost'
107
+ export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
108
+ export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
109
+ export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
110
+ export * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
111
+ export * as AppBskyFeedGetVotes from './types/app/bsky/feed/getVotes'
112
+ export * as AppBskyFeedPost from './types/app/bsky/feed/post'
113
+ export * as AppBskyFeedRepost from './types/app/bsky/feed/repost'
114
+ export * as AppBskyFeedSetVote from './types/app/bsky/feed/setVote'
115
+ export * as AppBskyFeedTrend from './types/app/bsky/feed/trend'
116
+ export * as AppBskyFeedVote from './types/app/bsky/feed/vote'
117
+ export * as AppBskyGraphAssertCreator from './types/app/bsky/graph/assertCreator'
118
+ export * as AppBskyGraphAssertMember from './types/app/bsky/graph/assertMember'
119
+ export * as AppBskyGraphAssertion from './types/app/bsky/graph/assertion'
120
+ export * as AppBskyGraphConfirmation from './types/app/bsky/graph/confirmation'
121
+ export * as AppBskyGraphFollow from './types/app/bsky/graph/follow'
122
+ export * as AppBskyGraphGetAssertions from './types/app/bsky/graph/getAssertions'
123
+ export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
124
+ export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
125
+ export * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers'
126
+ export * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships'
127
+ export * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount'
128
+ export * as AppBskyNotificationList from './types/app/bsky/notification/list'
129
+ export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
130
+ export * as AppBskySystemActorScene from './types/app/bsky/system/actorScene'
131
+ export * as AppBskySystemActorUser from './types/app/bsky/system/actorUser'
132
+ export * as AppBskySystemDeclRef from './types/app/bsky/system/declRef'
133
+ export * as AppBskySystemDeclaration from './types/app/bsky/system/declaration'
134
+
135
+ export const APP_BSKY_GRAPH = {
136
+ AssertCreator: 'app.bsky.graph.assertCreator',
137
+ AssertMember: 'app.bsky.graph.assertMember',
138
+ }
139
+ export const APP_BSKY_SYSTEM = {
140
+ ActorScene: 'app.bsky.system.actorScene',
141
+ ActorUser: 'app.bsky.system.actorUser',
142
+ }
143
+
144
+ export class Client {
145
+ xrpc: XrpcClient = new XrpcClient()
146
+
147
+ constructor() {
148
+ this.xrpc.addLexicons(schemas)
149
+ }
150
+
151
+ service(serviceUri: string | URL): ServiceClient {
152
+ return new ServiceClient(this, this.xrpc.service(serviceUri))
153
+ }
154
+ }
155
+
156
+ const defaultInst = new Client()
157
+ export default defaultInst
158
+
159
+ export class ServiceClient {
160
+ _baseClient: Client
161
+ xrpc: XrpcServiceClient
162
+ com: ComNS
163
+ app: AppNS
164
+
165
+ constructor(baseClient: Client, xrpcService: XrpcServiceClient) {
166
+ this._baseClient = baseClient
167
+ this.xrpc = xrpcService
168
+ this.com = new ComNS(this)
169
+ this.app = new AppNS(this)
170
+ }
171
+
172
+ setHeader(key: string, value: string): void {
173
+ this.xrpc.setHeader(key, value)
174
+ }
175
+ }
176
+
177
+ export class ComNS {
178
+ _service: ServiceClient
179
+ atproto: AtprotoNS
180
+
181
+ constructor(service: ServiceClient) {
182
+ this._service = service
183
+ this.atproto = new AtprotoNS(service)
184
+ }
185
+ }
186
+
187
+ export class AtprotoNS {
188
+ _service: ServiceClient
189
+ account: AccountNS
190
+ blob: BlobNS
191
+ handle: HandleNS
192
+ repo: RepoNS
193
+ server: ServerNS
194
+ session: SessionNS
195
+ sync: SyncNS
196
+
197
+ constructor(service: ServiceClient) {
198
+ this._service = service
199
+ this.account = new AccountNS(service)
200
+ this.blob = new BlobNS(service)
201
+ this.handle = new HandleNS(service)
202
+ this.repo = new RepoNS(service)
203
+ this.server = new ServerNS(service)
204
+ this.session = new SessionNS(service)
205
+ this.sync = new SyncNS(service)
206
+ }
207
+ }
208
+
209
+ export class AccountNS {
210
+ _service: ServiceClient
211
+
212
+ constructor(service: ServiceClient) {
213
+ this._service = service
214
+ }
215
+
216
+ create(
217
+ data?: ComAtprotoAccountCreate.InputSchema,
218
+ opts?: ComAtprotoAccountCreate.CallOptions,
219
+ ): Promise<ComAtprotoAccountCreate.Response> {
220
+ return this._service.xrpc
221
+ .call('com.atproto.account.create', opts?.qp, data, opts)
222
+ .catch((e) => {
223
+ throw ComAtprotoAccountCreate.toKnownErr(e)
224
+ })
225
+ }
226
+
227
+ createInviteCode(
228
+ data?: ComAtprotoAccountCreateInviteCode.InputSchema,
229
+ opts?: ComAtprotoAccountCreateInviteCode.CallOptions,
230
+ ): Promise<ComAtprotoAccountCreateInviteCode.Response> {
231
+ return this._service.xrpc
232
+ .call('com.atproto.account.createInviteCode', opts?.qp, data, opts)
233
+ .catch((e) => {
234
+ throw ComAtprotoAccountCreateInviteCode.toKnownErr(e)
235
+ })
236
+ }
237
+
238
+ delete(
239
+ data?: ComAtprotoAccountDelete.InputSchema,
240
+ opts?: ComAtprotoAccountDelete.CallOptions,
241
+ ): Promise<ComAtprotoAccountDelete.Response> {
242
+ return this._service.xrpc
243
+ .call('com.atproto.account.delete', opts?.qp, data, opts)
244
+ .catch((e) => {
245
+ throw ComAtprotoAccountDelete.toKnownErr(e)
246
+ })
247
+ }
248
+
249
+ get(
250
+ params?: ComAtprotoAccountGet.QueryParams,
251
+ opts?: ComAtprotoAccountGet.CallOptions,
252
+ ): Promise<ComAtprotoAccountGet.Response> {
253
+ return this._service.xrpc
254
+ .call('com.atproto.account.get', params, undefined, opts)
255
+ .catch((e) => {
256
+ throw ComAtprotoAccountGet.toKnownErr(e)
257
+ })
258
+ }
259
+
260
+ requestPasswordReset(
261
+ data?: ComAtprotoAccountRequestPasswordReset.InputSchema,
262
+ opts?: ComAtprotoAccountRequestPasswordReset.CallOptions,
263
+ ): Promise<ComAtprotoAccountRequestPasswordReset.Response> {
264
+ return this._service.xrpc
265
+ .call('com.atproto.account.requestPasswordReset', opts?.qp, data, opts)
266
+ .catch((e) => {
267
+ throw ComAtprotoAccountRequestPasswordReset.toKnownErr(e)
268
+ })
269
+ }
270
+
271
+ resetPassword(
272
+ data?: ComAtprotoAccountResetPassword.InputSchema,
273
+ opts?: ComAtprotoAccountResetPassword.CallOptions,
274
+ ): Promise<ComAtprotoAccountResetPassword.Response> {
275
+ return this._service.xrpc
276
+ .call('com.atproto.account.resetPassword', opts?.qp, data, opts)
277
+ .catch((e) => {
278
+ throw ComAtprotoAccountResetPassword.toKnownErr(e)
279
+ })
280
+ }
281
+ }
282
+
283
+ export class BlobNS {
284
+ _service: ServiceClient
285
+
286
+ constructor(service: ServiceClient) {
287
+ this._service = service
288
+ }
289
+
290
+ upload(
291
+ data?: ComAtprotoBlobUpload.InputSchema,
292
+ opts?: ComAtprotoBlobUpload.CallOptions,
293
+ ): Promise<ComAtprotoBlobUpload.Response> {
294
+ return this._service.xrpc
295
+ .call('com.atproto.blob.upload', opts?.qp, data, opts)
296
+ .catch((e) => {
297
+ throw ComAtprotoBlobUpload.toKnownErr(e)
298
+ })
299
+ }
300
+ }
301
+
302
+ export class HandleNS {
303
+ _service: ServiceClient
304
+
305
+ constructor(service: ServiceClient) {
306
+ this._service = service
307
+ }
308
+
309
+ resolve(
310
+ params?: ComAtprotoHandleResolve.QueryParams,
311
+ opts?: ComAtprotoHandleResolve.CallOptions,
312
+ ): Promise<ComAtprotoHandleResolve.Response> {
313
+ return this._service.xrpc
314
+ .call('com.atproto.handle.resolve', params, undefined, opts)
315
+ .catch((e) => {
316
+ throw ComAtprotoHandleResolve.toKnownErr(e)
317
+ })
318
+ }
319
+ }
320
+
321
+ export class RepoNS {
322
+ _service: ServiceClient
323
+
324
+ constructor(service: ServiceClient) {
325
+ this._service = service
326
+ }
327
+
328
+ batchWrite(
329
+ data?: ComAtprotoRepoBatchWrite.InputSchema,
330
+ opts?: ComAtprotoRepoBatchWrite.CallOptions,
331
+ ): Promise<ComAtprotoRepoBatchWrite.Response> {
332
+ return this._service.xrpc
333
+ .call('com.atproto.repo.batchWrite', opts?.qp, data, opts)
334
+ .catch((e) => {
335
+ throw ComAtprotoRepoBatchWrite.toKnownErr(e)
336
+ })
337
+ }
338
+
339
+ createRecord(
340
+ data?: ComAtprotoRepoCreateRecord.InputSchema,
341
+ opts?: ComAtprotoRepoCreateRecord.CallOptions,
342
+ ): Promise<ComAtprotoRepoCreateRecord.Response> {
343
+ return this._service.xrpc
344
+ .call('com.atproto.repo.createRecord', opts?.qp, data, opts)
345
+ .catch((e) => {
346
+ throw ComAtprotoRepoCreateRecord.toKnownErr(e)
347
+ })
348
+ }
349
+
350
+ deleteRecord(
351
+ data?: ComAtprotoRepoDeleteRecord.InputSchema,
352
+ opts?: ComAtprotoRepoDeleteRecord.CallOptions,
353
+ ): Promise<ComAtprotoRepoDeleteRecord.Response> {
354
+ return this._service.xrpc
355
+ .call('com.atproto.repo.deleteRecord', opts?.qp, data, opts)
356
+ .catch((e) => {
357
+ throw ComAtprotoRepoDeleteRecord.toKnownErr(e)
358
+ })
359
+ }
360
+
361
+ describe(
362
+ params?: ComAtprotoRepoDescribe.QueryParams,
363
+ opts?: ComAtprotoRepoDescribe.CallOptions,
364
+ ): Promise<ComAtprotoRepoDescribe.Response> {
365
+ return this._service.xrpc
366
+ .call('com.atproto.repo.describe', params, undefined, opts)
367
+ .catch((e) => {
368
+ throw ComAtprotoRepoDescribe.toKnownErr(e)
369
+ })
370
+ }
371
+
372
+ getRecord(
373
+ params?: ComAtprotoRepoGetRecord.QueryParams,
374
+ opts?: ComAtprotoRepoGetRecord.CallOptions,
375
+ ): Promise<ComAtprotoRepoGetRecord.Response> {
376
+ return this._service.xrpc
377
+ .call('com.atproto.repo.getRecord', params, undefined, opts)
378
+ .catch((e) => {
379
+ throw ComAtprotoRepoGetRecord.toKnownErr(e)
380
+ })
381
+ }
382
+
383
+ listRecords(
384
+ params?: ComAtprotoRepoListRecords.QueryParams,
385
+ opts?: ComAtprotoRepoListRecords.CallOptions,
386
+ ): Promise<ComAtprotoRepoListRecords.Response> {
387
+ return this._service.xrpc
388
+ .call('com.atproto.repo.listRecords', params, undefined, opts)
389
+ .catch((e) => {
390
+ throw ComAtprotoRepoListRecords.toKnownErr(e)
391
+ })
392
+ }
393
+
394
+ putRecord(
395
+ data?: ComAtprotoRepoPutRecord.InputSchema,
396
+ opts?: ComAtprotoRepoPutRecord.CallOptions,
397
+ ): Promise<ComAtprotoRepoPutRecord.Response> {
398
+ return this._service.xrpc
399
+ .call('com.atproto.repo.putRecord', opts?.qp, data, opts)
400
+ .catch((e) => {
401
+ throw ComAtprotoRepoPutRecord.toKnownErr(e)
402
+ })
403
+ }
404
+ }
405
+
406
+ export class ServerNS {
407
+ _service: ServiceClient
408
+
409
+ constructor(service: ServiceClient) {
410
+ this._service = service
411
+ }
412
+
413
+ getAccountsConfig(
414
+ params?: ComAtprotoServerGetAccountsConfig.QueryParams,
415
+ opts?: ComAtprotoServerGetAccountsConfig.CallOptions,
416
+ ): Promise<ComAtprotoServerGetAccountsConfig.Response> {
417
+ return this._service.xrpc
418
+ .call('com.atproto.server.getAccountsConfig', params, undefined, opts)
419
+ .catch((e) => {
420
+ throw ComAtprotoServerGetAccountsConfig.toKnownErr(e)
421
+ })
422
+ }
423
+ }
424
+
425
+ export class SessionNS {
426
+ _service: ServiceClient
427
+
428
+ constructor(service: ServiceClient) {
429
+ this._service = service
430
+ }
431
+
432
+ create(
433
+ data?: ComAtprotoSessionCreate.InputSchema,
434
+ opts?: ComAtprotoSessionCreate.CallOptions,
435
+ ): Promise<ComAtprotoSessionCreate.Response> {
436
+ return this._service.xrpc
437
+ .call('com.atproto.session.create', opts?.qp, data, opts)
438
+ .catch((e) => {
439
+ throw ComAtprotoSessionCreate.toKnownErr(e)
440
+ })
441
+ }
442
+
443
+ delete(
444
+ data?: ComAtprotoSessionDelete.InputSchema,
445
+ opts?: ComAtprotoSessionDelete.CallOptions,
446
+ ): Promise<ComAtprotoSessionDelete.Response> {
447
+ return this._service.xrpc
448
+ .call('com.atproto.session.delete', opts?.qp, data, opts)
449
+ .catch((e) => {
450
+ throw ComAtprotoSessionDelete.toKnownErr(e)
451
+ })
452
+ }
453
+
454
+ get(
455
+ params?: ComAtprotoSessionGet.QueryParams,
456
+ opts?: ComAtprotoSessionGet.CallOptions,
457
+ ): Promise<ComAtprotoSessionGet.Response> {
458
+ return this._service.xrpc
459
+ .call('com.atproto.session.get', params, undefined, opts)
460
+ .catch((e) => {
461
+ throw ComAtprotoSessionGet.toKnownErr(e)
462
+ })
463
+ }
464
+
465
+ refresh(
466
+ data?: ComAtprotoSessionRefresh.InputSchema,
467
+ opts?: ComAtprotoSessionRefresh.CallOptions,
468
+ ): Promise<ComAtprotoSessionRefresh.Response> {
469
+ return this._service.xrpc
470
+ .call('com.atproto.session.refresh', opts?.qp, data, opts)
471
+ .catch((e) => {
472
+ throw ComAtprotoSessionRefresh.toKnownErr(e)
473
+ })
474
+ }
475
+ }
476
+
477
+ export class SyncNS {
478
+ _service: ServiceClient
479
+
480
+ constructor(service: ServiceClient) {
481
+ this._service = service
482
+ }
483
+
484
+ getRepo(
485
+ params?: ComAtprotoSyncGetRepo.QueryParams,
486
+ opts?: ComAtprotoSyncGetRepo.CallOptions,
487
+ ): Promise<ComAtprotoSyncGetRepo.Response> {
488
+ return this._service.xrpc
489
+ .call('com.atproto.sync.getRepo', params, undefined, opts)
490
+ .catch((e) => {
491
+ throw ComAtprotoSyncGetRepo.toKnownErr(e)
492
+ })
493
+ }
494
+
495
+ getRoot(
496
+ params?: ComAtprotoSyncGetRoot.QueryParams,
497
+ opts?: ComAtprotoSyncGetRoot.CallOptions,
498
+ ): Promise<ComAtprotoSyncGetRoot.Response> {
499
+ return this._service.xrpc
500
+ .call('com.atproto.sync.getRoot', params, undefined, opts)
501
+ .catch((e) => {
502
+ throw ComAtprotoSyncGetRoot.toKnownErr(e)
503
+ })
504
+ }
505
+
506
+ updateRepo(
507
+ data?: ComAtprotoSyncUpdateRepo.InputSchema,
508
+ opts?: ComAtprotoSyncUpdateRepo.CallOptions,
509
+ ): Promise<ComAtprotoSyncUpdateRepo.Response> {
510
+ return this._service.xrpc
511
+ .call('com.atproto.sync.updateRepo', opts?.qp, data, opts)
512
+ .catch((e) => {
513
+ throw ComAtprotoSyncUpdateRepo.toKnownErr(e)
514
+ })
515
+ }
516
+ }
517
+
518
+ export class AppNS {
519
+ _service: ServiceClient
520
+ bsky: BskyNS
521
+
522
+ constructor(service: ServiceClient) {
523
+ this._service = service
524
+ this.bsky = new BskyNS(service)
525
+ }
526
+ }
527
+
528
+ export class BskyNS {
529
+ _service: ServiceClient
530
+ actor: ActorNS
531
+ embed: EmbedNS
532
+ feed: FeedNS
533
+ graph: GraphNS
534
+ notification: NotificationNS
535
+ system: SystemNS
536
+
537
+ constructor(service: ServiceClient) {
538
+ this._service = service
539
+ this.actor = new ActorNS(service)
540
+ this.embed = new EmbedNS(service)
541
+ this.feed = new FeedNS(service)
542
+ this.graph = new GraphNS(service)
543
+ this.notification = new NotificationNS(service)
544
+ this.system = new SystemNS(service)
545
+ }
546
+ }
547
+
548
+ export class ActorNS {
549
+ _service: ServiceClient
550
+ profile: ProfileRecord
551
+
552
+ constructor(service: ServiceClient) {
553
+ this._service = service
554
+ this.profile = new ProfileRecord(service)
555
+ }
556
+
557
+ createScene(
558
+ data?: AppBskyActorCreateScene.InputSchema,
559
+ opts?: AppBskyActorCreateScene.CallOptions,
560
+ ): Promise<AppBskyActorCreateScene.Response> {
561
+ return this._service.xrpc
562
+ .call('app.bsky.actor.createScene', opts?.qp, data, opts)
563
+ .catch((e) => {
564
+ throw AppBskyActorCreateScene.toKnownErr(e)
565
+ })
566
+ }
567
+
568
+ getProfile(
569
+ params?: AppBskyActorGetProfile.QueryParams,
570
+ opts?: AppBskyActorGetProfile.CallOptions,
571
+ ): Promise<AppBskyActorGetProfile.Response> {
572
+ return this._service.xrpc
573
+ .call('app.bsky.actor.getProfile', params, undefined, opts)
574
+ .catch((e) => {
575
+ throw AppBskyActorGetProfile.toKnownErr(e)
576
+ })
577
+ }
578
+
579
+ getSuggestions(
580
+ params?: AppBskyActorGetSuggestions.QueryParams,
581
+ opts?: AppBskyActorGetSuggestions.CallOptions,
582
+ ): Promise<AppBskyActorGetSuggestions.Response> {
583
+ return this._service.xrpc
584
+ .call('app.bsky.actor.getSuggestions', params, undefined, opts)
585
+ .catch((e) => {
586
+ throw AppBskyActorGetSuggestions.toKnownErr(e)
587
+ })
588
+ }
589
+
590
+ search(
591
+ params?: AppBskyActorSearch.QueryParams,
592
+ opts?: AppBskyActorSearch.CallOptions,
593
+ ): Promise<AppBskyActorSearch.Response> {
594
+ return this._service.xrpc
595
+ .call('app.bsky.actor.search', params, undefined, opts)
596
+ .catch((e) => {
597
+ throw AppBskyActorSearch.toKnownErr(e)
598
+ })
599
+ }
600
+
601
+ searchTypeahead(
602
+ params?: AppBskyActorSearchTypeahead.QueryParams,
603
+ opts?: AppBskyActorSearchTypeahead.CallOptions,
604
+ ): Promise<AppBskyActorSearchTypeahead.Response> {
605
+ return this._service.xrpc
606
+ .call('app.bsky.actor.searchTypeahead', params, undefined, opts)
607
+ .catch((e) => {
608
+ throw AppBskyActorSearchTypeahead.toKnownErr(e)
609
+ })
610
+ }
611
+
612
+ updateProfile(
613
+ data?: AppBskyActorUpdateProfile.InputSchema,
614
+ opts?: AppBskyActorUpdateProfile.CallOptions,
615
+ ): Promise<AppBskyActorUpdateProfile.Response> {
616
+ return this._service.xrpc
617
+ .call('app.bsky.actor.updateProfile', opts?.qp, data, opts)
618
+ .catch((e) => {
619
+ throw AppBskyActorUpdateProfile.toKnownErr(e)
620
+ })
621
+ }
622
+ }
623
+
624
+ export class ProfileRecord {
625
+ _service: ServiceClient
626
+
627
+ constructor(service: ServiceClient) {
628
+ this._service = service
629
+ }
630
+
631
+ async list(
632
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
633
+ ): Promise<{
634
+ cursor?: string
635
+ records: { uri: string; value: AppBskyActorProfile.Record }[]
636
+ }> {
637
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
638
+ collection: 'app.bsky.actor.profile',
639
+ ...params,
640
+ })
641
+ return res.data
642
+ }
643
+
644
+ async get(
645
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
646
+ ): Promise<{ uri: string; cid: string; value: AppBskyActorProfile.Record }> {
647
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
648
+ collection: 'app.bsky.actor.profile',
649
+ ...params,
650
+ })
651
+ return res.data
652
+ }
653
+
654
+ async create(
655
+ params: Omit<
656
+ ComAtprotoRepoCreateRecord.InputSchema,
657
+ 'collection' | 'record'
658
+ >,
659
+ record: AppBskyActorProfile.Record,
660
+ headers?: Record<string, string>,
661
+ ): Promise<{ uri: string; cid: string }> {
662
+ record.$type = 'app.bsky.actor.profile'
663
+ const res = await this._service.xrpc.call(
664
+ 'com.atproto.repo.createRecord',
665
+ undefined,
666
+ { collection: 'app.bsky.actor.profile', ...params, record },
667
+ { encoding: 'application/json', headers },
668
+ )
669
+ return res.data
670
+ }
671
+
672
+ async delete(
673
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
674
+ headers?: Record<string, string>,
675
+ ): Promise<void> {
676
+ await this._service.xrpc.call(
677
+ 'com.atproto.repo.deleteRecord',
678
+ undefined,
679
+ { collection: 'app.bsky.actor.profile', ...params },
680
+ { headers },
681
+ )
682
+ }
683
+ }
684
+
685
+ export class EmbedNS {
686
+ _service: ServiceClient
687
+
688
+ constructor(service: ServiceClient) {
689
+ this._service = service
690
+ }
691
+ }
692
+
693
+ export class FeedNS {
694
+ _service: ServiceClient
695
+ post: PostRecord
696
+ repost: RepostRecord
697
+ trend: TrendRecord
698
+ vote: VoteRecord
699
+
700
+ constructor(service: ServiceClient) {
701
+ this._service = service
702
+ this.post = new PostRecord(service)
703
+ this.repost = new RepostRecord(service)
704
+ this.trend = new TrendRecord(service)
705
+ this.vote = new VoteRecord(service)
706
+ }
707
+
708
+ getAuthorFeed(
709
+ params?: AppBskyFeedGetAuthorFeed.QueryParams,
710
+ opts?: AppBskyFeedGetAuthorFeed.CallOptions,
711
+ ): Promise<AppBskyFeedGetAuthorFeed.Response> {
712
+ return this._service.xrpc
713
+ .call('app.bsky.feed.getAuthorFeed', params, undefined, opts)
714
+ .catch((e) => {
715
+ throw AppBskyFeedGetAuthorFeed.toKnownErr(e)
716
+ })
717
+ }
718
+
719
+ getPostThread(
720
+ params?: AppBskyFeedGetPostThread.QueryParams,
721
+ opts?: AppBskyFeedGetPostThread.CallOptions,
722
+ ): Promise<AppBskyFeedGetPostThread.Response> {
723
+ return this._service.xrpc
724
+ .call('app.bsky.feed.getPostThread', params, undefined, opts)
725
+ .catch((e) => {
726
+ throw AppBskyFeedGetPostThread.toKnownErr(e)
727
+ })
728
+ }
729
+
730
+ getRepostedBy(
731
+ params?: AppBskyFeedGetRepostedBy.QueryParams,
732
+ opts?: AppBskyFeedGetRepostedBy.CallOptions,
733
+ ): Promise<AppBskyFeedGetRepostedBy.Response> {
734
+ return this._service.xrpc
735
+ .call('app.bsky.feed.getRepostedBy', params, undefined, opts)
736
+ .catch((e) => {
737
+ throw AppBskyFeedGetRepostedBy.toKnownErr(e)
738
+ })
739
+ }
740
+
741
+ getTimeline(
742
+ params?: AppBskyFeedGetTimeline.QueryParams,
743
+ opts?: AppBskyFeedGetTimeline.CallOptions,
744
+ ): Promise<AppBskyFeedGetTimeline.Response> {
745
+ return this._service.xrpc
746
+ .call('app.bsky.feed.getTimeline', params, undefined, opts)
747
+ .catch((e) => {
748
+ throw AppBskyFeedGetTimeline.toKnownErr(e)
749
+ })
750
+ }
751
+
752
+ getVotes(
753
+ params?: AppBskyFeedGetVotes.QueryParams,
754
+ opts?: AppBskyFeedGetVotes.CallOptions,
755
+ ): Promise<AppBskyFeedGetVotes.Response> {
756
+ return this._service.xrpc
757
+ .call('app.bsky.feed.getVotes', params, undefined, opts)
758
+ .catch((e) => {
759
+ throw AppBskyFeedGetVotes.toKnownErr(e)
760
+ })
761
+ }
762
+
763
+ setVote(
764
+ data?: AppBskyFeedSetVote.InputSchema,
765
+ opts?: AppBskyFeedSetVote.CallOptions,
766
+ ): Promise<AppBskyFeedSetVote.Response> {
767
+ return this._service.xrpc
768
+ .call('app.bsky.feed.setVote', opts?.qp, data, opts)
769
+ .catch((e) => {
770
+ throw AppBskyFeedSetVote.toKnownErr(e)
771
+ })
772
+ }
773
+ }
774
+
775
+ export class PostRecord {
776
+ _service: ServiceClient
777
+
778
+ constructor(service: ServiceClient) {
779
+ this._service = service
780
+ }
781
+
782
+ async list(
783
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
784
+ ): Promise<{
785
+ cursor?: string
786
+ records: { uri: string; value: AppBskyFeedPost.Record }[]
787
+ }> {
788
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
789
+ collection: 'app.bsky.feed.post',
790
+ ...params,
791
+ })
792
+ return res.data
793
+ }
794
+
795
+ async get(
796
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
797
+ ): Promise<{ uri: string; cid: string; value: AppBskyFeedPost.Record }> {
798
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
799
+ collection: 'app.bsky.feed.post',
800
+ ...params,
801
+ })
802
+ return res.data
803
+ }
804
+
805
+ async create(
806
+ params: Omit<
807
+ ComAtprotoRepoCreateRecord.InputSchema,
808
+ 'collection' | 'record'
809
+ >,
810
+ record: AppBskyFeedPost.Record,
811
+ headers?: Record<string, string>,
812
+ ): Promise<{ uri: string; cid: string }> {
813
+ record.$type = 'app.bsky.feed.post'
814
+ const res = await this._service.xrpc.call(
815
+ 'com.atproto.repo.createRecord',
816
+ undefined,
817
+ { collection: 'app.bsky.feed.post', ...params, record },
818
+ { encoding: 'application/json', headers },
819
+ )
820
+ return res.data
821
+ }
822
+
823
+ async delete(
824
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
825
+ headers?: Record<string, string>,
826
+ ): Promise<void> {
827
+ await this._service.xrpc.call(
828
+ 'com.atproto.repo.deleteRecord',
829
+ undefined,
830
+ { collection: 'app.bsky.feed.post', ...params },
831
+ { headers },
832
+ )
833
+ }
834
+ }
835
+
836
+ export class RepostRecord {
837
+ _service: ServiceClient
838
+
839
+ constructor(service: ServiceClient) {
840
+ this._service = service
841
+ }
842
+
843
+ async list(
844
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
845
+ ): Promise<{
846
+ cursor?: string
847
+ records: { uri: string; value: AppBskyFeedRepost.Record }[]
848
+ }> {
849
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
850
+ collection: 'app.bsky.feed.repost',
851
+ ...params,
852
+ })
853
+ return res.data
854
+ }
855
+
856
+ async get(
857
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
858
+ ): Promise<{ uri: string; cid: string; value: AppBskyFeedRepost.Record }> {
859
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
860
+ collection: 'app.bsky.feed.repost',
861
+ ...params,
862
+ })
863
+ return res.data
864
+ }
865
+
866
+ async create(
867
+ params: Omit<
868
+ ComAtprotoRepoCreateRecord.InputSchema,
869
+ 'collection' | 'record'
870
+ >,
871
+ record: AppBskyFeedRepost.Record,
872
+ headers?: Record<string, string>,
873
+ ): Promise<{ uri: string; cid: string }> {
874
+ record.$type = 'app.bsky.feed.repost'
875
+ const res = await this._service.xrpc.call(
876
+ 'com.atproto.repo.createRecord',
877
+ undefined,
878
+ { collection: 'app.bsky.feed.repost', ...params, record },
879
+ { encoding: 'application/json', headers },
880
+ )
881
+ return res.data
882
+ }
883
+
884
+ async delete(
885
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
886
+ headers?: Record<string, string>,
887
+ ): Promise<void> {
888
+ await this._service.xrpc.call(
889
+ 'com.atproto.repo.deleteRecord',
890
+ undefined,
891
+ { collection: 'app.bsky.feed.repost', ...params },
892
+ { headers },
893
+ )
894
+ }
895
+ }
896
+
897
+ export class TrendRecord {
898
+ _service: ServiceClient
899
+
900
+ constructor(service: ServiceClient) {
901
+ this._service = service
902
+ }
903
+
904
+ async list(
905
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
906
+ ): Promise<{
907
+ cursor?: string
908
+ records: { uri: string; value: AppBskyFeedTrend.Record }[]
909
+ }> {
910
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
911
+ collection: 'app.bsky.feed.trend',
912
+ ...params,
913
+ })
914
+ return res.data
915
+ }
916
+
917
+ async get(
918
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
919
+ ): Promise<{ uri: string; cid: string; value: AppBskyFeedTrend.Record }> {
920
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
921
+ collection: 'app.bsky.feed.trend',
922
+ ...params,
923
+ })
924
+ return res.data
925
+ }
926
+
927
+ async create(
928
+ params: Omit<
929
+ ComAtprotoRepoCreateRecord.InputSchema,
930
+ 'collection' | 'record'
931
+ >,
932
+ record: AppBskyFeedTrend.Record,
933
+ headers?: Record<string, string>,
934
+ ): Promise<{ uri: string; cid: string }> {
935
+ record.$type = 'app.bsky.feed.trend'
936
+ const res = await this._service.xrpc.call(
937
+ 'com.atproto.repo.createRecord',
938
+ undefined,
939
+ { collection: 'app.bsky.feed.trend', ...params, record },
940
+ { encoding: 'application/json', headers },
941
+ )
942
+ return res.data
943
+ }
944
+
945
+ async delete(
946
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
947
+ headers?: Record<string, string>,
948
+ ): Promise<void> {
949
+ await this._service.xrpc.call(
950
+ 'com.atproto.repo.deleteRecord',
951
+ undefined,
952
+ { collection: 'app.bsky.feed.trend', ...params },
953
+ { headers },
954
+ )
955
+ }
956
+ }
957
+
958
+ export class VoteRecord {
959
+ _service: ServiceClient
960
+
961
+ constructor(service: ServiceClient) {
962
+ this._service = service
963
+ }
964
+
965
+ async list(
966
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
967
+ ): Promise<{
968
+ cursor?: string
969
+ records: { uri: string; value: AppBskyFeedVote.Record }[]
970
+ }> {
971
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
972
+ collection: 'app.bsky.feed.vote',
973
+ ...params,
974
+ })
975
+ return res.data
976
+ }
977
+
978
+ async get(
979
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
980
+ ): Promise<{ uri: string; cid: string; value: AppBskyFeedVote.Record }> {
981
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
982
+ collection: 'app.bsky.feed.vote',
983
+ ...params,
984
+ })
985
+ return res.data
986
+ }
987
+
988
+ async create(
989
+ params: Omit<
990
+ ComAtprotoRepoCreateRecord.InputSchema,
991
+ 'collection' | 'record'
992
+ >,
993
+ record: AppBskyFeedVote.Record,
994
+ headers?: Record<string, string>,
995
+ ): Promise<{ uri: string; cid: string }> {
996
+ record.$type = 'app.bsky.feed.vote'
997
+ const res = await this._service.xrpc.call(
998
+ 'com.atproto.repo.createRecord',
999
+ undefined,
1000
+ { collection: 'app.bsky.feed.vote', ...params, record },
1001
+ { encoding: 'application/json', headers },
1002
+ )
1003
+ return res.data
1004
+ }
1005
+
1006
+ async delete(
1007
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1008
+ headers?: Record<string, string>,
1009
+ ): Promise<void> {
1010
+ await this._service.xrpc.call(
1011
+ 'com.atproto.repo.deleteRecord',
1012
+ undefined,
1013
+ { collection: 'app.bsky.feed.vote', ...params },
1014
+ { headers },
1015
+ )
1016
+ }
1017
+ }
1018
+
1019
+ export class GraphNS {
1020
+ _service: ServiceClient
1021
+ assertion: AssertionRecord
1022
+ confirmation: ConfirmationRecord
1023
+ follow: FollowRecord
1024
+
1025
+ constructor(service: ServiceClient) {
1026
+ this._service = service
1027
+ this.assertion = new AssertionRecord(service)
1028
+ this.confirmation = new ConfirmationRecord(service)
1029
+ this.follow = new FollowRecord(service)
1030
+ }
1031
+
1032
+ getAssertions(
1033
+ params?: AppBskyGraphGetAssertions.QueryParams,
1034
+ opts?: AppBskyGraphGetAssertions.CallOptions,
1035
+ ): Promise<AppBskyGraphGetAssertions.Response> {
1036
+ return this._service.xrpc
1037
+ .call('app.bsky.graph.getAssertions', params, undefined, opts)
1038
+ .catch((e) => {
1039
+ throw AppBskyGraphGetAssertions.toKnownErr(e)
1040
+ })
1041
+ }
1042
+
1043
+ getFollowers(
1044
+ params?: AppBskyGraphGetFollowers.QueryParams,
1045
+ opts?: AppBskyGraphGetFollowers.CallOptions,
1046
+ ): Promise<AppBskyGraphGetFollowers.Response> {
1047
+ return this._service.xrpc
1048
+ .call('app.bsky.graph.getFollowers', params, undefined, opts)
1049
+ .catch((e) => {
1050
+ throw AppBskyGraphGetFollowers.toKnownErr(e)
1051
+ })
1052
+ }
1053
+
1054
+ getFollows(
1055
+ params?: AppBskyGraphGetFollows.QueryParams,
1056
+ opts?: AppBskyGraphGetFollows.CallOptions,
1057
+ ): Promise<AppBskyGraphGetFollows.Response> {
1058
+ return this._service.xrpc
1059
+ .call('app.bsky.graph.getFollows', params, undefined, opts)
1060
+ .catch((e) => {
1061
+ throw AppBskyGraphGetFollows.toKnownErr(e)
1062
+ })
1063
+ }
1064
+
1065
+ getMembers(
1066
+ params?: AppBskyGraphGetMembers.QueryParams,
1067
+ opts?: AppBskyGraphGetMembers.CallOptions,
1068
+ ): Promise<AppBskyGraphGetMembers.Response> {
1069
+ return this._service.xrpc
1070
+ .call('app.bsky.graph.getMembers', params, undefined, opts)
1071
+ .catch((e) => {
1072
+ throw AppBskyGraphGetMembers.toKnownErr(e)
1073
+ })
1074
+ }
1075
+
1076
+ getMemberships(
1077
+ params?: AppBskyGraphGetMemberships.QueryParams,
1078
+ opts?: AppBskyGraphGetMemberships.CallOptions,
1079
+ ): Promise<AppBskyGraphGetMemberships.Response> {
1080
+ return this._service.xrpc
1081
+ .call('app.bsky.graph.getMemberships', params, undefined, opts)
1082
+ .catch((e) => {
1083
+ throw AppBskyGraphGetMemberships.toKnownErr(e)
1084
+ })
1085
+ }
1086
+ }
1087
+
1088
+ export class AssertionRecord {
1089
+ _service: ServiceClient
1090
+
1091
+ constructor(service: ServiceClient) {
1092
+ this._service = service
1093
+ }
1094
+
1095
+ async list(
1096
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1097
+ ): Promise<{
1098
+ cursor?: string
1099
+ records: { uri: string; value: AppBskyGraphAssertion.Record }[]
1100
+ }> {
1101
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
1102
+ collection: 'app.bsky.graph.assertion',
1103
+ ...params,
1104
+ })
1105
+ return res.data
1106
+ }
1107
+
1108
+ async get(
1109
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1110
+ ): Promise<{
1111
+ uri: string
1112
+ cid: string
1113
+ value: AppBskyGraphAssertion.Record
1114
+ }> {
1115
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
1116
+ collection: 'app.bsky.graph.assertion',
1117
+ ...params,
1118
+ })
1119
+ return res.data
1120
+ }
1121
+
1122
+ async create(
1123
+ params: Omit<
1124
+ ComAtprotoRepoCreateRecord.InputSchema,
1125
+ 'collection' | 'record'
1126
+ >,
1127
+ record: AppBskyGraphAssertion.Record,
1128
+ headers?: Record<string, string>,
1129
+ ): Promise<{ uri: string; cid: string }> {
1130
+ record.$type = 'app.bsky.graph.assertion'
1131
+ const res = await this._service.xrpc.call(
1132
+ 'com.atproto.repo.createRecord',
1133
+ undefined,
1134
+ { collection: 'app.bsky.graph.assertion', ...params, record },
1135
+ { encoding: 'application/json', headers },
1136
+ )
1137
+ return res.data
1138
+ }
1139
+
1140
+ async delete(
1141
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1142
+ headers?: Record<string, string>,
1143
+ ): Promise<void> {
1144
+ await this._service.xrpc.call(
1145
+ 'com.atproto.repo.deleteRecord',
1146
+ undefined,
1147
+ { collection: 'app.bsky.graph.assertion', ...params },
1148
+ { headers },
1149
+ )
1150
+ }
1151
+ }
1152
+
1153
+ export class ConfirmationRecord {
1154
+ _service: ServiceClient
1155
+
1156
+ constructor(service: ServiceClient) {
1157
+ this._service = service
1158
+ }
1159
+
1160
+ async list(
1161
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1162
+ ): Promise<{
1163
+ cursor?: string
1164
+ records: { uri: string; value: AppBskyGraphConfirmation.Record }[]
1165
+ }> {
1166
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
1167
+ collection: 'app.bsky.graph.confirmation',
1168
+ ...params,
1169
+ })
1170
+ return res.data
1171
+ }
1172
+
1173
+ async get(
1174
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1175
+ ): Promise<{
1176
+ uri: string
1177
+ cid: string
1178
+ value: AppBskyGraphConfirmation.Record
1179
+ }> {
1180
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
1181
+ collection: 'app.bsky.graph.confirmation',
1182
+ ...params,
1183
+ })
1184
+ return res.data
1185
+ }
1186
+
1187
+ async create(
1188
+ params: Omit<
1189
+ ComAtprotoRepoCreateRecord.InputSchema,
1190
+ 'collection' | 'record'
1191
+ >,
1192
+ record: AppBskyGraphConfirmation.Record,
1193
+ headers?: Record<string, string>,
1194
+ ): Promise<{ uri: string; cid: string }> {
1195
+ record.$type = 'app.bsky.graph.confirmation'
1196
+ const res = await this._service.xrpc.call(
1197
+ 'com.atproto.repo.createRecord',
1198
+ undefined,
1199
+ { collection: 'app.bsky.graph.confirmation', ...params, record },
1200
+ { encoding: 'application/json', headers },
1201
+ )
1202
+ return res.data
1203
+ }
1204
+
1205
+ async delete(
1206
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1207
+ headers?: Record<string, string>,
1208
+ ): Promise<void> {
1209
+ await this._service.xrpc.call(
1210
+ 'com.atproto.repo.deleteRecord',
1211
+ undefined,
1212
+ { collection: 'app.bsky.graph.confirmation', ...params },
1213
+ { headers },
1214
+ )
1215
+ }
1216
+ }
1217
+
1218
+ export class FollowRecord {
1219
+ _service: ServiceClient
1220
+
1221
+ constructor(service: ServiceClient) {
1222
+ this._service = service
1223
+ }
1224
+
1225
+ async list(
1226
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1227
+ ): Promise<{
1228
+ cursor?: string
1229
+ records: { uri: string; value: AppBskyGraphFollow.Record }[]
1230
+ }> {
1231
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
1232
+ collection: 'app.bsky.graph.follow',
1233
+ ...params,
1234
+ })
1235
+ return res.data
1236
+ }
1237
+
1238
+ async get(
1239
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1240
+ ): Promise<{ uri: string; cid: string; value: AppBskyGraphFollow.Record }> {
1241
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
1242
+ collection: 'app.bsky.graph.follow',
1243
+ ...params,
1244
+ })
1245
+ return res.data
1246
+ }
1247
+
1248
+ async create(
1249
+ params: Omit<
1250
+ ComAtprotoRepoCreateRecord.InputSchema,
1251
+ 'collection' | 'record'
1252
+ >,
1253
+ record: AppBskyGraphFollow.Record,
1254
+ headers?: Record<string, string>,
1255
+ ): Promise<{ uri: string; cid: string }> {
1256
+ record.$type = 'app.bsky.graph.follow'
1257
+ const res = await this._service.xrpc.call(
1258
+ 'com.atproto.repo.createRecord',
1259
+ undefined,
1260
+ { collection: 'app.bsky.graph.follow', ...params, record },
1261
+ { encoding: 'application/json', headers },
1262
+ )
1263
+ return res.data
1264
+ }
1265
+
1266
+ async delete(
1267
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1268
+ headers?: Record<string, string>,
1269
+ ): Promise<void> {
1270
+ await this._service.xrpc.call(
1271
+ 'com.atproto.repo.deleteRecord',
1272
+ undefined,
1273
+ { collection: 'app.bsky.graph.follow', ...params },
1274
+ { headers },
1275
+ )
1276
+ }
1277
+ }
1278
+
1279
+ export class NotificationNS {
1280
+ _service: ServiceClient
1281
+
1282
+ constructor(service: ServiceClient) {
1283
+ this._service = service
1284
+ }
1285
+
1286
+ getCount(
1287
+ params?: AppBskyNotificationGetCount.QueryParams,
1288
+ opts?: AppBskyNotificationGetCount.CallOptions,
1289
+ ): Promise<AppBskyNotificationGetCount.Response> {
1290
+ return this._service.xrpc
1291
+ .call('app.bsky.notification.getCount', params, undefined, opts)
1292
+ .catch((e) => {
1293
+ throw AppBskyNotificationGetCount.toKnownErr(e)
1294
+ })
1295
+ }
1296
+
1297
+ list(
1298
+ params?: AppBskyNotificationList.QueryParams,
1299
+ opts?: AppBskyNotificationList.CallOptions,
1300
+ ): Promise<AppBskyNotificationList.Response> {
1301
+ return this._service.xrpc
1302
+ .call('app.bsky.notification.list', params, undefined, opts)
1303
+ .catch((e) => {
1304
+ throw AppBskyNotificationList.toKnownErr(e)
1305
+ })
1306
+ }
1307
+
1308
+ updateSeen(
1309
+ data?: AppBskyNotificationUpdateSeen.InputSchema,
1310
+ opts?: AppBskyNotificationUpdateSeen.CallOptions,
1311
+ ): Promise<AppBskyNotificationUpdateSeen.Response> {
1312
+ return this._service.xrpc
1313
+ .call('app.bsky.notification.updateSeen', opts?.qp, data, opts)
1314
+ .catch((e) => {
1315
+ throw AppBskyNotificationUpdateSeen.toKnownErr(e)
1316
+ })
1317
+ }
1318
+ }
1319
+
1320
+ export class SystemNS {
1321
+ _service: ServiceClient
1322
+ declaration: DeclarationRecord
1323
+
1324
+ constructor(service: ServiceClient) {
1325
+ this._service = service
1326
+ this.declaration = new DeclarationRecord(service)
1327
+ }
1328
+ }
1329
+
1330
+ export class DeclarationRecord {
1331
+ _service: ServiceClient
1332
+
1333
+ constructor(service: ServiceClient) {
1334
+ this._service = service
1335
+ }
1336
+
1337
+ async list(
1338
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1339
+ ): Promise<{
1340
+ cursor?: string
1341
+ records: { uri: string; value: AppBskySystemDeclaration.Record }[]
1342
+ }> {
1343
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
1344
+ collection: 'app.bsky.system.declaration',
1345
+ ...params,
1346
+ })
1347
+ return res.data
1348
+ }
1349
+
1350
+ async get(
1351
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1352
+ ): Promise<{
1353
+ uri: string
1354
+ cid: string
1355
+ value: AppBskySystemDeclaration.Record
1356
+ }> {
1357
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
1358
+ collection: 'app.bsky.system.declaration',
1359
+ ...params,
1360
+ })
1361
+ return res.data
1362
+ }
1363
+
1364
+ async create(
1365
+ params: Omit<
1366
+ ComAtprotoRepoCreateRecord.InputSchema,
1367
+ 'collection' | 'record'
1368
+ >,
1369
+ record: AppBskySystemDeclaration.Record,
1370
+ headers?: Record<string, string>,
1371
+ ): Promise<{ uri: string; cid: string }> {
1372
+ record.$type = 'app.bsky.system.declaration'
1373
+ const res = await this._service.xrpc.call(
1374
+ 'com.atproto.repo.createRecord',
1375
+ undefined,
1376
+ { collection: 'app.bsky.system.declaration', ...params, record },
1377
+ { encoding: 'application/json', headers },
1378
+ )
1379
+ return res.data
1380
+ }
1381
+
1382
+ async delete(
1383
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1384
+ headers?: Record<string, string>,
1385
+ ): Promise<void> {
1386
+ await this._service.xrpc.call(
1387
+ 'com.atproto.repo.deleteRecord',
1388
+ undefined,
1389
+ { collection: 'app.bsky.system.declaration', ...params },
1390
+ { headers },
1391
+ )
1392
+ }
1393
+ }