@atproto/api 0.0.4 → 0.0.6

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 (105) hide show
  1. package/dist/client/lexicons.d.ts +0 -3
  2. package/dist/client/types/app/bsky/actor/getProfile.d.ts +3 -0
  3. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +5 -0
  4. package/dist/client/types/app/bsky/actor/profile.d.ts +3 -0
  5. package/dist/client/types/app/bsky/actor/ref.d.ts +7 -0
  6. package/dist/client/types/app/bsky/actor/search.d.ts +3 -0
  7. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +3 -0
  8. package/dist/client/types/app/bsky/embed/external.d.ts +9 -0
  9. package/dist/client/types/app/bsky/embed/images.d.ts +9 -0
  10. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +9 -0
  11. package/dist/client/types/app/bsky/feed/getPostThread.d.ts +5 -0
  12. package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -0
  13. package/dist/client/types/app/bsky/feed/getVotes.d.ts +3 -0
  14. package/dist/client/types/app/bsky/feed/post.d.ts +13 -1
  15. package/dist/client/types/app/bsky/feed/repost.d.ts +3 -0
  16. package/dist/client/types/app/bsky/feed/trend.d.ts +3 -0
  17. package/dist/client/types/app/bsky/feed/vote.d.ts +3 -0
  18. package/dist/client/types/app/bsky/graph/assertion.d.ts +3 -0
  19. package/dist/client/types/app/bsky/graph/confirmation.d.ts +3 -0
  20. package/dist/client/types/app/bsky/graph/follow.d.ts +3 -0
  21. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +5 -0
  22. package/dist/client/types/app/bsky/graph/getFollowers.d.ts +3 -0
  23. package/dist/client/types/app/bsky/graph/getFollows.d.ts +3 -0
  24. package/dist/client/types/app/bsky/graph/getMembers.d.ts +3 -0
  25. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +3 -0
  26. package/dist/client/types/app/bsky/graph/getMutes.d.ts +3 -0
  27. package/dist/client/types/app/bsky/notification/list.d.ts +3 -0
  28. package/dist/client/types/app/bsky/system/declRef.d.ts +3 -0
  29. package/dist/client/types/app/bsky/system/declaration.d.ts +3 -0
  30. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +7 -0
  31. package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -0
  32. package/dist/client/types/com/atproto/repo/strongRef.d.ts +3 -0
  33. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +3 -0
  34. package/dist/client/util.d.ts +2 -0
  35. package/dist/index.js +571 -23
  36. package/dist/index.js.map +4 -4
  37. package/package.json +1 -1
  38. package/src/client/lexicons.ts +0 -3
  39. package/src/client/types/app/bsky/actor/createScene.ts +3 -0
  40. package/src/client/types/app/bsky/actor/getProfile.ts +15 -0
  41. package/src/client/types/app/bsky/actor/getSuggestions.ts +27 -0
  42. package/src/client/types/app/bsky/actor/profile.ts +17 -0
  43. package/src/client/types/app/bsky/actor/ref.ts +37 -0
  44. package/src/client/types/app/bsky/actor/search.ts +13 -0
  45. package/src/client/types/app/bsky/actor/searchTypeahead.ts +15 -0
  46. package/src/client/types/app/bsky/actor/updateProfile.ts +3 -0
  47. package/src/client/types/app/bsky/embed/external.ts +53 -0
  48. package/src/client/types/app/bsky/embed/images.ts +51 -0
  49. package/src/client/types/app/bsky/feed/feedViewPost.ts +52 -0
  50. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +3 -0
  51. package/src/client/types/app/bsky/feed/getPostThread.ts +27 -0
  52. package/src/client/types/app/bsky/feed/getRepostedBy.ts +15 -0
  53. package/src/client/types/app/bsky/feed/getTimeline.ts +3 -0
  54. package/src/client/types/app/bsky/feed/getVotes.ts +13 -0
  55. package/src/client/types/app/bsky/feed/post.ts +69 -1
  56. package/src/client/types/app/bsky/feed/repost.ts +16 -0
  57. package/src/client/types/app/bsky/feed/setVote.ts +3 -0
  58. package/src/client/types/app/bsky/feed/trend.ts +16 -0
  59. package/src/client/types/app/bsky/feed/vote.ts +15 -0
  60. package/src/client/types/app/bsky/graph/assertCreator.ts +4 -0
  61. package/src/client/types/app/bsky/graph/assertMember.ts +4 -0
  62. package/src/client/types/app/bsky/graph/assertion.ts +16 -0
  63. package/src/client/types/app/bsky/graph/confirmation.ts +16 -0
  64. package/src/client/types/app/bsky/graph/follow.ts +16 -0
  65. package/src/client/types/app/bsky/graph/getAssertions.ts +27 -0
  66. package/src/client/types/app/bsky/graph/getFollowers.ts +15 -0
  67. package/src/client/types/app/bsky/graph/getFollows.ts +15 -0
  68. package/src/client/types/app/bsky/graph/getMembers.ts +15 -0
  69. package/src/client/types/app/bsky/graph/getMemberships.ts +15 -0
  70. package/src/client/types/app/bsky/graph/getMutes.ts +15 -0
  71. package/src/client/types/app/bsky/graph/mute.ts +3 -0
  72. package/src/client/types/app/bsky/graph/unmute.ts +3 -0
  73. package/src/client/types/app/bsky/notification/getCount.ts +3 -0
  74. package/src/client/types/app/bsky/notification/list.ts +15 -0
  75. package/src/client/types/app/bsky/notification/updateSeen.ts +3 -0
  76. package/src/client/types/app/bsky/system/actorScene.ts +4 -0
  77. package/src/client/types/app/bsky/system/actorUser.ts +4 -0
  78. package/src/client/types/app/bsky/system/declRef.ts +17 -0
  79. package/src/client/types/app/bsky/system/declaration.ts +17 -0
  80. package/src/client/types/com/atproto/account/create.ts +3 -0
  81. package/src/client/types/com/atproto/account/createInviteCode.ts +3 -0
  82. package/src/client/types/com/atproto/account/delete.ts +3 -0
  83. package/src/client/types/com/atproto/account/get.ts +3 -0
  84. package/src/client/types/com/atproto/account/requestPasswordReset.ts +3 -0
  85. package/src/client/types/com/atproto/account/resetPassword.ts +3 -0
  86. package/src/client/types/com/atproto/blob/upload.ts +3 -0
  87. package/src/client/types/com/atproto/handle/resolve.ts +3 -0
  88. package/src/client/types/com/atproto/repo/batchWrite.ts +39 -0
  89. package/src/client/types/com/atproto/repo/createRecord.ts +3 -0
  90. package/src/client/types/com/atproto/repo/deleteRecord.ts +3 -0
  91. package/src/client/types/com/atproto/repo/describe.ts +3 -0
  92. package/src/client/types/com/atproto/repo/getRecord.ts +3 -0
  93. package/src/client/types/com/atproto/repo/listRecords.ts +15 -0
  94. package/src/client/types/com/atproto/repo/putRecord.ts +3 -0
  95. package/src/client/types/com/atproto/repo/strongRef.ts +17 -0
  96. package/src/client/types/com/atproto/server/getAccountsConfig.ts +15 -0
  97. package/src/client/types/com/atproto/session/create.ts +3 -0
  98. package/src/client/types/com/atproto/session/delete.ts +3 -0
  99. package/src/client/types/com/atproto/session/get.ts +3 -0
  100. package/src/client/types/com/atproto/session/refresh.ts +3 -0
  101. package/src/client/types/com/atproto/sync/getRepo.ts +3 -0
  102. package/src/client/types/com/atproto/sync/getRoot.ts +3 -0
  103. package/src/client/types/com/atproto/sync/updateRepo.ts +3 -0
  104. package/src/client/util.ts +13 -0
  105. package/tsconfig.build.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "codegen": "lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
