@atproto/api 0.5.3 → 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.
Files changed (118) hide show
  1. package/README.md +11 -3
  2. package/dist/agent.d.ts +44 -25
  3. package/dist/bsky-agent.d.ts +62 -43
  4. package/dist/client/lexicons.d.ts +48 -0
  5. package/dist/client/types/app/bsky/actor/defs.d.ts +74 -65
  6. package/dist/client/types/app/bsky/actor/profile.d.ts +5 -0
  7. package/dist/client/types/app/bsky/embed/external.d.ts +23 -23
  8. package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
  9. package/dist/client/types/app/bsky/embed/record.d.ts +53 -41
  10. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +26 -20
  11. package/dist/client/types/app/bsky/feed/defs.d.ts +141 -107
  12. package/dist/client/types/app/bsky/feed/generator.d.ts +5 -0
  13. package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +1 -0
  14. package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
  15. package/dist/client/types/app/bsky/feed/post.d.ts +5 -0
  16. package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
  17. package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
  18. package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
  19. package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
  20. package/dist/client/types/app/bsky/graph/list.d.ts +5 -0
  21. package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
  22. package/dist/client/types/app/bsky/richtext/facet.d.ts +26 -22
  23. package/dist/client/types/com/atproto/label/defs.d.ts +12 -0
  24. package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
  25. package/dist/client/types/com/atproto/moderation/defs.d.ts +16 -7
  26. package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
  27. package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
  28. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +46 -46
  29. package/dist/client/util.d.ts +5 -2
  30. package/dist/index.js +94 -22
  31. package/dist/index.js.map +2 -2
  32. package/dist/moderation/types.d.ts +7 -3
  33. package/dist/moderation/util.d.ts +1 -3
  34. package/dist/rich-text/detection.d.ts +4 -4
  35. package/dist/rich-text/rich-text.d.ts +31 -31
  36. package/dist/rich-text/sanitization.d.ts +7 -4
  37. package/dist/rich-text/unicode.d.ts +9 -9
  38. package/dist/types.d.ts +34 -22
  39. package/docs/moderation.md +14 -5
  40. package/package.json +1 -1
  41. package/src/client/lexicons.ts +55 -0
  42. package/src/client/types/app/bsky/actor/profile.ts +4 -0
  43. package/src/client/types/app/bsky/feed/generator.ts +4 -0
  44. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +5 -0
  45. package/src/client/types/app/bsky/feed/post.ts +4 -0
  46. package/src/client/types/app/bsky/graph/list.ts +4 -0
  47. package/src/client/types/com/atproto/label/defs.ts +37 -0
  48. package/src/moderation/accumulator.ts +17 -12
  49. package/src/moderation/types.ts +5 -3
  50. package/tests/moderation.test.ts +334 -0
  51. package/tests/util/moderation-behavior.ts +3 -2
  52. package/tsconfig.build.tsbuildinfo +1 -1
  53. package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
  54. package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
  55. package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
  56. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
  57. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -40
  58. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
  59. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +0 -21
  60. package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
  61. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
  62. package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
  63. package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
  64. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +0 -17
  65. package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
  66. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
  67. package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
  68. package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
  69. package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
  70. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
  71. package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +0 -21
  72. package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
  73. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
  74. package/dist/client/types/app/bsky/graph/listblock.d.ts +0 -8
  75. package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
  76. package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +0 -17
  77. package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
  78. package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +0 -17
  79. package/dist/client/types/app/bsky/notification/getCount.d.ts +0 -17
  80. package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
  81. package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
  82. package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
  83. package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
  84. package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
  85. package/dist/client/types/com/atproto/account/create.d.ts +0 -41
  86. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
  87. package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
  88. package/dist/client/types/com/atproto/account/get.d.ts +0 -12
  89. package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
  90. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
  91. package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
  92. package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
  93. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
  94. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
  95. package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
  96. package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
  97. package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
  98. package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
  99. package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
  100. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
  101. package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
  102. package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
  103. package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
  104. package/dist/client/types/com/atproto/report/create.d.ts +0 -39
  105. package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
  106. package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
  107. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
  108. package/dist/client/types/com/atproto/session/create.d.ts +0 -29
  109. package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
  110. package/dist/client/types/com/atproto/session/get.d.ts +0 -18
  111. package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
  112. package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -18
  113. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
  114. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
  115. package/dist/helpers/bsky.d.ts +0 -20
  116. package/dist/mixins/bsky.d.ts +0 -23
  117. package/dist/rich-text/sanitize.d.ts +0 -4
  118. 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
