@atproto/api 0.0.6 → 0.0.8

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 (86) hide show
  1. package/dist/client/index.d.ts +75 -44
  2. package/dist/client/lexicons.d.ts +1075 -407
  3. package/dist/client/types/app/bsky/actor/getProfile.d.ts +0 -2
  4. package/dist/client/types/app/bsky/actor/search.d.ts +1 -1
  5. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +1 -1
  6. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -1
  7. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +1 -8
  8. package/dist/client/types/app/bsky/graph/getFollows.d.ts +1 -0
  9. package/dist/client/types/app/bsky/notification/list.d.ts +1 -1
  10. package/dist/client/types/app/bsky/system/declRef.d.ts +1 -1
  11. package/dist/client/types/app/bsky/system/declaration.d.ts +1 -1
  12. package/dist/client/types/com/atproto/account/delete.d.ts +14 -2
  13. package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
  14. package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +16 -0
  15. package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +22 -0
  16. package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +16 -0
  17. package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +23 -0
  18. package/dist/client/types/com/atproto/admin/getRecord.d.ts +17 -0
  19. package/dist/client/types/com/atproto/admin/getRepo.d.ts +16 -0
  20. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +49 -0
  21. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
  22. package/dist/client/types/com/atproto/admin/record.d.ts +40 -0
  23. package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
  24. package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +22 -0
  25. package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +22 -0
  26. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +22 -0
  27. package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +28 -0
  28. package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
  29. package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
  30. package/dist/client/types/com/atproto/report/create.d.ts +39 -0
  31. package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
  32. package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
  33. package/dist/client/types/com/atproto/session/create.d.ts +5 -2
  34. package/dist/client/types/com/atproto/session/refresh.d.ts +4 -1
  35. package/dist/client/types/com/atproto/sync/getCheckout.d.ts +15 -0
  36. package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +20 -0
  37. package/dist/client/types/com/atproto/sync/getHead.d.ts +18 -0
  38. package/dist/client/types/com/atproto/sync/getRecord.d.ts +17 -0
  39. package/dist/index.js +1997 -927
  40. package/dist/index.js.map +4 -4
  41. package/package.json +1 -1
  42. package/src/client/index.ts +249 -142
  43. package/src/client/lexicons.ts +1223 -478
  44. package/src/client/types/app/bsky/actor/getProfile.ts +0 -2
  45. package/src/client/types/app/bsky/actor/search.ts +1 -1
  46. package/src/client/types/app/bsky/actor/searchTypeahead.ts +1 -1
  47. package/src/client/types/app/bsky/actor/updateProfile.ts +0 -1
  48. package/src/client/types/app/bsky/feed/feedViewPost.ts +1 -19
  49. package/src/client/types/app/bsky/graph/getFollows.ts +1 -0
  50. package/src/client/types/app/bsky/notification/list.ts +1 -2
  51. package/src/client/types/app/bsky/system/declRef.ts +1 -4
  52. package/src/client/types/app/bsky/system/declaration.ts +1 -4
  53. package/src/client/types/com/atproto/account/delete.ts +21 -1
  54. package/src/client/types/com/atproto/account/requestDelete.ts +27 -0
  55. package/src/client/types/com/atproto/admin/getModerationAction.ts +31 -0
  56. package/src/client/types/com/atproto/admin/getModerationActions.ts +38 -0
  57. package/src/client/types/com/atproto/admin/getModerationReport.ts +31 -0
  58. package/src/client/types/com/atproto/admin/getModerationReports.ts +39 -0
  59. package/src/client/types/com/atproto/admin/getRecord.ts +32 -0
  60. package/src/client/types/com/atproto/admin/getRepo.ts +31 -0
  61. package/src/client/types/com/atproto/admin/moderationAction.ts +99 -0
  62. package/src/client/types/com/atproto/admin/moderationReport.ts +64 -0
  63. package/src/client/types/com/atproto/admin/record.ts +89 -0
  64. package/src/client/types/com/atproto/admin/repo.ts +103 -0
  65. package/src/client/types/com/atproto/admin/resolveModerationReports.ts +37 -0
  66. package/src/client/types/com/atproto/admin/reverseModerationAction.ts +37 -0
  67. package/src/client/types/com/atproto/admin/searchRepos.ts +38 -0
  68. package/src/client/types/com/atproto/admin/takeModerationAction.ts +47 -0
  69. package/src/client/types/com/atproto/repo/recordRef.ts +25 -0
  70. package/src/client/types/com/atproto/repo/repoRef.ts +24 -0
  71. package/src/client/types/com/atproto/report/create.ts +54 -0
  72. package/src/client/types/com/atproto/report/reasonType.ts +16 -0
  73. package/src/client/types/com/atproto/report/subject.ts +66 -0
  74. package/src/client/types/com/atproto/session/create.ts +9 -1
  75. package/src/client/types/com/atproto/session/refresh.ts +7 -0
  76. package/src/client/types/com/atproto/sync/{updateRepo.ts → getCheckout.ts} +4 -3
  77. package/src/client/types/com/atproto/sync/getCommitPath.ts +39 -0
  78. package/src/client/types/com/atproto/sync/{getRoot.ts → getHead.ts} +0 -0
  79. package/src/client/types/com/atproto/sync/getRecord.ts +34 -0
  80. package/tsconfig.build.tsbuildinfo +1 -1
  81. package/src/client/types/app/bsky/actor/createScene.ts +0 -55
  82. package/src/client/types/app/bsky/feed/trend.ts +0 -26
  83. package/src/client/types/app/bsky/graph/getAssertions.ts +0 -85
  84. package/src/client/types/app/bsky/graph/getMembers.ts +0 -62
  85. package/src/client/types/app/bsky/graph/getMemberships.ts +0 -62
  86. package/src/client/types/app/bsky/system/actorScene.ts +0 -9