@@ -2140,9 +2140,6 @@ export const schemaDict = {
2140
2140
  downvote: {
2141
2141
  type: 'string',
2142
2142
  },
2143
- muted: {
2144
- type: 'boolean',
2145
- },
2146
2143
  },
2147
2144
  },
2148
2145
  },
@@ -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 {}
@@ -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 {
@@ -49,3 +52,15 @@ export interface MyState {
49
52
  muted?: boolean
50
53
  [k: string]: unknown
51
54
  }
55
+
56
+ export function isMyState(v: unknown): v is MyState {
57
+ return (
58
+ isObj(v) &&
59
+ hasProp(v, '$type') &&
60
+ v.$type === 'app.bsky.actor.getProfile#myState'
61
+ )
62
+ }
63
+
64
+ export function validateMyState(v: unknown): ValidationResult {
65
+ return lexicons.validate('app.bsky.actor.getProfile#myState', v)
66
+ }
@@ -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 {
@@ -45,7 +48,31 @@ export interface Actor {
45
48
  [k: string]: unknown
46
49
  }
47
50
 
51
+ export function isActor(v: unknown): v is Actor {
52
+ return (
53
+ isObj(v) &&
54
+ hasProp(v, '$type') &&
55
+ v.$type === 'app.bsky.actor.getSuggestions#actor'
56
+ )
57
+ }
58
+
59
+ export function validateActor(v: unknown): ValidationResult {
60
+ return lexicons.validate('app.bsky.actor.getSuggestions#actor', v)
61
+ }
62
+
48
63
  export interface MyState {
49
64
  follow?: string
50
65
  [k: string]: unknown
51
66
  }
67
+
68
+ export function isMyState(v: unknown): v is MyState {
69
+ return (
70
+ isObj(v) &&
71
+ hasProp(v, '$type') &&
72
+ v.$type === 'app.bsky.actor.getSuggestions#myState'
73
+ )
74
+ }
75
+
76
+ export function validateMyState(v: unknown): ValidationResult {
77
+ return lexicons.validate('app.bsky.actor.getSuggestions#myState', v)
78
+ }
@@ -1,6 +1,10 @@
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
  export interface Record {
5
9
  displayName: string
6
10
  description?: string
@@ -8,3 +12,16 @@ export interface Record {
8
12
  banner?: { cid: string; mimeType: string; [k: string]: unknown }
9
13
  [k: string]: unknown
10
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.actor.profile#main' ||
21
+ v.$type === 'app.bsky.actor.profile')
22
+ )
23
+ }
24
+
25
+ export function validateRecord(v: unknown): ValidationResult {
26
+ return lexicons.validate('app.bsky.actor.profile#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 AppBskySystemDeclRef from '../system/declRef'
5
8
 
6
9
  export interface Main {
@@ -9,6 +12,18 @@ export interface Main {
9
12
  [k: string]: unknown
10
13
  }
11
14
 
15
+ export function isMain(v: unknown): v is Main {
16
+ return (
17
+ isObj(v) &&
18
+ hasProp(v, '$type') &&
19
+ (v.$type === 'app.bsky.actor.ref#main' || v.$type === 'app.bsky.actor.ref')
20
+ )
21
+ }
22
+
23
+ export function validateMain(v: unknown): ValidationResult {
24
+ return lexicons.validate('app.bsky.actor.ref#main', v)
25
+ }
26
+
12
27
  export interface WithInfo {
13
28
  did: string
14
29
  declaration: AppBskySystemDeclRef.Main
@@ -19,7 +34,29 @@ export interface WithInfo {
19
34
  [k: string]: unknown
20
35
  }
21
36
 
37
+ export function isWithInfo(v: unknown): v is WithInfo {
38
+ return (
39
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.ref#withInfo'
40
+ )
41
+ }
42
+
43
+ export function validateWithInfo(v: unknown): ValidationResult {
44
+ return lexicons.validate('app.bsky.actor.ref#withInfo', v)
45
+ }
46
+
22
47
  export interface ViewerState {
23
48
  muted?: boolean
24
49
  [k: string]: unknown
25
50
  }
51
+
52
+ export function isViewerState(v: unknown): v is ViewerState {
53
+ return (
54
+ isObj(v) &&
55
+ hasProp(v, '$type') &&
56
+ v.$type === 'app.bsky.actor.ref#viewerState'
57
+ )
58
+ }
59
+
60
+ export function validateViewerState(v: unknown): ValidationResult {
61
+ return lexicons.validate('app.bsky.actor.ref#viewerState', 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 AppBskySystemDeclRef from '../system/declRef'
6
9
 
7
10
  export interface QueryParams {
@@ -44,3 +47,13 @@ export interface User {
44
47
  indexedAt?: string
45
48
  [k: string]: unknown
46
49
  }
50
+
51
+ export function isUser(v: unknown): v is User {
52
+ return (
53
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.search#user'
54
+ )
55
+ }
56
+
57
+ export function validateUser(v: unknown): ValidationResult {
58
+ return lexicons.validate('app.bsky.actor.search#user', v)
59
+ }
@@ -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 {
@@ -40,3 +43,15 @@ export interface User {
40
43
  avatar?: string
41
44
  [k: string]: unknown
42
45
  }
46
+
47
+ export function isUser(v: unknown): v is User {
48
+ return (
49
+ isObj(v) &&
50
+ hasProp(v, '$type') &&
51
+ v.$type === 'app.bsky.actor.searchTypeahead#user'
52
+ )
53
+ }
54
+
55
+ export function validateUser(v: unknown): ValidationResult {
56
+ return lexicons.validate('app.bsky.actor.searchTypeahead#user', v)
57
+ }
@@ -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
 
6
9
  export interface QueryParams {}
7
10
 
@@ -1,11 +1,28 @@
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
  export interface Main {
5
9
  external: External
6
10
  [k: string]: unknown
7
11
  }
8
12
 
13
+ export function isMain(v: unknown): v is Main {
14
+ return (
15
+ isObj(v) &&
16
+ hasProp(v, '$type') &&
17
+ (v.$type === 'app.bsky.embed.external#main' ||
18
+ v.$type === 'app.bsky.embed.external')
19
+ )
20
+ }
21
+
22
+ export function validateMain(v: unknown): ValidationResult {
23
+ return lexicons.validate('app.bsky.embed.external#main', v)
24
+ }
25
+
9
26
  export interface External {
10
27
  uri: string
11
28
  title: string
@@ -14,11 +31,35 @@ export interface External {
14
31
  [k: string]: unknown
15
32
  }
16
33
 
34
+ export function isExternal(v: unknown): v is External {
35
+ return (
36
+ isObj(v) &&
37
+ hasProp(v, '$type') &&
38
+ v.$type === 'app.bsky.embed.external#external'
39
+ )
40
+ }
41
+
42
+ export function validateExternal(v: unknown): ValidationResult {
43
+ return lexicons.validate('app.bsky.embed.external#external', v)
44
+ }
45
+
17
46
  export interface Presented {
18
47
  external: PresentedExternal
19
48
  [k: string]: unknown
20
49
  }
21
50
 
51
+ export function isPresented(v: unknown): v is Presented {
52
+ return (
53
+ isObj(v) &&
54
+ hasProp(v, '$type') &&
55
+ v.$type === 'app.bsky.embed.external#presented'
56
+ )
57
+ }
58
+
59
+ export function validatePresented(v: unknown): ValidationResult {
60
+ return lexicons.validate('app.bsky.embed.external#presented', v)
61
+ }
62
+
22
63
  export interface PresentedExternal {
23
64
  uri: string
24
65
  title: string
@@ -26,3 +67,15 @@ export interface PresentedExternal {
26
67
  thumb?: string
27
68
  [k: string]: unknown
28
69
  }
70
+
71
+ export function isPresentedExternal(v: unknown): v is PresentedExternal {
72
+ return (
73
+ isObj(v) &&
74
+ hasProp(v, '$type') &&
75
+ v.$type === 'app.bsky.embed.external#presentedExternal'
76
+ )
77
+ }
78
+
79
+ export function validatePresentedExternal(v: unknown): ValidationResult {
80
+ return lexicons.validate('app.bsky.embed.external#presentedExternal', v)
81
+ }
@@ -1,25 +1,76 @@
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
  export interface Main {
5
9
  images: Image[]
6
10
  [k: string]: unknown
7
11
  }
8
12
 
13
+ export function isMain(v: unknown): v is Main {
14
+ return (
15
+ isObj(v) &&
16
+ hasProp(v, '$type') &&
17
+ (v.$type === 'app.bsky.embed.images#main' ||
18
+ v.$type === 'app.bsky.embed.images')
19
+ )
20
+ }
21
+
22
+ export function validateMain(v: unknown): ValidationResult {
23
+ return lexicons.validate('app.bsky.embed.images#main', v)
24
+ }
25
+
9
26
  export interface Image {
10
27
  image: { cid: string; mimeType: string; [k: string]: unknown }
11
28
  alt: string
12
29
  [k: string]: unknown
13
30
  }
14
31
 
32
+ export function isImage(v: unknown): v is Image {
33
+ return (
34
+ isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#image'
35
+ )
36
+ }
37
+
38
+ export function validateImage(v: unknown): ValidationResult {
39
+ return lexicons.validate('app.bsky.embed.images#image', v)
40
+ }
41
+
15
42
  export interface Presented {
16
43
  images: PresentedImage[]
17
44
  [k: string]: unknown
18
45
  }
19
46
 
47
+ export function isPresented(v: unknown): v is Presented {
48
+ return (
49
+ isObj(v) &&
50
+ hasProp(v, '$type') &&
51
+ v.$type === 'app.bsky.embed.images#presented'
52
+ )
53
+ }
54
+
55
+ export function validatePresented(v: unknown): ValidationResult {
56
+ return lexicons.validate('app.bsky.embed.images#presented', v)
57
+ }
58
+
20
59
  export interface PresentedImage {
21
60
  thumb: string
22
61
  fullsize: string
23
62
  alt: string
24
63
  [k: string]: unknown
25
64
  }
65
+
66
+ export function isPresentedImage(v: unknown): v is PresentedImage {
67
+ return (
68
+ isObj(v) &&
69
+ hasProp(v, '$type') &&
70
+ v.$type === 'app.bsky.embed.images#presentedImage'
71
+ )
72
+ }
73
+
74
+ export function validatePresentedImage(v: unknown): ValidationResult {
75
+ return lexicons.validate('app.bsky.embed.images#presentedImage', v)
76
+ }
@@ -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
+ }