@atproto/api 0.0.8 → 0.1.0
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/README.md +44 -6
- package/dist/agent.d.ts +22 -0
- package/dist/client/index.d.ts +60 -61
- package/dist/client/lexicons.d.ts +136 -22
- package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +0 -7
- package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +13 -2
- package/dist/client/types/com/atproto/admin/record.d.ts +5 -2
- package/dist/client/types/com/atproto/admin/repo.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +425 -196
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +33 -0
- package/package.json +1 -1
- package/src/agent.ts +305 -0
- package/src/client/index.ts +62 -63
- package/src/client/lexicons.ts +169 -36
- package/src/client/types/app/bsky/actor/getSuggestions.ts +0 -18
- package/src/client/types/com/atproto/admin/blob.ts +84 -0
- package/src/client/types/com/atproto/admin/moderationAction.ts +29 -10
- package/src/client/types/com/atproto/admin/record.ts +5 -2
- package/src/client/types/com/atproto/admin/repo.ts +2 -2
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +8 -0
- package/src/index.ts +3 -3
- package/src/types.ts +71 -0
- package/tests/_util.ts +26 -0
- package/tests/agent.test.ts +391 -0
- package/tests/errors.test.ts +4 -8
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/session.ts +0 -194
- package/tests/session.test.ts +0 -239
|
@@ -28,14 +28,7 @@ export interface Actor {
|
|
|
28
28
|
description?: string;
|
|
29
29
|
avatar?: string;
|
|
30
30
|
indexedAt?: string;
|
|
31
|
-
myState?: MyState;
|
|
32
31
|
[k: string]: unknown;
|
|
33
32
|
}
|
|
34
33
|
export declare function isActor(v: unknown): v is Actor;
|
|
35
34
|
export declare function validateActor(v: unknown): ValidationResult;
|
|
36
|
-
export interface MyState {
|
|
37
|
-
follow?: string;
|
|
38
|
-
[k: string]: unknown;
|
|
39
|
-
}
|
|
40
|
-
export declare function isMyState(v: unknown): v is MyState;
|
|
41
|
-
export declare function validateMyState(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
import * as ComAtprotoAdminModerationAction from './moderationAction';
|
|
3
|
+
export interface View {
|
|
4
|
+
cid: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
size: number;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
details?: ImageDetails | VideoDetails | {
|
|
9
|
+
$type: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
moderation?: Moderation;
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function isView(v: unknown): v is View;
|
|
16
|
+
export declare function validateView(v: unknown): ValidationResult;
|
|
17
|
+
export interface ImageDetails {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
export declare function isImageDetails(v: unknown): v is ImageDetails;
|
|
23
|
+
export declare function validateImageDetails(v: unknown): ValidationResult;
|
|
24
|
+
export interface VideoDetails {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
length: number;
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare function isVideoDetails(v: unknown): v is VideoDetails;
|
|
31
|
+
export declare function validateVideoDetails(v: unknown): ValidationResult;
|
|
32
|
+
export interface Moderation {
|
|
33
|
+
currentAction?: ComAtprotoAdminModerationAction.ViewCurrent;
|
|
34
|
+
[k: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
export declare function isModeration(v: unknown): v is Moderation;
|
|
37
|
+
export declare function validateModeration(v: unknown): ValidationResult;
|
|
@@ -3,14 +3,16 @@ import * as ComAtprotoRepoRepoRef from '../repo/repoRef';
|
|
|
3
3
|
import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
|
|
4
4
|
import * as ComAtprotoAdminRepo from './repo';
|
|
5
5
|
import * as ComAtprotoAdminRecord from './record';
|
|
6
|
+
import * as ComAtprotoAdminBlob from './blob';
|
|
6
7
|
import * as ComAtprotoAdminModerationReport from './moderationReport';
|
|
7
8
|
export interface View {
|
|
8
9
|
id: number;
|
|
9
|
-
action:
|
|
10
|
+
action: ActionType;
|
|
10
11
|
subject: ComAtprotoRepoRepoRef.Main | ComAtprotoRepoStrongRef.Main | {
|
|
11
12
|
$type: string;
|
|
12
13
|
[k: string]: unknown;
|
|
13
14
|
};
|
|
15
|
+
subjectBlobCids: string[];
|
|
14
16
|
reason: string;
|
|
15
17
|
createdBy: string;
|
|
16
18
|
createdAt: string;
|
|
@@ -22,11 +24,12 @@ export declare function isView(v: unknown): v is View;
|
|
|
22
24
|
export declare function validateView(v: unknown): ValidationResult;
|
|
23
25
|
export interface ViewDetail {
|
|
24
26
|
id: number;
|
|
25
|
-
action:
|
|
27
|
+
action: ActionType;
|
|
26
28
|
subject: ComAtprotoAdminRepo.View | ComAtprotoAdminRecord.View | {
|
|
27
29
|
$type: string;
|
|
28
30
|
[k: string]: unknown;
|
|
29
31
|
};
|
|
32
|
+
subjectBlobs: ComAtprotoAdminBlob.View[];
|
|
30
33
|
reason: string;
|
|
31
34
|
createdBy: string;
|
|
32
35
|
createdAt: string;
|
|
@@ -36,6 +39,13 @@ export interface ViewDetail {
|
|
|
36
39
|
}
|
|
37
40
|
export declare function isViewDetail(v: unknown): v is ViewDetail;
|
|
38
41
|
export declare function validateViewDetail(v: unknown): ValidationResult;
|
|
42
|
+
export interface ViewCurrent {
|
|
43
|
+
id: number;
|
|
44
|
+
action: ActionType;
|
|
45
|
+
[k: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
export declare function isViewCurrent(v: unknown): v is ViewCurrent;
|
|
48
|
+
export declare function validateViewCurrent(v: unknown): ValidationResult;
|
|
39
49
|
export interface Reversal {
|
|
40
50
|
reason: string;
|
|
41
51
|
createdBy: string;
|
|
@@ -44,6 +54,7 @@ export interface Reversal {
|
|
|
44
54
|
}
|
|
45
55
|
export declare function isReversal(v: unknown): v is Reversal;
|
|
46
56
|
export declare function validateReversal(v: unknown): ValidationResult;
|
|
57
|
+
export declare type ActionType = 'com.atproto.admin.moderationAction#takedown' | 'com.atproto.admin.moderationAction#flag' | 'com.atproto.admin.moderationAction#acknowledge' | (string & {});
|
|
47
58
|
export declare const TAKEDOWN = "com.atproto.admin.moderationAction#takedown";
|
|
48
59
|
export declare const FLAG = "com.atproto.admin.moderationAction#flag";
|
|
49
60
|
export declare const ACKNOWLEDGE = "com.atproto.admin.moderationAction#acknowledge";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ValidationResult } from '@atproto/lexicon';
|
|
2
2
|
import * as ComAtprotoAdminRepo from './repo';
|
|
3
|
+
import * as ComAtprotoAdminBlob from './blob';
|
|
3
4
|
import * as ComAtprotoAdminModerationAction from './moderationAction';
|
|
4
5
|
import * as ComAtprotoAdminModerationReport from './moderationReport';
|
|
5
6
|
export interface View {
|
|
6
7
|
uri: string;
|
|
7
8
|
cid: string;
|
|
8
9
|
value: {};
|
|
10
|
+
blobCids: string[];
|
|
9
11
|
indexedAt: string;
|
|
10
12
|
moderation: Moderation;
|
|
11
13
|
repo: ComAtprotoAdminRepo.View;
|
|
@@ -17,6 +19,7 @@ export interface ViewDetail {
|
|
|
17
19
|
uri: string;
|
|
18
20
|
cid: string;
|
|
19
21
|
value: {};
|
|
22
|
+
blobs: ComAtprotoAdminBlob.View[];
|
|
20
23
|
indexedAt: string;
|
|
21
24
|
moderation: ModerationDetail;
|
|
22
25
|
repo: ComAtprotoAdminRepo.View;
|
|
@@ -25,15 +28,15 @@ export interface ViewDetail {
|
|
|
25
28
|
export declare function isViewDetail(v: unknown): v is ViewDetail;
|
|
26
29
|
export declare function validateViewDetail(v: unknown): ValidationResult;
|
|
27
30
|
export interface Moderation {
|
|
28
|
-
|
|
31
|
+
currentAction?: ComAtprotoAdminModerationAction.ViewCurrent;
|
|
29
32
|
[k: string]: unknown;
|
|
30
33
|
}
|
|
31
34
|
export declare function isModeration(v: unknown): v is Moderation;
|
|
32
35
|
export declare function validateModeration(v: unknown): ValidationResult;
|
|
33
36
|
export interface ModerationDetail {
|
|
37
|
+
currentAction?: ComAtprotoAdminModerationAction.ViewCurrent;
|
|
34
38
|
actions: ComAtprotoAdminModerationAction.View[];
|
|
35
39
|
reports: ComAtprotoAdminModerationReport.View[];
|
|
36
|
-
takedownId?: number;
|
|
37
40
|
[k: string]: unknown;
|
|
38
41
|
}
|
|
39
42
|
export declare function isModerationDetail(v: unknown): v is ModerationDetail;
|
|
@@ -30,15 +30,15 @@ export interface Account {
|
|
|
30
30
|
export declare function isAccount(v: unknown): v is Account;
|
|
31
31
|
export declare function validateAccount(v: unknown): ValidationResult;
|
|
32
32
|
export interface Moderation {
|
|
33
|
-
|
|
33
|
+
currentAction?: ComAtprotoAdminModerationAction.ViewCurrent;
|
|
34
34
|
[k: string]: unknown;
|
|
35
35
|
}
|
|
36
36
|
export declare function isModeration(v: unknown): v is Moderation;
|
|
37
37
|
export declare function validateModeration(v: unknown): ValidationResult;
|
|
38
38
|
export interface ModerationDetail {
|
|
39
|
+
currentAction?: ComAtprotoAdminModerationAction.ViewCurrent;
|
|
39
40
|
actions: ComAtprotoAdminModerationAction.View[];
|
|
40
41
|
reports: ComAtprotoAdminModerationReport.View[];
|
|
41
|
-
takedownId?: number;
|
|
42
42
|
[k: string]: unknown;
|
|
43
43
|
}
|
|
44
44
|
export declare function isModerationDetail(v: unknown): v is ModerationDetail;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Headers } from '@atproto/xrpc';
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
2
|
import * as ComAtprotoRepoRepoRef from '../repo/repoRef';
|
|
3
3
|
import * as ComAtprotoRepoRecordRef from '../repo/recordRef';
|
|
4
4
|
import * as ComAtprotoAdminModerationAction from './moderationAction';
|
|
@@ -10,6 +10,7 @@ export interface InputSchema {
|
|
|
10
10
|
$type: string;
|
|
11
11
|
[k: string]: unknown;
|
|
12
12
|
};
|
|
13
|
+
subjectBlobCids?: string[];
|
|
13
14
|
reason: string;
|
|
14
15
|
createdBy: string;
|
|
15
16
|
[k: string]: unknown;
|
|
@@ -25,4 +26,7 @@ export interface Response {
|
|
|
25
26
|
headers: Headers;
|
|
26
27
|
data: OutputSchema;
|
|
27
28
|
}
|
|
29
|
+
export declare class SubjectHasActionError extends XRPCError {
|
|
30
|
+
constructor(src: XRPCError);
|
|
31
|
+
}
|
|
28
32
|
export declare function toKnownErr(e: any): any;
|
package/dist/index.d.ts
CHANGED