@atproto/api 0.0.3 → 0.0.5

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 (109) hide show
  1. package/dist/client/index.d.ts +9 -0
  2. package/dist/client/lexicons.d.ts +129 -0
  3. package/dist/client/types/app/bsky/actor/getProfile.d.ts +4 -0
  4. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +5 -0
  5. package/dist/client/types/app/bsky/actor/profile.d.ts +3 -0
  6. package/dist/client/types/app/bsky/actor/ref.d.ts +12 -0
  7. package/dist/client/types/app/bsky/actor/search.d.ts +3 -0
  8. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +3 -0
  9. package/dist/client/types/app/bsky/embed/external.d.ts +9 -0
  10. package/dist/client/types/app/bsky/embed/images.d.ts +9 -0
  11. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +9 -0
  12. package/dist/client/types/app/bsky/feed/getPostThread.d.ts +5 -0
  13. package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -0
  14. package/dist/client/types/app/bsky/feed/getVotes.d.ts +3 -0
  15. package/dist/client/types/app/bsky/feed/post.d.ts +13 -0
  16. package/dist/client/types/app/bsky/feed/repost.d.ts +3 -0
  17. package/dist/client/types/app/bsky/feed/trend.d.ts +3 -0
  18. package/dist/client/types/app/bsky/feed/vote.d.ts +3 -0
  19. package/dist/client/types/app/bsky/graph/assertion.d.ts +3 -0
  20. package/dist/client/types/app/bsky/graph/confirmation.d.ts +3 -0
  21. package/dist/client/types/app/bsky/graph/follow.d.ts +3 -0
  22. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +5 -0
  23. package/dist/client/types/app/bsky/graph/getFollowers.d.ts +3 -0
  24. package/dist/client/types/app/bsky/graph/getFollows.d.ts +3 -0
  25. package/dist/client/types/app/bsky/graph/getMembers.d.ts +3 -0
  26. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +3 -0
  27. package/dist/client/types/app/bsky/graph/getMutes.d.ts +32 -0
  28. package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
  29. package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
  30. package/dist/client/types/app/bsky/notification/list.d.ts +3 -0
  31. package/dist/client/types/app/bsky/system/declRef.d.ts +3 -0
  32. package/dist/client/types/app/bsky/system/declaration.d.ts +3 -0
  33. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +7 -0
  34. package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -0
  35. package/dist/client/types/com/atproto/repo/strongRef.d.ts +3 -0
  36. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +3 -0
  37. package/dist/client/util.d.ts +2 -0
  38. package/dist/index.js +713 -34
  39. package/dist/index.js.map +4 -4
  40. package/package.json +1 -1
  41. package/src/client/index.ts +39 -0
  42. package/src/client/lexicons.ts +138 -9
  43. package/src/client/types/app/bsky/actor/createScene.ts +3 -0
  44. package/src/client/types/app/bsky/actor/getProfile.ts +16 -0
  45. package/src/client/types/app/bsky/actor/getSuggestions.ts +27 -0
  46. package/src/client/types/app/bsky/actor/profile.ts +17 -0
  47. package/src/client/types/app/bsky/actor/ref.ts +43 -0
  48. package/src/client/types/app/bsky/actor/search.ts +13 -0
  49. package/src/client/types/app/bsky/actor/searchTypeahead.ts +15 -0
  50. package/src/client/types/app/bsky/actor/updateProfile.ts +3 -0
  51. package/src/client/types/app/bsky/embed/external.ts +53 -0
  52. package/src/client/types/app/bsky/embed/images.ts +51 -0
  53. package/src/client/types/app/bsky/feed/feedViewPost.ts +52 -0
  54. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +3 -0
  55. package/src/client/types/app/bsky/feed/getPostThread.ts +27 -0
  56. package/src/client/types/app/bsky/feed/getRepostedBy.ts +15 -0
  57. package/src/client/types/app/bsky/feed/getTimeline.ts +3 -0
  58. package/src/client/types/app/bsky/feed/getVotes.ts +13 -0
  59. package/src/client/types/app/bsky/feed/post.ts +70 -0
  60. package/src/client/types/app/bsky/feed/repost.ts +16 -0
  61. package/src/client/types/app/bsky/feed/setVote.ts +3 -0
  62. package/src/client/types/app/bsky/feed/trend.ts +16 -0
  63. package/src/client/types/app/bsky/feed/vote.ts +15 -0
  64. package/src/client/types/app/bsky/graph/assertCreator.ts +4 -0
  65. package/src/client/types/app/bsky/graph/assertMember.ts +4 -0
  66. package/src/client/types/app/bsky/graph/assertion.ts +16 -0
  67. package/src/client/types/app/bsky/graph/confirmation.ts +16 -0
  68. package/src/client/types/app/bsky/graph/follow.ts +16 -0
  69. package/src/client/types/app/bsky/graph/getAssertions.ts +27 -0
  70. package/src/client/types/app/bsky/graph/getFollowers.ts +15 -0
  71. package/src/client/types/app/bsky/graph/getFollows.ts +15 -0
  72. package/src/client/types/app/bsky/graph/getMembers.ts +15 -0
  73. package/src/client/types/app/bsky/graph/getMemberships.ts +15 -0
  74. package/src/client/types/app/bsky/graph/getMutes.ts +58 -0
  75. package/src/client/types/app/bsky/graph/mute.ts +31 -0
  76. package/src/client/types/app/bsky/graph/unmute.ts +31 -0
  77. package/src/client/types/app/bsky/notification/getCount.ts +3 -0
  78. package/src/client/types/app/bsky/notification/list.ts +15 -0
  79. package/src/client/types/app/bsky/notification/updateSeen.ts +3 -0
  80. package/src/client/types/app/bsky/system/actorScene.ts +4 -0
  81. package/src/client/types/app/bsky/system/actorUser.ts +4 -0
  82. package/src/client/types/app/bsky/system/declRef.ts +17 -0
  83. package/src/client/types/app/bsky/system/declaration.ts +17 -0
  84. package/src/client/types/com/atproto/account/create.ts +3 -0
  85. package/src/client/types/com/atproto/account/createInviteCode.ts +3 -0
  86. package/src/client/types/com/atproto/account/delete.ts +3 -0
  87. package/src/client/types/com/atproto/account/get.ts +3 -0
  88. package/src/client/types/com/atproto/account/requestPasswordReset.ts +3 -0
  89. package/src/client/types/com/atproto/account/resetPassword.ts +3 -0
  90. package/src/client/types/com/atproto/blob/upload.ts +3 -0
  91. package/src/client/types/com/atproto/handle/resolve.ts +3 -0
  92. package/src/client/types/com/atproto/repo/batchWrite.ts +39 -0
  93. package/src/client/types/com/atproto/repo/createRecord.ts +3 -0
  94. package/src/client/types/com/atproto/repo/deleteRecord.ts +3 -0
  95. package/src/client/types/com/atproto/repo/describe.ts +3 -0
  96. package/src/client/types/com/atproto/repo/getRecord.ts +3 -0
  97. package/src/client/types/com/atproto/repo/listRecords.ts +15 -0
  98. package/src/client/types/com/atproto/repo/putRecord.ts +3 -0
  99. package/src/client/types/com/atproto/repo/strongRef.ts +17 -0
  100. package/src/client/types/com/atproto/server/getAccountsConfig.ts +15 -0
  101. package/src/client/types/com/atproto/session/create.ts +3 -0
  102. package/src/client/types/com/atproto/session/delete.ts +3 -0
  103. package/src/client/types/com/atproto/session/get.ts +3 -0
  104. package/src/client/types/com/atproto/session/refresh.ts +3 -0
  105. package/src/client/types/com/atproto/sync/getRepo.ts +3 -0
  106. package/src/client/types/com/atproto/sync/getRoot.ts +3 -0
  107. package/src/client/types/com/atproto/sync/updateRepo.ts +3 -0
  108. package/src/client/util.ts +13 -0
  109. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as AppBskyFeedPost from './post'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
 
