@atproto/api 0.6.9 → 0.6.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/LICENSE +21 -0
- package/README.md +45 -36
- package/bench/agent.bench.ts +2 -2
- package/build.js +0 -8
- package/definitions/labels.json +7 -1
- package/definitions/locale/en/label-groups.json +1 -1
- package/definitions/locale/en/labels.json +15 -1
- package/definitions/locale/en/proposed-label-groups.json +1 -1
- package/definitions/locale/en/proposed-labels.json +1 -1
- package/definitions/post-moderation-behaviors.json +315 -231
- package/definitions/profile-moderation-behaviors.json +188 -117
- package/definitions/proposed-labels.json +1 -1
- package/dist/client/lexicons.d.ts +33 -0
- package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +7 -1
- package/dist/client/types/app/bsky/actor/ref.d.ts +28 -0
- package/dist/client/types/app/bsky/actor/search.d.ts +22 -0
- package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +20 -0
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +40 -0
- package/dist/client/types/app/bsky/embed/images.d.ts +9 -0
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
- package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/setVote.d.ts +25 -0
- package/dist/client/types/app/bsky/feed/trend.d.ts +9 -0
- package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/vote.d.ts +10 -0
- package/dist/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/assertMember.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/assertion.d.ts +10 -0
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
- package/dist/client/types/app/bsky/{actor/getFeedSuggestions.d.ts → graph/getListBlocks.d.ts} +2 -2
- package/dist/client/types/app/bsky/graph/getMembers.d.ts +36 -0
- package/dist/client/types/app/bsky/graph/getMemberships.d.ts +36 -0
- package/dist/client/types/app/bsky/graph/listblock.d.ts +8 -0
- package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/getCount.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/list.d.ts +35 -0
- package/dist/client/types/app/bsky/system/actorScene.d.ts +1 -0
- package/dist/client/types/app/bsky/system/actorUser.d.ts +1 -0
- package/dist/client/types/app/bsky/system/declRef.d.ts +8 -0
- package/dist/client/types/app/bsky/system/declaration.d.ts +7 -0
- package/dist/client/types/app/bsky/unspecced/registerPushNotification.d.ts +16 -0
- package/dist/client/types/com/atproto/account/create.d.ts +41 -0
- package/dist/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
- package/dist/client/types/com/atproto/account/delete.d.ts +25 -0
- package/dist/client/types/com/atproto/account/get.d.ts +12 -0
- package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
- package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
- package/dist/client/types/com/atproto/account/resetPassword.d.ts +24 -0
- package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +60 -0
- package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +24 -0
- package/dist/client/types/com/atproto/admin/record.d.ts +43 -0
- package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
- package/dist/client/types/com/atproto/blob/upload.d.ts +19 -0
- package/dist/client/types/com/atproto/handle/resolve.d.ts +18 -0
- package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
- package/dist/client/types/com/atproto/repo/batchWrite.d.ts +46 -0
- package/dist/client/types/com/atproto/repo/describe.d.ts +22 -0
- package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +24 -0
- package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
- package/dist/client/types/com/atproto/report/create.d.ts +39 -0
- package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
- package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
- package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +27 -0
- package/dist/client/types/com/atproto/session/create.d.ts +29 -0
- package/dist/client/types/com/atproto/session/delete.d.ts +13 -0
- package/dist/client/types/com/atproto/session/get.d.ts +18 -0
- package/dist/client/types/com/atproto/session/refresh.d.ts +24 -0
- package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +20 -0
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +18 -0
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
- package/dist/helpers/bsky.d.ts +20 -0
- package/dist/index.js +941 -1137
- package/dist/index.js.map +4 -4
- package/dist/mixins/bsky.d.ts +23 -0
- package/dist/rich-text/sanitize.d.ts +4 -0
- package/dist/session.d.ts +42 -0
- package/docs/labels.md +43 -27
- package/docs/moderation-behaviors/posts.md +13 -516
- package/docs/moderation-behaviors/profiles.md +14 -174
- package/docs/moderation.md +3 -3
- package/package.json +24 -24
- package/src/client/lexicons.ts +35 -0
- package/src/client/types/app/bsky/actor/defs.ts +19 -0
- package/src/client/types/app/bsky/embed/images.ts +21 -0
- package/src/moderation/const/label-groups.ts +1 -0
- package/src/moderation/const/labels.ts +30 -0
- package/tsconfig.build.json +1 -1
- package/update-pkg.js +0 -14
- /package/dist/client/types/app/bsky/feed/{getFeedSuggestions.d.ts → getSavedFeeds.d.ts} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AtpAgentType } from '../types';
|
|
2
|
+
export declare function addBsky<TBase extends AtpAgentType>(Base: TBase): {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
like(uri: string, cid: string): Promise<{
|
|
5
|
+
uri: string;
|
|
6
|
+
cid: string;
|
|
7
|
+
}>;
|
|
8
|
+
unlike(likeUri: string): Promise<void>;
|
|
9
|
+
repost(uri: string, cid: string): Promise<{
|
|
10
|
+
uri: string;
|
|
11
|
+
cid: string;
|
|
12
|
+
}>;
|
|
13
|
+
unrepost(repostUri: string): Promise<void>;
|
|
14
|
+
follow(subjectDid: string): Promise<{
|
|
15
|
+
uri: string;
|
|
16
|
+
cid: string;
|
|
17
|
+
}>;
|
|
18
|
+
unfollow(followUri: string): Promise<void>;
|
|
19
|
+
service: URL;
|
|
20
|
+
api: import("..").AtpServiceClient;
|
|
21
|
+
session?: import("../types").AtpSessionData | undefined;
|
|
22
|
+
};
|
|
23
|
+
} & TBase;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CallOptions, Client as XrpcClient, ServiceClient as XrpcServiceClient, QueryParams, XRPCResponse } from '@atproto/xrpc';
|
|
2
|
+
import TypedEmitter from 'typed-emitter';
|
|
3
|
+
import { Client, ServiceClient } from './client';
|
|
4
|
+
export declare class SessionClient extends Client {
|
|
5
|
+
service(serviceUri: string | URL): SessionServiceClient;
|
|
6
|
+
}
|
|
7
|
+
declare const defaultInst: SessionClient;
|
|
8
|
+
export default defaultInst;
|
|
9
|
+
export declare class SessionServiceClient extends ServiceClient {
|
|
10
|
+
xrpc: SessionXrpcServiceClient;
|
|
11
|
+
sessionManager: SessionManager;
|
|
12
|
+
constructor(baseClient: Client, xrpcService: SessionXrpcServiceClient);
|
|
13
|
+
}
|
|
14
|
+
export declare class SessionXrpcServiceClient extends XrpcServiceClient {
|
|
15
|
+
sessionManager: SessionManager;
|
|
16
|
+
refreshing?: Promise<XRPCResponse>;
|
|
17
|
+
constructor(baseClient: XrpcClient, serviceUri: string | URL);
|
|
18
|
+
call(methodNsid: string, params?: QueryParams, data?: unknown, opts?: CallOptions): Promise<XRPCResponse>;
|
|
19
|
+
refresh(opts?: CallOptions): Promise<XRPCResponse>;
|
|
20
|
+
private _refresh;
|
|
21
|
+
}
|
|
22
|
+
declare const SessionManager_base: new () => TypedEmitter<SessionEvents>;
|
|
23
|
+
export declare class SessionManager extends SessionManager_base {
|
|
24
|
+
session?: Session;
|
|
25
|
+
get(): Session | undefined;
|
|
26
|
+
set(session: Session): void;
|
|
27
|
+
unset(): void;
|
|
28
|
+
active(): boolean;
|
|
29
|
+
accessHeaders(): {
|
|
30
|
+
authorization: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
refreshHeaders(): {
|
|
33
|
+
authorization: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}
|
|
36
|
+
export declare type Session = {
|
|
37
|
+
refreshJwt: string;
|
|
38
|
+
accessJwt: string;
|
|
39
|
+
};
|
|
40
|
+
declare type SessionEvents = {
|
|
41
|
+
session: (session?: Session) => void;
|
|
42
|
+
};
|
package/docs/labels.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
<!-- this doc is generated by ./scripts/docs/labels.mjs -->
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This document is a reference for the labels used in the SDK.
|
|
3
|
+
# Labels
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
This document is a reference for the labels used in the SDK.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
**⚠️ Note**: These labels are still in development and may change over time. Not all are currently in use.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## Key
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
### Label Preferences
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
- <code>warn</code> Provide some form of warning on the content (see "On Warn" behavior).
|
|
17
|
-
- <code>hide</code> Remove the content from feeds and apply the warning when directly viewed.
|
|
13
|
+
The possible client interpretations for a label.
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
- <code>ignore</code> Do nothing with the label.
|
|
16
|
+
- <code>warn</code> Provide some form of warning on the content (see "On Warn" behavior).
|
|
17
|
+
- <code>hide</code> Remove the content from feeds and apply the warning when directly viewed.
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
Each label specifies which preferences it can support. If a label is not configurable, it must have only own supported preference.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
### Configurable?
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
Non-configurable labels cannot have their preference changed by the user.
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
### Flags
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
- <code>adult</code> The user must have adult content enabled to configure the label. If adult content is not enabled, the label must adopt the strictest preference.
|
|
27
|
+
Additional behaviors which a label can adopt.
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
- <code>no-override</code> The user cannot click through any covering of content created by the label.
|
|
30
|
+
- <code>adult</code> The user must have adult content enabled to configure the label. If adult content is not enabled, the label must adopt the strictest preference.
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
### On Warn
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
- <code>blur-media</code> Hide only the media within the content (ie images) behind an interstitial.
|
|
38
|
-
- <code>alert</code> Display a descriptive warning but do not hide the content.
|
|
39
|
-
- <code>null</code> Do nothing.
|
|
34
|
+
The kind of UI behavior used when a warning must be applied.
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
- <code>blur</code> Hide all of the content behind an interstitial.
|
|
37
|
+
- <code>blur-media</code> Hide only the media within the content (ie images) behind an interstitial.
|
|
38
|
+
- <code>alert</code> Display a descriptive warning but do not hide the content.
|
|
39
|
+
- <code>null</code> Do nothing.
|
|
40
|
+
|
|
41
|
+
## Label Behaviors
|
|
42
42
|
|
|
43
43
|
<table>
|
|
44
44
|
<tr>
|
|
@@ -256,10 +256,18 @@
|
|
|
256
256
|
<td>✅</td>
|
|
257
257
|
<td></td>
|
|
258
258
|
<td>alert</td>
|
|
259
|
+
</tr>
|
|
260
|
+
<tr>
|
|
261
|
+
<td>misleading</td>
|
|
262
|
+
<td>misinfo</td>
|
|
263
|
+
<td>ignore, warn, hide</td>
|
|
264
|
+
<td>✅</td>
|
|
265
|
+
<td></td>
|
|
266
|
+
<td>alert</td>
|
|
259
267
|
</tr>
|
|
260
268
|
</table>
|
|
261
269
|
|
|
262
|
-
|
|
270
|
+
## Label Group Descriptions
|
|
263
271
|
|
|
264
272
|
<table>
|
|
265
273
|
<tr>
|
|
@@ -304,7 +312,7 @@
|
|
|
304
312
|
</tr>
|
|
305
313
|
</table>
|
|
306
314
|
|
|
307
|
-
|
|
315
|
+
## Label Descriptions
|
|
308
316
|
|
|
309
317
|
<table>
|
|
310
318
|
<tr>
|
|
@@ -519,4 +527,12 @@
|
|
|
519
527
|
<code>on content</code><br><strong>Scam Warning</strong><br>The moderators believe this is fraudulent content.<br><br>
|
|
520
528
|
</td>
|
|
521
529
|
</tr>
|
|
522
|
-
|
|
530
|
+
<tr>
|
|
531
|
+
<td>misleading</td>
|
|
532
|
+
<td>
|
|
533
|
+
<code>general</code><br><strong>Misleading</strong><br>Accounts which share misleading information.<br><br>
|
|
534
|
+
<code>on an account</code><br><strong>Misleading</strong><br>The moderators believe this account is spreading misleading information.<br><br>
|
|
535
|
+
<code>on content</code><br><strong>Misleading</strong><br>The moderators believe this account is spreading misleading information.<br><br>
|
|
536
|
+
</td>
|
|
537
|
+
</tr>
|
|
538
|
+
</table>
|