@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.
- package/CHANGELOG.md +26 -0
- package/LICENSE.txt +7 -0
- package/README.md +10 -1
- package/definitions/moderation-behaviors.d.ts +1 -0
- package/definitions/profile-moderation-behaviors.json +25 -0
- package/dist/agent.d.ts +2 -0
- package/dist/bsky-agent.d.ts +7 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/lexicons.d.ts +243 -3
- package/dist/client/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +28 -0
- package/dist/client/types/com/atproto/admin/getAccountInfo.d.ts +16 -0
- package/dist/client/types/com/atproto/admin/getSubjectStatus.d.ts +26 -0
- package/dist/client/types/com/atproto/admin/searchRepos.d.ts +0 -1
- package/dist/client/types/com/atproto/admin/updateSubjectStatus.d.ts +32 -0
- package/dist/client/types/com/atproto/server/createAccount.d.ts +4 -2
- package/dist/client/types/com/atproto/server/createSession.d.ts +1 -0
- package/dist/client/types/com/atproto/server/refreshSession.d.ts +1 -0
- package/dist/client/types/com/atproto/server/reserveSigningKey.d.ts +22 -0
- package/dist/client/types/com/atproto/sync/listRepos.d.ts +1 -0
- package/dist/index.js +878 -425
- package/dist/index.js.map +3 -3
- package/dist/moderation/accumulator.d.ts +1 -0
- package/docs/moderation-behaviors/profiles.md +17 -0
- package/package.json +8 -7
- package/src/agent.ts +28 -1
- package/src/bsky-agent.ts +43 -0
- package/src/client/index.ts +52 -0
- package/src/client/lexicons.ts +259 -5
- package/src/client/types/app/bsky/actor/defs.ts +1 -0
- package/src/client/types/com/atproto/admin/defs.ts +61 -0
- package/src/client/types/com/atproto/admin/getAccountInfo.ts +32 -0
- package/src/client/types/com/atproto/admin/getSubjectStatus.ts +44 -0
- package/src/client/types/com/atproto/admin/searchRepos.ts +0 -1
- package/src/client/types/com/atproto/admin/updateSubjectStatus.ts +50 -0
- package/src/client/types/com/atproto/server/createAccount.ts +4 -2
- package/src/client/types/com/atproto/server/createSession.ts +1 -0
- package/src/client/types/com/atproto/server/refreshSession.ts +1 -0
- package/src/client/types/com/atproto/server/reserveSigningKey.ts +40 -0
- package/src/client/types/com/atproto/sync/listRepos.ts +1 -0
- package/src/moderation/accumulator.ts +13 -0
- package/src/moderation/subjects/account.ts +7 -1
- package/tests/agent.test.ts +18 -21
- package/tests/bsky-agent.test.ts +19 -25
- package/tests/errors.test.ts +5 -11
- package/tests/rich-text-detection.test.ts +3 -3
- package/tests/util/index.ts +3 -0
- package/tests/util/moderation-behavior.ts +10 -2
- 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;
|
|
@@ -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
|
|
5
|
+
email?: string;
|
|
6
6
|
handle: string;
|
|
7
7
|
did?: string;
|
|
8
8
|
inviteCode?: string;
|
|
9
|
-
password
|
|
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 {
|
|
@@ -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;
|