@atproto/api 0.3.0 → 0.3.2

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.
@@ -3488,6 +3488,10 @@ export const schemaDict = {
3488
3488
  muted: {
3489
3489
  type: 'boolean',
3490
3490
  },
3491
+ mutedByList: {
3492
+ type: 'ref',
3493
+ ref: 'lex:app.bsky.graph.defs#listViewBasic',
3494
+ },
3491
3495
  blockedBy: {
3492
3496
  type: 'boolean',
3493
3497
  },
@@ -4676,6 +4680,115 @@ export const schemaDict = {
4676
4680
  },
4677
4681
  },
4678
4682
  },
4683
+ AppBskyGraphDefs: {
4684
+ lexicon: 1,
4685
+ id: 'app.bsky.graph.defs',
4686
+ defs: {
4687
+ listViewBasic: {
4688
+ type: 'object',
4689
+ required: ['uri', 'creator', 'name', 'purpose'],
4690
+ properties: {
4691
+ uri: {
4692
+ type: 'string',
4693
+ format: 'at-uri',
4694
+ },
4695
+ name: {
4696
+ type: 'string',
4697
+ maxLength: 64,
4698
+ minLength: 1,
4699
+ },
4700
+ purpose: {
4701
+ type: 'ref',
4702
+ ref: 'lex:app.bsky.graph.defs#listPurpose',
4703
+ },
4704
+ avatar: {
4705
+ type: 'string',
4706
+ },
4707
+ viewer: {
4708
+ type: 'ref',
4709
+ ref: 'lex:app.bsky.graph.defs#listViewerState',
4710
+ },
4711
+ indexedAt: {
4712
+ type: 'string',
4713
+ format: 'datetime',
4714
+ },
4715
+ },
4716
+ },
4717
+ listView: {
4718
+ type: 'object',
4719
+ required: ['uri', 'creator', 'name', 'purpose', 'indexedAt'],
4720
+ properties: {
4721
+ uri: {
4722
+ type: 'string',
4723
+ format: 'at-uri',
4724
+ },
4725
+ creator: {
4726
+ type: 'ref',
4727
+ ref: 'lex:app.bsky.actor.defs#profileView',
4728
+ },
4729
+ name: {
4730
+ type: 'string',
4731
+ maxLength: 64,
4732
+ minLength: 1,
4733
+ },
4734
+ purpose: {
4735
+ type: 'ref',
4736
+ ref: 'lex:app.bsky.graph.defs#listPurpose',
4737
+ },
4738
+ description: {
4739
+ type: 'string',
4740
+ maxGraphemes: 300,
4741
+ maxLength: 3000,
4742
+ },
4743
+ descriptionFacets: {
4744
+ type: 'array',
4745
+ items: {
4746
+ type: 'ref',
4747
+ ref: 'lex:app.bsky.richtext.facet',
4748
+ },
4749
+ },
4750
+ avatar: {
4751
+ type: 'string',
4752
+ },
4753
+ viewer: {
4754
+ type: 'ref',
4755
+ ref: 'lex:app.bsky.graph.defs#listViewerState',
4756
+ },
4757
+ indexedAt: {
4758
+ type: 'string',
4759
+ format: 'datetime',
4760
+ },
4761
+ },
4762
+ },
4763
+ listItemView: {
4764
+ type: 'object',
4765
+ required: ['subject'],
4766
+ properties: {
4767
+ subject: {
4768
+ type: 'ref',
4769
+ ref: 'lex:app.bsky.actor.defs#profileView',
4770
+ },
4771
+ },
4772
+ },
4773
+ listPurpose: {
4774
+ type: 'string',
4775
+ knownValues: ['app.bsky.graph.defs#modlist'],
4776
+ },
4777
+ modlist: {
4778
+ type: 'token',
4779
+ description:
4780
+ 'A list of actors to apply an aggregate moderation action (mute/block) on',
4781
+ },
4782
+ listViewerState: {
4783
+ type: 'object',
4784
+ properties: {
4785
+ muted: {
4786
+ type: 'boolean',
4787
+ },
4788
+ },
4789
+ },
4790
+ },
4791
+ },
4679
4792
  AppBskyGraphFollow: {
4680
4793
  lexicon: 1,
4681
4794
  id: 'app.bsky.graph.follow',
@@ -4848,6 +4961,149 @@ export const schemaDict = {
4848
4961
  },
4849
4962
  },
