@atproto/api 0.2.9 → 0.2.11
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/README.md +2 -0
- package/dist/bsky-agent.d.ts +2 -0
- package/dist/client/index.d.ts +27 -0
- package/dist/client/lexicons.d.ts +111 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +2 -0
- package/dist/client/types/app/bsky/embed/record.d.ts +9 -1
- package/dist/client/types/app/bsky/feed/defs.d.ts +9 -2
- package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +7 -1
- package/dist/client/types/app/bsky/feed/getPostThread.d.ts +1 -1
- package/dist/client/types/app/bsky/graph/block.d.ts +8 -0
- package/dist/client/types/app/bsky/graph/getBlocks.d.ts +21 -0
- package/dist/index.js +258 -36
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/src/bsky-agent.ts +8 -0
- package/src/client/index.ts +78 -0
- package/src/client/lexicons.ts +120 -0
- package/src/client/types/app/bsky/actor/defs.ts +2 -0
- package/src/client/types/app/bsky/embed/record.ts +24 -1
- package/src/client/types/app/bsky/feed/defs.ts +20 -0
- package/src/client/types/app/bsky/feed/getAuthorFeed.ts +14 -0
- package/src/client/types/app/bsky/feed/getPostThread.ts +1 -0
- package/src/client/types/app/bsky/graph/block.ts +26 -0
- package/src/client/types/app/bsky/graph/getBlocks.ts +38 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ await agent.getTimeline(params, opts)
|
|
|
57
57
|
await agent.getAuthorFeed(params, opts)
|
|
58
58
|
await agent.getPostThread(params, opts)
|
|
59
59
|
await agent.getPost(params)
|
|
60
|
+
await agent.getPosts(params, opts)
|
|
60
61
|
await agent.getLikes(params, opts)
|
|
61
62
|
await agent.getRepostedBy(params, opts)
|
|
62
63
|
await agent.post(record)
|
|
@@ -77,6 +78,7 @@ await agent.deleteFollow(followUri)
|
|
|
77
78
|
await agent.getProfile(params, opts)
|
|
78
79
|
await agent.upsertProfile(updateFn)
|
|
79
80
|
await agent.getProfiles(params, opts)
|
|
81
|
+
await agent.getSuggestions(params, opts)
|
|
80
82
|
await agent.searchActors(params, opts)
|
|
81
83
|
await agent.searchActorsTypeahead(params, opts)
|
|
82
84
|
await agent.mute(did)
|
package/dist/bsky-agent.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ export declare class BskyAgent extends AtpAgent {
|
|
|
6
6
|
getAuthorFeed: typeof this.api.app.bsky.feed.getAuthorFeed;
|
|
7
7
|
getPostThread: typeof this.api.app.bsky.feed.getPostThread;
|
|
8
8
|
getPost: typeof this.api.app.bsky.feed.post.get;
|
|
9
|
+
getPosts: typeof this.api.app.bsky.feed.getPosts;
|
|
9
10
|
getLikes: typeof this.api.app.bsky.feed.getLikes;
|
|
10
11
|
getRepostedBy: typeof this.api.app.bsky.feed.getRepostedBy;
|
|
11
12
|
getFollows: typeof this.api.app.bsky.graph.getFollows;
|
|
12
13
|
getFollowers: typeof this.api.app.bsky.graph.getFollowers;
|
|
13
14
|
getProfile: typeof this.api.app.bsky.actor.getProfile;
|
|
14
15
|
getProfiles: typeof this.api.app.bsky.actor.getProfiles;
|
|
16
|
+
getSuggestions: typeof this.api.app.bsky.actor.getSuggestions;
|
|
15
17
|
searchActors: typeof this.api.app.bsky.actor.searchActors;
|
|
16
18
|
searchActorsTypeahead: typeof this.api.app.bsky.actor.searchActorsTypeahead;
|
|
17
19
|
listNotifications: typeof this.api.app.bsky.notification.listNotifications;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -67,7 +67,9 @@ import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline';
|
|
|
67
67
|
import * as AppBskyFeedLike from './types/app/bsky/feed/like';
|
|
68
68
|
import * as AppBskyFeedPost from './types/app/bsky/feed/post';
|
|
69
69
|
import * as AppBskyFeedRepost from './types/app/bsky/feed/repost';
|
|
70
|
+
import * as AppBskyGraphBlock from './types/app/bsky/graph/block';
|
|
70
71
|
import * as AppBskyGraphFollow from './types/app/bsky/graph/follow';
|
|
72
|
+
import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks';
|
|
71
73
|
import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers';
|
|
72
74
|
import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows';
|
|
73
75
|
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
@@ -158,7 +160,9 @@ export * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline';
|
|
|
158
160
|
export * as AppBskyFeedLike from './types/app/bsky/feed/like';
|
|
159
161
|
export * as AppBskyFeedPost from './types/app/bsky/feed/post';
|
|
160
162
|
export * as AppBskyFeedRepost from './types/app/bsky/feed/repost';
|
|
163
|
+
export * as AppBskyGraphBlock from './types/app/bsky/graph/block';
|
|
161
164
|
export * as AppBskyGraphFollow from './types/app/bsky/graph/follow';
|
|
165
|
+
export * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks';
|
|
162
166
|
export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers';
|
|
163
167
|
export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows';
|
|
164
168
|
export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
@@ -421,14 +425,37 @@ export declare class RepostRecord {
|
|
|
421
425
|
}
|
|
422
426
|
export declare class GraphNS {
|
|
423
427
|
_service: AtpServiceClient;
|
|
428
|
+
block: BlockRecord;
|
|
424
429
|
follow: FollowRecord;
|
|
425
430
|
constructor(service: AtpServiceClient);
|
|
431
|
+
getBlocks(params?: AppBskyGraphGetBlocks.QueryParams, opts?: AppBskyGraphGetBlocks.CallOptions): Promise<AppBskyGraphGetBlocks.Response>;
|
|
426
432
|
getFollowers(params?: AppBskyGraphGetFollowers.QueryParams, opts?: AppBskyGraphGetFollowers.CallOptions): Promise<AppBskyGraphGetFollowers.Response>;
|
|
427
433
|
getFollows(params?: AppBskyGraphGetFollows.QueryParams, opts?: AppBskyGraphGetFollows.CallOptions): Promise<AppBskyGraphGetFollows.Response>;
|
|
428
434
|
getMutes(params?: AppBskyGraphGetMutes.QueryParams, opts?: AppBskyGraphGetMutes.CallOptions): Promise<AppBskyGraphGetMutes.Response>;
|
|
429
435
|
muteActor(data?: AppBskyGraphMuteActor.InputSchema, opts?: AppBskyGraphMuteActor.CallOptions): Promise<AppBskyGraphMuteActor.Response>;
|
|
430
436
|
unmuteActor(data?: AppBskyGraphUnmuteActor.InputSchema, opts?: AppBskyGraphUnmuteActor.CallOptions): Promise<AppBskyGraphUnmuteActor.Response>;
|
|
431
437
|
}
|
|
438
|
+
export declare class BlockRecord {
|
|
439
|
+
_service: AtpServiceClient;
|
|
440
|
+
constructor(service: AtpServiceClient);
|
|
441
|
+
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
442
|
+
cursor?: string;
|
|
443
|
+
records: {
|
|
444
|
+
uri: string;
|
|
445
|
+
value: AppBskyGraphBlock.Record;
|
|
446
|
+
}[];
|
|
447
|
+
}>;
|
|
448
|
+
get(params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>): Promise<{
|
|
449
|
+
uri: string;
|
|
450
|
+
cid: string;
|
|
451
|
+
value: AppBskyGraphBlock.Record;
|
|
452
|
+
}>;
|
|
453
|
+
create(params: Omit<ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record'>, record: AppBskyGraphBlock.Record, headers?: Record<string, string>): Promise<{
|
|
454
|
+
uri: string;
|
|
455
|
+
cid: string;
|
|
456
|
+
}>;
|
|
457
|
+
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
458
|
+
}
|
|
432
459
|
export declare class FollowRecord {
|
|
433
460
|
_service: AtpServiceClient;
|
|
434
461
|
constructor(service: AtpServiceClient);
|
|
@@ -3169,6 +3169,13 @@ export declare const schemaDict: {
|
|
|
3169
3169
|
muted: {
|
|
3170
3170
|
type: string;
|
|
3171
3171
|
};
|
|
3172
|
+
blockedBy: {
|
|
3173
|
+
type: string;
|
|
3174
|
+
};
|
|
3175
|
+
blocking: {
|
|
3176
|
+
type: string;
|
|
3177
|
+
format: string;
|
|
3178
|
+
};
|
|
3172
3179
|
following: {
|
|
3173
3180
|
type: string;
|
|
3174
3181
|
format: string;
|
|
@@ -3585,6 +3592,13 @@ export declare const schemaDict: {
|
|
|
3585
3592
|
value: {
|
|
3586
3593
|
type: string;
|
|
3587
3594
|
};
|
|
3595
|
+
labels: {
|
|
3596
|
+
type: string;
|
|
3597
|
+
items: {
|
|
3598
|
+
type: string;
|
|
3599
|
+
ref: string;
|
|
3600
|
+
};
|
|
3601
|
+
};
|
|
3588
3602
|
embeds: {
|
|
3589
3603
|
type: string;
|
|
3590
3604
|
items: {
|
|
@@ -3608,6 +3622,16 @@ export declare const schemaDict: {
|
|
|
3608
3622
|
};
|
|
3609
3623
|
};
|
|
3610
3624
|
};
|
|
3625
|
+
viewBlocked: {
|
|
3626
|
+
type: string;
|
|
3627
|
+
required: string[];
|
|
3628
|
+
properties: {
|
|
3629
|
+
uri: {
|
|
3630
|
+
type: string;
|
|
3631
|
+
format: string;
|
|
3632
|
+
};
|
|
3633
|
+
};
|
|
3634
|
+
};
|
|
3611
3635
|
};
|
|
3612
3636
|
};
|
|
3613
3637
|
AppBskyEmbedRecordWithMedia: {
|
|
@@ -3792,6 +3816,20 @@ export declare const schemaDict: {
|
|
|
3792
3816
|
};
|
|
3793
3817
|
};
|
|
3794
3818
|
};
|
|
3819
|
+
blockedPost: {
|
|
3820
|
+
type: string;
|
|
3821
|
+
required: string[];
|
|
3822
|
+
properties: {
|
|
3823
|
+
uri: {
|
|
3824
|
+
type: string;
|
|
3825
|
+
format: string;
|
|
3826
|
+
};
|
|
3827
|
+
blocked: {
|
|
3828
|
+
type: string;
|
|
3829
|
+
const: boolean;
|
|
3830
|
+
};
|
|
3831
|
+
};
|
|
3832
|
+
};
|
|
3795
3833
|
};
|
|
3796
3834
|
};
|
|
3797
3835
|
AppBskyFeedGetAuthorFeed: {
|
|
@@ -3839,6 +3877,9 @@ export declare const schemaDict: {
|
|
|
3839
3877
|
};
|
|
3840
3878
|
};
|
|
3841
3879
|
};
|
|
3880
|
+
errors: {
|
|
3881
|
+
name: string;
|
|
3882
|
+
}[];
|
|
3842
3883
|
};
|
|
3843
3884
|
};
|
|
3844
3885
|
};
|
|
@@ -4245,6 +4286,31 @@ export declare const schemaDict: {
|
|
|
4245
4286
|
};
|
|
4246
4287
|
};
|
|
4247
4288
|
};
|
|
4289
|
+
AppBskyGraphBlock: {
|
|
4290
|
+
lexicon: number;
|
|
4291
|
+
id: string;
|
|
4292
|
+
defs: {
|
|
4293
|
+
main: {
|
|
4294
|
+
type: string;
|
|
4295
|
+
description: string;
|
|
4296
|
+
key: string;
|
|
4297
|
+
record: {
|
|
4298
|
+
type: string;
|
|
4299
|
+
required: string[];
|
|
4300
|
+
properties: {
|
|
4301
|
+
subject: {
|
|
4302
|
+
type: string;
|
|
4303
|
+
format: string;
|
|
4304
|
+
};
|
|
4305
|
+
createdAt: {
|
|
4306
|
+
type: string;
|
|
4307
|
+
format: string;
|
|
4308
|
+
};
|
|
4309
|
+
};
|
|
4310
|
+
};
|
|
4311
|
+
};
|
|
4312
|
+
};
|
|
4313
|
+
};
|
|
4248
4314
|
AppBskyGraphFollow: {
|
|
4249
4315
|
lexicon: number;
|
|
4250
4316
|
id: string;
|
|
@@ -4270,6 +4336,49 @@ export declare const schemaDict: {
|
|
|
4270
4336
|
};
|
|
4271
4337
|
};
|
|
4272
4338
|
};
|
|
4339
|
+
AppBskyGraphGetBlocks: {
|
|
4340
|
+
lexicon: number;
|
|
4341
|
+
id: string;
|
|
4342
|
+
defs: {
|
|
4343
|
+
main: {
|
|
4344
|
+
type: string;
|
|
4345
|
+
description: string;
|
|
4346
|
+
parameters: {
|
|
4347
|
+
type: string;
|
|
4348
|
+
properties: {
|
|
4349
|
+
limit: {
|
|
4350
|
+
type: string;
|
|
4351
|
+
minimum: number;
|
|
4352
|
+
maximum: number;
|
|
4353
|
+
default: number;
|
|
4354
|
+
};
|
|
4355
|
+
cursor: {
|
|
4356
|
+
type: string;
|
|
4357
|
+
};
|
|
4358
|
+
};
|
|
4359
|
+
};
|
|
4360
|
+
output: {
|
|
4361
|
+
encoding: string;
|
|
4362
|
+
schema: {
|
|
4363
|
+
type: string;
|
|
4364
|
+
required: string[];
|
|
4365
|
+
properties: {
|
|
4366
|
+
cursor: {
|
|
4367
|
+
type: string;
|
|
4368
|
+
};
|
|
4369
|
+
blocks: {
|
|
4370
|
+
type: string;
|
|
4371
|
+
items: {
|
|
4372
|
+
type: string;
|
|
4373
|
+
ref: string;
|
|
4374
|
+
};
|
|
4375
|
+
};
|
|
4376
|
+
};
|
|
4377
|
+
};
|
|
4378
|
+
};
|
|
4379
|
+
};
|
|
4380
|
+
};
|
|
4381
|
+
};
|
|
4273
4382
|
AppBskyGraphGetFollowers: {
|
|
4274
4383
|
lexicon: number;
|
|
4275
4384
|
id: string;
|
|
@@ -4794,7 +4903,9 @@ export declare const ids: {
|
|
|
4794
4903
|
AppBskyFeedLike: string;
|
|
4795
4904
|
AppBskyFeedPost: string;
|
|
4796
4905
|
AppBskyFeedRepost: string;
|
|
4906
|
+
AppBskyGraphBlock: string;
|
|
4797
4907
|
AppBskyGraphFollow: string;
|
|
4908
|
+
AppBskyGraphGetBlocks: string;
|
|
4798
4909
|
AppBskyGraphGetFollowers: string;
|
|
4799
4910
|
AppBskyGraphGetFollows: string;
|
|
4800
4911
|
AppBskyGraphGetMutes: string;
|
|
@@ -43,6 +43,8 @@ export declare function isProfileViewDetailed(v: unknown): v is ProfileViewDetai
|
|
|
43
43
|
export declare function validateProfileViewDetailed(v: unknown): ValidationResult;
|
|
44
44
|
export interface ViewerState {
|
|
45
45
|
muted?: boolean;
|
|
46
|
+
blockedBy?: boolean;
|
|
47
|
+
blocking?: string;
|
|
46
48
|
following?: string;
|
|
47
49
|
followedBy?: string;
|
|
48
50
|
[k: string]: unknown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ValidationResult } from '@atproto/lexicon';
|
|
2
2
|
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
|
|
3
3
|
import * as AppBskyActorDefs from '../actor/defs';
|
|
4
|
+
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
|
|
4
5
|
import * as AppBskyEmbedImages from './images';
|
|
5
6
|
import * as AppBskyEmbedExternal from './external';
|
|
6
7
|
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia';
|
|
@@ -11,7 +12,7 @@ export interface Main {
|
|
|
11
12
|
export declare function isMain(v: unknown): v is Main;
|
|
12
13
|
export declare function validateMain(v: unknown): ValidationResult;
|
|
13
14
|
export interface View {
|
|
14
|
-
record: ViewRecord | ViewNotFound | {
|
|
15
|
+
record: ViewRecord | ViewNotFound | ViewBlocked | {
|
|
15
16
|
$type: string;
|
|
16
17
|
[k: string]: unknown;
|
|
17
18
|
};
|
|
@@ -24,6 +25,7 @@ export interface ViewRecord {
|
|
|
24
25
|
cid: string;
|
|
25
26
|
author: AppBskyActorDefs.ProfileViewBasic;
|
|
26
27
|
value: {};
|
|
28
|
+
labels?: ComAtprotoLabelDefs.Label[];
|
|
27
29
|
embeds?: (AppBskyEmbedImages.View | AppBskyEmbedExternal.View | View | AppBskyEmbedRecordWithMedia.View | {
|
|
28
30
|
$type: string;
|
|
29
31
|
[k: string]: unknown;
|
|
@@ -39,3 +41,9 @@ export interface ViewNotFound {
|
|
|
39
41
|
}
|
|
40
42
|
export declare function isViewNotFound(v: unknown): v is ViewNotFound;
|
|
41
43
|
export declare function validateViewNotFound(v: unknown): ValidationResult;
|
|
44
|
+
export interface ViewBlocked {
|
|
45
|
+
uri: string;
|
|
46
|
+
[k: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
export declare function isViewBlocked(v: unknown): v is ViewBlocked;
|
|
49
|
+
export declare function validateViewBlocked(v: unknown): ValidationResult;
|
|
@@ -58,11 +58,11 @@ export declare function isReasonRepost(v: unknown): v is ReasonRepost;
|
|
|
58
58
|
export declare function validateReasonRepost(v: unknown): ValidationResult;
|
|
59
59
|
export interface ThreadViewPost {
|
|
60
60
|
post: PostView;
|
|
61
|
-
parent?: ThreadViewPost | NotFoundPost | {
|
|
61
|
+
parent?: ThreadViewPost | NotFoundPost | BlockedPost | {
|
|
62
62
|
$type: string;
|
|
63
63
|
[k: string]: unknown;
|
|
64
64
|
};
|
|
65
|
-
replies?: (ThreadViewPost | NotFoundPost | {
|
|
65
|
+
replies?: (ThreadViewPost | NotFoundPost | BlockedPost | {
|
|
66
66
|
$type: string;
|
|
67
67
|
[k: string]: unknown;
|
|
68
68
|
})[];
|
|
@@ -77,3 +77,10 @@ export interface NotFoundPost {
|
|
|
77
77
|
}
|
|
78
78
|
export declare function isNotFoundPost(v: unknown): v is NotFoundPost;
|
|
79
79
|
export declare function validateNotFoundPost(v: unknown): ValidationResult;
|
|
80
|
+
export interface BlockedPost {
|
|
81
|
+
uri: string;
|
|
82
|
+
blocked: true;
|
|
83
|
+
[k: string]: unknown;
|
|
84
|
+
}
|
|
85
|
+
export declare function isBlockedPost(v: unknown): v is BlockedPost;
|
|
86
|
+
export declare function validateBlockedPost(v: unknown): ValidationResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Headers } from '@atproto/xrpc';
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
2
|
import * as AppBskyFeedDefs from './defs';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
actor: string;
|
|
@@ -19,4 +19,10 @@ export interface Response {
|
|
|
19
19
|
headers: Headers;
|
|
20
20
|
data: OutputSchema;
|
|
21
21
|
}
|
|
22
|
+
export declare class BlockedActorError extends XRPCError {
|
|
23
|
+
constructor(src: XRPCError);
|
|
24
|
+
}
|
|
25
|
+
export declare class BlockedByActorError extends XRPCError {
|
|
26
|
+
constructor(src: XRPCError);
|
|
27
|
+
}
|
|
22
28
|
export declare function toKnownErr(e: any): any;
|
|
@@ -6,7 +6,7 @@ export interface QueryParams {
|
|
|
6
6
|
}
|
|
7
7
|
export declare type InputSchema = undefined;
|
|
8
8
|
export interface OutputSchema {
|
|
9
|
-
thread: AppBskyFeedDefs.ThreadViewPost | AppBskyFeedDefs.NotFoundPost | {
|
|
9
|
+
thread: AppBskyFeedDefs.ThreadViewPost | AppBskyFeedDefs.NotFoundPost | AppBskyFeedDefs.BlockedPost | {
|
|
10
10
|
$type: string;
|
|
11
11
|
[k: string]: unknown;
|
|
12
12
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
export interface Record {
|
|
3
|
+
subject: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
[k: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare function isRecord(v: unknown): v is Record;
|
|
8
|
+
export declare function validateRecord(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
import * as AppBskyActorDefs from '../actor/defs';
|
|
3
|
+
export interface QueryParams {
|
|
4
|
+
limit?: number;
|
|
5
|
+
cursor?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type InputSchema = undefined;
|
|
8
|
+
export interface OutputSchema {
|
|
9
|
+
cursor?: string;
|
|
10
|
+
blocks: AppBskyActorDefs.ProfileView[];
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface CallOptions {
|
|
14
|
+
headers?: Headers;
|
|
15
|
+
}
|
|
16
|
+
export interface Response {
|
|
17
|
+
success: boolean;
|
|
18
|
+
headers: Headers;
|
|
19
|
+
data: OutputSchema;
|
|
20
|
+
}
|
|
21
|
+
export declare function toKnownErr(e: any): any;
|