@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "codegen": "lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
@@ -61,6 +61,9 @@ import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
61
61
  import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
62
62
  import * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers'
63
63
  import * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships'
64
+ import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
65
+ import * as AppBskyGraphMute from './types/app/bsky/graph/mute'
66
+ import * as AppBskyGraphUnmute from './types/app/bsky/graph/unmute'
64
67
  import * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount'
65
68
  import * as AppBskyNotificationList from './types/app/bsky/notification/list'
66
69
  import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
@@ -124,6 +127,9 @@ export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
124
127
  export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
125
128
  export * as AppBskyGraphGetMembers from './types/app/bsky/graph/getMembers'
126
129
  export * as AppBskyGraphGetMemberships from './types/app/bsky/graph/getMemberships'
130
+ export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
131
+ export * as AppBskyGraphMute from './types/app/bsky/graph/mute'
132
+ export * as AppBskyGraphUnmute from './types/app/bsky/graph/unmute'
127
133
  export * as AppBskyNotificationGetCount from './types/app/bsky/notification/getCount'
128
134
  export * as AppBskyNotificationList from './types/app/bsky/notification/list'
129
135
  export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
@@ -1083,6 +1089,39 @@ export class GraphNS {
1083
1089
  throw AppBskyGraphGetMemberships.toKnownErr(e)
1084
1090
  })
1085
1091
  }
1092
+
1093
+ getMutes(
1094
+ params?: AppBskyGraphGetMutes.QueryParams,
1095
+ opts?: AppBskyGraphGetMutes.CallOptions,
1096
+ ): Promise<AppBskyGraphGetMutes.Response> {
1097
+ return this._service.xrpc
1098
+ .call('app.bsky.graph.getMutes', params, undefined, opts)
1099
+ .catch((e) => {
1100
+ throw AppBskyGraphGetMutes.toKnownErr(e)
1101
+ })
1102
+ }
1103
+
1104
+ mute(
1105
+ data?: AppBskyGraphMute.InputSchema,
1106
+ opts?: AppBskyGraphMute.CallOptions,
1107
+ ): Promise<AppBskyGraphMute.Response> {
1108
+ return this._service.xrpc
1109
+ .call('app.bsky.graph.mute', opts?.qp, data, opts)
1110
+ .catch((e) => {
1111
+ throw AppBskyGraphMute.toKnownErr(e)
1112
+ })
1113
+ }
1114
+
1115
+ unmute(
1116
+ data?: AppBskyGraphUnmute.InputSchema,
1117
+ opts?: AppBskyGraphUnmute.CallOptions,
1118
+ ): Promise<AppBskyGraphUnmute.Response> {
1119
+ return this._service.xrpc
1120
+ .call('app.bsky.graph.unmute', opts?.qp, data, opts)
1121
+ .catch((e) => {
1122
+ throw AppBskyGraphUnmute.toKnownErr(e)
1123
+ })
1124
+ }
1086
1125
  }
1087
1126
 
1088
1127
  export class AssertionRecord {
@@ -1048,6 +1048,9 @@ export const schemaDict = {
1048
1048
  member: {
1049
1049
  type: 'string',
1050
1050
  },
1051
+ muted: {
1052
+ type: 'boolean',
1053
+ },
1051
1054
  },
1052
1055
  },
1053
1056
  },
@@ -1159,15 +1162,15 @@ export const schemaDict = {
1159
1162
  avatar: {
1160
1163
  type: 'image',
1161
1164
  accept: ['image/png', 'image/jpeg'],
1162
- maxWidth: 500,
1163
- maxHeight: 500,
1165
+ maxWidth: 1000,
1166
+ maxHeight: 1000,
1164
1167
  maxSize: 300000,
1165
1168
  },
1166
1169
  banner: {
1167
1170
  type: 'image',
1168
1171
  accept: ['image/png', 'image/jpeg'],
1169
- maxWidth: 1500,
1170
- maxHeight: 500,
1172
+ maxWidth: 3000,
1173
+ maxHeight: 1000,
1171
1174
  maxSize: 500000,
1172
1175
  },
1173
1176
  },
@@ -1213,6 +1216,18 @@ export const schemaDict = {
1213
1216
  avatar: {
1214
1217
  type: 'string',
1215
1218
  },
1219
+ viewer: {
1220
+ type: 'ref',
1221
+ ref: 'lex:app.bsky.actor.ref#viewerState',
1222
+ },
1223
+ },
1224
+ },
1225
+ viewerState: {
1226
+ type: 'object',
1227
+ properties: {
1228
+ muted: {
1229
+ type: 'boolean',
1230
+ },
1216
1231
  },
1217
1232
  },
1218
1233
  },
@@ -1464,9 +1479,9 @@ export const schemaDict = {
1464
1479
  thumb: {
1465
1480
  type: 'image',
1466
1481
  accept: ['image/*'],
1467
- maxWidth: 250,
1468
- maxHeight: 250,
1469
- maxSize: 100000,
1482
+ maxWidth: 1000,
1483
+ maxHeight: 1000,
1484
+ maxSize: 300000,
1470
1485
  },
1471
1486
  },
1472
1487
  },
