@atproto/api 0.5.4 → 0.5.5
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 +11 -3
- package/dist/agent.d.ts +44 -25
- package/dist/bsky-agent.d.ts +62 -43
- package/dist/client/lexicons.d.ts +48 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +74 -65
- package/dist/client/types/app/bsky/actor/profile.d.ts +5 -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 +53 -41
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +26 -20
- package/dist/client/types/app/bsky/feed/defs.d.ts +141 -107
- package/dist/client/types/app/bsky/feed/generator.d.ts +5 -0
- package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +1 -0
- package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
- package/dist/client/types/app/bsky/feed/post.d.ts +5 -0
- package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
- package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
- 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/list.d.ts +5 -0
- package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
- package/dist/client/types/app/bsky/richtext/facet.d.ts +26 -22
- package/dist/client/types/com/atproto/label/defs.d.ts +12 -0
- package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
- package/dist/client/types/com/atproto/moderation/defs.d.ts +16 -7
- package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
- package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +46 -46
- package/dist/client/util.d.ts +5 -2
- package/dist/index.js +76 -8
- package/dist/index.js.map +2 -2
- package/dist/moderation/types.d.ts +7 -3
- 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 +7 -4
- package/dist/rich-text/unicode.d.ts +9 -9
- package/dist/types.d.ts +34 -22
- package/docs/moderation.md +14 -5
- package/package.json +1 -1
- package/src/client/lexicons.ts +55 -0
- package/src/client/types/app/bsky/actor/profile.ts +4 -0
- package/src/client/types/app/bsky/feed/generator.ts +4 -0
- package/src/client/types/app/bsky/feed/getAuthorFeed.ts +5 -0
- package/src/client/types/app/bsky/feed/post.ts +4 -0
- package/src/client/types/app/bsky/graph/list.ts +4 -0
- package/src/client/types/com/atproto/label/defs.ts +37 -0
- package/src/moderation/accumulator.ts +17 -12
- package/src/moderation/types.ts +5 -3
- package/tests/moderation.test.ts +334 -0
- package/tests/util/moderation-behavior.ts +3 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
- package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
- package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
- package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -40
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
- package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +0 -21
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
- package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
- package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
- package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
- package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +0 -21
- package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/listblock.d.ts +0 -8
- package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +0 -17
- package/dist/client/types/app/bsky/notification/getCount.d.ts +0 -17
- package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
- package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
- package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
- package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
- package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
- package/dist/client/types/com/atproto/account/create.d.ts +0 -41
- package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
- package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
- package/dist/client/types/com/atproto/account/get.d.ts +0 -12
- package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
- package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
- package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
- package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
- package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
- package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
- package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
- package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
- package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
- package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
- package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
- package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
- package/dist/client/types/com/atproto/report/create.d.ts +0 -39
- package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
- package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
- package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
- package/dist/client/types/com/atproto/session/create.d.ts +0 -29
- package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
- package/dist/client/types/com/atproto/session/get.d.ts +0 -18
- package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -18
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
- package/dist/helpers/bsky.d.ts +0 -20
- package/dist/mixins/bsky.d.ts +0 -23
- package/dist/rich-text/sanitize.d.ts +0 -4
- package/dist/session.d.ts +0 -42
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon'
|
|
2
2
|
export interface Record {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
subject: string
|
|
4
|
+
list: string
|
|
5
|
+
createdAt: string
|
|
6
|
+
[k: string]: unknown
|
|
7
7
|
}
|
|
8
|
-
export declare function isRecord(v: unknown): v is Record
|
|
9
|
-
export declare function validateRecord(v: unknown): ValidationResult
|
|
8
|
+
export declare function isRecord(v: unknown): v is Record
|
|
9
|
+
export declare function validateRecord(v: unknown): ValidationResult
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon'
|
|
2
2
|
export interface Main {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
index: ByteSlice
|
|
4
|
+
features: (
|
|
5
|
+
| Mention
|
|
6
|
+
| Link
|
|
7
|
+
| {
|
|
8
|
+
$type: string
|
|
9
|
+
[k: string]: unknown
|
|
10
|
+
}
|
|
11
|
+
)[]
|
|
12
|
+
[k: string]: unknown
|
|
9
13
|
}
|
|
10
|
-
export declare function isMain(v: unknown): v is Main
|
|
11
|
-
export declare function validateMain(v: unknown): ValidationResult
|
|
14
|
+
export declare function isMain(v: unknown): v is Main
|
|
15
|
+
export declare function validateMain(v: unknown): ValidationResult
|
|
12
16
|
export interface Mention {
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
did: string
|
|
18
|
+
[k: string]: unknown
|
|
15
19
|
}
|
|
16
|
-
export declare function isMention(v: unknown): v is Mention
|
|
17
|
-
export declare function validateMention(v: unknown): ValidationResult
|
|
20
|
+
export declare function isMention(v: unknown): v is Mention
|
|
21
|
+
export declare function validateMention(v: unknown): ValidationResult
|
|
18
22
|
export interface Link {
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
uri: string
|
|
24
|
+
[k: string]: unknown
|
|
21
25
|
}
|
|
22
|
-
export declare function isLink(v: unknown): v is Link
|
|
23
|
-
export declare function validateLink(v: unknown): ValidationResult
|
|
26
|
+
export declare function isLink(v: unknown): v is Link
|
|
27
|
+
export declare function validateLink(v: unknown): ValidationResult
|
|
24
28
|
export interface ByteSlice {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
byteStart: number
|
|
30
|
+
byteEnd: number
|
|
31
|
+
[k: string]: unknown
|
|
28
32
|
}
|
|
29
|
-
export declare function isByteSlice(v: unknown): v is ByteSlice
|
|
30
|
-
export declare function validateByteSlice(v: unknown): ValidationResult
|
|
33
|
+
export declare function isByteSlice(v: unknown): v is ByteSlice
|
|
34
|
+
export declare function validateByteSlice(v: unknown): ValidationResult
|
|
@@ -10,3 +10,15 @@ export interface Label {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function isLabel(v: unknown): v is Label;
|
|
12
12
|
export declare function validateLabel(v: unknown): ValidationResult;
|
|
13
|
+
export interface SelfLabels {
|
|
14
|
+
values: SelfLabel[];
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare function isSelfLabels(v: unknown): v is SelfLabels;
|
|
18
|
+
export declare function validateSelfLabels(v: unknown): ValidationResult;
|
|
19
|
+
export interface SelfLabel {
|
|
20
|
+
val: string;
|
|
21
|
+
[k: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare function isSelfLabel(v: unknown): v is SelfLabel;
|
|
24
|
+
export declare function validateSelfLabel(v: unknown): ValidationResult;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
2
|
-
import * as ComAtprotoLabelDefs from './defs'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon'
|
|
2
|
+
import * as ComAtprotoLabelDefs from './defs'
|
|
3
3
|
export interface Labels {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
seq: number
|
|
5
|
+
labels: ComAtprotoLabelDefs.Label[]
|
|
6
|
+
[k: string]: unknown
|
|
7
7
|
}
|
|
8
|
-
export declare function isLabels(v: unknown): v is Labels
|
|
9
|
-
export declare function validateLabels(v: unknown): ValidationResult
|
|
8
|
+
export declare function isLabels(v: unknown): v is Labels
|
|
9
|
+
export declare function validateLabels(v: unknown): ValidationResult
|
|
10
10
|
export interface Info {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
name: 'OutdatedCursor' | (string & {})
|
|
12
|
+
message?: string
|
|
13
|
+
[k: string]: unknown
|
|
14
14
|
}
|
|
15
|
-
export declare function isInfo(v: unknown): v is Info
|
|
16
|
-
export declare function validateInfo(v: unknown): ValidationResult
|
|
15
|
+
export declare function isInfo(v: unknown): v is Info
|
|
16
|
+
export declare function validateInfo(v: unknown): ValidationResult
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
export declare type ReasonType =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export declare type ReasonType =
|
|
2
|
+
| 'com.atproto.moderation.defs#reasonSpam'
|
|
3
|
+
| 'com.atproto.moderation.defs#reasonViolation'
|
|
4
|
+
| 'com.atproto.moderation.defs#reasonMisleading'
|
|
5
|
+
| 'com.atproto.moderation.defs#reasonSexual'
|
|
6
|
+
| 'com.atproto.moderation.defs#reasonRude'
|
|
7
|
+
| 'com.atproto.moderation.defs#reasonOther'
|
|
8
|
+
| (string & {})
|
|
9
|
+
export declare const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
|
|
10
|
+
export declare const REASONVIOLATION =
|
|
11
|
+
'com.atproto.moderation.defs#reasonViolation'
|
|
12
|
+
export declare const REASONMISLEADING =
|
|
13
|
+
'com.atproto.moderation.defs#reasonMisleading'
|
|
14
|
+
export declare const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
|
|
15
|
+
export declare const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
|
|
16
|
+
export declare const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon'
|
|
2
2
|
export interface Main {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
uri: string
|
|
4
|
+
cid: string
|
|
5
|
+
[k: string]: unknown
|
|
6
6
|
}
|
|
7
|
-
export declare function isMain(v: unknown): v is Main
|
|
8
|
-
export declare function validateMain(v: unknown): ValidationResult
|
|
7
|
+
export declare function isMain(v: unknown): v is Main
|
|
8
|
+
export declare function validateMain(v: unknown): ValidationResult
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon'
|
|
2
2
|
export interface InviteCode {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
code: string
|
|
4
|
+
available: number
|
|
5
|
+
disabled: boolean
|
|
6
|
+
forAccount: string
|
|
7
|
+
createdBy: string
|
|
8
|
+
createdAt: string
|
|
9
|
+
uses: InviteCodeUse[]
|
|
10
|
+
[k: string]: unknown
|
|
11
11
|
}
|
|
12
|
-
export declare function isInviteCode(v: unknown): v is InviteCode
|
|
13
|
-
export declare function validateInviteCode(v: unknown): ValidationResult
|
|
12
|
+
export declare function isInviteCode(v: unknown): v is InviteCode
|
|
13
|
+
export declare function validateInviteCode(v: unknown): ValidationResult
|
|
14
14
|
export interface InviteCodeUse {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
usedBy: string
|
|
16
|
+
usedAt: string
|
|
17
|
+
[k: string]: unknown
|
|
18
18
|
}
|
|
19
|
-
export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse
|
|
20
|
-
export declare function validateInviteCodeUse(v: unknown): ValidationResult
|
|
19
|
+
export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse
|
|
20
|
+
export declare function validateInviteCodeUse(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
|
package/dist/client/util.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare function isObj(v: unknown): v is Record<string, unknown
|
|
2
|
-
export declare function hasProp<K extends PropertyKey>(
|
|
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>
|
package/dist/index.js
CHANGED
|
@@ -17131,6 +17131,33 @@ var schemaDict = {
|
|
|
17131
17131
|
description: "timestamp when this label was created"
|
|
17132
17132
|
}
|
|
17133
17133
|
}
|
|
17134
|
+
},
|
|
17135
|
+
selfLabels: {
|
|
17136
|
+
type: "object",
|
|
17137
|
+
description: "Metadata tags on an atproto record, published by the author within the record.",
|
|
17138
|
+
required: ["values"],
|
|
17139
|
+
properties: {
|
|
17140
|
+
values: {
|
|
17141
|
+
type: "array",
|
|
17142
|
+
items: {
|
|
17143
|
+
type: "ref",
|
|
17144
|
+
ref: "lex:com.atproto.label.defs#selfLabel"
|
|
17145
|
+
},
|
|
17146
|
+
maxLength: 10
|
|
17147
|
+
}
|
|
17148
|
+
}
|
|
17149
|
+
},
|
|
17150
|
+
selfLabel: {
|
|
17151
|
+
type: "object",
|
|
17152
|
+
description: "Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel.",
|
|
17153
|
+
required: ["val"],
|
|
17154
|
+
properties: {
|
|
17155
|
+
val: {
|
|
17156
|
+
type: "string",
|
|
17157
|
+
maxLength: 128,
|
|
17158
|
+
description: "the short string name of the value or type of this label"
|
|
17159
|
+
}
|
|
17160
|
+
}
|
|
17134
17161
|
}
|
|
17135
17162
|
}
|
|
17136
17163
|
},
|
|
@@ -19592,6 +19619,10 @@ var schemaDict = {
|
|
|
19592
19619
|
type: "blob",
|
|
19593
19620
|
accept: ["image/png", "image/jpeg"],
|
|
19594
19621
|
maxSize: 1e6
|
|
19622
|
+
},
|
|
19623
|
+
labels: {
|
|
19624
|
+
type: "union",
|
|
19625
|
+
refs: ["lex:com.atproto.label.defs#selfLabels"]
|
|
19595
19626
|
}
|
|
19596
19627
|
}
|
|
19597
19628
|
}
|
|
@@ -20335,6 +20366,10 @@ var schemaDict = {
|
|
|
20335
20366
|
accept: ["image/png", "image/jpeg"],
|
|
20336
20367
|
maxSize: 1e6
|
|
20337
20368
|
},
|
|
20369
|
+
labels: {
|
|
20370
|
+
type: "union",
|
|
20371
|
+
refs: ["lex:com.atproto.label.defs#selfLabels"]
|
|
20372
|
+
},
|
|
20338
20373
|
createdAt: {
|
|
20339
20374
|
type: "string",
|
|
20340
20375
|
format: "datetime"
|
|
@@ -20415,6 +20450,15 @@ var schemaDict = {
|
|
|
20415
20450
|
},
|
|
20416
20451
|
cursor: {
|
|
20417
20452
|
type: "string"
|
|
20453
|
+
},
|
|
20454
|
+
filter: {
|
|
20455
|
+
type: "string",
|
|
20456
|
+
knownValues: [
|
|
20457
|
+
"posts_with_replies",
|
|
20458
|
+
"posts_no_replies",
|
|
20459
|
+
"posts_with_media"
|
|
20460
|
+
],
|
|
20461
|
+
default: "posts_with_replies"
|
|
20418
20462
|
}
|
|
20419
20463
|
}
|
|
20420
20464
|
},
|
|
@@ -20983,6 +21027,10 @@ var schemaDict = {
|
|
|
20983
21027
|
format: "language"
|
|
20984
21028
|
}
|
|
20985
21029
|
},
|
|
21030
|
+
labels: {
|
|
21031
|
+
type: "union",
|
|
21032
|
+
refs: ["lex:com.atproto.label.defs#selfLabels"]
|
|
21033
|
+
},
|
|
20986
21034
|
createdAt: {
|
|
20987
21035
|
type: "string",
|
|
20988
21036
|
format: "datetime"
|
|
@@ -21600,6 +21648,10 @@ var schemaDict = {
|
|
|
21600
21648
|
accept: ["image/png", "image/jpeg"],
|
|
21601
21649
|
maxSize: 1e6
|
|
21602
21650
|
},
|
|
21651
|
+
labels: {
|
|
21652
|
+
type: "union",
|
|
21653
|
+
refs: ["lex:com.atproto.label.defs#selfLabels"]
|
|
21654
|
+
},
|
|
21603
21655
|
createdAt: {
|
|
21604
21656
|
type: "string",
|
|
21605
21657
|
format: "datetime"
|
|
@@ -23723,7 +23775,11 @@ function validateVideoDetails(v) {
|
|
|
23723
23775
|
var defs_exports2 = {};
|
|
23724
23776
|
__export(defs_exports2, {
|
|
23725
23777
|
isLabel: () => isLabel,
|
|
23726
|
-
|
|
23778
|
+
isSelfLabel: () => isSelfLabel,
|
|
23779
|
+
isSelfLabels: () => isSelfLabels,
|
|
23780
|
+
validateLabel: () => validateLabel,
|
|
23781
|
+
validateSelfLabel: () => validateSelfLabel,
|
|
23782
|
+
validateSelfLabels: () => validateSelfLabels
|
|
23727
23783
|
});
|
|
23728
23784
|
function isLabel(v) {
|
|
23729
23785
|
return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.label.defs#label";
|
|
@@ -23731,6 +23787,18 @@ function isLabel(v) {
|
|
|
23731
23787
|
function validateLabel(v) {
|
|
23732
23788
|
return lexicons.validate("com.atproto.label.defs#label", v);
|
|
23733
23789
|
}
|
|
23790
|
+
function isSelfLabels(v) {
|
|
23791
|
+
return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.label.defs#selfLabels";
|
|
23792
|
+
}
|
|
23793
|
+
function validateSelfLabels(v) {
|
|
23794
|
+
return lexicons.validate("com.atproto.label.defs#selfLabels", v);
|
|
23795
|
+
}
|
|
23796
|
+
function isSelfLabel(v) {
|
|
23797
|
+
return isObj2(v) && hasProp2(v, "$type") && v.$type === "com.atproto.label.defs#selfLabel";
|
|
23798
|
+
}
|
|
23799
|
+
function validateSelfLabel(v) {
|
|
23800
|
+
return lexicons.validate("com.atproto.label.defs#selfLabel", v);
|
|
23801
|
+
}
|
|
23734
23802
|
|
|
23735
23803
|
// src/client/types/com/atproto/label/subscribeLabels.ts
|
|
23736
23804
|
var subscribeLabels_exports = {};
|
|
@@ -28136,17 +28204,17 @@ var ModerationCauseAccumulator = class {
|
|
|
28136
28204
|
if (!labelDef) {
|
|
28137
28205
|
return;
|
|
28138
28206
|
}
|
|
28139
|
-
const
|
|
28140
|
-
|
|
28141
|
-
return;
|
|
28142
|
-
}
|
|
28207
|
+
const isSelf = label.src === this.did;
|
|
28208
|
+
const labeler = isSelf ? void 0 : opts.labelers.find((s) => s.labeler.did === label.src);
|
|
28143
28209
|
let labelPref = "ignore";
|
|
28144
28210
|
if (!labelDef.configurable) {
|
|
28145
28211
|
labelPref = labelDef.preferences[0];
|
|
28146
28212
|
} else if (labelDef.flags.includes("adult") && !opts.adultContentEnabled) {
|
|
28147
28213
|
labelPref = "hide";
|
|
28148
|
-
} else if (
|
|
28149
|
-
labelPref =
|
|
28214
|
+
} else if (labeler?.labels[label.val]) {
|
|
28215
|
+
labelPref = labeler.labels[label.val];
|
|
28216
|
+
} else if (opts.labels[label.val]) {
|
|
28217
|
+
labelPref = opts.labels[label.val];
|
|
28150
28218
|
}
|
|
28151
28219
|
if (labelPref === "ignore") {
|
|
28152
28220
|
return;
|
|
@@ -28165,9 +28233,9 @@ var ModerationCauseAccumulator = class {
|
|
|
28165
28233
|
}
|
|
28166
28234
|
this.causes.push({
|
|
28167
28235
|
type: "label",
|
|
28236
|
+
source: isSelf || !labeler ? { type: "user" } : { type: "labeler", labeler: labeler.labeler },
|
|
28168
28237
|
label,
|
|
28169
28238
|
labelDef,
|
|
28170
|
-
labeler: labelerSettings.labeler,
|
|
28171
28239
|
setting: labelPref,
|
|
28172
28240
|
priority
|
|
28173
28241
|
});
|