@atproto/api 0.1.3 → 0.2.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 (205) hide show
  1. package/README.md +179 -25
  2. package/build.js +2 -1
  3. package/dist/agent.d.ts +11 -6
  4. package/dist/bsky-agent.d.ts +43 -0
  5. package/dist/client/index.d.ts +117 -215
  6. package/dist/client/lexicons.d.ts +1440 -1401
  7. package/dist/client/types/app/bsky/actor/defs.d.ts +47 -0
  8. package/dist/client/types/app/bsky/actor/getProfile.d.ts +2 -2
  9. package/dist/client/types/app/bsky/actor/getProfiles.d.ts +2 -2
  10. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +2 -2
  11. package/dist/client/types/app/bsky/actor/profile.d.ts +4 -60
  12. package/dist/client/types/app/bsky/actor/searchActors.d.ts +22 -0
  13. package/dist/client/types/app/bsky/actor/searchActorsTypeahead.d.ts +20 -0
  14. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +3 -10
  15. package/dist/client/types/app/bsky/embed/external.d.ts +9 -13
  16. package/dist/client/types/app/bsky/embed/images.d.ts +9 -13
  17. package/dist/client/types/app/bsky/embed/record.d.ts +21 -13
  18. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +24 -0
  19. package/dist/client/types/app/bsky/feed/defs.d.ts +77 -0
  20. package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +4 -4
  21. package/dist/client/types/app/bsky/feed/getLikes.d.ts +34 -0
  22. package/dist/client/types/app/bsky/feed/getPostThread.d.ts +2 -24
  23. package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -3
  24. package/dist/client/types/app/bsky/feed/getTimeline.d.ts +3 -3
  25. package/dist/client/types/app/bsky/feed/like.d.ts +9 -0
  26. package/dist/client/types/app/bsky/feed/post.d.ts +4 -29
  27. package/dist/client/types/app/bsky/graph/follow.d.ts +1 -2
  28. package/dist/client/types/app/bsky/graph/getFollowers.d.ts +5 -5
  29. package/dist/client/types/app/bsky/graph/getFollows.d.ts +5 -5
  30. package/dist/client/types/app/bsky/graph/getMutes.d.ts +3 -3
  31. package/dist/client/types/app/bsky/graph/muteActor.d.ts +17 -0
  32. package/dist/client/types/app/bsky/graph/unmuteActor.d.ts +17 -0
  33. package/dist/client/types/app/bsky/notification/getUnreadCount.d.ts +17 -0
  34. package/dist/client/types/app/bsky/notification/listNotifications.d.ts +35 -0
  35. package/dist/client/types/app/bsky/richtext/facet.d.ts +30 -0
  36. package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +21 -0
  37. package/dist/client/types/com/atproto/admin/defs.d.ts +181 -0
  38. package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +2 -2
  39. package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +3 -3
  40. package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +2 -2
  41. package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +3 -3
  42. package/dist/client/types/com/atproto/admin/getRecord.d.ts +2 -2
  43. package/dist/client/types/com/atproto/admin/getRepo.d.ts +2 -2
  44. package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +2 -2
  45. package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +2 -2
  46. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +3 -3
  47. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -6
  48. package/dist/client/types/com/atproto/identity/resolveHandle.d.ts +18 -0
  49. package/dist/client/types/com/atproto/identity/updateHandle.d.ts +17 -0
  50. package/dist/client/types/com/atproto/moderation/createReport.d.ts +38 -0
  51. package/dist/client/types/com/atproto/moderation/defs.d.ts +3 -0
  52. package/dist/client/types/com/atproto/repo/applyWrites.d.ts +47 -0
  53. package/dist/client/types/com/atproto/repo/createRecord.d.ts +7 -2
  54. package/dist/client/types/com/atproto/repo/deleteRecord.d.ts +7 -2
  55. package/dist/client/types/com/atproto/repo/describeRepo.d.ts +22 -0
  56. package/dist/client/types/com/atproto/repo/getRecord.d.ts +1 -1
  57. package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -3
  58. package/dist/client/types/com/atproto/repo/putRecord.d.ts +7 -2
  59. package/dist/client/types/com/atproto/repo/uploadBlob.d.ts +20 -0
  60. package/dist/client/types/com/atproto/server/createAccount.d.ts +44 -0
  61. package/dist/client/types/com/atproto/server/createInviteCode.d.ts +22 -0
  62. package/dist/client/types/com/atproto/server/createSession.d.ts +29 -0
  63. package/dist/client/types/com/atproto/server/deleteAccount.d.ts +25 -0
  64. package/dist/client/types/com/atproto/server/deleteSession.d.ts +13 -0
  65. package/dist/client/types/com/atproto/server/describeServer.d.ts +27 -0
  66. package/dist/client/types/com/atproto/server/getSession.d.ts +18 -0
  67. package/dist/client/types/com/atproto/server/refreshSession.d.ts +24 -0
  68. package/dist/client/types/com/atproto/server/requestAccountDelete.d.ts +13 -0
  69. package/dist/client/types/com/atproto/server/requestPasswordReset.d.ts +17 -0
  70. package/dist/client/types/com/atproto/server/resetPassword.d.ts +24 -0
  71. package/dist/client/types/com/atproto/sync/getBlob.d.ts +15 -0
  72. package/dist/client/types/com/atproto/sync/listBlobs.d.ts +20 -0
  73. package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +1 -0
  74. package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +1 -1
  75. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -1
  76. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +58 -0
  77. package/dist/helpers/bsky.d.ts +20 -0
  78. package/dist/index.d.ts +6 -0
  79. package/dist/index.js +8046 -3649
  80. package/dist/index.js.map +4 -4
  81. package/dist/mixins/bsky.d.ts +23 -0
  82. package/dist/rich-text/detection.d.ts +4 -0
  83. package/dist/rich-text/rich-text.d.ts +39 -0
  84. package/dist/rich-text/sanitization.d.ts +4 -0
  85. package/dist/rich-text/sanitize.d.ts +4 -0
  86. package/dist/rich-text/unicode.d.ts +11 -0
  87. package/dist/types.d.ts +2 -2
  88. package/docs/rn-fetch-handler.ts +88 -0
  89. package/package.json +4 -1
  90. package/src/agent.ts +51 -15
  91. package/src/bsky-agent.ts +228 -0
  92. package/src/client/index.ts +330 -581
  93. package/src/client/lexicons.ts +1824 -1777
  94. package/src/client/types/app/bsky/actor/defs.ts +97 -0
  95. package/src/client/types/app/bsky/actor/getProfile.ts +4 -3
  96. package/src/client/types/app/bsky/actor/getProfiles.ts +4 -3
  97. package/src/client/types/app/bsky/actor/getSuggestions.ts +4 -3
  98. package/src/client/types/app/bsky/actor/profile.ts +5 -95
  99. package/src/client/types/app/bsky/actor/{searchTypeahead.ts → searchActors.ts} +6 -3
  100. package/src/client/types/app/bsky/actor/{search.ts → searchActorsTypeahead.ts} +4 -5
  101. package/src/client/types/app/bsky/embed/external.ts +14 -13
  102. package/src/client/types/app/bsky/embed/images.ts +14 -15
  103. package/src/client/types/app/bsky/embed/record.ts +32 -25
  104. package/src/client/types/app/bsky/embed/recordWithMedia.ts +53 -0
  105. package/src/client/types/app/bsky/feed/defs.ts +156 -0
  106. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +6 -5
  107. package/src/client/types/app/bsky/feed/{getVotes.ts → getLikes.ts} +11 -12
  108. package/src/client/types/app/bsky/feed/getPostThread.ts +5 -48
  109. package/src/client/types/app/bsky/feed/getRepostedBy.ts +5 -4
  110. package/src/client/types/app/bsky/feed/getTimeline.ts +5 -4
  111. package/src/client/types/app/bsky/feed/{vote.ts → like.ts} +4 -4
  112. package/src/client/types/app/bsky/feed/post.ts +10 -52
  113. package/src/client/types/app/bsky/feed/repost.ts +2 -1
  114. package/src/client/types/app/bsky/graph/follow.ts +3 -3
  115. package/src/client/types/app/bsky/graph/getFollowers.ts +7 -6
  116. package/src/client/types/app/bsky/graph/getFollows.ts +7 -6
  117. package/src/client/types/app/bsky/graph/getMutes.ts +5 -4
  118. package/src/client/types/app/bsky/graph/{mute.ts → muteActor.ts} +3 -2
  119. package/src/client/types/app/bsky/graph/{unmute.ts → unmuteActor.ts} +3 -2
  120. package/src/client/types/app/bsky/notification/{getCount.ts → getUnreadCount.ts} +2 -1
  121. package/src/client/types/app/bsky/notification/{list.ts → listNotifications.ts} +13 -9
  122. package/src/client/types/app/bsky/notification/updateSeen.ts +2 -1
  123. package/src/client/types/app/bsky/richtext/facet.ts +81 -0
  124. package/src/client/types/app/bsky/unspecced/getPopular.ts +38 -0
  125. package/src/client/types/com/atproto/admin/defs.ts +366 -0
  126. package/src/client/types/com/atproto/admin/getModerationAction.ts +4 -3
  127. package/src/client/types/com/atproto/admin/getModerationActions.ts +5 -4
  128. package/src/client/types/com/atproto/admin/getModerationReport.ts +4 -3
  129. package/src/client/types/com/atproto/admin/getModerationReports.ts +5 -4
  130. package/src/client/types/com/atproto/admin/getRecord.ts +4 -3
  131. package/src/client/types/com/atproto/admin/getRepo.ts +4 -3
  132. package/src/client/types/com/atproto/admin/resolveModerationReports.ts +4 -3
  133. package/src/client/types/com/atproto/admin/reverseModerationAction.ts +4 -3
  134. package/src/client/types/com/atproto/admin/searchRepos.ts +5 -4
  135. package/src/client/types/com/atproto/admin/takeModerationAction.ts +10 -10
  136. package/src/client/types/com/atproto/{handle/resolve.ts → identity/resolveHandle.ts} +2 -1
  137. package/src/client/types/com/atproto/{handle/update.ts → identity/updateHandle.ts} +2 -1
  138. package/src/client/types/com/atproto/{report/create.ts → moderation/createReport.ts} +10 -10
  139. package/src/client/types/com/atproto/moderation/defs.ts +17 -0
  140. package/src/client/types/com/atproto/repo/{batchWrite.ts → applyWrites.ts} +21 -12
  141. package/src/client/types/com/atproto/repo/createRecord.ts +15 -3
  142. package/src/client/types/com/atproto/repo/deleteRecord.ts +15 -3
  143. package/src/client/types/com/atproto/repo/{describe.ts → describeRepo.ts} +3 -2
  144. package/src/client/types/com/atproto/repo/getRecord.ts +4 -3
  145. package/src/client/types/com/atproto/repo/listRecords.ts +7 -6
  146. package/src/client/types/com/atproto/repo/putRecord.ts +18 -6
  147. package/src/client/types/com/atproto/repo/strongRef.ts +2 -1
  148. package/src/client/types/com/atproto/{blob/upload.ts → repo/uploadBlob.ts} +3 -2
  149. package/src/client/types/com/atproto/{account/create.ts → server/createAccount.ts} +9 -1
  150. package/src/client/types/com/atproto/{account → server}/createInviteCode.ts +2 -1
  151. package/src/client/types/com/atproto/{session/create.ts → server/createSession.ts} +2 -1
  152. package/src/client/types/com/atproto/{account/delete.ts → server/deleteAccount.ts} +2 -1
  153. package/src/client/types/com/atproto/{account/requestDelete.ts → server/deleteSession.ts} +2 -1
  154. package/src/client/types/com/atproto/server/{getAccountsConfig.ts → describeServer.ts} +4 -3
  155. package/src/client/types/com/atproto/{session/get.ts → server/getSession.ts} +2 -1
  156. package/src/client/types/com/atproto/{session/refresh.ts → server/refreshSession.ts} +2 -1
  157. package/src/client/types/com/atproto/{session/delete.ts → server/requestAccountDelete.ts} +2 -1
  158. package/src/client/types/com/atproto/{account → server}/requestPasswordReset.ts +2 -1
  159. package/src/client/types/com/atproto/{account → server}/resetPassword.ts +2 -1
  160. package/src/client/types/com/atproto/sync/getBlob.ts +33 -0
  161. package/src/client/types/com/atproto/sync/getBlocks.ts +2 -1
  162. package/src/client/types/com/atproto/sync/getCheckout.ts +2 -1
  163. package/src/client/types/com/atproto/sync/getCommitPath.ts +2 -1
  164. package/src/client/types/com/atproto/sync/getHead.ts +2 -1
  165. package/src/client/types/com/atproto/sync/getRecord.ts +2 -1
  166. package/src/client/types/com/atproto/sync/getRepo.ts +2 -1
  167. package/src/client/types/com/atproto/sync/listBlobs.ts +40 -0
  168. package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +6 -2
  169. package/src/client/types/com/atproto/sync/requestCrawl.ts +3 -2
  170. package/src/client/types/com/atproto/sync/subscribeRepos.ts +131 -0
  171. package/src/index.ts +12 -0
  172. package/src/rich-text/detection.ts +83 -0
  173. package/src/rich-text/rich-text.ts +401 -0
  174. package/src/rich-text/sanitization.ts +40 -0
  175. package/src/rich-text/unicode.ts +47 -0
  176. package/src/types.ts +2 -2
  177. package/tests/agent.test.ts +10 -6
  178. package/tests/bsky-agent.test.ts +140 -0
  179. package/tests/errors.test.ts +4 -4
  180. package/tests/rich-text-detection.test.ts +229 -0
  181. package/tests/rich-text-sanitization.test.ts +211 -0
  182. package/tests/rich-text.test.ts +661 -0
  183. package/tsconfig.build.tsbuildinfo +1 -1
  184. package/src/client/types/app/bsky/actor/ref.ts +0 -64
  185. package/src/client/types/app/bsky/actor/updateProfile.ts +0 -71
  186. package/src/client/types/app/bsky/feed/feedViewPost.ts +0 -64
  187. package/src/client/types/app/bsky/feed/setVote.ts +0 -40
  188. package/src/client/types/app/bsky/graph/assertCreator.ts +0 -9
  189. package/src/client/types/app/bsky/graph/assertMember.ts +0 -9
  190. package/src/client/types/app/bsky/graph/assertion.ts +0 -27
  191. package/src/client/types/app/bsky/graph/confirmation.ts +0 -28
  192. package/src/client/types/app/bsky/system/actorUser.ts +0 -9
  193. package/src/client/types/app/bsky/system/declRef.ts +0 -26
  194. package/src/client/types/app/bsky/system/declaration.ts +0 -24
  195. package/src/client/types/com/atproto/account/get.ts +0 -26
  196. package/src/client/types/com/atproto/admin/blob.ts +0 -84
  197. package/src/client/types/com/atproto/admin/moderationAction.ts +0 -118
  198. package/src/client/types/com/atproto/admin/moderationReport.ts +0 -64
  199. package/src/client/types/com/atproto/admin/record.ts +0 -92
  200. package/src/client/types/com/atproto/admin/repo.ts +0 -103
  201. package/src/client/types/com/atproto/repo/recordRef.ts +0 -25
  202. package/src/client/types/com/atproto/repo/repoRef.ts +0 -24
  203. package/src/client/types/com/atproto/report/reasonType.ts +0 -16
  204. package/src/client/types/com/atproto/report/subject.ts +0 -66
  205. package/src/client/types/com/atproto/sync/subscribeAllRepos.ts +0 -7
