@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
@@ -0,0 +1,58 @@
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 AppBskySystemDeclRef from '../system/declRef'
9
+
10
+ export interface QueryParams {
11
+ limit?: number
12
+ before?: string
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ cursor?: string
19
+ mutes: Mute[]
20
+ [k: string]: unknown
21
+ }
22
+
23
+ export interface CallOptions {
24
+ headers?: Headers
25
+ }
26
+
27
+ export interface Response {
28
+ success: boolean
29
+ headers: Headers
30
+ data: OutputSchema
31
+ }
32
+
33
+ export function toKnownErr(e: any) {
34
+ if (e instanceof XRPCError) {
35
+ }
36
+ return e
37
+ }
38
+
39
+ export interface Mute {
40
+ did: string
41
+ declaration: AppBskySystemDeclRef.Main
42
+ handle: string
43
+ displayName?: string
44
+ createdAt: string
45
+ [k: string]: unknown
46
+ }
47
+
48
+ export function isMute(v: unknown): v is Mute {
49
+ return (
50
+ isObj(v) &&
51
+ hasProp(v, '$type') &&
52
+ v.$type === 'app.bsky.graph.getMutes#mute'
53
+ )
54
+ }
55
+
56
+ export function validateMute(v: unknown): ValidationResult {
57
+ return lexicons.validate('app.bsky.graph.getMutes#mute', v)
58
+ }
@@ -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
+
9
+ export interface QueryParams {}
10
+
11
+ export interface InputSchema {
12
+ user: string
13
+ [k: string]: unknown
14
+ }
15
+
16
+ export interface CallOptions {
17
+ headers?: Headers
18
+ qp?: QueryParams
19
+ encoding: 'application/json'
20
+ }
21
+
22
+ export interface Response {
23
+ success: boolean
24
+ headers: Headers
25
+ }
26
+
27
+ export function toKnownErr(e: any) {
28
+ if (e instanceof XRPCError) {
29
+ }
30
+ return e
31
+ }
@@ -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
+
9
+ export interface QueryParams {}
10
+
11
+ export interface InputSchema {
12
+ user: string
13
+ [k: string]: unknown
14
+ }
15
+
16
+ export interface CallOptions {
17
+ headers?: Headers
18
+ qp?: QueryParams
19
+ encoding: 'application/json'
20
+ }
21
+
22
+ export interface Response {
23
+ success: boolean
24
+ headers: Headers
25
+ }
26
+
27
+ export function toKnownErr(e: any) {
28
+ if (e instanceof XRPCError) {
29
+ }
30
+ return e
31
+ }
@@ -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
 
@@ -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 {
@@ -53,3 +56,15 @@ export interface Notification {
53
56
  indexedAt: string
54
57
  [k: string]: unknown
55
58
  }
59
+
60
+ export function isNotification(v: unknown): v is Notification {
61
+ return (
62
+ isObj(v) &&
63
+ hasProp(v, '$type') &&
64
+ v.$type === 'app.bsky.notification.list#notification'
65
+ )
66
+ }
67
+
68
+ export function validateNotification(v: unknown): ValidationResult {
69
+ return lexicons.validate('app.bsky.notification.list#notification', v)
70
+ }
@@ -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,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
  /** Actor type: Scene. Defined for app.bsky.system.declaration's actorType. */
5
9
  export const MAIN = 'app.bsky.system.actorScene#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
  /** Actor type: User. Defined for app.bsky.system.declaration's actorType. */
5
9
  export const MAIN = 'app.bsky.system.actorUser#main'
@@ -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
  /** A reference to a app.bsky.system.declaration record. */
5
9
  export interface Main {
6
10
  cid: string
@@ -10,3 +14,16 @@ export interface Main {
10
14
  | (string & {})
11
15
  [k: string]: unknown
12
16
  }
17
+
18
+ export function isMain(v: unknown): v is Main {
19
+ return (
20
+ isObj(v) &&
21
+ hasProp(v, '$type') &&
22
+ (v.$type === 'app.bsky.system.declRef#main' ||
23
+ v.$type === 'app.bsky.system.declRef')
24
+ )
25
+ }
26
+
27
+ export function validateMain(v: unknown): ValidationResult {
28
+ return lexicons.validate('app.bsky.system.declRef#main', v)
29
+ }
@@ -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
  actorType:
6
10
  | 'app.bsky.system.actorUser'
@@ -8,3 +12,16 @@ export interface Record {
8
12
  | (string & {})
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.system.declaration#main' ||
21
+ v.$type === 'app.bsky.system.declaration')
22
+ )
23
+ }
24
+
25
+ export function validateRecord(v: unknown): ValidationResult {
26
+ return lexicons.validate('app.bsky.system.declaration#main', v)
27
+ }
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
  /** The handle to resolve. If not supplied, will resolve the host's own handle. */