@@ -11,20 +14,69 @@ export interface Main {
11
14
  [k: string]: unknown
12
15
  }
13
16
 
17
+ export function isMain(v: unknown): v is Main {
18
+ return (
19
+ isObj(v) &&
20
+ hasProp(v, '$type') &&
21
+ (v.$type === 'app.bsky.feed.feedViewPost#main' ||
22
+ v.$type === 'app.bsky.feed.feedViewPost')
23
+ )
24
+ }
25
+
26
+ export function validateMain(v: unknown): ValidationResult {
27
+ return lexicons.validate('app.bsky.feed.feedViewPost#main', v)
28
+ }
29
+
14
30
  export interface ReplyRef {
15
31
  root: AppBskyFeedPost.View
16
32
  parent: AppBskyFeedPost.View
17
33
  [k: string]: unknown
18
34
  }
19
35
 
36
+ export function isReplyRef(v: unknown): v is ReplyRef {
37
+ return (
38
+ isObj(v) &&
39
+ hasProp(v, '$type') &&
40
+ v.$type === 'app.bsky.feed.feedViewPost#replyRef'
41
+ )
42
+ }
43
+
44
+ export function validateReplyRef(v: unknown): ValidationResult {
45
+ return lexicons.validate('app.bsky.feed.feedViewPost#replyRef', v)
46
+ }
47
+
20
48
  export interface ReasonTrend {
21
49
  by: AppBskyActorRef.WithInfo
22
50
  indexedAt: string
23
51
  [k: string]: unknown
24
52
  }