@@ -1,27 +0,0 @@
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 AppBskyActorRef from '../actor/ref'
8
-
9
- export interface Record {
10
- assertion: string
11
- subject: AppBskyActorRef.Main
12
- createdAt: string
13
- [k: string]: unknown
14
- }
15
-
16
- export function isRecord(v: unknown): v is Record {
17
- return (
18
- isObj(v) &&
19
- hasProp(v, '$type') &&
20
- (v.$type === 'app.bsky.graph.assertion#main' ||
21
- v.$type === 'app.bsky.graph.assertion')
22
- )
23
- }
24
-
25
- export function validateRecord(v: unknown): ValidationResult {
26
- return lexicons.validate('app.bsky.graph.assertion#main', v)
27
- }
@@ -1,28 +0,0 @@
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 AppBskyActorRef from '../actor/ref'
8
- import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
9
-
10
- export interface Record {
11
- originator: AppBskyActorRef.Main
12
- assertion: ComAtprotoRepoStrongRef.Main
13
- createdAt: string
14
- [k: string]: unknown
15
- }
16
-
17
- export function isRecord(v: unknown): v is Record {
18
- return (
19
- isObj(v) &&
20
- hasProp(v, '$type') &&
21
- (v.$type === 'app.bsky.graph.confirmation#main' ||
22
- v.$type === 'app.bsky.graph.confirmation')
23
- )
24
- }
25
-
26
- export function validateRecord(v: unknown): ValidationResult {
27
- return lexicons.validate('app.bsky.graph.confirmation#main', v)
28
- }
@@ -1,9 +0,0 @@
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
-
8
- /** Actor type: User. Defined for app.bsky.system.declaration's actorType. */
9
- export const MAIN = 'app.bsky.system.actorUser#main'
@@ -1,26 +0,0 @@
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
-
8
- /** A reference to a app.bsky.system.declaration record. */
9
- export interface Main {
10
- cid: string
11
- actorType: 'app.bsky.system.actorUser' | (string & {})
12
- [k: string]: unknown
13
- }
14
-
15
- export function isMain(v: unknown): v is Main {
16
- return (
17
- isObj(v) &&
18
- hasProp(v, '$type') &&
19
- (v.$type === 'app.bsky.system.declRef#main' ||
20
- v.$type === 'app.bsky.system.declRef')
21
- )
22
- }
23
-
24
- export function validateMain(v: unknown): ValidationResult {
25
- return lexicons.validate('app.bsky.system.declRef#main', v)
26
- }
@@ -1,24 +0,0 @@
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
-
8
- export interface Record {
9
- actorType: 'app.bsky.system.actorUser' | (string & {})
10
- [k: string]: unknown
11
- }
12
-
13
- export function isRecord(v: unknown): v is Record {
14
- return (
15
- isObj(v) &&
16
- hasProp(v, '$type') &&
17
- (v.$type === 'app.bsky.system.declaration#main' ||
18
- v.$type === 'app.bsky.system.declaration')
19
- )
20
- }
21
-
22
- export function validateRecord(v: unknown): ValidationResult {
23
- return lexicons.validate('app.bsky.system.declaration#main', v)
24
- }
@@ -1,26 +0,0 @@
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
- }
16
-
17
- export interface Response {
18
- success: boolean
19
- headers: Headers
20
- }
21
-
22
- export function toKnownErr(e: any) {
23
- if (e instanceof XRPCError) {
24
- }
25
- return e
26
- }
@@ -1,84 +0,0 @@
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
- }
@@ -1,118 +0,0 @@
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 ComAtprotoRepoRepoRef from '../repo/repoRef'
8
- import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
9
- import * as ComAtprotoAdminRepo from './repo'
10
- import * as ComAtprotoAdminRecord from './record'
11
- import * as ComAtprotoAdminBlob from './blob'
12
- import * as ComAtprotoAdminModerationReport from './moderationReport'
13
-
14
- export interface View {
15
- id: number
16
- action: ActionType
17
- subject:
18
- | ComAtprotoRepoRepoRef.Main
19
- | ComAtprotoRepoStrongRef.Main
20
- | { $type: string; [k: string]: unknown }
21
- subjectBlobCids: string[]
22
- reason: string
23
- createdBy: string
24
- createdAt: string
25
- reversal?: Reversal
26
- resolvedReportIds: number[]
27
- [k: string]: unknown
28
- }
29
-
30
- export function isView(v: unknown): v is View {
31
- return (
32
- isObj(v) &&
33
- hasProp(v, '$type') &&
34
- v.$type === 'com.atproto.admin.moderationAction#view'
35
- )
36
- }
37
-
38
- export function validateView(v: unknown): ValidationResult {
39
- return lexicons.validate('com.atproto.admin.moderationAction#view', v)
40
- }
41
-
42
- export interface ViewDetail {
43
- id: number
44
- action: ActionType
45
- subject:
46
- | ComAtprotoAdminRepo.View
47
- | ComAtprotoAdminRecord.View
48
- | { $type: string; [k: string]: unknown }
49
- subjectBlobs: ComAtprotoAdminBlob.View[]
50
- reason: string
51
- createdBy: string
52
- createdAt: string
53
- reversal?: Reversal
54
- resolvedReports: ComAtprotoAdminModerationReport.View[]
55
- [k: string]: unknown
56
- }
57
-
58
- export function isViewDetail(v: unknown): v is ViewDetail {
59
- return (
60
- isObj(v) &&
61
- hasProp(v, '$type') &&
62
- v.$type === 'com.atproto.admin.moderationAction#viewDetail'
63
- )
64
- }
65
-
66
- export function validateViewDetail(v: unknown): ValidationResult {
67
- return lexicons.validate('com.atproto.admin.moderationAction#viewDetail', v)
68
- }
69
-
70
- export interface ViewCurrent {
71
- id: number
72
- action: ActionType
73
- [k: string]: unknown
74
- }
75
-
76
- export function isViewCurrent(v: unknown): v is ViewCurrent {
77
- return (
78
- isObj(v) &&
79
- hasProp(v, '$type') &&
80
- v.$type === 'com.atproto.admin.moderationAction#viewCurrent'
81
- )
82
- }
83
-
84
- export function validateViewCurrent(v: unknown): ValidationResult {
85
- return lexicons.validate('com.atproto.admin.moderationAction#viewCurrent', v)
86
- }
87
-
88
- export interface Reversal {
89
- reason: string
90
- createdBy: string
91
- createdAt: string
92
- [k: string]: unknown
93
- }
94
-
95
- export function isReversal(v: unknown): v is Reversal {
96
- return (
97
- isObj(v) &&
98
- hasProp(v, '$type') &&
99
- v.$type === 'com.atproto.admin.moderationAction#reversal'
100
- )
101
- }
102
-
103
- export function validateReversal(v: unknown): ValidationResult {
104
- return lexicons.validate('com.atproto.admin.moderationAction#reversal', v)
105
- }
106
-
107
- export type ActionType =
108
- | 'com.atproto.admin.moderationAction#takedown'
109
- | 'com.atproto.admin.moderationAction#flag'
110
- | 'com.atproto.admin.moderationAction#acknowledge'
111
- | (string & {})
112
-
113
- /** Moderation action type: Takedown. Indicates that content should not be served by the PDS. */
114
- export const TAKEDOWN = 'com.atproto.admin.moderationAction#takedown'
115
- /** Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served. */
116
- export const FLAG = 'com.atproto.admin.moderationAction#flag'
117
- /** Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules. */
118
- export const ACKNOWLEDGE = 'com.atproto.admin.moderationAction#acknowledge'
@@ -1,64 +0,0 @@
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 ComAtprotoReportReasonType from '../report/reasonType'
8
- import * as ComAtprotoRepoRepoRef from '../repo/repoRef'
9
- import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
10
- import * as ComAtprotoAdminRepo from './repo'
11
- import * as ComAtprotoAdminRecord from './record'
12
- import * as ComAtprotoAdminModerationAction from './moderationAction'
13
-
14
- export interface View {
15
- id: number
16
- reasonType: ComAtprotoReportReasonType.Main
17
- reason?: string
18
- subject:
19
- | ComAtprotoRepoRepoRef.Main
20
- | ComAtprotoRepoStrongRef.Main
21
- | { $type: string; [k: string]: unknown }
22
- reportedByDid: string
23
- createdAt: string
24
- resolvedByActionIds: number[]
25
- [k: string]: unknown
26
- }
27
-
28
- export function isView(v: unknown): v is View {
29
- return (
30
- isObj(v) &&
31
- hasProp(v, '$type') &&
32
- v.$type === 'com.atproto.admin.moderationReport#view'
33
- )
34
- }
35
-
36
- export function validateView(v: unknown): ValidationResult {
37
- return lexicons.validate('com.atproto.admin.moderationReport#view', v)
38
- }
39
-
40
- export interface ViewDetail {
41
- id: number
42
- reasonType: ComAtprotoReportReasonType.Main
43
- reason?: string
44
- subject:
45
- | ComAtprotoAdminRepo.View
46
- | ComAtprotoAdminRecord.View
47
- | { $type: string; [k: string]: unknown }
48
- reportedByDid: string
49
- createdAt: string
50
- resolvedByActions: ComAtprotoAdminModerationAction.View[]
51
- [k: string]: unknown
52
- }
53
-
54
- export function isViewDetail(v: unknown): v is ViewDetail {
55
- return (
56
- isObj(v) &&
57
- hasProp(v, '$type') &&
58
- v.$type === 'com.atproto.admin.moderationReport#viewDetail'
59
- )
60
- }
61
-
62
- export function validateViewDetail(v: unknown): ValidationResult {
63
- return lexicons.validate('com.atproto.admin.moderationReport#viewDetail', v)
64
- }
@@ -1,92 +0,0 @@
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 ComAtprotoAdminRepo from './repo'
8
- import * as ComAtprotoAdminBlob from './blob'
9
- import * as ComAtprotoAdminModerationAction from './moderationAction'
10
- import * as ComAtprotoAdminModerationReport from './moderationReport'
11
-
12
- export interface View {
13
- uri: string
14
- cid: string
15
- value: {}
16
- blobCids: string[]
17
- indexedAt: string
18
- moderation: Moderation
19
- repo: ComAtprotoAdminRepo.View
20
- [k: string]: unknown
21
- }
22
-
23
- export function isView(v: unknown): v is View {
24
- return (
25
- isObj(v) &&
26
- hasProp(v, '$type') &&
27
- v.$type === 'com.atproto.admin.record#view'
28
- )
29
- }
30
-
31
- export function validateView(v: unknown): ValidationResult {
32
- return lexicons.validate('com.atproto.admin.record#view', v)
33
- }
34
-
35
- export interface ViewDetail {
36
- uri: string
37
- cid: string
38
- value: {}
39
- blobs: ComAtprotoAdminBlob.View[]
40
- indexedAt: string
41
- moderation: ModerationDetail
42
- repo: ComAtprotoAdminRepo.View
43
- [k: string]: unknown
44
- }
45
-
46
- export function isViewDetail(v: unknown): v is ViewDetail {
47
- return (
48
- isObj(v) &&
49
- hasProp(v, '$type') &&
50
- v.$type === 'com.atproto.admin.record#viewDetail'
51
- )
52
- }
53
-
54
- export function validateViewDetail(v: unknown): ValidationResult {
55
- return lexicons.validate('com.atproto.admin.record#viewDetail', v)
56
- }
57
-
58
- export interface Moderation {
59
- currentAction?: ComAtprotoAdminModerationAction.ViewCurrent
60
- [k: string]: unknown
61
- }
62
-
63
- export function isModeration(v: unknown): v is Moderation {
64
- return (
65
- isObj(v) &&
66
- hasProp(v, '$type') &&
67
- v.$type === 'com.atproto.admin.record#moderation'
68
- )
69
- }
70
-
71
- export function validateModeration(v: unknown): ValidationResult {
72
- return lexicons.validate('com.atproto.admin.record#moderation', v)
73
- }
74
-
75
- export interface ModerationDetail {
76
- currentAction?: ComAtprotoAdminModerationAction.ViewCurrent
77
- actions: ComAtprotoAdminModerationAction.View[]
78
- reports: ComAtprotoAdminModerationReport.View[]
79
- [k: string]: unknown
80
- }
81
-
82
- export function isModerationDetail(v: unknown): v is ModerationDetail {
83
- return (
84
- isObj(v) &&
85
- hasProp(v, '$type') &&
86
- v.$type === 'com.atproto.admin.record#moderationDetail'
87
- )
88
- }
89
-
90
- export function validateModerationDetail(v: unknown): ValidationResult {
91
- return lexicons.validate('com.atproto.admin.record#moderationDetail', v)
92
- }
@@ -1,103 +0,0 @@
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
- import * as ComAtprotoAdminModerationReport from './moderationReport'
9
-
10
- export interface View {
11
- did: string
12
- handle: string
13
- account?: Account
14
- relatedRecords: {}[]
15
- indexedAt: string
16
- moderation: Moderation
17
- [k: string]: unknown
18
- }
19
-
20
- export function isView(v: unknown): v is View {
21
- return (
22
- isObj(v) && hasProp(v, '$type') && v.$type === 'com.atproto.admin.repo#view'
23
- )
24
- }
25
-
26
- export function validateView(v: unknown): ValidationResult {
27
- return lexicons.validate('com.atproto.admin.repo#view', v)
28
- }
29
-
30
- export interface ViewDetail {
31
- did: string
32
- handle: string
33
- account?: Account
34
- relatedRecords: {}[]
35
- indexedAt: string
36
- moderation: ModerationDetail
37
- [k: string]: unknown
38
- }
39
-
40
- export function isViewDetail(v: unknown): v is ViewDetail {
41
- return (
42
- isObj(v) &&
43
- hasProp(v, '$type') &&
44
- v.$type === 'com.atproto.admin.repo#viewDetail'
45
- )
46
- }
47
-
48
- export function validateViewDetail(v: unknown): ValidationResult {
49
- return lexicons.validate('com.atproto.admin.repo#viewDetail', v)
50
- }
51
-
52
- export interface Account {
53
- email: string
54
- [k: string]: unknown
55
- }
56
-
57
- export function isAccount(v: unknown): v is Account {
58
- return (
59
- isObj(v) &&
60
- hasProp(v, '$type') &&
61
- v.$type === 'com.atproto.admin.repo#account'
62
- )
63
- }
64
-
65
- export function validateAccount(v: unknown): ValidationResult {
66
- return lexicons.validate('com.atproto.admin.repo#account', 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.repo#moderation'
79
- )
80
- }
81
-
82
- export function validateModeration(v: unknown): ValidationResult {
83
- return lexicons.validate('com.atproto.admin.repo#moderation', v)
84
- }
85
-
86
- export interface ModerationDetail {
87
- currentAction?: ComAtprotoAdminModerationAction.ViewCurrent
88
- actions: ComAtprotoAdminModerationAction.View[]
89
- reports: ComAtprotoAdminModerationReport.View[]
90
- [k: string]: unknown
91
- }
92
-
93
- export function isModerationDetail(v: unknown): v is ModerationDetail {
94
- return (
95
- isObj(v) &&
96
- hasProp(v, '$type') &&
97
- v.$type === 'com.atproto.admin.repo#moderationDetail'
98
- )
99
- }
100
-
101
- export function validateModerationDetail(v: unknown): ValidationResult {
102
- return lexicons.validate('com.atproto.admin.repo#moderationDetail', v)
103
- }
@@ -1,25 +0,0 @@
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
-
8
- export interface Main {
9
- uri: string
10
- cid?: string
11
- [k: string]: unknown
12
- }
13
-
14
- export function isMain(v: unknown): v is Main {
15
- return (
16
- isObj(v) &&
17
- hasProp(v, '$type') &&
18
- (v.$type === 'com.atproto.repo.recordRef#main' ||
19
- v.$type === 'com.atproto.repo.recordRef')
20
- )
21
- }
22
-
23
- export function validateMain(v: unknown): ValidationResult {
24
- return lexicons.validate('com.atproto.repo.recordRef#main', v)
25
- }
@@ -1,24 +0,0 @@
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
-
8
- export interface Main {
9
- did: string
10
- [k: string]: unknown
11
- }
12
-
13
- export function isMain(v: unknown): v is Main {
14
- return (
15
- isObj(v) &&
16
- hasProp(v, '$type') &&
17
- (v.$type === 'com.atproto.repo.repoRef#main' ||
18
- v.$type === 'com.atproto.repo.repoRef')
19
- )
20
- }
21
-
22
- export function validateMain(v: unknown): ValidationResult {
23
- return lexicons.validate('com.atproto.repo.repoRef#main', v)
24
- }
@@ -1,16 +0,0 @@
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
-
8
- export type Main =
9
- | 'com.atproto.report.reasonType#spam'
10
- | 'com.atproto.report.reasonType#other'
11
- | (string & {})
12
-
13
- /** Moderation report reason: Spam. */
14
- export const SPAM = 'com.atproto.report.reasonType#spam'
15
- /** Moderation report reason: Other. */
16
- export const OTHER = 'com.atproto.report.reasonType#other'