@atproto/api 0.6.1 → 0.6.3
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/dist/agent.d.ts +25 -44
- package/dist/bsky-agent.d.ts +43 -62
- package/dist/client/lexicons.d.ts +30 -0
- package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +65 -74
- 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/external.d.ts +23 -23
- package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
- package/dist/client/types/app/bsky/embed/record.d.ts +44 -53
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +20 -26
- package/dist/client/types/app/bsky/feed/defs.d.ts +115 -141
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
- package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +21 -0
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
- package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
- package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
- 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/block.d.ts +6 -6
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
- package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
- package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
- package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +21 -0
- 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/listitem.d.ts +7 -7
- 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/richtext/facet.d.ts +22 -26
- 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/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/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/label/subscribeLabels.d.ts +12 -12
- package/dist/client/types/com/atproto/moderation/defs.d.ts +7 -16
- 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/recordRef.d.ts +8 -0
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
- package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
- 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/defs.d.ts +16 -16
- 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/getRoot.d.ts +18 -0
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +46 -46
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
- package/dist/client/util.d.ts +2 -5
- package/dist/helpers/bsky.d.ts +20 -0
- package/dist/index.js +79 -12
- package/dist/index.js.map +2 -2
- package/dist/mixins/bsky.d.ts +23 -0
- package/dist/moderation/accumulator.d.ts +1 -0
- package/dist/moderation/types.d.ts +4 -0
- package/dist/rich-text/detection.d.ts +4 -4
- package/dist/rich-text/rich-text.d.ts +31 -31
- package/dist/rich-text/sanitization.d.ts +4 -7
- package/dist/rich-text/sanitize.d.ts +4 -0
- package/dist/rich-text/unicode.d.ts +9 -9
- package/dist/session.d.ts +42 -0
- package/dist/types.d.ts +22 -34
- package/package.json +1 -1
- package/src/client/lexicons.ts +33 -3
- package/src/client/types/app/bsky/embed/record.ts +3 -0
- package/src/client/types/app/bsky/feed/defs.ts +19 -0
- package/src/client/types/app/bsky/feed/getAuthorFeed.ts +2 -2
- package/src/client/types/app/bsky/feed/getFeed.ts +1 -1
- package/src/client/types/app/bsky/feed/getFeedSkeleton.ts +1 -1
- package/src/client/types/app/bsky/feed/getPostThread.ts +1 -1
- package/src/client/types/app/bsky/unspecced/getTimelineSkeleton.ts +1 -1
- package/src/client/types/com/atproto/admin/getRecord.ts +1 -1
- package/src/client/types/com/atproto/admin/getRepo.ts +1 -1
- package/src/client/types/com/atproto/admin/rebaseRepo.ts +2 -2
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +1 -1
- package/src/client/types/com/atproto/repo/applyWrites.ts +1 -1
- package/src/client/types/com/atproto/repo/createRecord.ts +1 -1
- package/src/client/types/com/atproto/repo/deleteRecord.ts +1 -1
- package/src/client/types/com/atproto/repo/putRecord.ts +1 -1
- package/src/client/types/com/atproto/repo/rebaseRepo.ts +2 -2
- package/src/client/types/com/atproto/server/createAccount.ts +7 -7
- package/src/client/types/com/atproto/server/createAppPassword.ts +1 -1
- package/src/client/types/com/atproto/server/createSession.ts +1 -1
- package/src/client/types/com/atproto/server/deleteAccount.ts +2 -2
- package/src/client/types/com/atproto/server/getAccountInviteCodes.ts +1 -1
- package/src/client/types/com/atproto/server/listAppPasswords.ts +1 -1
- package/src/client/types/com/atproto/server/refreshSession.ts +1 -1
- package/src/client/types/com/atproto/server/resetPassword.ts +2 -2
- package/src/client/types/com/atproto/sync/getHead.ts +1 -1
- package/src/moderation/accumulator.ts +15 -1
- package/src/moderation/subjects/quoted-post.ts +18 -0
- package/src/moderation/types.ts +1 -0
- package/src/moderation/util.ts +2 -14
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export declare type InputSchema = undefined;
|
|
5
|
+
export interface OutputSchema {
|
|
6
|
+
accessJwt: string;
|
|
7
|
+
refreshJwt: string;
|
|
8
|
+
handle: string;
|
|
9
|
+
did: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface CallOptions {
|
|
13
|
+
headers?: Headers;
|
|
14
|
+
qp?: QueryParams;
|
|
15
|
+
}
|
|
16
|
+
export interface Response {
|
|
17
|
+
success: boolean;
|
|
18
|
+
headers: Headers;
|
|
19
|
+
data: OutputSchema;
|
|
20
|
+
}
|
|
21
|
+
export declare class AccountTakedownError extends XRPCError {
|
|
22
|
+
constructor(src: XRPCError);
|
|
23
|
+
}
|
|
24
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
did: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type InputSchema = undefined;
|
|
6
|
+
export interface OutputSchema {
|
|
7
|
+
root: string;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface CallOptions {
|
|
11
|
+
headers?: Headers;
|
|
12
|
+
}
|
|
13
|
+
export interface Response {
|
|
14
|
+
success: boolean;
|
|
15
|
+
headers: Headers;
|
|
16
|
+
data: OutputSchema;
|
|
17
|
+
}
|
|
18
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
export interface RepoOp {
|
|
3
|
+
action: 'create' | 'update' | 'delete' | (string & {});
|
|
4
|
+
path: string;
|
|
5
|
+
cid: string | null;
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function isRepoOp(v: unknown): v is RepoOp;
|
|
9
|
+
export declare function validateRepoOp(v: unknown): ValidationResult;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
2
|
-
import { CID } from 'multiformats/cid'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
import { CID } from 'multiformats/cid';
|
|
3
3
|
export interface Commit {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
seq: number;
|
|
5
|
+
rebase: boolean;
|
|
6
|
+
tooBig: boolean;
|
|
7
|
+
repo: string;
|
|
8
|
+
commit: CID;
|
|
9
|
+
prev: CID | null;
|
|
10
|
+
blocks: Uint8Array;
|
|
11
|
+
ops: RepoOp[];
|
|
12
|
+
blobs: CID[];
|
|
13
|
+
time: string;
|
|
14
|
+
[k: string]: unknown;
|
|
15
15
|
}
|
|
16
|
-
export declare function isCommit(v: unknown): v is Commit
|
|
17
|
-
export declare function validateCommit(v: unknown): ValidationResult
|
|
16
|
+
export declare function isCommit(v: unknown): v is Commit;
|
|
17
|
+
export declare function validateCommit(v: unknown): ValidationResult;
|
|
18
18
|
export interface Handle {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
seq: number;
|
|
20
|
+
did: string;
|
|
21
|
+
handle: string;
|
|
22
|
+
time: string;
|
|
23
|
+
[k: string]: unknown;
|
|
24
24
|
}
|
|
25
|
-
export declare function isHandle(v: unknown): v is Handle
|
|
26
|
-
export declare function validateHandle(v: unknown): ValidationResult
|
|
25
|
+
export declare function isHandle(v: unknown): v is Handle;
|
|
26
|
+
export declare function validateHandle(v: unknown): ValidationResult;
|
|
27
27
|
export interface Migrate {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
seq: number;
|
|
29
|
+
did: string;
|
|
30
|
+
migrateTo: string | null;
|
|
31
|
+
time: string;
|
|
32
|
+
[k: string]: unknown;
|
|
33
33
|
}
|
|
34
|
-
export declare function isMigrate(v: unknown): v is Migrate
|
|
35
|
-
export declare function validateMigrate(v: unknown): ValidationResult
|
|
34
|
+
export declare function isMigrate(v: unknown): v is Migrate;
|
|
35
|
+
export declare function validateMigrate(v: unknown): ValidationResult;
|
|
36
36
|
export interface Tombstone {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
seq: number;
|
|
38
|
+
did: string;
|
|
39
|
+
time: string;
|
|
40
|
+
[k: string]: unknown;
|
|
41
41
|
}
|
|
42
|
-
export declare function isTombstone(v: unknown): v is Tombstone
|
|
43
|
-
export declare function validateTombstone(v: unknown): ValidationResult
|
|
42
|
+
export declare function isTombstone(v: unknown): v is Tombstone;
|
|
43
|
+
export declare function validateTombstone(v: unknown): ValidationResult;
|
|
44
44
|
export interface Info {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
name: 'OutdatedCursor' | (string & {});
|
|
46
|
+
message?: string;
|
|
47
|
+
[k: string]: unknown;
|
|
48
48
|
}
|
|
49
|
-
export declare function isInfo(v: unknown): v is Info
|
|
50
|
-
export declare function validateInfo(v: unknown): ValidationResult
|
|
49
|
+
export declare function isInfo(v: unknown): v is Info;
|
|
50
|
+
export declare function validateInfo(v: unknown): ValidationResult;
|
|
51
51
|
export interface RepoOp {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
action: 'create' | 'update' | 'delete' | (string & {});
|
|
53
|
+
path: string;
|
|
54
|
+
cid: CID | null;
|
|
55
|
+
[k: string]: unknown;
|
|
56
56
|
}
|
|
57
|
-
export declare function isRepoOp(v: unknown): v is RepoOp
|
|
58
|
-
export declare function validateRepoOp(v: unknown): ValidationResult
|
|
57
|
+
export declare function isRepoOp(v: unknown): v is RepoOp;
|
|
58
|
+
export declare function validateRepoOp(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
did: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type InputSchema = string | Uint8Array;
|
|
6
|
+
export interface CallOptions {
|
|
7
|
+
headers?: Headers;
|
|
8
|
+
qp?: QueryParams;
|
|
9
|
+
encoding: 'application/cbor';
|
|
10
|
+
}
|
|
11
|
+
export interface Response {
|
|
12
|
+
success: boolean;
|
|
13
|
+
headers: Headers;
|
|
14
|
+
}
|
|
15
|
+
export declare function toKnownErr(e: any): any;
|
package/dist/client/util.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare function isObj(v: unknown): v is Record<string, unknown
|
|
2
|
-
export declare function hasProp<K extends PropertyKey>(
|
|
3
|
-
data: object,
|
|
4
|
-
prop: K,
|
|
5
|
-
): data is Record<K, unknown>
|
|
1
|
+
export declare function isObj(v: unknown): v is Record<string, unknown>;
|
|
2
|
+
export declare function hasProp<K extends PropertyKey>(data: object, prop: K): data is Record<K, unknown>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AtpAgent } from '../agent';
|
|
2
|
+
export declare class Bsky {
|
|
3
|
+
private agent;
|
|
4
|
+
constructor(agent: AtpAgent);
|
|
5
|
+
like(uri: string, cid: string): Promise<{
|
|
6
|
+
uri: string;
|
|
7
|
+
cid: string;
|
|
8
|
+
}>;
|
|
9
|
+
unlike(likeUri: string): Promise<void>;
|
|
10
|
+
repost(uri: string, cid: string): Promise<{
|
|
11
|
+
uri: string;
|
|
12
|
+
cid: string;
|
|
13
|
+
}>;
|
|
14
|
+
unrepost(repostUri: string): Promise<void>;
|
|
15
|
+
follow(subjectDid: string): Promise<{
|
|
16
|
+
uri: string;
|
|
17
|
+
cid: string;
|
|
18
|
+
}>;
|
|
19
|
+
unfollow(followUri: string): Promise<void>;
|
|
20
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -15445,7 +15445,7 @@ var XRPCResponse = class {
|
|
|
15445
15445
|
}
|
|
15446
15446
|
};
|
|
15447
15447
|
var XRPCError = class extends Error {
|
|
15448
|
-
constructor(status, error, message) {
|
|
15448
|
+
constructor(status, error, message, headers) {
|
|
15449
15449
|
super(message || error || ResponseTypeStrings[status]);
|
|
15450
15450
|
this.status = status;
|
|
15451
15451
|
this.error = error;
|
|
@@ -15453,6 +15453,7 @@ var XRPCError = class extends Error {
|
|
|
15453
15453
|
if (!this.error) {
|
|
15454
15454
|
this.error = ResponseTypeNames[status];
|
|
15455
15455
|
}
|
|
15456
|
+
this.headers = headers;
|
|
15456
15457
|
}
|
|
15457
15458
|
};
|
|
15458
15459
|
var XRPCInvalidResponseError = class extends XRPCError {
|
|
@@ -15674,7 +15675,12 @@ var ServiceClient = class {
|
|
|
15674
15675
|
return new XRPCResponse(res.body, res.headers);
|
|
15675
15676
|
} else {
|
|
15676
15677
|
if (res.body && isErrorResponseBody(res.body)) {
|
|
15677
|
-
throw new XRPCError(
|
|
15678
|
+
throw new XRPCError(
|
|
15679
|
+
resCode,
|
|
15680
|
+
res.body.error,
|
|
15681
|
+
res.body.message,
|
|
15682
|
+
res.headers
|
|
15683
|
+
);
|
|
15678
15684
|
} else {
|
|
15679
15685
|
throw new XRPCError(resCode);
|
|
15680
15686
|
}
|
|
@@ -19946,21 +19952,33 @@ var schemaDict = {
|
|
|
19946
19952
|
},
|
|
19947
19953
|
viewNotFound: {
|
|
19948
19954
|
type: "object",
|
|
19949
|
-
required: ["uri"],
|
|
19955
|
+
required: ["uri", "notFound"],
|
|
19950
19956
|
properties: {
|
|
19951
19957
|
uri: {
|
|
19952
19958
|
type: "string",
|
|
19953
19959
|
format: "at-uri"
|
|
19960
|
+
},
|
|
19961
|
+
notFound: {
|
|
19962
|
+
type: "boolean",
|
|
19963
|
+
const: true
|
|
19954
19964
|
}
|
|
19955
19965
|
}
|
|
19956
19966
|
},
|
|
19957
19967
|
viewBlocked: {
|
|
19958
19968
|
type: "object",
|
|
19959
|
-
required: ["uri"],
|
|
19969
|
+
required: ["uri", "blocked", "author"],
|
|
19960
19970
|
properties: {
|
|
19961
19971
|
uri: {
|
|
19962
19972
|
type: "string",
|
|
19963
19973
|
format: "at-uri"
|
|
19974
|
+
},
|
|
19975
|
+
blocked: {
|
|
19976
|
+
type: "boolean",
|
|
19977
|
+
const: true
|
|
19978
|
+
},
|
|
19979
|
+
author: {
|
|
19980
|
+
type: "ref",
|
|
19981
|
+
ref: "lex:app.bsky.feed.defs#blockedAuthor"
|
|
19964
19982
|
}
|
|
19965
19983
|
}
|
|
19966
19984
|
}
|
|
@@ -20174,7 +20192,7 @@ var schemaDict = {
|
|
|
20174
20192
|
},
|
|
20175
20193
|
blockedPost: {
|
|
20176
20194
|
type: "object",
|
|
20177
|
-
required: ["uri", "blocked"],
|
|
20195
|
+
required: ["uri", "blocked", "author"],
|
|
20178
20196
|
properties: {
|
|
20179
20197
|
uri: {
|
|
20180
20198
|
type: "string",
|
|
@@ -20183,6 +20201,24 @@ var schemaDict = {
|
|
|
20183
20201
|
blocked: {
|
|
20184
20202
|
type: "boolean",
|
|
20185
20203
|
const: true
|
|
20204
|
+
},
|
|
20205
|
+
author: {
|
|
20206
|
+
type: "ref",
|
|
20207
|
+
ref: "lex:app.bsky.feed.defs#blockedAuthor"
|
|
20208
|
+
}
|
|
20209
|
+
}
|
|
20210
|
+
},
|
|
20211
|
+
blockedAuthor: {
|
|
20212
|
+
type: "object",
|
|
20213
|
+
required: ["did"],
|
|
20214
|
+
properties: {
|
|
20215
|
+
did: {
|
|
20216
|
+
type: "string",
|
|
20217
|
+
format: "did"
|
|
20218
|
+
},
|
|
20219
|
+
viewer: {
|
|
20220
|
+
type: "ref",
|
|
20221
|
+
ref: "lex:app.bsky.actor.defs#viewerState"
|
|
20186
20222
|
}
|
|
20187
20223
|
}
|
|
20188
20224
|
},
|
|
@@ -24142,6 +24178,7 @@ function validateView4(v) {
|
|
|
24142
24178
|
// src/client/types/app/bsky/feed/defs.ts
|
|
24143
24179
|
var defs_exports6 = {};
|
|
24144
24180
|
__export(defs_exports6, {
|
|
24181
|
+
isBlockedAuthor: () => isBlockedAuthor,
|
|
24145
24182
|
isBlockedPost: () => isBlockedPost,
|
|
24146
24183
|
isFeedViewPost: () => isFeedViewPost,
|
|
24147
24184
|
isGeneratorView: () => isGeneratorView,
|
|
@@ -24154,6 +24191,7 @@ __export(defs_exports6, {
|
|
|
24154
24191
|
isSkeletonReasonRepost: () => isSkeletonReasonRepost,
|
|
24155
24192
|
isThreadViewPost: () => isThreadViewPost,
|
|
24156
24193
|
isViewerState: () => isViewerState2,
|
|
24194
|
+
validateBlockedAuthor: () => validateBlockedAuthor,
|
|
24157
24195
|
validateBlockedPost: () => validateBlockedPost,
|
|
24158
24196
|
validateFeedViewPost: () => validateFeedViewPost,
|
|
24159
24197
|
validateGeneratorView: () => validateGeneratorView,
|
|
@@ -24215,6 +24253,12 @@ function isBlockedPost(v) {
|
|
|
24215
24253
|
function validateBlockedPost(v) {
|
|
24216
24254
|
return lexicons.validate("app.bsky.feed.defs#blockedPost", v);
|
|
24217
24255
|
}
|
|
24256
|
+
function isBlockedAuthor(v) {
|
|
24257
|
+
return isObj2(v) && hasProp2(v, "$type") && v.$type === "app.bsky.feed.defs#blockedAuthor";
|
|
24258
|
+
}
|
|
24259
|
+
function validateBlockedAuthor(v) {
|
|
24260
|
+
return lexicons.validate("app.bsky.feed.defs#blockedAuthor", v);
|
|
24261
|
+
}
|
|
24218
24262
|
function isGeneratorView(v) {
|
|
24219
24263
|
return isObj2(v) && hasProp2(v, "$type") && v.$type === "app.bsky.feed.defs#generatorView";
|
|
24220
24264
|
}
|
|
@@ -28199,6 +28243,15 @@ var ModerationCauseAccumulator = class {
|
|
|
28199
28243
|
});
|
|
28200
28244
|
}
|
|
28201
28245
|
}
|
|
28246
|
+
addBlockOther(blockOther) {
|
|
28247
|
+
if (blockOther) {
|
|
28248
|
+
this.causes.push({
|
|
28249
|
+
type: "block-other",
|
|
28250
|
+
source: { type: "user" },
|
|
28251
|
+
priority: 4
|
|
28252
|
+
});
|
|
28253
|
+
}
|
|
28254
|
+
}
|
|
28202
28255
|
addLabel(label, opts) {
|
|
28203
28256
|
const labelDef = LABELS[label.val];
|
|
28204
28257
|
if (!labelDef) {
|
|
@@ -28267,7 +28320,7 @@ var ModerationCauseAccumulator = class {
|
|
|
28267
28320
|
this.causes.sort((a, b) => a.priority - b.priority);
|
|
28268
28321
|
mod.cause = this.causes[0];
|
|
28269
28322
|
mod.additionalCauses = this.causes.slice(1);
|
|
28270
|
-
if (mod.cause.type === "blocking" || mod.cause.type === "blocked-by") {
|
|
28323
|
+
if (mod.cause.type === "blocking" || mod.cause.type === "blocked-by" || mod.cause.type === "block-other") {
|
|
28271
28324
|
mod.filter = true;
|
|
28272
28325
|
mod.blur = true;
|
|
28273
28326
|
mod.noOverride = true;
|
|
@@ -28368,6 +28421,15 @@ function decideQuotedPost(subject, opts) {
|
|
|
28368
28421
|
acc.addLabel(label, opts);
|
|
28369
28422
|
}
|
|
28370
28423
|
}
|
|
28424
|
+
} else if (record_exports.isViewBlocked(subject.record)) {
|
|
28425
|
+
acc.setDid(subject.record.author.did);
|
|
28426
|
+
if (subject.record.author.viewer?.blocking) {
|
|
28427
|
+
acc.addBlocking(subject.record.author.viewer?.blocking);
|
|
28428
|
+
} else if (subject.record.author.viewer?.blockedBy) {
|
|
28429
|
+
acc.addBlockedBy(subject.record.author.viewer?.blockedBy);
|
|
28430
|
+
} else {
|
|
28431
|
+
acc.addBlockOther(true);
|
|
28432
|
+
}
|
|
28371
28433
|
}
|
|
28372
28434
|
return acc.finalizeDecision(opts);
|
|
28373
28435
|
}
|
|
@@ -28386,6 +28448,15 @@ function decideQuotedPostWithMedia(subject, opts) {
|
|
|
28386
28448
|
acc.addLabel(label, opts);
|
|
28387
28449
|
}
|
|
28388
28450
|
}
|
|
28451
|
+
} else if (record_exports.isViewBlocked(subject.record.record)) {
|
|
28452
|
+
acc.setDid(subject.record.record.author.did);
|
|
28453
|
+
if (subject.record.record.author.viewer?.blocking) {
|
|
28454
|
+
acc.addBlocking(subject.record.record.author.viewer?.blocking);
|
|
28455
|
+
} else if (subject.record.record.author.viewer?.blockedBy) {
|
|
28456
|
+
acc.addBlockedBy(subject.record.record.author.viewer?.blockedBy);
|
|
28457
|
+
} else {
|
|
28458
|
+
acc.addBlockOther(true);
|
|
28459
|
+
}
|
|
28389
28460
|
}
|
|
28390
28461
|
return acc.finalizeDecision(opts);
|
|
28391
28462
|
}
|
|
@@ -28456,14 +28527,10 @@ function isModerationDecisionNoop(decision, { ignoreFilter } = { ignoreFilter: f
|
|
|
28456
28527
|
return true;
|
|
28457
28528
|
}
|
|
28458
28529
|
function isQuotedPost(embed) {
|
|
28459
|
-
return Boolean(
|
|
28460
|
-
embed && record_exports.isView(embed) && record_exports.isViewRecord(embed.record) && post_exports.isRecord(embed.record.value) && post_exports.validateRecord(embed.record.value).success
|
|
28461
|
-
);
|
|
28530
|
+
return Boolean(embed && record_exports.isView(embed));
|
|
28462
28531
|
}
|
|
28463
28532
|
function isQuotedPostWithMedia(embed) {
|
|
28464
|
-
return Boolean(
|
|
28465
|
-
embed && recordWithMedia_exports.isView(embed) && record_exports.isViewRecord(embed.record.record) && post_exports.isRecord(embed.record.record.value) && post_exports.validateRecord(embed.record.record.value).success
|
|
28466
|
-
);
|
|
28533
|
+
return Boolean(embed && recordWithMedia_exports.isView(embed));
|
|
28467
28534
|
}
|
|
28468
28535
|
function toModerationUI(decision) {
|
|
28469
28536
|
return {
|