@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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -36
  3. package/bench/agent.bench.ts +2 -2
  4. package/build.js +0 -8
  5. package/definitions/labels.json +7 -1
  6. package/definitions/locale/en/label-groups.json +1 -1
  7. package/definitions/locale/en/labels.json +15 -1
  8. package/definitions/locale/en/proposed-label-groups.json +1 -1
  9. package/definitions/locale/en/proposed-labels.json +1 -1
  10. package/definitions/post-moderation-behaviors.json +315 -231
  11. package/definitions/profile-moderation-behaviors.json +188 -117
  12. package/definitions/proposed-labels.json +1 -1
  13. package/dist/client/lexicons.d.ts +33 -0
  14. package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
  15. package/dist/client/types/app/bsky/actor/defs.d.ts +7 -1
  16. package/dist/client/types/app/bsky/actor/ref.d.ts +28 -0
  17. package/dist/client/types/app/bsky/actor/search.d.ts +22 -0
  18. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +20 -0
  19. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +40 -0
  20. package/dist/client/types/app/bsky/embed/images.d.ts +9 -0
  21. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
  22. package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
  23. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
  24. package/dist/client/types/app/bsky/feed/setVote.d.ts +25 -0
  25. package/dist/client/types/app/bsky/feed/trend.d.ts +9 -0
  26. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
  27. package/dist/client/types/app/bsky/feed/vote.d.ts +10 -0
  28. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
  29. package/dist/client/types/app/bsky/graph/assertMember.d.ts +1 -0
  30. package/dist/client/types/app/bsky/graph/assertion.d.ts +10 -0
  31. package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
  32. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
  33. package/dist/client/types/app/bsky/{actor/getFeedSuggestions.d.ts → graph/getListBlocks.d.ts} +2 -2
  34. package/dist/client/types/app/bsky/graph/getMembers.d.ts +36 -0
  35. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +36 -0
  36. package/dist/client/types/app/bsky/graph/listblock.d.ts +8 -0
  37. package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
  38. package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +17 -0
  39. package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
  40. package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +17 -0
  41. package/dist/client/types/app/bsky/notification/getCount.d.ts +17 -0
  42. package/dist/client/types/app/bsky/notification/list.d.ts +35 -0
  43. package/dist/client/types/app/bsky/system/actorScene.d.ts +1 -0
  44. package/dist/client/types/app/bsky/system/actorUser.d.ts +1 -0
  45. package/dist/client/types/app/bsky/system/declRef.d.ts +8 -0
  46. package/dist/client/types/app/bsky/system/declaration.d.ts +7 -0
  47. package/dist/client/types/app/bsky/unspecced/registerPushNotification.d.ts +16 -0
  48. package/dist/client/types/com/atproto/account/create.d.ts +41 -0
  49. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
  50. package/dist/client/types/com/atproto/account/delete.d.ts +25 -0
  51. package/dist/client/types/com/atproto/account/get.d.ts +12 -0
  52. package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
  53. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
  54. package/dist/client/types/com/atproto/account/resetPassword.d.ts +24 -0
  55. package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
  56. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +60 -0
  57. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
  58. package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +24 -0
  59. package/dist/client/types/com/atproto/admin/record.d.ts +43 -0
  60. package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
  61. package/dist/client/types/com/atproto/blob/upload.d.ts +19 -0
  62. package/dist/client/types/com/atproto/handle/resolve.d.ts +18 -0
  63. package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
  64. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +46 -0
  65. package/dist/client/types/com/atproto/repo/describe.d.ts +22 -0
  66. package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +24 -0
  67. package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
  68. package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
  69. package/dist/client/types/com/atproto/report/create.d.ts +39 -0
  70. package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
  71. package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
  72. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +27 -0
  73. package/dist/client/types/com/atproto/session/create.d.ts +29 -0
  74. package/dist/client/types/com/atproto/session/delete.d.ts +13 -0
  75. package/dist/client/types/com/atproto/session/get.d.ts +18 -0
  76. package/dist/client/types/com/atproto/session/refresh.d.ts +24 -0
  77. package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +20 -0
  78. package/dist/client/types/com/atproto/sync/getRoot.d.ts +18 -0
  79. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
  80. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
  81. package/dist/helpers/bsky.d.ts +20 -0
  82. package/dist/index.js +941 -1137
  83. package/dist/index.js.map +4 -4
  84. package/dist/mixins/bsky.d.ts +23 -0
  85. package/dist/rich-text/sanitize.d.ts +4 -0
  86. package/dist/session.d.ts +42 -0
  87. package/docs/labels.md +43 -27
  88. package/docs/moderation-behaviors/posts.md +13 -516
  89. package/docs/moderation-behaviors/profiles.md +14 -174
  90. package/docs/moderation.md +3 -3
  91. package/package.json +24 -24
  92. package/src/client/lexicons.ts +35 -0
  93. package/src/client/types/app/bsky/actor/defs.ts +19 -0
  94. package/src/client/types/app/bsky/embed/images.ts +21 -0
  95. package/src/moderation/const/label-groups.ts +1 -0
  96. package/src/moderation/const/labels.ts +30 -0
  97. package/tsconfig.build.json +1 -1
  98. package/update-pkg.js +0 -14
  99. /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,4 @@
1
+ import { RichText } from './rich-text';
2
+ export declare function sanitizeRichText(richText: RichText, opts: {
3
+ cleanNewlines?: boolean;
4
+ }): RichText;
@@ -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
- # Labels
4
-
5
- This document is a reference for the labels used in the SDK.
3
+ # Labels
6
4
 
7
- **⚠️ Note**: These labels are still in development and may change over time. Not all are currently in use.
5
+ This document is a reference for the labels used in the SDK.
8
6
 
9
- ## Key
7
+ **⚠️ Note**: These labels are still in development and may change over time. Not all are currently in use.
10
8
 
11
- ### Label Preferences
9
+ ## Key
12
10
 
13
- The possible client interpretations for a label.
11
+ ### Label Preferences
14
12
 
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.
13
+ The possible client interpretations for a label.
18
14
 
19
- Each label specifies which preferences it can support. If a label is not configurable, it must have only own supported preference.
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
- ### Configurable?
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
- Non-configurable labels cannot have their preference changed by the user.
21
+ ### Configurable?
24
22
 
25
- ### Flags
23
+ Non-configurable labels cannot have their preference changed by the user.
26
24
 
27
- Additional behaviors which a label can adopt.
25
+ ### Flags
28
26
 
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.
27
+ Additional behaviors which a label can adopt.
31
28
 
32
- ### On Warn
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
- The kind of UI behavior used when a warning must be applied.
32
+ ### On Warn
35
33
 
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.
34
+ The kind of UI behavior used when a warning must be applied.
40
35
 
41
- ## Label Behaviors
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
- ## Label Group Descriptions
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
- ## Label Descriptions
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
- </table>
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>