4850
4963
  },
4964
+ AppBskyGraphGetList: {
4965
+ lexicon: 1,
4966
+ id: 'app.bsky.graph.getList',
4967
+ defs: {
4968
+ main: {
4969
+ type: 'query',
4970
+ description: 'Fetch a list of actors',
4971
+ parameters: {
4972
+ type: 'params',
4973
+ required: ['list'],
4974
+ properties: {
4975
+ list: {
4976
+ type: 'string',
4977
+ format: 'at-uri',
4978
+ },
4979
+ limit: {
4980
+ type: 'integer',
4981
+ minimum: 1,
4982
+ maximum: 100,
4983
+ default: 50,
4984
+ },
4985
+ cursor: {
4986
+ type: 'string',
4987
+ },
4988
+ },
4989
+ },
4990
+ output: {
4991
+ encoding: 'application/json',
4992
+ schema: {
4993
+ type: 'object',
4994
+ required: ['list', 'items'],
4995
+ properties: {
4996
+ cursor: {
4997
+ type: 'string',
4998
+ },
4999
+ list: {
5000
+ type: 'ref',
5001
+ ref: 'lex:app.bsky.graph.defs#listView',
5002
+ },
5003
+ items: {
5004
+ type: 'array',
5005
+ items: {
5006
+ type: 'ref',
5007
+ ref: 'lex:app.bsky.graph.defs#listItemView',
5008
+ },
5009
+ },
5010
+ },
5011
+ },
5012
+ },
5013
+ },
5014
+ },
5015
+ },
5016
+ AppBskyGraphGetListMutes: {
5017
+ lexicon: 1,
5018
+ id: 'app.bsky.graph.getListMutes',
5019
+ defs: {
5020
+ main: {
5021
+ type: 'query',
5022
+ description: "Which lists is the requester's account muting?",
5023
+ parameters: {
5024
+ type: 'params',
5025
+ properties: {
5026
+ limit: {
5027
+ type: 'integer',
5028
+ minimum: 1,
5029
+ maximum: 100,
5030
+ default: 50,
5031
+ },
5032
+ cursor: {
5033
+ type: 'string',
5034
+ },
5035
+ },
5036
+ },
5037
+ output: {
5038
+ encoding: 'application/json',
5039
+ schema: {
5040
+ type: 'object',
5041
+ required: ['lists'],
5042
+ properties: {
5043
+ cursor: {
5044
+ type: 'string',
5045
+ },
5046
+ lists: {
5047
+ type: 'array',
5048
+ items: {
5049
+ type: 'ref',
5050
+ ref: 'lex:app.bsky.graph.defs#listView',
5051
+ },
5052
+ },
5053
+ },
5054
+ },
5055
+ },
5056
+ },
5057
+ },
5058
+ },
5059
+ AppBskyGraphGetLists: {
5060
+ lexicon: 1,
5061
+ id: 'app.bsky.graph.getLists',
5062
+ defs: {
5063
+ main: {
5064
+ type: 'query',
5065
+ description: 'Fetch a list of lists that belong to an actor',
5066
+ parameters: {
5067
+ type: 'params',
5068
+ required: ['actor'],
5069
+ properties: {
5070
+ actor: {
5071
+ type: 'string',
5072
+ format: 'at-identifier',
5073
+ },
5074
+ limit: {
5075
+ type: 'integer',
5076
+ minimum: 1,
5077
+ maximum: 100,
5078
+ default: 50,
5079
+ },
5080
+ cursor: {
5081
+ type: 'string',
5082
+ },
5083
+ },
5084
+ },
5085
+ output: {
5086
+ encoding: 'application/json',
5087
+ schema: {
5088
+ type: 'object',
5089
+ required: ['lists'],
5090
+ properties: {
5091
+ cursor: {
5092
+ type: 'string',
5093
+ },
5094
+ lists: {
5095
+ type: 'array',
5096
+ items: {
5097
+ type: 'ref',
5098
+ ref: 'lex:app.bsky.graph.defs#listView',
5099
+ },
5100
+ },
5101
+ },
5102
+ },
5103
+ },
5104
+ },
5105
+ },
5106
+ },
4851
5107
  AppBskyGraphGetMutes: {
4852
5108
  lexicon: 1,
4853
5109
  id: 'app.bsky.graph.getMutes',
@@ -4891,6 +5147,82 @@ export const schemaDict = {
4891
5147
  },
4892
5148
  },
