Skip to content

Commit e851998

Browse files
authored
refactor: refactor directory structure, file names and add import aliases (#13)
1 parent 848dd21 commit e851998

File tree

18 files changed

+478
-436
lines changed

18 files changed

+478
-436
lines changed

packages/core/src/actor.ts

Lines changed: 0 additions & 347 deletions
This file was deleted.

packages/core/src/bsky/Actor.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import type {
2+
AppBskyGraphMuteActor,
3+
AppBskyGraphMuteActorList,
4+
AppBskyGraphUnmuteActor,
5+
AppBskyGraphUnmuteActorList,
6+
AppBskyNS,
7+
} from '@atproto/api';
8+
import { BaseActor } from './BaseActor';
9+
10+
export class Actor extends BaseActor {
11+
/**
12+
* Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.
13+
*/
14+
mute(options?: AppBskyGraphMuteActor.CallOptions) {
15+
return this.instance.graph.muteActor({ actor: this.actor }, options);
16+
}
17+
18+
/**
19+
* Unmutes the specified account. Requires auth.
20+
*/
21+
unmute(options?: AppBskyGraphUnmuteActor.CallOptions) {
22+
return this.instance.graph.unmuteActor({ actor: this.actor }, options);
23+
}
24+
25+
/**
26+
* Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.
27+
*/
28+
static muteMany(
29+
instance: AppBskyNS,
30+
actors: string[],
31+
options?: AppBskyGraphMuteActorList.CallOptions,
32+
) {
33+
// FIXME: Shouldn't this take an array?
34+
return instance.graph.muteActorList({ list: actors[0] }, options);
35+
}
36+
37+
/**
38+
* Unmutes the specified list of accounts. Requires auth.
39+
*/
40+
static unmuteMany(
41+
instance: AppBskyNS,
42+
actors: string[],
43+
options?: AppBskyGraphUnmuteActorList.CallOptions,
44+
) {
45+
// FIXME: Shouldn't this take an array?
46+
return instance.graph.unmuteActorList({ list: actors[0] }, options);
47+
}
48+
}

0 commit comments

Comments
 (0)