- subject: string;
4
- list: string;
5
- createdAt: string;
6
- [k: string]: unknown;
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
- index: ByteSlice;
4
- features: (Mention | Link | {
5
- $type: string;
6
- [k: string]: unknown;
7
- })[];
8
- [k: string]: unknown;
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
- did: string;
14
- [k: string]: unknown;
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
- uri: string;
20
- [k: string]: unknown;
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
- byteStart: number;
26
- byteEnd: number;
27
- [k: string]: unknown;
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
- seq: number;
5
- labels: ComAtprotoLabelDefs.Label[];
6
- [k: string]: unknown;
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
- name: 'OutdatedCursor' | (string & {});
12
- message?: string;
13
- [k: string]: unknown;
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 = 'com.atproto.moderation.defs#reasonSpam' | 'com.atproto.moderation.defs#reasonViolation' | 'com.atproto.moderation.defs#reasonMisleading' | 'com.atproto.moderation.defs#reasonSexual' | 'com.atproto.moderation.defs#reasonRude' | 'com.atproto.moderation.defs#reasonOther' | (string & {});
2
- export declare const REASONSPAM = "com.atproto.moderation.defs#reasonSpam";
3
- export declare const REASONVIOLATION = "com.atproto.moderation.defs#reasonViolation";
4
- export declare const REASONMISLEADING = "com.atproto.moderation.defs#reasonMisleading";
5
- export declare const REASONSEXUAL = "com.atproto.moderation.defs#reasonSexual";
6
- export declare const REASONRUDE = "com.atproto.moderation.defs#reasonRude";
7
- export declare const REASONOTHER = "com.atproto.moderation.defs#reasonOther";
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
- uri: string;
4
- cid: string;
5
- [k: string]: unknown;
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
- code: string;
4
- available: number;
5
- disabled: boolean;
6
- forAccount: string;
7
- createdBy: string;
8
- createdAt: string;
9
- uses: InviteCodeUse[];
10
- [k: string]: unknown;
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
- usedBy: string;
16
- usedAt: string;
17
- [k: string]: unknown;
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
- 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;
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
- seq: number;
20
- did: string;
21
- handle: string;
22
- time: string;
23
- [k: string]: unknown;
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
- seq: number;
29
- did: string;
30
- migrateTo: string | null;
31
- time: string;
32
- [k: string]: unknown;
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
- seq: number;
38
- did: string;
39
- time: string;
40
- [k: string]: unknown;
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
- name: 'OutdatedCursor' | (string & {});
46
- message?: string;
47
- [k: string]: unknown;
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
- action: 'create' | 'update' | 'delete' | (string & {});
53
- path: string;
54
- cid: CID | null;
55
- [k: string]: unknown;
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
@@ -1,2 +1,5 @@
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>;
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
- validateLabel: () => validateLabel
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 labelerSettings = opts.labelerSettings[0];
28140
- if (!labelerSettings) {
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 (labelerSettings.settings[label.val]) {
28149
- labelPref = labelerSettings.settings[label.val];
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
  });
@@ -28358,14 +28426,18 @@ function takeHighestPriorityDecision(...decisions) {
28358
28426
  });
28359
28427
  return filtered[0];
28360
28428
  }
28361
- function downgradeDecision(decision, { alert }) {
28362
- decision.blur = false;
28363
- decision.blurMedia = false;
28429
+ function downgradeDecision(decision, to) {
28364
28430
  decision.filter = false;
28365
28431
  decision.noOverride = false;
28366
- decision.alert = alert;
28367
- if (!alert) {
28432
+ if (to === "noop") {
28433
+ decision.blur = false;
28434
+ decision.blurMedia = false;
28435
+ decision.alert = false;
28368
28436
  delete decision.cause;
28437
+ } else if (to === "alert") {
28438
+ decision.blur = false;
28439
+ decision.blurMedia = false;
28440
+ decision.alert = true;
28369
28441
  }
28370
28442
  }
28371
28443
  function isModerationDecisionNoop(decision, { ignoreFilter } = { ignoreFilter: false }) {
@@ -28412,10 +28484,10 @@ function moderateProfile(subject, opts) {
28412
28484
  }
28413
28485
  profile.filter = false;
28414
28486
  if (!isModerationDecisionNoop(account) && account.did === opts.userDid) {
28415
- downgradeDecision(account, { alert: true });
28487
+ downgradeDecision(account, "alert");
28416
28488
  }
28417
28489
  if (!isModerationDecisionNoop(profile) && profile.did === opts.userDid) {
28418
- downgradeDecision(profile, { alert: true });
28490
+ downgradeDecision(profile, "alert");
28419
28491
  }
28420
28492
  let avatarBlur = false;
28421
28493
  let avatarNoOverride = false;
@@ -28458,19 +28530,19 @@ function moderatePost(subject, opts) {
28458
28530
  quote.blur = true;
28459
28531
  }
28460
28532
  if (!isModerationDecisionNoop(post) && post.did === opts.userDid) {
28461
- downgradeDecision(post, { alert: true });
28533
+ downgradeDecision(post, "blur");
28462
28534
  }
28463
- if (!isModerationDecisionNoop(account) && account.did === opts.userDid) {
28464
- downgradeDecision(account, { alert: false });
28535
+ if (account.cause && account.did === opts.userDid) {
28536
+ downgradeDecision(account, "noop");
28465
28537
  }
28466
- if (!isModerationDecisionNoop(profile) && profile.did === opts.userDid) {
28467
- downgradeDecision(profile, { alert: false });
28538
+ if (profile.cause && profile.did === opts.userDid) {
28539
+ downgradeDecision(profile, "noop");
28468
28540
  }
28469
28541
  if (quote && !isModerationDecisionNoop(quote) && quote.did === opts.userDid) {
28470
- downgradeDecision(quote, { alert: true });
28542
+ downgradeDecision(quote, "blur");
28471
28543
  }
28472
28544
  if (quotedAccount && !isModerationDecisionNoop(quotedAccount) && quotedAccount.did === opts.userDid) {
28473
- downgradeDecision(quotedAccount, { alert: false });
28545
+ downgradeDecision(quotedAccount, "noop");
28474
28546
  }
28475
28547
  const mergedForFeed = takeHighestPriorityDecision(
28476
28548
  post,