4893
5149
  },
5150
+ AppBskyGraphList: {
5151
+ lexicon: 1,
5152
+ id: 'app.bsky.graph.list',
5153
+ defs: {
5154
+ main: {
5155
+ type: 'record',
5156
+ description: 'A declaration of a list of actors.',
5157
+ key: 'tid',
5158
+ record: {
5159
+ type: 'object',
5160
+ required: ['name', 'purpose', 'createdAt'],
5161
+ properties: {
5162
+ purpose: {
5163
+ type: 'ref',
5164
+ ref: 'lex:app.bsky.graph.defs#listPurpose',
5165
+ },
5166
+ name: {
5167
+ type: 'string',
5168
+ maxLength: 64,
5169
+ minLength: 1,
5170
+ },
5171
+ description: {
5172
+ type: 'string',
5173
+ maxGraphemes: 300,
5174
+ maxLength: 3000,
5175
+ },
5176
+ descriptionFacets: {
5177
+ type: 'array',
5178
+ items: {
5179
+ type: 'ref',
5180
+ ref: 'lex:app.bsky.richtext.facet',
5181
+ },
5182
+ },
5183
+ avatar: {
5184
+ type: 'blob',
5185
+ accept: ['image/png', 'image/jpeg'],
5186
+ maxSize: 1000000,
5187
+ },
5188
+ createdAt: {
5189
+ type: 'string',
5190
+ format: 'datetime',
5191
+ },
5192
+ },
5193
+ },
5194
+ },
5195
+ },
5196
+ },
5197
+ AppBskyGraphListitem: {
5198
+ lexicon: 1,
5199
+ id: 'app.bsky.graph.listitem',
5200
+ defs: {
5201
+ main: {
5202
+ type: 'record',
5203
+ description: 'An item under a declared list of actors',
5204
+ key: 'tid',
5205
+ record: {
5206
+ type: 'object',
5207
+ required: ['subject', 'list', 'createdAt'],
5208
+ properties: {
5209
+ subject: {
5210
+ type: 'string',
5211
+ format: 'did',
5212
+ },
5213
+ list: {
5214
+ type: 'string',
5215
+ format: 'at-uri',
5216
+ },
5217
+ createdAt: {
5218
+ type: 'string',
5219
+ format: 'datetime',
5220
+ },
5221
+ },
5222
+ },
5223
+ },
5224
+ },
5225
+ },
4894
5226
  AppBskyGraphMuteActor: {
4895
5227
  lexicon: 1,
4896
5228
  id: 'app.bsky.graph.muteActor',
@@ -4914,6 +5246,29 @@ export const schemaDict = {
4914
5246
  },
4915
5247
  },
4916
5248
  },
5249
+ AppBskyGraphMuteActorList: {
5250
+ lexicon: 1,
5251
+ id: 'app.bsky.graph.muteActorList',
5252
+ defs: {
5253
+ main: {
5254
+ type: 'procedure',
5255
+ description: 'Mute a list of actors.',
5256
+ input: {
5257
+ encoding: 'application/json',
5258
+ schema: {
5259
+ type: 'object',
5260
+ required: ['list'],
5261
+ properties: {
5262
+ list: {
5263
+ type: 'string',
5264
+ format: 'at-uri',
5265
+ },
5266
+ },
5267
+ },
5268
+ },
5269
+ },
5270
+ },
5271
+ },
4917
5272
  AppBskyGraphUnmuteActor: {
4918
5273
  lexicon: 1,
4919
5274
  id: 'app.bsky.graph.unmuteActor',
@@ -4937,6 +5292,29 @@ export const schemaDict = {
4937
5292
  },
4938
5293
  },
4939
5294
  },
