@atproto/api 0.0.3 → 0.0.4
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.
- package/dist/client/index.d.ts +9 -0
- package/dist/client/lexicons.d.ts +132 -0
- package/dist/client/types/app/bsky/actor/getProfile.d.ts +1 -0
- package/dist/client/types/app/bsky/actor/ref.d.ts +5 -0
- package/dist/client/types/app/bsky/feed/post.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/getMutes.d.ts +29 -0
- package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
- package/dist/index.js +201 -18
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/src/client/index.ts +39 -0
- package/src/client/lexicons.ts +141 -9
- package/src/client/types/app/bsky/actor/getProfile.ts +1 -0
- package/src/client/types/app/bsky/actor/ref.ts +6 -0
- package/src/client/types/app/bsky/feed/post.ts +2 -0
- package/src/client/types/app/bsky/graph/getMutes.ts +43 -0
- package/src/client/types/app/bsky/graph/mute.ts +28 -0
- package/src/client/types/app/bsky/graph/unmute.ts +28 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/client/index.ts
CHANGED
|
@@ -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 {
|
package/src/client/lexicons.ts
CHANGED
|
@@ -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:
|
|
1163
|
-
maxHeight:
|
|
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:
|
|
1170
|
-
maxHeight:
|
|
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:
|
|
1468
|
-
maxHeight:
|
|
1469
|
-
maxSize:
|
|
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:
|
|
1530
|
-
maxHeight:
|
|
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: {
|
|
@@ -2124,6 +2140,9 @@ export const schemaDict = {
|
|
|
2124
2140
|
downvote: {
|
|
2125
2141
|
type: 'string',
|
|
2126
2142
|
},
|
|
2143
|
+
muted: {
|
|
2144
|
+
type: 'boolean',
|
|
2145
|
+
},
|
|
2127
2146
|
},
|
|
2128
2147
|
},
|
|
2129
2148
|
},
|
|
@@ -2766,6 +2785,116 @@ export const schemaDict = {
|
|
|
2766
2785
|
},
|
|
2767
2786
|
},
|
|
2768
2787
|
},
|
|
2788
|
+
AppBskyGraphGetMutes: {
|
|
2789
|
+
lexicon: 1,
|
|
2790
|
+
id: 'app.bsky.graph.getMutes',
|
|
2791
|
+
defs: {
|
|
2792
|
+
main: {
|
|
2793
|
+
type: 'query',
|
|
2794
|
+
description: 'Who does the viewer mute?',
|
|
2795
|
+
parameters: {
|
|
2796
|
+
type: 'params',
|
|
2797
|
+
properties: {
|
|
2798
|
+
limit: {
|
|
2799
|
+
type: 'integer',
|
|
2800
|
+
minimum: 1,
|
|
2801
|
+
maximum: 100,
|
|
2802
|
+
default: 50,
|
|
2803
|
+
},
|
|
2804
|
+
before: {
|
|
2805
|
+
type: 'string',
|
|
2806
|
+
},
|
|
2807
|
+
},
|
|
2808
|
+
},
|
|
2809
|
+
output: {
|
|
2810
|
+
encoding: 'application/json',
|
|
2811
|
+
schema: {
|
|
2812
|
+
type: 'object',
|
|
2813
|
+
required: ['mutes'],
|
|
2814
|
+
properties: {
|
|
2815
|
+
cursor: {
|
|
2816
|
+
type: 'string',
|
|
2817
|
+
},
|
|
2818
|
+
mutes: {
|
|
2819
|
+
type: 'array',
|
|
2820
|
+
items: {
|
|
2821
|
+
type: 'ref',
|
|
2822
|
+
ref: 'lex:app.bsky.graph.getMutes#mute',
|
|
2823
|
+
},
|
|
2824
|
+
},
|
|
2825
|
+
},
|
|
2826
|
+
},
|
|
2827
|
+
},
|
|
2828
|
+
},
|
|
2829
|
+
mute: {
|
|
2830
|
+
type: 'object',
|
|
2831
|
+
required: ['did', 'declaration', 'handle', 'createdAt'],
|
|
2832
|
+
properties: {
|
|
2833
|
+
did: {
|
|
2834
|
+
type: 'string',
|
|
2835
|
+
},
|
|
2836
|
+
declaration: {
|
|
2837
|
+
type: 'ref',
|
|
2838
|
+
ref: 'lex:app.bsky.system.declRef',
|
|
2839
|
+
},
|
|
2840
|
+
handle: {
|
|
2841
|
+
type: 'string',
|
|
2842
|
+
},
|
|
2843
|
+
displayName: {
|
|
2844
|
+
type: 'string',
|
|
2845
|
+
maxLength: 64,
|
|
2846
|
+
},
|
|
2847
|
+
createdAt: {
|
|
2848
|
+
type: 'datetime',
|
|
2849
|
+
},
|
|
2850
|
+
},
|
|
2851
|
+
},
|
|
2852
|
+
},
|
|
2853
|
+
},
|
|
2854
|
+
AppBskyGraphMute: {
|
|
2855
|
+
lexicon: 1,
|
|
2856
|
+
id: 'app.bsky.graph.mute',
|
|
2857
|
+
defs: {
|
|
2858
|
+
main: {
|
|
2859
|
+
type: 'procedure',
|
|
2860
|
+
description: 'Mute an actor by did or handle.',
|
|
2861
|
+
input: {
|
|
2862
|
+
encoding: 'application/json',
|
|
2863
|
+
schema: {
|
|
2864
|
+
type: 'object',
|
|
2865
|
+
required: ['user'],
|
|
2866
|
+
properties: {
|
|
2867
|
+
user: {
|
|
2868
|
+
type: 'string',
|
|
2869
|
+
},
|
|
2870
|
+
},
|
|
2871
|
+
},
|
|
2872
|
+
},
|
|
2873
|
+
},
|
|
2874
|
+
},
|
|
2875
|
+
},
|
|
2876
|
+
AppBskyGraphUnmute: {
|
|
2877
|
+
lexicon: 1,
|
|
2878
|
+
id: 'app.bsky.graph.unmute',
|
|
2879
|
+
defs: {
|
|
2880
|
+
main: {
|
|
2881
|
+
type: 'procedure',
|
|
2882
|
+
description: 'Unmute an actor by did or handle.',
|
|
2883
|
+
input: {
|
|
2884
|
+
encoding: 'application/json',
|
|
2885
|
+
schema: {
|
|
2886
|
+
type: 'object',
|
|
2887
|
+
required: ['user'],
|
|
2888
|
+
properties: {
|
|
2889
|
+
user: {
|
|
2890
|
+
type: 'string',
|
|
2891
|
+
},
|
|
2892
|
+
},
|
|
2893
|
+
},
|
|
2894
|
+
},
|
|
2895
|
+
},
|
|
2896
|
+
},
|
|
2897
|
+
},
|
|
2769
2898
|
AppBskyNotificationGetCount: {
|
|
2770
2899
|
lexicon: 1,
|
|
2771
2900
|
id: 'app.bsky.notification.getCount',
|
|
@@ -3031,6 +3160,9 @@ export const ids = {
|
|
|
3031
3160
|
AppBskyGraphGetFollows: 'app.bsky.graph.getFollows',
|
|
3032
3161
|
AppBskyGraphGetMembers: 'app.bsky.graph.getMembers',
|
|
3033
3162
|
AppBskyGraphGetMemberships: 'app.bsky.graph.getMemberships',
|
|
3163
|
+
AppBskyGraphGetMutes: 'app.bsky.graph.getMutes',
|
|
3164
|
+
AppBskyGraphMute: 'app.bsky.graph.mute',
|
|
3165
|
+
AppBskyGraphUnmute: 'app.bsky.graph.unmute',
|
|
3034
3166
|
AppBskyNotificationGetCount: 'app.bsky.notification.getCount',
|
|
3035
3167
|
AppBskyNotificationList: 'app.bsky.notification.list',
|
|
3036
3168
|
AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen',
|
|
@@ -32,6 +32,7 @@ export interface Entity {
|
|
|
32
32
|
[k: string]: unknown
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** A text segment. Start is inclusive, end is exclusive. */
|
|
35
36
|
export interface TextSlice {
|
|
36
37
|
start: number
|
|
37
38
|
end: number
|
|
@@ -60,5 +61,6 @@ export interface ViewerState {
|
|
|
60
61
|
repost?: string
|
|
61
62
|
upvote?: string
|
|
62
63
|
downvote?: string
|
|
64
|
+
muted?: boolean
|
|
63
65
|
[k: string]: unknown
|
|
64
66
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
import * as AppBskySystemDeclRef from '../system/declRef'
|
|
6
|
+
|
|
7
|
+
export interface QueryParams {
|
|
8
|
+
limit?: number
|
|
9
|
+
before?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type InputSchema = undefined
|
|
13
|
+
|
|
14
|
+
export interface OutputSchema {
|
|
15
|
+
cursor?: string
|
|
16
|
+
mutes: Mute[]
|
|
17
|
+
[k: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CallOptions {
|
|
21
|
+
headers?: Headers
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Response {
|
|
25
|
+
success: boolean
|
|
26
|
+
headers: Headers
|
|
27
|
+
data: OutputSchema
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function toKnownErr(e: any) {
|
|
31
|
+
if (e instanceof XRPCError) {
|
|
32
|
+
}
|
|
33
|
+
return e
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface Mute {
|
|
37
|
+
did: string
|
|
38
|
+
declaration: AppBskySystemDeclRef.Main
|
|
39
|
+
handle: string
|
|
40
|
+
displayName?: string
|
|
41
|
+
createdAt: string
|
|
42
|
+
[k: string]: unknown
|
|
43
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
|
|
6
|
+
export interface QueryParams {}
|
|
7
|
+
|
|
8
|
+
export interface InputSchema {
|
|
9
|
+
user: string
|
|
10
|
+
[k: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CallOptions {
|
|
14
|
+
headers?: Headers
|
|
15
|
+
qp?: QueryParams
|
|
16
|
+
encoding: 'application/json'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Response {
|
|
20
|
+
success: boolean
|
|
21
|
+
headers: Headers
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function toKnownErr(e: any) {
|
|
25
|
+
if (e instanceof XRPCError) {
|
|
26
|
+
}
|
|
27
|
+
return e
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
+
|
|
6
|
+
export interface QueryParams {}
|
|
7
|
+
|
|
8
|
+
export interface InputSchema {
|
|
9
|
+
user: string
|
|
10
|
+
[k: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CallOptions {
|
|
14
|
+
headers?: Headers
|
|
15
|
+
qp?: QueryParams
|
|
16
|
+
encoding: 'application/json'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Response {
|
|
20
|
+
success: boolean
|
|
21
|
+
headers: Headers
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function toKnownErr(e: any) {
|
|
25
|
+
if (e instanceof XRPCError) {
|
|
26
|
+
}
|
|
27
|
+
return e
|
|
28
|
+
}
|