@@ -1526,8 +1541,8 @@ export const schemaDict = {
1526
1541
  image: {
1527
1542
  type: 'image',
1528
1543
  accept: ['image/*'],
1529
- maxWidth: 500,
1530
- maxHeight: 500,
1544
+ maxWidth: 1000,
1545
+ maxHeight: 1000,
1531
1546
  maxSize: 300000,
1532
1547
  },
1533
1548
  alt: {
@@ -2044,6 +2059,7 @@ export const schemaDict = {
2044
2059
  },
2045
2060
  textSlice: {
2046
2061
  type: 'object',
2062
+ description: 'A text segment. Start is inclusive, end is exclusive.',
2047
2063
  required: ['start', 'end'],
2048
2064
  properties: {
2049
2065
  start: {
@@ -2766,6 +2782,116 @@ export const schemaDict = {
2766
2782
  },
2767
2783
  },
2768
2784
  },
2785
+ AppBskyGraphGetMutes: {
2786
+ lexicon: 1,
2787
+ id: 'app.bsky.graph.getMutes',
2788
+ defs: {
2789
+ main: {
2790
+ type: 'query',
2791
+ description: 'Who does the viewer mute?',
2792
+ parameters: {
2793
+ type: 'params',
2794
+ properties: {
2795
+ limit: {
2796
+ type: 'integer',
2797
+ minimum: 1,
2798
+ maximum: 100,
2799
+ default: 50,
2800
+ },
2801
+ before: {
2802
+ type: 'string',
2803
+ },
2804
+ },
2805
+ },
2806
+ output: {
2807
+ encoding: 'application/json',
2808
+ schema: {
2809
+ type: 'object',
2810
+ required: ['mutes'],
2811
+ properties: {
2812
+ cursor: {
2813
+ type: 'string',
2814
+ },
2815
+ mutes: {
2816
+ type: 'array',
2817
+ items: {
2818
+ type: 'ref',
2819
+ ref: 'lex:app.bsky.graph.getMutes#mute',
2820
+ },
2821
+ },
2822
+ },
2823
+ },
2824
+ },
2825
+ },
2826
+ mute: {
2827
+ type: 'object',
2828
+ required: ['did', 'declaration', 'handle', 'createdAt'],
2829
+ properties: {
2830
+ did: {
2831
+ type: 'string',
2832
+ },
2833
+ declaration: {
2834
+ type: 'ref',
2835
+ ref: 'lex:app.bsky.system.declRef',
2836
+ },
2837
+ handle: {
2838
+ type: 'string',
2839
+ },
2840
+ displayName: {
2841
+ type: 'string',
2842
+ maxLength: 64,
2843
+ },
2844
+ createdAt: {
2845
+ type: 'datetime',
2846
+ },
2847
+ },
2848
+ },
2849
+ },
2850
+ },
2851
+ AppBskyGraphMute: {
2852
+ lexicon: 1,
2853
+ id: 'app.bsky.graph.mute',
2854
+ defs: {
2855
+ main: {
2856
+ type: 'procedure',
2857
+ description: 'Mute an actor by did or handle.',
2858
+ input: {
2859
+ encoding: 'application/json',
2860
+ schema: {
2861
+ type: 'object',
2862
+ required: ['user'],
2863
+ properties: {
2864
+ user: {
2865
+ type: 'string',
2866
+ },
2867
+ },
2868
+ },
2869
+ },
2870
+ },
2871
+ },
2872
+ },
2873
+ AppBskyGraphUnmute: {
2874
+ lexicon: 1,
2875
+ id: 'app.bsky.graph.unmute',
2876
+ defs: {
2877
+ main: {
2878
+ type: 'procedure',
2879
+ description: 'Unmute an actor by did or handle.',
2880
+ input: {
2881
+ encoding: 'application/json',
2882
+ schema: {
2883
+ type: 'object',
2884
+ required: ['user'],
2885
+ properties: {
2886
+ user: {
2887
+ type: 'string',
2888
+ },
2889
+ },
2890
+ },
2891
+ },
2892
+ },
2893
+ },
2894
+ },
2769
2895
  AppBskyNotificationGetCount: {
2770
2896
  lexicon: 1,
2771
2897
  id: 'app.bsky.notification.getCount',
@@ -3031,6 +3157,9 @@ export const ids = {
3031
3157
  AppBskyGraphGetFollows: 'app.bsky.graph.getFollows',
3032
3158
  AppBskyGraphGetMembers: 'app.bsky.graph.getMembers',
3033
3159
  AppBskyGraphGetMemberships: 'app.bsky.graph.getMemberships',
3160
+ AppBskyGraphGetMutes: 'app.bsky.graph.getMutes',
3161
+ AppBskyGraphMute: 'app.bsky.graph.mute',
3162
+ AppBskyGraphUnmute: 'app.bsky.graph.unmute',
3034
3163
  AppBskyNotificationGetCount: 'app.bsky.notification.getCount',
3035
3164
  AppBskyNotificationList: 'app.bsky.notification.list',
3036
3165
  AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
@@ -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 {
@@ -46,5 +49,18 @@ export function toKnownErr(e: any) {
46
49
  export interface MyState {
47
50
  follow?: string
48
51
  member?: string
52
+ muted?: boolean
49
53
  [k: string]: unknown
50
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,11 +12,51 @@ 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
15
30
  handle: string
16
31
  displayName?: string
17
32
  avatar?: string
33
+ viewer?: ViewerState
18
34
  [k: string]: unknown
19
35
  }
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
+
47
+ export interface ViewerState {
48
+ muted?: boolean
49
+ [k: string]: unknown
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
+ }