5295
+ AppBskyGraphUnmuteActorList: {
5296
+ lexicon: 1,
5297
+ id: 'app.bsky.graph.unmuteActorList',
5298
+ defs: {
5299
+ main: {
5300
+ type: 'procedure',
5301
+ description: 'Unmute a list of actors.',
5302
+ input: {
5303
+ encoding: 'application/json',
5304
+ schema: {
5305
+ type: 'object',
5306
+ required: ['list'],
5307
+ properties: {
5308
+ list: {
5309
+ type: 'string',
5310
+ format: 'at-uri',
5311
+ },
5312
+ },
5313
+ },
5314
+ },
5315
+ },
5316
+ },
5317
+ },
4940
5318
  AppBskyNotificationGetUnreadCount: {
4941
5319
  lexicon: 1,
4942
5320
  id: 'app.bsky.notification.getUnreadCount',
@@ -5302,13 +5680,21 @@ export const ids = {
5302
5680
  AppBskyFeedPost: 'app.bsky.feed.post',
5303
5681
  AppBskyFeedRepost: 'app.bsky.feed.repost',
5304
5682
  AppBskyGraphBlock: 'app.bsky.graph.block',
5683
+ AppBskyGraphDefs: 'app.bsky.graph.defs',
5305
5684
  AppBskyGraphFollow: 'app.bsky.graph.follow',
5306
5685
  AppBskyGraphGetBlocks: 'app.bsky.graph.getBlocks',
5307
5686
  AppBskyGraphGetFollowers: 'app.bsky.graph.getFollowers',
5308
5687
  AppBskyGraphGetFollows: 'app.bsky.graph.getFollows',
5688
+ AppBskyGraphGetList: 'app.bsky.graph.getList',
5689
+ AppBskyGraphGetListMutes: 'app.bsky.graph.getListMutes',
5690
+ AppBskyGraphGetLists: 'app.bsky.graph.getLists',
5309
5691
  AppBskyGraphGetMutes: 'app.bsky.graph.getMutes',
5692
+ AppBskyGraphList: 'app.bsky.graph.list',
5693
+ AppBskyGraphListitem: 'app.bsky.graph.listitem',
5310
5694
  AppBskyGraphMuteActor: 'app.bsky.graph.muteActor',
5695
+ AppBskyGraphMuteActorList: 'app.bsky.graph.muteActorList',
5311
5696
  AppBskyGraphUnmuteActor: 'app.bsky.graph.unmuteActor',
5697
+ AppBskyGraphUnmuteActorList: 'app.bsky.graph.unmuteActorList',
5312
5698
  AppBskyNotificationGetUnreadCount: 'app.bsky.notification.getUnreadCount',
5313
5699
  AppBskyNotificationListNotifications:
5314
5700
  'app.bsky.notification.listNotifications',
@@ -6,6 +6,7 @@ import { isObj, hasProp } from '../../../../util'
6
6
  import { lexicons } from '../../../../lexicons'
7
7
  import { CID } from 'multiformats/cid'
8
8
  import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
9
+ import * as AppBskyGraphDefs from '../graph/defs'
9
10
 
10
11
  export interface ProfileViewBasic {
11
12
  did: string
@@ -83,6 +84,7 @@ export function validateProfileViewDetailed(v: unknown): ValidationResult {
83
84
 
84
85
  export interface ViewerState {
85
86
  muted?: boolean
87
+ mutedByList?: AppBskyGraphDefs.ListViewBasic
86
88
  blockedBy?: boolean
87
89
  blocking?: string
88
90
  following?: string
@@ -0,0 +1,95 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyActorDefs from '../actor/defs'
9
+ import * as AppBskyRichtextFacet from '../richtext/facet'
10
+
11
+ export interface ListViewBasic {
12
+ uri: string
13
+ name: string
14
+ purpose: ListPurpose
15
+ avatar?: string
16
+ viewer?: ListViewerState
17
+ indexedAt?: string
18
+ [k: string]: unknown
19
+ }
20
+
21
+ export function isListViewBasic(v: unknown): v is ListViewBasic {
22
+ return (
23
+ isObj(v) &&
24
+ hasProp(v, '$type') &&
25
+ v.$type === 'app.bsky.graph.defs#listViewBasic'
26
+ )
27
+ }
28
+
29
+ export function validateListViewBasic(v: unknown): ValidationResult {
30
+ return lexicons.validate('app.bsky.graph.defs#listViewBasic', v)
31
+ }
32
+
33
+ export interface ListView {
34
+ uri: string
35
+ creator: AppBskyActorDefs.ProfileView
36
+ name: string
37
+ purpose: ListPurpose
38
+ description?: string
39
+ descriptionFacets?: AppBskyRichtextFacet.Main[]
40
+ avatar?: string
41
+ viewer?: ListViewerState
42
+ indexedAt: string
43
+ [k: string]: unknown
44
+ }
45
+
46
+ export function isListView(v: unknown): v is ListView {
47
+ return (
48
+ isObj(v) &&
49
+ hasProp(v, '$type') &&
50
+ v.$type === 'app.bsky.graph.defs#listView'
51
+ )
52
+ }
53
+
54
+ export function validateListView(v: unknown): ValidationResult {
55
+ return lexicons.validate('app.bsky.graph.defs#listView', v)
56
+ }
57
+
58
+ export interface ListItemView {
59
+ subject: AppBskyActorDefs.ProfileView
60
+ [k: string]: unknown
61
+ }
62
+
63
+ export function isListItemView(v: unknown): v is ListItemView {
64
+ return (
65
+ isObj(v) &&
66
+ hasProp(v, '$type') &&
67
+ v.$type === 'app.bsky.graph.defs#listItemView'
68
+ )
69
+ }
70
+
71
+ export function validateListItemView(v: unknown): ValidationResult {
72
+ return lexicons.validate('app.bsky.graph.defs#listItemView', v)
73
+ }
74
+
75
+ export type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {})
76
+
77
+ /** A list of actors to apply an aggregate moderation action (mute/block) on */
78
+ export const MODLIST = 'app.bsky.graph.defs#modlist'
79
+
80
+ export interface ListViewerState {
81
+ muted?: boolean
82
+ [k: string]: unknown
83
+ }
84
+
85
+ export function isListViewerState(v: unknown): v is ListViewerState {
86
+ return (
87
+ isObj(v) &&
88
+ hasProp(v, '$type') &&
89
+ v.$type === 'app.bsky.graph.defs#listViewerState'
90
+ )
91
+ }
92
+
93
+ export function validateListViewerState(v: unknown): ValidationResult {
94
+ return lexicons.validate('app.bsky.graph.defs#listViewerState', v)
95
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ list: string
13
+ limit?: number
14
+ cursor?: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ list: AppBskyGraphDefs.ListView
22
+ items: AppBskyGraphDefs.ListItemView[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export interface CallOptions {
27
+ headers?: Headers
28
+ }
29
+
30
+ export interface Response {
31
+ success: boolean
32
+ headers: Headers
33
+ data: OutputSchema
34
+ }
35
+
36
+ export function toKnownErr(e: any) {
37
+ if (e instanceof XRPCError) {
38
+ }
39
+ return e
40
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ limit?: number
13
+ cursor?: string
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ cursor?: string
20
+ lists: AppBskyGraphDefs.ListView[]
21
+ [k: string]: unknown
22
+ }
23
+
24
+ export interface CallOptions {
25
+ headers?: Headers
26
+ }
27
+
28
+ export interface Response {
29
+ success: boolean
30
+ headers: Headers
31
+ data: OutputSchema
32
+ }
33
+
34
+ export function toKnownErr(e: any) {
35
+ if (e instanceof XRPCError) {
36
+ }
37
+ return e
38
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ actor: string
13
+ limit?: number
14
+ cursor?: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ lists: AppBskyGraphDefs.ListView[]
22
+ [k: string]: unknown
23
+ }
24
+
25
+ export interface CallOptions {
26
+ headers?: Headers
27
+ }
28
+
29
+ export interface Response {
30
+ success: boolean
31
+ headers: Headers
32
+ data: OutputSchema
33
+ }
34
+
35
+ export function toKnownErr(e: any) {
36
+ if (e instanceof XRPCError) {
37
+ }
38
+ return e
39
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppBskyGraphDefs from './defs'
9
+ import * as AppBskyRichtextFacet from '../richtext/facet'
10
+
11
+ export interface Record {
12
+ purpose: AppBskyGraphDefs.ListPurpose
13
+ name: string
14
+ description?: string
15
+ descriptionFacets?: AppBskyRichtextFacet.Main[]
16
+ avatar?: BlobRef
17
+ createdAt: string
18
+ [k: string]: unknown
19
+ }
20
+
21
+ export function isRecord(v: unknown): v is Record {
22
+ return (
23
+ isObj(v) &&
24
+ hasProp(v, '$type') &&
25
+ (v.$type === 'app.bsky.graph.list#main' ||
26
+ v.$type === 'app.bsky.graph.list')
27
+ )
28
+ }
29
+
30
+ export function validateRecord(v: unknown): ValidationResult {
31
+ return lexicons.validate('app.bsky.graph.list#main', v)
32
+ }