@@ -24,7 +24,6 @@ export interface OutputSchema {
24
24
  banner?: string
25
25
  followersCount: number
26
26
  followsCount: number
27
- membersCount: number
28
27
  postsCount: number
29
28
  myState?: MyState
30
29
  [k: string]: unknown
@@ -48,7 +47,6 @@ export function toKnownErr(e: any) {
48
47
 
49
48
  export interface MyState {
50
49
  follow?: string
51
- member?: string
52
50
  muted?: boolean
53
51
  [k: string]: unknown
54
52
  }
@@ -8,7 +8,7 @@ import { lexicons } from '../../../../lexicons'
8
8
  import * as AppBskySystemDeclRef from '../system/declRef'
9
9
 
10
10
  export interface QueryParams {
11
- term: string
11
+ term?: string
12
12
  limit?: number
13
13
  before?: string
14
14
  }
@@ -8,7 +8,7 @@ import { lexicons } from '../../../../lexicons'
8
8
  import * as AppBskySystemDeclRef from '../system/declRef'
9
9
 
10
10
  export interface QueryParams {
11
- term: string
11
+ term?: string
12
12
  limit?: number
13
13
  }
14
14
 
@@ -9,7 +9,6 @@ import { lexicons } from '../../../../lexicons'
9
9
  export interface QueryParams {}
10
10
 
11
11
  export interface InputSchema {
12
- did?: string
13
12
  displayName?: string
14
13
  description?: string
15
14
  avatar?: { cid: string; mimeType: string; [k: string]: unknown }
@@ -10,7 +10,7 @@ import * as AppBskyActorRef from '../actor/ref'
10
10
  export interface Main {
11
11
  post: AppBskyFeedPost.View
12
12
  reply?: ReplyRef
13
- reason?: ReasonTrend | ReasonRepost | { $type: string; [k: string]: unknown }
13
+ reason?: ReasonRepost | { $type: string; [k: string]: unknown }
14
14
  [k: string]: unknown
15
15
  }
16
16
 
@@ -45,24 +45,6 @@ export function validateReplyRef(v: unknown): ValidationResult {
45
45
  return lexicons.validate('app.bsky.feed.feedViewPost#replyRef', v)
46
46
  }
47
47
 
48
- export interface ReasonTrend {
49
- by: AppBskyActorRef.WithInfo
50
- indexedAt: string
51
- [k: string]: unknown
52
- }
53
-
54
- export function isReasonTrend(v: unknown): v is ReasonTrend {
55
- return (
56
- isObj(v) &&
57
- hasProp(v, '$type') &&
58
- v.$type === 'app.bsky.feed.feedViewPost#reasonTrend'
59
- )
60
- }
61
-
62
- export function validateReasonTrend(v: unknown): ValidationResult {
63
- return lexicons.validate('app.bsky.feed.feedViewPost#reasonTrend', v)
64
- }
65
-
66
48
  export interface ReasonRepost {
67
49
  by: AppBskyActorRef.WithInfo
68
50
  indexedAt: string
@@ -44,6 +44,7 @@ export interface Follow {
44
44
  declaration: AppBskySystemDeclRef.Main
45
45
  handle: string
46
46
  displayName?: string
47
+ avatar?: string
47
48
  createdAt?: string
48
49
  indexedAt: string
49
50
  [k: string]: unknown
@@ -40,11 +40,10 @@ export interface Notification {
40
40
  uri: string
41
41
  cid: string
42
42
  author: AppBskyActorRef.WithInfo
43
- /** Expected values are 'vote', 'repost', 'trend', 'follow', 'invite', 'mention' and 'reply'. */
43
+ /** Expected values are 'vote', 'repost', 'follow', 'invite', 'mention' and 'reply'. */
44
44
  reason:
45
45
  | 'vote'
46
46
  | 'repost'
47
- | 'trend'
48
47
  | 'follow'
49
48
  | 'invite'
50
49
  | 'mention'
@@ -8,10 +8,7 @@ import { lexicons } from '../../../../lexicons'
8
8
  /** A reference to a app.bsky.system.declaration record. */
9
9
  export interface Main {
10
10
  cid: string
11
- actorType:
12
- | 'app.bsky.system.actorUser'
13
- | 'app.bsky.system.actorScene'
14
- | (string & {})
11
+ actorType: 'app.bsky.system.actorUser' | (string & {})
15
12
  [k: string]: unknown
16
13
  }
17
14
 
@@ -6,10 +6,7 @@ import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
7
 
8
8
  export interface Record {
9
- actorType:
10
- | 'app.bsky.system.actorUser'
11
- | 'app.bsky.system.actorScene'
12
- | (string & {})
9
+ actorType: 'app.bsky.system.actorUser' | (string & {})
13
10
  [k: string]: unknown
14
11
  }
15
12
 
@@ -8,11 +8,17 @@ import { lexicons } from '../../../../lexicons'
8
8
 
9
9
  export interface QueryParams {}
10
10
 
11
- export type InputSchema = undefined
11
+ export interface InputSchema {
12
+ did: string
13
+ password: string
14
+ token: string
15
+ [k: string]: unknown
16
+ }
12
17
 
13
18
  export interface CallOptions {
14
19
  headers?: Headers
15
20
  qp?: QueryParams
21
+ encoding: 'application/json'
16
22
  }
17
23
 
18
24
  export interface Response {
@@ -20,8 +26,22 @@ export interface Response {
20
26
  headers: Headers
21
27
  }
22
28
 
29
+ export class ExpiredTokenError extends XRPCError {
30
+ constructor(src: XRPCError) {
31
+ super(src.status, src.error, src.message)
32
+ }
33
+ }
34
+
35
+ export class InvalidTokenError extends XRPCError {
36
+ constructor(src: XRPCError) {
37
+ super(src.status, src.error, src.message)
38
+ }
39
+ }
40
+
23
41
  export function toKnownErr(e: any) {
24
42
  if (e instanceof XRPCError) {
43
+ if (e.error === 'ExpiredToken') return new ExpiredTokenError(e)
44
+ if (e.error === 'InvalidToken') return new InvalidTokenError(e)
25
45
  }
26
46
  return e
27
47
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+
9
+ export interface QueryParams {}
10
+
11
+ export type InputSchema = undefined
12
+
13
+ export interface CallOptions {
14
+ headers?: Headers
15
+ qp?: QueryParams
16
+ }
17
+
18
+ export interface Response {
19
+ success: boolean
20
+ headers: Headers
21
+ }
22
+
23
+ export function toKnownErr(e: any) {
24
+ if (e instanceof XRPCError) {
25
+ }
26
+ return e
27
+ }
@@ -0,0 +1,31 @@
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
+ import * as ComAtprotoAdminModerationAction from './moderationAction'
9
+
10
+ export interface QueryParams {
11
+ id: number
12
+ }
13
+
14
+ export type InputSchema = undefined
15
+ export type OutputSchema = ComAtprotoAdminModerationAction.ViewDetail
16
+
17
+ export interface CallOptions {
18
+ headers?: Headers
19
+ }
20
+
21
+ export interface Response {
22
+ success: boolean
23
+ headers: Headers
24
+ data: OutputSchema
25
+ }
26
+
27
+ export function toKnownErr(e: any) {
28
+ if (e instanceof XRPCError) {
29
+ }
30
+ return e
31
+ }
@@ -0,0 +1,38 @@
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
+ import * as ComAtprotoAdminModerationAction from './moderationAction'
9
+
10
+ export interface QueryParams {
11
+ subject?: string
12
+ limit?: number
13
+ before?: string
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ cursor?: string
20
+ actions: ComAtprotoAdminModerationAction.View[]
21
+ [k: string]: unknown
22
+ }
23
+
24
+ export interface CallOptions {
25
+ headers?: Headers
26
+ }
27
+
28
+ export interface Response {
29
+ success: boolean
30
+ headers: Headers
31
+ data: OutputSchema
32
+ }
33
+
34
+ export function toKnownErr(e: any) {
35
+ if (e instanceof XRPCError) {
36
+ }
37
+ return e
38
+ }
@@ -0,0 +1,31 @@
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
+ import * as ComAtprotoAdminModerationReport from './moderationReport'
9
+
10
+ export interface QueryParams {
11
+ id: number
12
+ }
13
+
14
+ export type InputSchema = undefined
15
+ export type OutputSchema = ComAtprotoAdminModerationReport.ViewDetail
16
+
17
+ export interface CallOptions {
18
+ headers?: Headers
19
+ }
20
+
21
+ export interface Response {
22
+ success: boolean
23
+ headers: Headers
24
+ data: OutputSchema
25
+ }
26
+
27
+ export function toKnownErr(e: any) {
28
+ if (e instanceof XRPCError) {
29
+ }
30
+ return e
31
+ }
@@ -0,0 +1,39 @@
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
+ import * as ComAtprotoAdminModerationReport from './moderationReport'
9
+
10
+ export interface QueryParams {
11
+ subject?: string
12
+ resolved?: boolean
13
+ limit?: number
14
+ before?: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ reports: ComAtprotoAdminModerationReport.View[]
22
+ [k: string]: unknown
23
+ }
24
+
25
+ export interface CallOptions {
26
+ headers?: Headers
27
+ }
28
+
29
+ export interface Response {
30
+ success: boolean
31
+ headers: Headers
32
+ data: OutputSchema
33
+ }
34
+
35
+ export function toKnownErr(e: any) {
36
+ if (e instanceof XRPCError) {
37
+ }
38
+ return e
39
+ }
@@ -0,0 +1,32 @@
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
+ import * as ComAtprotoAdminRecord from './record'
9
+
10
+ export interface QueryParams {
11
+ uri: string
12
+ cid?: string
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+ export type OutputSchema = ComAtprotoAdminRecord.ViewDetail
17
+
18
+ export interface CallOptions {
19
+ headers?: Headers
20
+ }
21
+
22
+ export interface Response {
23
+ success: boolean
24
+ headers: Headers
25
+ data: OutputSchema
26
+ }
27
+
28
+ export function toKnownErr(e: any) {
29
+ if (e instanceof XRPCError) {
30
+ }
31
+ return e
32
+ }
@@ -0,0 +1,31 @@
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
+ import * as ComAtprotoAdminRepo from './repo'
9
+
10
+ export interface QueryParams {
11
+ did: string
12
+ }
13
+
14
+ export type InputSchema = undefined
15
+ export type OutputSchema = ComAtprotoAdminRepo.ViewDetail
16
+
17
+ export interface CallOptions {
18
+ headers?: Headers
19
+ }
20
+
21
+ export interface Response {
22
+ success: boolean
23
+ headers: Headers
24
+ data: OutputSchema
25
+ }
26
+
27
+ export function toKnownErr(e: any) {
28
+ if (e instanceof XRPCError) {
29
+ }
30
+ return e
31
+ }
@@ -0,0 +1,99 @@
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 ComAtprotoAdminModerationReport from './moderationReport'
12
+
13
+ export interface View {
14
+ id: number
15
+ action:
16
+ | 'com.atproto.admin.moderationAction#takedown'
17
+ | 'com.atproto.admin.moderationAction#flag'
18
+ | 'com.atproto.admin.moderationAction#acknowledge'
19
+ | (string & {})
20
+ subject:
21
+ | ComAtprotoRepoRepoRef.Main
22
+ | ComAtprotoRepoStrongRef.Main
23
+ | { $type: string; [k: string]: unknown }
24
+ reason: string
25
+ createdBy: string
26
+ createdAt: string
27
+ reversal?: Reversal
28
+ resolvedReportIds: number[]
29
+ [k: string]: unknown
30
+ }
31
+
32
+ export function isView(v: unknown): v is View {
33
+ return (
34
+ isObj(v) &&
35
+ hasProp(v, '$type') &&
36
+ v.$type === 'com.atproto.admin.moderationAction#view'
37
+ )
38
+ }
39
+
40
+ export function validateView(v: unknown): ValidationResult {
41
+ return lexicons.validate('com.atproto.admin.moderationAction#view', v)
42
+ }
43
+
44
+ export interface ViewDetail {
45
+ id: number
46
+ action:
47
+ | 'com.atproto.admin.moderationAction#takedown'
48
+ | 'com.atproto.admin.moderationAction#flag'
49
+ | 'com.atproto.admin.moderationAction#acknowledge'
50
+ | (string & {})
51
+ subject:
52
+ | ComAtprotoAdminRepo.View
53
+ | ComAtprotoAdminRecord.View
54
+ | { $type: string; [k: string]: unknown }
55
+ reason: string
56
+ createdBy: string
57
+ createdAt: string
58
+ reversal?: Reversal
59
+ resolvedReports: ComAtprotoAdminModerationReport.View[]
60
+ [k: string]: unknown
61
+ }
62
+
63
+ export function isViewDetail(v: unknown): v is ViewDetail {
64
+ return (
65
+ isObj(v) &&
66
+ hasProp(v, '$type') &&
67
+ v.$type === 'com.atproto.admin.moderationAction#viewDetail'
68
+ )
69
+ }
70
+
71
+ export function validateViewDetail(v: unknown): ValidationResult {
72
+ return lexicons.validate('com.atproto.admin.moderationAction#viewDetail', v)
73
+ }
74
+
75
+ export interface Reversal {
76
+ reason: string
77
+ createdBy: string
78
+ createdAt: string
79
+ [k: string]: unknown
80
+ }
81
+
82
+ export function isReversal(v: unknown): v is Reversal {
83
+ return (
84
+ isObj(v) &&
85
+ hasProp(v, '$type') &&
86
+ v.$type === 'com.atproto.admin.moderationAction#reversal'
87
+ )
88
+ }
89
+
90
+ export function validateReversal(v: unknown): ValidationResult {
91
+ return lexicons.validate('com.atproto.admin.moderationAction#reversal', v)
92
+ }
93
+
94
+ /** Moderation action type: Takedown. Indicates that content should not be served by the PDS. */
95
+ export const TAKEDOWN = 'com.atproto.admin.moderationAction#takedown'
96
+ /** Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served. */
97
+ export const FLAG = 'com.atproto.admin.moderationAction#flag'
98
+ /** Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules. */
99
+ export const ACKNOWLEDGE = 'com.atproto.admin.moderationAction#acknowledge'
@@ -0,0 +1,64 @@
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
+ }
@@ -0,0 +1,89 @@
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 ComAtprotoAdminModerationAction from './moderationAction'
9
+ import * as ComAtprotoAdminModerationReport from './moderationReport'
10
+
11
+ export interface View {
12
+ uri: string
13
+ cid: string
14
+ value: {}
15
+ indexedAt: string
16
+ moderation: Moderation
17
+ repo: ComAtprotoAdminRepo.View
18
+ [k: string]: unknown
19
+ }
20
+
21
+ export function isView(v: unknown): v is View {
22
+ return (
23
+ isObj(v) &&
24
+ hasProp(v, '$type') &&
25
+ v.$type === 'com.atproto.admin.record#view'
26
+ )
27
+ }
28
+
29
+ export function validateView(v: unknown): ValidationResult {
30
+ return lexicons.validate('com.atproto.admin.record#view', v)
31
+ }
32
+
33
+ export interface ViewDetail {
34
+ uri: string
35
+ cid: string
36
+ value: {}
37
+ indexedAt: string
38
+ moderation: ModerationDetail
39
+ repo: ComAtprotoAdminRepo.View
40
+ [k: string]: unknown
41
+ }
42
+
43
+ export function isViewDetail(v: unknown): v is ViewDetail {
44
+ return (
45
+ isObj(v) &&
46
+ hasProp(v, '$type') &&
47
+ v.$type === 'com.atproto.admin.record#viewDetail'
48
+ )
49
+ }
50
+
51
+ export function validateViewDetail(v: unknown): ValidationResult {
52
+ return lexicons.validate('com.atproto.admin.record#viewDetail', v)
53
+ }
54
+
55
+ export interface Moderation {
56
+ takedownId?: number
57
+ [k: string]: unknown
58
+ }
59
+
60
+ export function isModeration(v: unknown): v is Moderation {
61
+ return (
62
+ isObj(v) &&
63
+ hasProp(v, '$type') &&
64
+ v.$type === 'com.atproto.admin.record#moderation'
65
+ )
66
+ }
67
+
68
+ export function validateModeration(v: unknown): ValidationResult {
69
+ return lexicons.validate('com.atproto.admin.record#moderation', v)
70
+ }
71
+
72
+ export interface ModerationDetail {
73
+ actions: ComAtprotoAdminModerationAction.View[]
74
+ reports: ComAtprotoAdminModerationReport.View[]
75
+ takedownId?: number
76
+ [k: string]: unknown
77
+ }
78
+
79
+ export function isModerationDetail(v: unknown): v is ModerationDetail {
80
+ return (
81
+ isObj(v) &&
82
+ hasProp(v, '$type') &&
83
+ v.$type === 'com.atproto.admin.record#moderationDetail'
84
+ )
85
+ }
86
+
87
+ export function validateModerationDetail(v: unknown): ValidationResult {
88
+ return lexicons.validate('com.atproto.admin.record#moderationDetail', v)
89
+ }