@atproto/api 0.6.20 → 0.6.22

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 (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE.txt +7 -0
  3. package/README.md +10 -1
  4. package/definitions/moderation-behaviors.d.ts +1 -0
  5. package/definitions/profile-moderation-behaviors.json +25 -0
  6. package/dist/agent.d.ts +2 -0
  7. package/dist/bsky-agent.d.ts +7 -0
  8. package/dist/client/index.d.ts +12 -0
  9. package/dist/client/lexicons.d.ts +243 -3
  10. package/dist/client/types/app/bsky/actor/defs.d.ts +1 -0
  11. package/dist/client/types/com/atproto/admin/defs.d.ts +28 -0
  12. package/dist/client/types/com/atproto/admin/getAccountInfo.d.ts +16 -0
  13. package/dist/client/types/com/atproto/admin/getSubjectStatus.d.ts +26 -0
  14. package/dist/client/types/com/atproto/admin/searchRepos.d.ts +0 -1
  15. package/dist/client/types/com/atproto/admin/updateSubjectStatus.d.ts +32 -0
  16. package/dist/client/types/com/atproto/server/createAccount.d.ts +4 -2
  17. package/dist/client/types/com/atproto/server/createSession.d.ts +1 -0
  18. package/dist/client/types/com/atproto/server/refreshSession.d.ts +1 -0
  19. package/dist/client/types/com/atproto/server/reserveSigningKey.d.ts +22 -0
  20. package/dist/client/types/com/atproto/sync/listRepos.d.ts +1 -0
  21. package/dist/index.js +878 -425
  22. package/dist/index.js.map +3 -3
  23. package/dist/moderation/accumulator.d.ts +1 -0
  24. package/docs/moderation-behaviors/profiles.md +17 -0
  25. package/package.json +8 -7
  26. package/src/agent.ts +28 -1
  27. package/src/bsky-agent.ts +43 -0
  28. package/src/client/index.ts +52 -0
  29. package/src/client/lexicons.ts +259 -5
  30. package/src/client/types/app/bsky/actor/defs.ts +1 -0
  31. package/src/client/types/com/atproto/admin/defs.ts +61 -0
  32. package/src/client/types/com/atproto/admin/getAccountInfo.ts +32 -0
  33. package/src/client/types/com/atproto/admin/getSubjectStatus.ts +44 -0
  34. package/src/client/types/com/atproto/admin/searchRepos.ts +0 -1
  35. package/src/client/types/com/atproto/admin/updateSubjectStatus.ts +50 -0
  36. package/src/client/types/com/atproto/server/createAccount.ts +4 -2
  37. package/src/client/types/com/atproto/server/createSession.ts +1 -0
  38. package/src/client/types/com/atproto/server/refreshSession.ts +1 -0
  39. package/src/client/types/com/atproto/server/reserveSigningKey.ts +40 -0
  40. package/src/client/types/com/atproto/sync/listRepos.ts +1 -0
  41. package/src/moderation/accumulator.ts +13 -0
  42. package/src/moderation/subjects/account.ts +7 -1
  43. package/tests/agent.test.ts +18 -21
  44. package/tests/bsky-agent.test.ts +19 -25
  45. package/tests/errors.test.ts +5 -11
  46. package/tests/rich-text-detection.test.ts +3 -3
  47. package/tests/util/index.ts +3 -0
  48. package/tests/util/moderation-behavior.ts +10 -2
  49. package/LICENSE +0 -21
@@ -3,6 +3,13 @@ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
3
3
  import * as ComAtprotoModerationDefs from '../moderation/defs';
4
4
  import * as ComAtprotoServerDefs from '../server/defs';
5
5
  import * as ComAtprotoLabelDefs from '../label/defs';
6
+ export interface StatusAttr {
7
+ applied: boolean;
8
+ ref?: string;
9
+ [k: string]: unknown;
10
+ }
11
+ export declare function isStatusAttr(v: unknown): v is StatusAttr;
12
+ export declare function validateStatusAttr(v: unknown): ValidationResult;
6
13
  export interface ActionView {
7
14
  id: number;
8
15
  action: ActionType;
@@ -125,6 +132,19 @@ export interface RepoViewDetail {
125
132
  }
126
133
  export declare function isRepoViewDetail(v: unknown): v is RepoViewDetail;
127
134
  export declare function validateRepoViewDetail(v: unknown): ValidationResult;
135
+ export interface AccountView {
136
+ did: string;
137
+ handle: string;
138
+ email?: string;
139
+ indexedAt: string;
140
+ invitedBy?: ComAtprotoServerDefs.InviteCode;
141
+ invites?: ComAtprotoServerDefs.InviteCode[];
142
+ invitesDisabled?: boolean;
143
+ inviteNote?: string;
144
+ [k: string]: unknown;
145
+ }
146
+ export declare function isAccountView(v: unknown): v is AccountView;
147
+ export declare function validateAccountView(v: unknown): ValidationResult;
128
148
  export interface RepoViewNotFound {
129
149
  did: string;
130
150
  [k: string]: unknown;
@@ -137,6 +157,14 @@ export interface RepoRef {
137
157
  }
138
158
  export declare function isRepoRef(v: unknown): v is RepoRef;
139
159
  export declare function validateRepoRef(v: unknown): ValidationResult;
160
+ export interface RepoBlobRef {
161
+ did: string;
162
+ cid: string;
163
+ recordUri?: string;
164
+ [k: string]: unknown;
165
+ }
166
+ export declare function isRepoBlobRef(v: unknown): v is RepoBlobRef;
167
+ export declare function validateRepoBlobRef(v: unknown): ValidationResult;
140
168
  export interface RecordView {
141
169
  uri: string;
142
170
  cid: string;
@@ -0,0 +1,16 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as ComAtprotoAdminDefs from './defs';
3
+ export interface QueryParams {
4
+ did: string;
5
+ }
6
+ export declare type InputSchema = undefined;
7
+ export declare type OutputSchema = ComAtprotoAdminDefs.AccountView;
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ }
11
+ export interface Response {
12
+ success: boolean;
13
+ headers: Headers;
14
+ data: OutputSchema;
15
+ }
16
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,26 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
4
+ export interface QueryParams {
5
+ did?: string;
6
+ uri?: string;
7
+ blob?: string;
8
+ }
9
+ export declare type InputSchema = undefined;
10
+ export interface OutputSchema {
11
+ subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | ComAtprotoAdminDefs.RepoBlobRef | {
12
+ $type: string;
13
+ [k: string]: unknown;
14
+ };
15
+ takedown?: ComAtprotoAdminDefs.StatusAttr;
16
+ [k: string]: unknown;
17
+ }
18
+ export interface CallOptions {
19
+ headers?: Headers;
20
+ }
21
+ export interface Response {
22
+ success: boolean;
23
+ headers: Headers;
24
+ data: OutputSchema;
25
+ }
26
+ export declare function toKnownErr(e: any): any;
@@ -3,7 +3,6 @@ import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  term?: string;
5
5
  q?: string;
6
- invitedBy?: string;
7
6
  limit?: number;
8
7
  cursor?: string;
9
8
  }
@@ -0,0 +1,32 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
4
+ export interface QueryParams {
5
+ }
6
+ export interface InputSchema {
7
+ subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | ComAtprotoAdminDefs.RepoBlobRef | {
8
+ $type: string;
9
+ [k: string]: unknown;
10
+ };
11
+ takedown?: ComAtprotoAdminDefs.StatusAttr;
12
+ [k: string]: unknown;
13
+ }
14
+ export interface OutputSchema {
15
+ subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | ComAtprotoAdminDefs.RepoBlobRef | {
16
+ $type: string;
17
+ [k: string]: unknown;
18
+ };
19
+ takedown?: ComAtprotoAdminDefs.StatusAttr;
20
+ [k: string]: unknown;
21
+ }
22
+ export interface CallOptions {
23
+ headers?: Headers;
24
+ qp?: QueryParams;
25
+ encoding: 'application/json';
26
+ }
27
+ export interface Response {
28
+ success: boolean;
29
+ headers: Headers;
30
+ data: OutputSchema;
31
+ }
32
+ export declare function toKnownErr(e: any): any;
@@ -2,12 +2,13 @@ import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
3
  }
4
4
  export interface InputSchema {
5
- email: string;
5
+ email?: string;
6
6
  handle: string;
7
7
  did?: string;
8
8
  inviteCode?: string;
9
- password: string;
9
+ password?: string;
10
10
  recoveryKey?: string;
11
+ plcOp?: {};
11
12
  [k: string]: unknown;
12
13
  }
13
14
  export interface OutputSchema {
@@ -15,6 +16,7 @@ export interface OutputSchema {
15
16
  refreshJwt: string;
16
17
  handle: string;
17
18
  did: string;
19
+ didDoc?: {};
18
20
  [k: string]: unknown;
19
21
  }
20
22
  export interface CallOptions {
@@ -11,6 +11,7 @@ export interface OutputSchema {
11
11
  refreshJwt: string;
12
12
  handle: string;
13
13
  did: string;
14
+ didDoc?: {};
14
15
  email?: string;
15
16
  emailConfirmed?: boolean;
16
17
  [k: string]: unknown;
@@ -7,6 +7,7 @@ export interface OutputSchema {
7
7
  refreshJwt: string;
8
8
  handle: string;
9
9
  did: string;
10
+ didDoc?: {};
10
11
  [k: string]: unknown;
11
12
  }
12
13
  export interface CallOptions {
@@ -0,0 +1,22 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ did?: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface OutputSchema {
9
+ signingKey: string;
10
+ [k: string]: unknown;
11
+ }
12
+ export interface CallOptions {
13
+ headers?: Headers;
14
+ qp?: QueryParams;
15
+ encoding: 'application/json';
16
+ }
17
+ export interface Response {
18
+ success: boolean;
19
+ headers: Headers;
20
+ data: OutputSchema;
21
+ }
22
+ export declare function toKnownErr(e: any): any;
@@ -22,6 +22,7 @@ export declare function toKnownErr(e: any): any;
22
22
  export interface Repo {
23
23
  did: string;
24
24
  head: string;
25
+ rev: string;
25
26
  [k: string]: unknown;
26
27
  }
27
28
  export declare function isRepo(v: unknown): v is Repo;