@@ -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
 
@@ -39,6 +42,18 @@ export interface Create {
39
42
  [k: string]: unknown
40
43
  }
41
44
 
45
+ export function isCreate(v: unknown): v is Create {
46
+ return (
47
+ isObj(v) &&
48
+ hasProp(v, '$type') &&
49
+ v.$type === 'com.atproto.repo.batchWrite#create'
50
+ )
51
+ }
52
+
53
+ export function validateCreate(v: unknown): ValidationResult {
54
+ return lexicons.validate('com.atproto.repo.batchWrite#create', v)
55
+ }
56
+
42
57
  export interface Update {
43
58
  action: 'update'
44
59
  collection: string
@@ -47,9 +62,33 @@ export interface Update {
47
62
  [k: string]: unknown
48
63
  }
49
64
 
65
+ export function isUpdate(v: unknown): v is Update {
66
+ return (
67
+ isObj(v) &&
68
+ hasProp(v, '$type') &&
69
+ v.$type === 'com.atproto.repo.batchWrite#update'
70
+ )
71
+ }
72
+
73
+ export function validateUpdate(v: unknown): ValidationResult {
74
+ return lexicons.validate('com.atproto.repo.batchWrite#update', v)
75
+ }
76
+
50
77
  export interface Delete {
51
78
  action: 'delete'
52
79
  collection: string
53
80
  rkey: string
54
81
  [k: string]: unknown
55
82
  }
83
+
84
+ export function isDelete(v: unknown): v is Delete {
85
+ return (
86
+ isObj(v) &&
87
+ hasProp(v, '$type') &&
88
+ v.$type === 'com.atproto.repo.batchWrite#delete'
89
+ )
90
+ }
91
+
92
+ export function validateDelete(v: unknown): ValidationResult {
93
+ return lexicons.validate('com.atproto.repo.batchWrite#delete', v)
94
+ }
@@ -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
 
@@ -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
 
@@ -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
  /** The handle or DID of the repo. */
@@ -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
  /** The handle or DID of the repo. */
@@ -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
  /** The handle or DID of the repo. */
@@ -48,3 +51,15 @@ export interface Record {
48
51
  value: {}
49
52
  [k: string]: unknown
50
53
  }
54
+
55
+ export function isRecord(v: unknown): v is Record {
56
+ return (
57
+ isObj(v) &&
58
+ hasProp(v, '$type') &&
59
+ v.$type === 'com.atproto.repo.listRecords#record'
60
+ )
61
+ }
62
+
63
+ export function validateRecord(v: unknown): ValidationResult {
64
+ return lexicons.validate('com.atproto.repo.listRecords#record', v)
65
+ }
@@ -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,8 +1,25 @@
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
  uri: string
6
10
  cid: string
7
11
  [k: string]: unknown
8
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.strongRef#main' ||
19
+ v.$type === 'com.atproto.repo.strongRef')
20
+ )
21
+ }
22
+
23
+ export function validateMain(v: unknown): ValidationResult {
24
+ return lexicons.validate('com.atproto.repo.strongRef#main', v)
25
+ }
@@ -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
 
@@ -35,3 +38,15 @@ export interface Links {
35
38
  termsOfService?: string
36
39
  [k: string]: unknown
37
40
  }
41
+
42
+ export function isLinks(v: unknown): v is Links {
43
+ return (
44
+ isObj(v) &&
45
+ hasProp(v, '$type') &&
46
+ v.$type === 'com.atproto.server.getAccountsConfig#links'
47
+ )
48
+ }
49
+
50
+ export function validateLinks(v: unknown): ValidationResult {
51
+ return lexicons.validate('com.atproto.server.getAccountsConfig#links', v)
52
+ }
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
  /** The DID of the repo. */
@@ -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
  /** The DID of the repo. */
@@ -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
  /** The DID of the repo. */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ export function isObj(v: unknown): v is Record<string, unknown> {
5
+ return typeof v === 'object' && v !== null
6
+ }
7
+
8
+ export function hasProp<K extends PropertyKey>(
9
+ data: object,
10
+ prop: K,
11
+ ): data is Record<K, unknown> {
12
+ return prop in data
13
+ }