25
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
+
26
66
  export interface ReasonRepost {
27
67
  by: AppBskyActorRef.WithInfo
28
68
  indexedAt: string
29
69
  [k: string]: unknown
30
70
  }
71
+
72
+ export function isReasonRepost(v: unknown): v is ReasonRepost {
73
+ return (
74
+ isObj(v) &&
75
+ hasProp(v, '$type') &&
76
+ v.$type === 'app.bsky.feed.feedViewPost#reasonRepost'
77
+ )
78
+ }
79
+
80
+ export function validateReasonRepost(v: unknown): ValidationResult {
81
+ return lexicons.validate('app.bsky.feed.feedViewPost#reasonRepost', v)
82
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyFeedFeedViewPost from './feedViewPost'
6
9
 
7
10
  export interface QueryParams {
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyFeedPost from './post'
6
9
 
7
10
  export interface QueryParams {
@@ -56,8 +59,32 @@ export interface ThreadViewPost {
56
59
  [k: string]: unknown
57
60
  }
58
61
 
62
+ export function isThreadViewPost(v: unknown): v is ThreadViewPost {
63
+ return (
64
+ isObj(v) &&
65
+ hasProp(v, '$type') &&
66
+ v.$type === 'app.bsky.feed.getPostThread#threadViewPost'
67
+ )
68
+ }
69
+
70
+ export function validateThreadViewPost(v: unknown): ValidationResult {
71
+ return lexicons.validate('app.bsky.feed.getPostThread#threadViewPost', v)
72
+ }
73
+
59
74
  export interface NotFoundPost {
60
75
  uri: string
61
76
  notFound: true
62
77
  [k: string]: unknown
63
78
  }
79
+
80
+ export function isNotFoundPost(v: unknown): v is NotFoundPost {
81
+ return (
82
+ isObj(v) &&
83
+ hasProp(v, '$type') &&
84
+ v.$type === 'app.bsky.feed.getPostThread#notFoundPost'
85
+ )
86
+ }
87
+
88
+ export function validateNotFoundPost(v: unknown): ValidationResult {
89
+ return lexicons.validate('app.bsky.feed.getPostThread#notFoundPost', v)
90
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskySystemDeclRef from '../system/declRef'
6
9
 
7
10
  export interface QueryParams {
@@ -47,3 +50,15 @@ export interface RepostedBy {
47
50
  indexedAt: string
48
51
  [k: string]: unknown
49
52
  }
53
+
54
+ export function isRepostedBy(v: unknown): v is RepostedBy {
55
+ return (
56
+ isObj(v) &&
57
+ hasProp(v, '$type') &&
58
+ v.$type === 'app.bsky.feed.getRepostedBy#repostedBy'
59
+ )
60
+ }
61
+
62
+ export function validateRepostedBy(v: unknown): ValidationResult {
63
+ return lexicons.validate('app.bsky.feed.getRepostedBy#repostedBy', v)
64
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyFeedFeedViewPost from './feedViewPost'
6
9
 
7
10
  export interface QueryParams {
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
 
7
10
  export interface QueryParams {
@@ -45,3 +48,13 @@ export interface Vote {
45
48
  actor: AppBskyActorRef.WithInfo
46
49
  [k: string]: unknown
47
50
  }
51
+
52
+ export function isVote(v: unknown): v is Vote {
53
+ return (
54
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getVotes#vote'
55
+ )
56
+ }
57
+
58
+ export function validateVote(v: unknown): ValidationResult {
59
+ return lexicons.validate('app.bsky.feed.getVotes#vote', v)
60
+ }
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as AppBskyEmbedImages from '../embed/images'
5
8
  import * as AppBskyEmbedExternal from '../embed/external'
6
9
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
@@ -18,12 +21,34 @@ export interface Record {
18
21
  [k: string]: unknown
19
22
  }
20
23
 
24
+ export function isRecord(v: unknown): v is Record {
25
+ return (
26
+ isObj(v) &&
27
+ hasProp(v, '$type') &&
28
+ (v.$type === 'app.bsky.feed.post#main' || v.$type === 'app.bsky.feed.post')
29
+ )
30
+ }
31
+
32
+ export function validateRecord(v: unknown): ValidationResult {
33
+ return lexicons.validate('app.bsky.feed.post#main', v)
34
+ }
35
+
21
36
  export interface ReplyRef {
22
37
  root: ComAtprotoRepoStrongRef.Main
23
38
  parent: ComAtprotoRepoStrongRef.Main
24
39
  [k: string]: unknown
25
40
  }
26
41
 
42
+ export function isReplyRef(v: unknown): v is ReplyRef {
43
+ return (
44
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#replyRef'
45
+ )
46
+ }
47
+
48
+ export function validateReplyRef(v: unknown): ValidationResult {
49
+ return lexicons.validate('app.bsky.feed.post#replyRef', v)
50
+ }
51
+
27
52
  export interface Entity {
28
53
  index: TextSlice
29
54
  /** Expected values are 'mention', 'hashtag', and 'link'. */
@@ -32,12 +57,35 @@ export interface Entity {
32
57
  [k: string]: unknown
33
58
  }
34
59
 
60
+ export function isEntity(v: unknown): v is Entity {
61
+ return (
62
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#entity'
63
+ )
64
+ }
65
+
66
+ export function validateEntity(v: unknown): ValidationResult {
67
+ return lexicons.validate('app.bsky.feed.post#entity', v)
68
+ }
69
+
70
+ /** A text segment. Start is inclusive, end is exclusive. */
35
71
  export interface TextSlice {
36
72
  start: number
37
73
  end: number
38
74
  [k: string]: unknown
39
75
  }
40
76
 
77
+ export function isTextSlice(v: unknown): v is TextSlice {
78
+ return (
79
+ isObj(v) &&
80
+ hasProp(v, '$type') &&
81
+ v.$type === 'app.bsky.feed.post#textSlice'
82
+ )
83
+ }
84
+
85
+ export function validateTextSlice(v: unknown): ValidationResult {
86
+ return lexicons.validate('app.bsky.feed.post#textSlice', v)
87
+ }
88
+
41
89
  export interface View {
42
90
  uri: string
43
91
  cid: string
@@ -56,9 +104,31 @@ export interface View {
56
104
  [k: string]: unknown
57
105
  }
58
106
 
107
+ export function isView(v: unknown): v is View {
108
+ return (
109
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#view'
110
+ )
111
+ }
112
+
113
+ export function validateView(v: unknown): ValidationResult {
114
+ return lexicons.validate('app.bsky.feed.post#view', v)
115
+ }
116
+
59
117
  export interface ViewerState {
60
118
  repost?: string
61
119
  upvote?: string
62
120
  downvote?: string
63
121
  [k: string]: unknown
64
122
  }
123
+
124
+ export function isViewerState(v: unknown): v is ViewerState {
125
+ return (
126
+ isObj(v) &&
127
+ hasProp(v, '$type') &&
128
+ v.$type === 'app.bsky.feed.post#viewerState'
129
+ )
130
+ }
131
+
132
+ export function validateViewerState(v: unknown): ValidationResult {
133
+ return lexicons.validate('app.bsky.feed.post#viewerState', v)
134
+ }
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
5
8
 
6
9
  export interface Record {
@@ -8,3 +11,16 @@ export interface Record {
8
11
  createdAt: string
9
12
  [k: string]: unknown
10
13
  }
14
+
15
+ export function isRecord(v: unknown): v is Record {
16
+ return (
17
+ isObj(v) &&
18
+ hasProp(v, '$type') &&
19
+ (v.$type === 'app.bsky.feed.repost#main' ||
20
+ v.$type === 'app.bsky.feed.repost')
21
+ )
22
+ }
23
+
24
+ export function validateRecord(v: unknown): ValidationResult {
25
+ return lexicons.validate('app.bsky.feed.repost#main', v)
26
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
6
9
 
7
10
  export interface QueryParams {}
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
5
8
 
6
9
  export interface Record {
@@ -8,3 +11,16 @@ export interface Record {
8
11
  createdAt: string
9
12
  [k: string]: unknown
10
13
  }
14
+
15
+ export function isRecord(v: unknown): v is Record {
16
+ return (
17
+ isObj(v) &&
18
+ hasProp(v, '$type') &&
19
+ (v.$type === 'app.bsky.feed.trend#main' ||
20
+ v.$type === 'app.bsky.feed.trend')
21
+ )
22
+ }
23
+
24
+ export function validateRecord(v: unknown): ValidationResult {
25
+ return lexicons.validate('app.bsky.feed.trend#main', v)
26
+ }
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
5
8
 
6
9
  export interface Record {
@@ -9,3 +12,15 @@ export interface Record {
9
12
  createdAt: string
10
13
  [k: string]: unknown
11
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.feed.vote#main' || v.$type === 'app.bsky.feed.vote')
21
+ )
22
+ }
23
+
24
+ export function validateRecord(v: unknown): ValidationResult {
25
+ return lexicons.validate('app.bsky.feed.vote#main', v)
26
+ }
@@ -1,5 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+
4
8
  /** Assertion type: Creator. Defined for app.bsky.graph.assertions's assertion. */
5
9
  export const MAIN = 'app.bsky.graph.assertCreator#main'
@@ -1,5 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+
4
8
  /** Assertion type: Member. Defined for app.bsky.graph.assertions's assertion. */
5
9
  export const MAIN = 'app.bsky.graph.assertMember#main'
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as AppBskyActorRef from '../actor/ref'
5
8
 
6
9
  export interface Record {
@@ -9,3 +12,16 @@ export interface Record {
9
12
  createdAt: string
10
13
  [k: string]: unknown
11
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,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as AppBskyActorRef from '../actor/ref'
5
8
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
6
9
 
@@ -10,3 +13,16 @@ export interface Record {
10
13
  createdAt: string
11
14
  [k: string]: unknown
12
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,6 +1,9 @@
1
1
  /**
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
+ import { ValidationResult } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
4
7
  import * as AppBskyActorRef from '../actor/ref'
5
8
 
6
9
  export interface Record {
@@ -8,3 +11,16 @@ export interface Record {
8
11
  createdAt: string
9
12
  [k: string]: unknown
10
13
  }
14
+
15
+ export function isRecord(v: unknown): v is Record {
16
+ return (
17
+ isObj(v) &&
18
+ hasProp(v, '$type') &&
19
+ (v.$type === 'app.bsky.graph.follow#main' ||
20
+ v.$type === 'app.bsky.graph.follow')
21
+ )
22
+ }
23
+
24
+ export function validateRecord(v: unknown): ValidationResult {
25
+ return lexicons.validate('app.bsky.graph.follow#main', v)
26
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
 
7
10
  export interface QueryParams {
@@ -49,6 +52,18 @@ export interface Assertion {
49
52
  [k: string]: unknown
50
53
  }
51
54
 
55
+ export function isAssertion(v: unknown): v is Assertion {
56
+ return (
57
+ isObj(v) &&
58
+ hasProp(v, '$type') &&
59
+ v.$type === 'app.bsky.graph.getAssertions#assertion'
60
+ )
61
+ }
62
+
63
+ export function validateAssertion(v: unknown): ValidationResult {
64
+ return lexicons.validate('app.bsky.graph.getAssertions#assertion', v)
65
+ }
66
+
52
67
  export interface Confirmation {
53
68
  uri: string
54
69
  cid: string
@@ -56,3 +71,15 @@ export interface Confirmation {
56
71
  createdAt: string
57
72
  [k: string]: unknown
58
73
  }
74
+
75
+ export function isConfirmation(v: unknown): v is Confirmation {
76
+ return (
77
+ isObj(v) &&
78
+ hasProp(v, '$type') &&
79
+ v.$type === 'app.bsky.graph.getAssertions#confirmation'
80
+ )
81
+ }
82
+
83
+ export function validateConfirmation(v: unknown): ValidationResult {
84
+ return lexicons.validate('app.bsky.graph.getAssertions#confirmation', v)
85
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
  import * as AppBskySystemDeclRef from '../system/declRef'
7
10
 
@@ -46,3 +49,15 @@ export interface Follower {
46
49
  indexedAt: string
47
50
  [k: string]: unknown
48
51
  }
52
+
53
+ export function isFollower(v: unknown): v is Follower {
54
+ return (
55
+ isObj(v) &&
56
+ hasProp(v, '$type') &&
57
+ v.$type === 'app.bsky.graph.getFollowers#follower'
58
+ )
59
+ }
60
+
61
+ export function validateFollower(v: unknown): ValidationResult {
62
+ return lexicons.validate('app.bsky.graph.getFollowers#follower', v)
63
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
  import * as AppBskySystemDeclRef from '../system/declRef'
7
10
 
@@ -45,3 +48,15 @@ export interface Follow {
45
48
  indexedAt: string
46
49
  [k: string]: unknown
47
50
  }
51
+
52
+ export function isFollow(v: unknown): v is Follow {
53
+ return (
54
+ isObj(v) &&
55
+ hasProp(v, '$type') &&
56
+ v.$type === 'app.bsky.graph.getFollows#follow'
57
+ )
58
+ }
59
+
60
+ export function validateFollow(v: unknown): ValidationResult {
61
+ return lexicons.validate('app.bsky.graph.getFollows#follow', v)
62
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
  import * as AppBskySystemDeclRef from '../system/declRef'
7
10
 
@@ -45,3 +48,15 @@ export interface Member {
45
48
  indexedAt: string
46
49
  [k: string]: unknown
47
50
  }
51
+
52
+ export function isMember(v: unknown): v is Member {
53
+ return (
54
+ isObj(v) &&
55
+ hasProp(v, '$type') &&
56
+ v.$type === 'app.bsky.graph.getMembers#member'
57
+ )
58
+ }
59
+
60
+ export function validateMember(v: unknown): ValidationResult {
61
+ return lexicons.validate('app.bsky.graph.getMembers#member', v)
62
+ }
@@ -2,6 +2,9 @@
2
2
  * GENERATED CODE - DO NOT MODIFY
3
3
  */
4
4
  import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
5
8
  import * as AppBskyActorRef from '../actor/ref'
6
9
  import * as AppBskySystemDeclRef from '../system/declRef'
7
10
 
@@ -45,3 +48,15 @@ export interface Membership {
45
48
  indexedAt: string
46
49
  [k: string]: unknown
47
50
  }
51
+
52
+ export function isMembership(v: unknown): v is Membership {
53
+ return (
54
+ isObj(v) &&
55
+ hasProp(v, '$type') &&
56
+ v.$type === 'app.bsky.graph.getMemberships#membership'
57
+ )
58
+ }
59
+
60
+ export function validateMembership(v: unknown): ValidationResult {
61
+ return lexicons.validate('app.bsky.graph.getMemberships#membership', v)
62
+ }