@atproto/api 0.14.0-next.1 → 0.14.0-next.2
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 +35 -0
- package/definitions/labels.json +1 -0
- package/dist/client/lexicons.d.ts +66 -0
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +33 -0
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/app/bsky/actor/defs.d.ts +24 -24
- package/dist/client/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/client/types/app/bsky/actor/profile.d.ts +1 -3
- package/dist/client/types/app/bsky/actor/profile.d.ts.map +1 -1
- package/dist/client/types/app/bsky/actor/profile.js.map +1 -1
- package/dist/client/types/app/bsky/embed/defs.d.ts +1 -1
- package/dist/client/types/app/bsky/embed/defs.js.map +1 -1
- package/dist/client/types/app/bsky/embed/external.d.ts +4 -4
- package/dist/client/types/app/bsky/embed/external.js.map +1 -1
- package/dist/client/types/app/bsky/embed/images.d.ts +4 -4
- package/dist/client/types/app/bsky/embed/images.js.map +1 -1
- package/dist/client/types/app/bsky/embed/record.d.ts +6 -6
- package/dist/client/types/app/bsky/embed/record.js.map +1 -1
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +2 -2
- package/dist/client/types/app/bsky/embed/recordWithMedia.js.map +1 -1
- package/dist/client/types/app/bsky/embed/video.d.ts +3 -3
- package/dist/client/types/app/bsky/embed/video.js.map +1 -1
- package/dist/client/types/app/bsky/feed/defs.d.ts +17 -17
- package/dist/client/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/client/types/app/bsky/feed/describeFeedGenerator.d.ts +2 -2
- package/dist/client/types/app/bsky/feed/describeFeedGenerator.js.map +1 -1
- package/dist/client/types/app/bsky/feed/generator.d.ts +1 -3
- package/dist/client/types/app/bsky/feed/generator.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/generator.js.map +1 -1
- package/dist/client/types/app/bsky/feed/getLikes.d.ts +1 -1
- package/dist/client/types/app/bsky/feed/getLikes.js.map +1 -1
- package/dist/client/types/app/bsky/feed/like.d.ts +2 -4
- package/dist/client/types/app/bsky/feed/like.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/like.js.map +1 -1
- package/dist/client/types/app/bsky/feed/post.d.ts +4 -6
- package/dist/client/types/app/bsky/feed/post.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/post.js.map +1 -1
- package/dist/client/types/app/bsky/feed/postgate.d.ts +2 -4
- package/dist/client/types/app/bsky/feed/postgate.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/postgate.js.map +1 -1
- package/dist/client/types/app/bsky/feed/repost.d.ts +2 -4
- package/dist/client/types/app/bsky/feed/repost.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/repost.js.map +1 -1
- package/dist/client/types/app/bsky/feed/threadgate.d.ts +4 -6
- package/dist/client/types/app/bsky/feed/threadgate.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/threadgate.js.map +1 -1
- package/dist/client/types/app/bsky/graph/block.d.ts +2 -4
- package/dist/client/types/app/bsky/graph/block.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/block.js.map +1 -1
- package/dist/client/types/app/bsky/graph/defs.d.ts +8 -8
- package/dist/client/types/app/bsky/graph/defs.js.map +1 -1
- package/dist/client/types/app/bsky/graph/follow.d.ts +2 -4
- package/dist/client/types/app/bsky/graph/follow.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/follow.js.map +1 -1
- package/dist/client/types/app/bsky/graph/list.d.ts +1 -3
- package/dist/client/types/app/bsky/graph/list.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/list.js.map +1 -1
- package/dist/client/types/app/bsky/graph/listblock.d.ts +2 -4
- package/dist/client/types/app/bsky/graph/listblock.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/listblock.js.map +1 -1
- package/dist/client/types/app/bsky/graph/listitem.d.ts +2 -4
- package/dist/client/types/app/bsky/graph/listitem.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/listitem.js.map +1 -1
- package/dist/client/types/app/bsky/graph/starterpack.d.ts +3 -5
- package/dist/client/types/app/bsky/graph/starterpack.d.ts.map +1 -1
- package/dist/client/types/app/bsky/graph/starterpack.js.map +1 -1
- package/dist/client/types/app/bsky/labeler/defs.d.ts +4 -4
- package/dist/client/types/app/bsky/labeler/defs.js.map +1 -1
- package/dist/client/types/app/bsky/labeler/service.d.ts +1 -3
- package/dist/client/types/app/bsky/labeler/service.d.ts.map +1 -1
- package/dist/client/types/app/bsky/labeler/service.js.map +1 -1
- package/dist/client/types/app/bsky/notification/listNotifications.d.ts +1 -1
- package/dist/client/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/client/types/app/bsky/richtext/facet.d.ts +5 -5
- package/dist/client/types/app/bsky/richtext/facet.js.map +1 -1
- package/dist/client/types/app/bsky/unspecced/defs.d.ts +4 -4
- package/dist/client/types/app/bsky/unspecced/defs.js.map +1 -1
- package/dist/client/types/app/bsky/unspecced/getTaggedSuggestions.d.ts +1 -1
- package/dist/client/types/app/bsky/unspecced/getTaggedSuggestions.js.map +1 -1
- package/dist/client/types/app/bsky/video/defs.d.ts +1 -1
- package/dist/client/types/app/bsky/video/defs.js.map +1 -1
- package/dist/client/types/chat/bsky/actor/declaration.d.ts +2 -4
- package/dist/client/types/chat/bsky/actor/declaration.d.ts.map +1 -1
- package/dist/client/types/chat/bsky/actor/declaration.js.map +1 -1
- package/dist/client/types/chat/bsky/actor/defs.d.ts +1 -1
- package/dist/client/types/chat/bsky/actor/defs.js.map +1 -1
- package/dist/client/types/chat/bsky/convo/defs.d.ts +10 -10
- package/dist/client/types/chat/bsky/convo/defs.js.map +1 -1
- package/dist/client/types/chat/bsky/convo/sendMessageBatch.d.ts +1 -1
- package/dist/client/types/chat/bsky/convo/sendMessageBatch.js.map +1 -1
- package/dist/client/types/chat/bsky/moderation/getActorMetadata.d.ts +1 -1
- package/dist/client/types/chat/bsky/moderation/getActorMetadata.js.map +1 -1
- package/dist/client/types/com/atproto/admin/defs.d.ts +5 -5
- package/dist/client/types/com/atproto/admin/defs.js.map +1 -1
- package/dist/client/types/com/atproto/label/defs.d.ts +5 -5
- package/dist/client/types/com/atproto/label/defs.js.map +1 -1
- package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +2 -2
- package/dist/client/types/com/atproto/label/subscribeLabels.js.map +1 -1
- package/dist/client/types/com/atproto/repo/applyWrites.d.ts +6 -6
- package/dist/client/types/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/client/types/com/atproto/repo/defs.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/defs.js.map +1 -1
- package/dist/client/types/com/atproto/repo/listMissingBlobs.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/listMissingBlobs.js.map +1 -1
- package/dist/client/types/com/atproto/repo/listRecords.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/listRecords.js.map +1 -1
- package/dist/client/types/com/atproto/repo/strongRef.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/strongRef.js.map +1 -1
- package/dist/client/types/com/atproto/server/createAppPassword.d.ts +1 -1
- package/dist/client/types/com/atproto/server/createAppPassword.js.map +1 -1
- package/dist/client/types/com/atproto/server/createInviteCodes.d.ts +1 -1
- package/dist/client/types/com/atproto/server/createInviteCodes.js.map +1 -1
- package/dist/client/types/com/atproto/server/createSession.d.ts +2 -0
- package/dist/client/types/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/client/types/com/atproto/server/createSession.js.map +1 -1
- package/dist/client/types/com/atproto/server/defs.d.ts +2 -2
- package/dist/client/types/com/atproto/server/defs.js.map +1 -1
- package/dist/client/types/com/atproto/server/describeServer.d.ts +2 -2
- package/dist/client/types/com/atproto/server/describeServer.js.map +1 -1
- package/dist/client/types/com/atproto/server/listAppPasswords.d.ts +1 -1
- package/dist/client/types/com/atproto/server/listAppPasswords.js.map +1 -1
- package/dist/client/types/com/atproto/sync/listRepos.d.ts +1 -1
- package/dist/client/types/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +8 -8
- package/dist/client/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/client/types/tools/ozone/communication/defs.d.ts +1 -1
- package/dist/client/types/tools/ozone/communication/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/moderation/defs.d.ts +36 -34
- package/dist/client/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/moderation/queryEvents.d.ts +1 -0
- package/dist/client/types/tools/ozone/moderation/queryEvents.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/moderation/queryEvents.js.map +1 -1
- package/dist/client/types/tools/ozone/moderation/queryStatuses.d.ts +6 -0
- package/dist/client/types/tools/ozone/moderation/queryStatuses.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/moderation/queryStatuses.js.map +1 -1
- package/dist/client/types/tools/ozone/server/getConfig.d.ts +2 -2
- package/dist/client/types/tools/ozone/server/getConfig.js.map +1 -1
- package/dist/client/types/tools/ozone/set/defs.d.ts +2 -2
- package/dist/client/types/tools/ozone/set/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/setting/defs.d.ts +1 -1
- package/dist/client/types/tools/ozone/setting/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/signature/defs.d.ts +1 -1
- package/dist/client/types/tools/ozone/signature/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/signature/findRelatedAccounts.d.ts +1 -1
- package/dist/client/types/tools/ozone/signature/findRelatedAccounts.js.map +1 -1
- package/dist/client/types/tools/ozone/team/defs.d.ts +1 -1
- package/dist/client/types/tools/ozone/team/defs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/moderation/const/labels.d.ts +1 -1
- package/dist/moderation/const/labels.d.ts.map +1 -1
- package/dist/moderation/const/labels.js +23 -0
- package/dist/moderation/const/labels.js.map +1 -1
- package/dist/moderation/decision.d.ts.map +1 -1
- package/dist/moderation/decision.js +1 -1
- package/dist/moderation/decision.js.map +1 -1
- package/dist/moderation/subjects/post.d.ts.map +1 -1
- package/dist/moderation/subjects/post.js +22 -17
- package/dist/moderation/subjects/post.js.map +1 -1
- package/dist/moderation/types.d.ts +2 -2
- package/dist/moderation/types.d.ts.map +1 -1
- package/dist/moderation/types.js.map +1 -1
- package/package.json +5 -5
- package/scripts/code/labels.mjs +33 -9
- package/src/client/lexicons.ts +40 -1
- package/src/client/types/app/bsky/actor/defs.ts +24 -24
- package/src/client/types/app/bsky/actor/profile.ts +1 -1
- package/src/client/types/app/bsky/embed/defs.ts +1 -1
- package/src/client/types/app/bsky/embed/external.ts +4 -4
- package/src/client/types/app/bsky/embed/images.ts +4 -4
- package/src/client/types/app/bsky/embed/record.ts +6 -6
- package/src/client/types/app/bsky/embed/recordWithMedia.ts +2 -2
- package/src/client/types/app/bsky/embed/video.ts +3 -3
- package/src/client/types/app/bsky/feed/defs.ts +17 -17
- package/src/client/types/app/bsky/feed/describeFeedGenerator.ts +2 -2
- package/src/client/types/app/bsky/feed/generator.ts +1 -1
- package/src/client/types/app/bsky/feed/getLikes.ts +1 -1
- package/src/client/types/app/bsky/feed/like.ts +1 -1
- package/src/client/types/app/bsky/feed/post.ts +4 -4
- package/src/client/types/app/bsky/feed/postgate.ts +2 -2
- package/src/client/types/app/bsky/feed/repost.ts +1 -1
- package/src/client/types/app/bsky/feed/threadgate.ts +4 -4
- package/src/client/types/app/bsky/graph/block.ts +1 -1
- package/src/client/types/app/bsky/graph/defs.ts +8 -8
- package/src/client/types/app/bsky/graph/follow.ts +1 -1
- package/src/client/types/app/bsky/graph/list.ts +1 -1
- package/src/client/types/app/bsky/graph/listblock.ts +1 -1
- package/src/client/types/app/bsky/graph/listitem.ts +1 -1
- package/src/client/types/app/bsky/graph/starterpack.ts +2 -2
- package/src/client/types/app/bsky/labeler/defs.ts +4 -4
- package/src/client/types/app/bsky/labeler/service.ts +1 -1
- package/src/client/types/app/bsky/notification/listNotifications.ts +1 -1
- package/src/client/types/app/bsky/richtext/facet.ts +5 -5
- package/src/client/types/app/bsky/unspecced/defs.ts +4 -4
- package/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts +1 -1
- package/src/client/types/app/bsky/video/defs.ts +1 -1
- package/src/client/types/chat/bsky/actor/declaration.ts +1 -1
- package/src/client/types/chat/bsky/actor/defs.ts +1 -1
- package/src/client/types/chat/bsky/convo/defs.ts +10 -10
- package/src/client/types/chat/bsky/convo/sendMessageBatch.ts +1 -1
- package/src/client/types/chat/bsky/moderation/getActorMetadata.ts +1 -1
- package/src/client/types/com/atproto/admin/defs.ts +5 -5
- package/src/client/types/com/atproto/label/defs.ts +5 -5
- package/src/client/types/com/atproto/label/subscribeLabels.ts +2 -2
- package/src/client/types/com/atproto/repo/applyWrites.ts +6 -6
- package/src/client/types/com/atproto/repo/defs.ts +1 -1
- package/src/client/types/com/atproto/repo/listMissingBlobs.ts +1 -1
- package/src/client/types/com/atproto/repo/listRecords.ts +1 -1
- package/src/client/types/com/atproto/repo/strongRef.ts +1 -1
- package/src/client/types/com/atproto/server/createAppPassword.ts +1 -1
- package/src/client/types/com/atproto/server/createInviteCodes.ts +1 -1
- package/src/client/types/com/atproto/server/createSession.ts +2 -0
- package/src/client/types/com/atproto/server/defs.ts +2 -2
- package/src/client/types/com/atproto/server/describeServer.ts +2 -2
- package/src/client/types/com/atproto/server/listAppPasswords.ts +1 -1
- package/src/client/types/com/atproto/sync/listRepos.ts +1 -1
- package/src/client/types/com/atproto/sync/subscribeRepos.ts +8 -8
- package/src/client/types/tools/ozone/communication/defs.ts +1 -1
- package/src/client/types/tools/ozone/moderation/defs.ts +40 -34
- package/src/client/types/tools/ozone/moderation/queryEvents.ts +1 -0
- package/src/client/types/tools/ozone/moderation/queryStatuses.ts +6 -0
- package/src/client/types/tools/ozone/server/getConfig.ts +2 -2
- package/src/client/types/tools/ozone/set/defs.ts +2 -2
- package/src/client/types/tools/ozone/setting/defs.ts +1 -1
- package/src/client/types/tools/ozone/signature/defs.ts +1 -1
- package/src/client/types/tools/ozone/signature/findRelatedAccounts.ts +1 -1
- package/src/client/types/tools/ozone/team/defs.ts +1 -1
- package/src/index.ts +1 -0
- package/src/moderation/const/labels.ts +24 -0
- package/src/moderation/decision.ts +1 -3
- package/src/moderation/subjects/post.ts +40 -22
- package/src/moderation/types.ts +2 -0
- package/tests/rich-text-detection.test.ts +2 -6
|
@@ -53,7 +53,7 @@ export function validateCommit<V>(v: V) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export function isValidCommit<V>(v: V) {
|
|
56
|
-
return isValid<Commit>(v, id, hashCommit)
|
|
56
|
+
return isValid<Commit & V>(v, id, hashCommit)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. */
|
|
@@ -77,7 +77,7 @@ export function validateIdentity<V>(v: V) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export function isValidIdentity<V>(v: V) {
|
|
80
|
-
return isValid<Identity>(v, id, hashIdentity)
|
|
80
|
+
return isValid<Identity & V>(v, id, hashIdentity)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/** Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. */
|
|
@@ -103,7 +103,7 @@ export function validateAccount<V>(v: V) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
export function isValidAccount<V>(v: V) {
|
|
106
|
-
return isValid<Account>(v, id, hashAccount)
|
|
106
|
+
return isValid<Account & V>(v, id, hashAccount)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/** DEPRECATED -- Use #identity event instead */
|
|
@@ -126,7 +126,7 @@ export function validateHandle<V>(v: V) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
export function isValidHandle<V>(v: V) {
|
|
129
|
-
return isValid<Handle>(v, id, hashHandle)
|
|
129
|
+
return isValid<Handle & V>(v, id, hashHandle)
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/** DEPRECATED -- Use #account event instead */
|
|
@@ -149,7 +149,7 @@ export function validateMigrate<V>(v: V) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export function isValidMigrate<V>(v: V) {
|
|
152
|
-
return isValid<Migrate>(v, id, hashMigrate)
|
|
152
|
+
return isValid<Migrate & V>(v, id, hashMigrate)
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/** DEPRECATED -- Use #account event instead */
|
|
@@ -171,7 +171,7 @@ export function validateTombstone<V>(v: V) {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
export function isValidTombstone<V>(v: V) {
|
|
174
|
-
return isValid<Tombstone>(v, id, hashTombstone)
|
|
174
|
+
return isValid<Tombstone & V>(v, id, hashTombstone)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export interface Info {
|
|
@@ -191,7 +191,7 @@ export function validateInfo<V>(v: V) {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
export function isValidInfo<V>(v: V) {
|
|
194
|
-
return isValid<Info>(v, id, hashInfo)
|
|
194
|
+
return isValid<Info & V>(v, id, hashInfo)
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/** A repo operation, ie a mutation of a single record. */
|
|
@@ -214,5 +214,5 @@ export function validateRepoOp<V>(v: V) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export function isValidRepoOp<V>(v: V) {
|
|
217
|
-
return isValid<RepoOp>(v, id, hashRepoOp)
|
|
217
|
+
return isValid<RepoOp & V>(v, id, hashRepoOp)
|
|
218
218
|
}
|
|
@@ -66,7 +66,7 @@ export function validateModEventView<V>(v: V) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export function isValidModEventView<V>(v: V) {
|
|
69
|
-
return isValid<ModEventView>(v, id, hashModEventView)
|
|
69
|
+
return isValid<ModEventView & V>(v, id, hashModEventView)
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface ModEventViewDetail {
|
|
@@ -114,7 +114,7 @@ export function validateModEventViewDetail<V>(v: V) {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export function isValidModEventViewDetail<V>(v: V) {
|
|
117
|
-
return isValid<ModEventViewDetail>(v, id, hashModEventViewDetail)
|
|
117
|
+
return isValid<ModEventViewDetail & V>(v, id, hashModEventViewDetail)
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export interface SubjectStatusView {
|
|
@@ -159,7 +159,7 @@ export function validateSubjectStatusView<V>(v: V) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
export function isValidSubjectStatusView<V>(v: V) {
|
|
162
|
-
return isValid<SubjectStatusView>(v, id, hashSubjectStatusView)
|
|
162
|
+
return isValid<SubjectStatusView & V>(v, id, hashSubjectStatusView)
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export type SubjectReviewState =
|
|
@@ -186,6 +186,8 @@ export interface ModEventTakedown {
|
|
|
186
186
|
durationInHours?: number
|
|
187
187
|
/** If true, all other reports on content authored by this account will be resolved (acknowledged). */
|
|
188
188
|
acknowledgeAccountSubjects?: boolean
|
|
189
|
+
/** Names/Keywords of the policies that drove the decision. */
|
|
190
|
+
policies?: string[]
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
const hashModEventTakedown = 'modEventTakedown'
|
|
@@ -199,7 +201,7 @@ export function validateModEventTakedown<V>(v: V) {
|
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
export function isValidModEventTakedown<V>(v: V) {
|
|
202
|
-
return isValid<ModEventTakedown>(v, id, hashModEventTakedown)
|
|
204
|
+
return isValid<ModEventTakedown & V>(v, id, hashModEventTakedown)
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
/** Revert take down action on a subject */
|
|
@@ -224,7 +226,11 @@ export function validateModEventReverseTakedown<V>(v: V) {
|
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
export function isValidModEventReverseTakedown<V>(v: V) {
|
|
227
|
-
return isValid<ModEventReverseTakedown>(
|
|
229
|
+
return isValid<ModEventReverseTakedown & V>(
|
|
230
|
+
v,
|
|
231
|
+
id,
|
|
232
|
+
hashModEventReverseTakedown,
|
|
233
|
+
)
|
|
228
234
|
}
|
|
229
235
|
|
|
230
236
|
/** Resolve appeal on a subject */
|
|
@@ -245,7 +251,7 @@ export function validateModEventResolveAppeal<V>(v: V) {
|
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
export function isValidModEventResolveAppeal<V>(v: V) {
|
|
248
|
-
return isValid<ModEventResolveAppeal>(v, id, hashModEventResolveAppeal)
|
|
254
|
+
return isValid<ModEventResolveAppeal & V>(v, id, hashModEventResolveAppeal)
|
|
249
255
|
}
|
|
250
256
|
|
|
251
257
|
/** Add a comment to a subject */
|
|
@@ -267,7 +273,7 @@ export function validateModEventComment<V>(v: V) {
|
|
|
267
273
|
}
|
|
268
274
|
|
|
269
275
|
export function isValidModEventComment<V>(v: V) {
|
|
270
|
-
return isValid<ModEventComment>(v, id, hashModEventComment)
|
|
276
|
+
return isValid<ModEventComment & V>(v, id, hashModEventComment)
|
|
271
277
|
}
|
|
272
278
|
|
|
273
279
|
/** Report a subject */
|
|
@@ -290,7 +296,7 @@ export function validateModEventReport<V>(v: V) {
|
|
|
290
296
|
}
|
|
291
297
|
|
|
292
298
|
export function isValidModEventReport<V>(v: V) {
|
|
293
|
-
return isValid<ModEventReport>(v, id, hashModEventReport)
|
|
299
|
+
return isValid<ModEventReport & V>(v, id, hashModEventReport)
|
|
294
300
|
}
|
|
295
301
|
|
|
296
302
|
/** Apply/Negate labels on a subject */
|
|
@@ -312,7 +318,7 @@ export function validateModEventLabel<V>(v: V) {
|
|
|
312
318
|
}
|
|
313
319
|
|
|
314
320
|
export function isValidModEventLabel<V>(v: V) {
|
|
315
|
-
return isValid<ModEventLabel>(v, id, hashModEventLabel)
|
|
321
|
+
return isValid<ModEventLabel & V>(v, id, hashModEventLabel)
|
|
316
322
|
}
|
|
317
323
|
|
|
318
324
|
export interface ModEventAcknowledge {
|
|
@@ -333,7 +339,7 @@ export function validateModEventAcknowledge<V>(v: V) {
|
|
|
333
339
|
}
|
|
334
340
|
|
|
335
341
|
export function isValidModEventAcknowledge<V>(v: V) {
|
|
336
|
-
return isValid<ModEventAcknowledge>(v, id, hashModEventAcknowledge)
|
|
342
|
+
return isValid<ModEventAcknowledge & V>(v, id, hashModEventAcknowledge)
|
|
337
343
|
}
|
|
338
344
|
|
|
339
345
|
export interface ModEventEscalate {
|
|
@@ -352,7 +358,7 @@ export function validateModEventEscalate<V>(v: V) {
|
|
|
352
358
|
}
|
|
353
359
|
|
|
354
360
|
export function isValidModEventEscalate<V>(v: V) {
|
|
355
|
-
return isValid<ModEventEscalate>(v, id, hashModEventEscalate)
|
|
361
|
+
return isValid<ModEventEscalate & V>(v, id, hashModEventEscalate)
|
|
356
362
|
}
|
|
357
363
|
|
|
358
364
|
/** Mute incoming reports on a subject */
|
|
@@ -374,7 +380,7 @@ export function validateModEventMute<V>(v: V) {
|
|
|
374
380
|
}
|
|
375
381
|
|
|
376
382
|
export function isValidModEventMute<V>(v: V) {
|
|
377
|
-
return isValid<ModEventMute>(v, id, hashModEventMute)
|
|
383
|
+
return isValid<ModEventMute & V>(v, id, hashModEventMute)
|
|
378
384
|
}
|
|
379
385
|
|
|
380
386
|
/** Unmute action on a subject */
|
|
@@ -395,7 +401,7 @@ export function validateModEventUnmute<V>(v: V) {
|
|
|
395
401
|
}
|
|
396
402
|
|
|
397
403
|
export function isValidModEventUnmute<V>(v: V) {
|
|
398
|
-
return isValid<ModEventUnmute>(v, id, hashModEventUnmute)
|
|
404
|
+
return isValid<ModEventUnmute & V>(v, id, hashModEventUnmute)
|
|
399
405
|
}
|
|
400
406
|
|
|
401
407
|
/** Mute incoming reports from an account */
|
|
@@ -417,7 +423,7 @@ export function validateModEventMuteReporter<V>(v: V) {
|
|
|
417
423
|
}
|
|
418
424
|
|
|
419
425
|
export function isValidModEventMuteReporter<V>(v: V) {
|
|
420
|
-
return isValid<ModEventMuteReporter>(v, id, hashModEventMuteReporter)
|
|
426
|
+
return isValid<ModEventMuteReporter & V>(v, id, hashModEventMuteReporter)
|
|
421
427
|
}
|
|
422
428
|
|
|
423
429
|
/** Unmute incoming reports from an account */
|
|
@@ -438,7 +444,7 @@ export function validateModEventUnmuteReporter<V>(v: V) {
|
|
|
438
444
|
}
|
|
439
445
|
|
|
440
446
|
export function isValidModEventUnmuteReporter<V>(v: V) {
|
|
441
|
-
return isValid<ModEventUnmuteReporter>(v, id, hashModEventUnmuteReporter)
|
|
447
|
+
return isValid<ModEventUnmuteReporter & V>(v, id, hashModEventUnmuteReporter)
|
|
442
448
|
}
|
|
443
449
|
|
|
444
450
|
/** Keep a log of outgoing email to a user */
|
|
@@ -463,7 +469,7 @@ export function validateModEventEmail<V>(v: V) {
|
|
|
463
469
|
}
|
|
464
470
|
|
|
465
471
|
export function isValidModEventEmail<V>(v: V) {
|
|
466
|
-
return isValid<ModEventEmail>(v, id, hashModEventEmail)
|
|
472
|
+
return isValid<ModEventEmail & V>(v, id, hashModEventEmail)
|
|
467
473
|
}
|
|
468
474
|
|
|
469
475
|
/** Divert a record's blobs to a 3rd party service for further scanning/tagging */
|
|
@@ -483,7 +489,7 @@ export function validateModEventDivert<V>(v: V) {
|
|
|
483
489
|
}
|
|
484
490
|
|
|
485
491
|
export function isValidModEventDivert<V>(v: V) {
|
|
486
|
-
return isValid<ModEventDivert>(v, id, hashModEventDivert)
|
|
492
|
+
return isValid<ModEventDivert & V>(v, id, hashModEventDivert)
|
|
487
493
|
}
|
|
488
494
|
|
|
489
495
|
/** Add/Remove a tag on a subject */
|
|
@@ -508,7 +514,7 @@ export function validateModEventTag<V>(v: V) {
|
|
|
508
514
|
}
|
|
509
515
|
|
|
510
516
|
export function isValidModEventTag<V>(v: V) {
|
|
511
|
-
return isValid<ModEventTag>(v, id, hashModEventTag)
|
|
517
|
+
return isValid<ModEventTag & V>(v, id, hashModEventTag)
|
|
512
518
|
}
|
|
513
519
|
|
|
514
520
|
/** Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */
|
|
@@ -539,7 +545,7 @@ export function validateAccountEvent<V>(v: V) {
|
|
|
539
545
|
}
|
|
540
546
|
|
|
541
547
|
export function isValidAccountEvent<V>(v: V) {
|
|
542
|
-
return isValid<AccountEvent>(v, id, hashAccountEvent)
|
|
548
|
+
return isValid<AccountEvent & V>(v, id, hashAccountEvent)
|
|
543
549
|
}
|
|
544
550
|
|
|
545
551
|
/** Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */
|
|
@@ -563,7 +569,7 @@ export function validateIdentityEvent<V>(v: V) {
|
|
|
563
569
|
}
|
|
564
570
|
|
|
565
571
|
export function isValidIdentityEvent<V>(v: V) {
|
|
566
|
-
return isValid<IdentityEvent>(v, id, hashIdentityEvent)
|
|
572
|
+
return isValid<IdentityEvent & V>(v, id, hashIdentityEvent)
|
|
567
573
|
}
|
|
568
574
|
|
|
569
575
|
/** Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. */
|
|
@@ -586,7 +592,7 @@ export function validateRecordEvent<V>(v: V) {
|
|
|
586
592
|
}
|
|
587
593
|
|
|
588
594
|
export function isValidRecordEvent<V>(v: V) {
|
|
589
|
-
return isValid<RecordEvent>(v, id, hashRecordEvent)
|
|
595
|
+
return isValid<RecordEvent & V>(v, id, hashRecordEvent)
|
|
590
596
|
}
|
|
591
597
|
|
|
592
598
|
export interface RepoView {
|
|
@@ -615,7 +621,7 @@ export function validateRepoView<V>(v: V) {
|
|
|
615
621
|
}
|
|
616
622
|
|
|
617
623
|
export function isValidRepoView<V>(v: V) {
|
|
618
|
-
return isValid<RepoView>(v, id, hashRepoView)
|
|
624
|
+
return isValid<RepoView & V>(v, id, hashRepoView)
|
|
619
625
|
}
|
|
620
626
|
|
|
621
627
|
export interface RepoViewDetail {
|
|
@@ -647,7 +653,7 @@ export function validateRepoViewDetail<V>(v: V) {
|
|
|
647
653
|
}
|
|
648
654
|
|
|
649
655
|
export function isValidRepoViewDetail<V>(v: V) {
|
|
650
|
-
return isValid<RepoViewDetail>(v, id, hashRepoViewDetail)
|
|
656
|
+
return isValid<RepoViewDetail & V>(v, id, hashRepoViewDetail)
|
|
651
657
|
}
|
|
652
658
|
|
|
653
659
|
export interface RepoViewNotFound {
|
|
@@ -666,7 +672,7 @@ export function validateRepoViewNotFound<V>(v: V) {
|
|
|
666
672
|
}
|
|
667
673
|
|
|
668
674
|
export function isValidRepoViewNotFound<V>(v: V) {
|
|
669
|
-
return isValid<RepoViewNotFound>(v, id, hashRepoViewNotFound)
|
|
675
|
+
return isValid<RepoViewNotFound & V>(v, id, hashRepoViewNotFound)
|
|
670
676
|
}
|
|
671
677
|
|
|
672
678
|
export interface RecordView {
|
|
@@ -691,7 +697,7 @@ export function validateRecordView<V>(v: V) {
|
|
|
691
697
|
}
|
|
692
698
|
|
|
693
699
|
export function isValidRecordView<V>(v: V) {
|
|
694
|
-
return isValid<RecordView>(v, id, hashRecordView)
|
|
700
|
+
return isValid<RecordView & V>(v, id, hashRecordView)
|
|
695
701
|
}
|
|
696
702
|
|
|
697
703
|
export interface RecordViewDetail {
|
|
@@ -717,7 +723,7 @@ export function validateRecordViewDetail<V>(v: V) {
|
|
|
717
723
|
}
|
|
718
724
|
|
|
719
725
|
export function isValidRecordViewDetail<V>(v: V) {
|
|
720
|
-
return isValid<RecordViewDetail>(v, id, hashRecordViewDetail)
|
|
726
|
+
return isValid<RecordViewDetail & V>(v, id, hashRecordViewDetail)
|
|
721
727
|
}
|
|
722
728
|
|
|
723
729
|
export interface RecordViewNotFound {
|
|
@@ -736,7 +742,7 @@ export function validateRecordViewNotFound<V>(v: V) {
|
|
|
736
742
|
}
|
|
737
743
|
|
|
738
744
|
export function isValidRecordViewNotFound<V>(v: V) {
|
|
739
|
-
return isValid<RecordViewNotFound>(v, id, hashRecordViewNotFound)
|
|
745
|
+
return isValid<RecordViewNotFound & V>(v, id, hashRecordViewNotFound)
|
|
740
746
|
}
|
|
741
747
|
|
|
742
748
|
export interface Moderation {
|
|
@@ -755,7 +761,7 @@ export function validateModeration<V>(v: V) {
|
|
|
755
761
|
}
|
|
756
762
|
|
|
757
763
|
export function isValidModeration<V>(v: V) {
|
|
758
|
-
return isValid<Moderation>(v, id, hashModeration)
|
|
764
|
+
return isValid<Moderation & V>(v, id, hashModeration)
|
|
759
765
|
}
|
|
760
766
|
|
|
761
767
|
export interface ModerationDetail {
|
|
@@ -774,7 +780,7 @@ export function validateModerationDetail<V>(v: V) {
|
|
|
774
780
|
}
|
|
775
781
|
|
|
776
782
|
export function isValidModerationDetail<V>(v: V) {
|
|
777
|
-
return isValid<ModerationDetail>(v, id, hashModerationDetail)
|
|
783
|
+
return isValid<ModerationDetail & V>(v, id, hashModerationDetail)
|
|
778
784
|
}
|
|
779
785
|
|
|
780
786
|
export interface BlobView {
|
|
@@ -798,7 +804,7 @@ export function validateBlobView<V>(v: V) {
|
|
|
798
804
|
}
|
|
799
805
|
|
|
800
806
|
export function isValidBlobView<V>(v: V) {
|
|
801
|
-
return isValid<BlobView>(v, id, hashBlobView)
|
|
807
|
+
return isValid<BlobView & V>(v, id, hashBlobView)
|
|
802
808
|
}
|
|
803
809
|
|
|
804
810
|
export interface ImageDetails {
|
|
@@ -818,7 +824,7 @@ export function validateImageDetails<V>(v: V) {
|
|
|
818
824
|
}
|
|
819
825
|
|
|
820
826
|
export function isValidImageDetails<V>(v: V) {
|
|
821
|
-
return isValid<ImageDetails>(v, id, hashImageDetails)
|
|
827
|
+
return isValid<ImageDetails & V>(v, id, hashImageDetails)
|
|
822
828
|
}
|
|
823
829
|
|
|
824
830
|
export interface VideoDetails {
|
|
@@ -839,7 +845,7 @@ export function validateVideoDetails<V>(v: V) {
|
|
|
839
845
|
}
|
|
840
846
|
|
|
841
847
|
export function isValidVideoDetails<V>(v: V) {
|
|
842
|
-
return isValid<VideoDetails>(v, id, hashVideoDetails)
|
|
848
|
+
return isValid<VideoDetails & V>(v, id, hashVideoDetails)
|
|
843
849
|
}
|
|
844
850
|
|
|
845
851
|
export interface AccountHosting {
|
|
@@ -869,7 +875,7 @@ export function validateAccountHosting<V>(v: V) {
|
|
|
869
875
|
}
|
|
870
876
|
|
|
871
877
|
export function isValidAccountHosting<V>(v: V) {
|
|
872
|
-
return isValid<AccountHosting>(v, id, hashAccountHosting)
|
|
878
|
+
return isValid<AccountHosting & V>(v, id, hashAccountHosting)
|
|
873
879
|
}
|
|
874
880
|
|
|
875
881
|
export interface RecordHosting {
|
|
@@ -891,5 +897,5 @@ export function validateRecordHosting<V>(v: V) {
|
|
|
891
897
|
}
|
|
892
898
|
|
|
893
899
|
export function isValidRecordHosting<V>(v: V) {
|
|
894
|
-
return isValid<RecordHosting>(v, id, hashRecordHosting)
|
|
900
|
+
return isValid<RecordHosting & V>(v, id, hashRecordHosting)
|
|
895
901
|
}
|
|
@@ -17,6 +17,12 @@ const is$typed = _is$typed,
|
|
|
17
17
|
const id = 'tools.ozone.moderation.queryStatuses'
|
|
18
18
|
|
|
19
19
|
export interface QueryParams {
|
|
20
|
+
/** Number of queues being used by moderators. Subjects will be split among all queues. */
|
|
21
|
+
queueCount?: number
|
|
22
|
+
/** Index of the queue to fetch subjects from. Works only when queueCount value is specified. */
|
|
23
|
+
queueIndex?: number
|
|
24
|
+
/** A seeder to shuffle/balance the queue items. */
|
|
25
|
+
queueSeed?: string
|
|
20
26
|
/** All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. */
|
|
21
27
|
includeAllUserRecords?: boolean
|
|
22
28
|
/** The subject to get the status for. */
|
|
@@ -58,7 +58,7 @@ export function validateServiceConfig<V>(v: V) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export function isValidServiceConfig<V>(v: V) {
|
|
61
|
-
return isValid<ServiceConfig>(v, id, hashServiceConfig)
|
|
61
|
+
return isValid<ServiceConfig & V>(v, id, hashServiceConfig)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export interface ViewerConfig {
|
|
@@ -81,5 +81,5 @@ export function validateViewerConfig<V>(v: V) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export function isValidViewerConfig<V>(v: V) {
|
|
84
|
-
return isValid<ViewerConfig>(v, id, hashViewerConfig)
|
|
84
|
+
return isValid<ViewerConfig & V>(v, id, hashViewerConfig)
|
|
85
85
|
}
|
|
@@ -31,7 +31,7 @@ export function validateSet<V>(v: V) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export function isValidSet<V>(v: V) {
|
|
34
|
-
return isValid<Set>(v, id, hashSet)
|
|
34
|
+
return isValid<Set & V>(v, id, hashSet)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface SetView {
|
|
@@ -54,5 +54,5 @@ export function validateSetView<V>(v: V) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export function isValidSetView<V>(v: V) {
|
|
57
|
-
return isValid<SetView>(v, id, hashSetView)
|
|
57
|
+
return isValid<SetView & V>(v, id, hashSetView)
|
|
58
58
|
}
|
|
@@ -41,7 +41,7 @@ export function validateMember<V>(v: V) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function isValidMember<V>(v: V) {
|
|
44
|
-
return isValid<Member>(v, id, hashMember)
|
|
44
|
+
return isValid<Member & V>(v, id, hashMember)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/** Admin role. Highest level of access, can perform all actions. */
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './const'
|
|
|
15
15
|
export * from './util'
|
|
16
16
|
export * from './client'
|
|
17
17
|
export { schemas } from './client/lexicons'
|
|
18
|
+
export type { $Type, $Typed } from './client/util'
|
|
18
19
|
export * from './rich-text/rich-text'
|
|
19
20
|
export * from './rich-text/sanitization'
|
|
20
21
|
export * from './rich-text/unicode'
|
|
@@ -9,6 +9,7 @@ export type KnownLabelValue =
|
|
|
9
9
|
| 'sexual'
|
|
10
10
|
| 'nudity'
|
|
11
11
|
| 'graphic-media'
|
|
12
|
+
| 'gore'
|
|
12
13
|
|
|
13
14
|
export const DEFAULT_LABEL_SETTINGS: Record<string, LabelPreference> = {
|
|
14
15
|
porn: 'hide',
|
|
@@ -193,4 +194,27 @@ export const LABELS: Record<KnownLabelValue, InterpretedLabelValueDefinition> =
|
|
|
193
194
|
},
|
|
194
195
|
locales: [],
|
|
195
196
|
},
|
|
197
|
+
/** @deprecated alias for `graphic-media` */
|
|
198
|
+
gore: {
|
|
199
|
+
identifier: 'gore',
|
|
200
|
+
flags: ['adult'],
|
|
201
|
+
configurable: true,
|
|
202
|
+
defaultSetting: 'warn',
|
|
203
|
+
severity: 'none',
|
|
204
|
+
blurs: 'media',
|
|
205
|
+
behaviors: {
|
|
206
|
+
account: {
|
|
207
|
+
avatar: 'blur',
|
|
208
|
+
banner: 'blur',
|
|
209
|
+
},
|
|
210
|
+
profile: {
|
|
211
|
+
avatar: 'blur',
|
|
212
|
+
banner: 'blur',
|
|
213
|
+
},
|
|
214
|
+
content: {
|
|
215
|
+
contentMedia: 'blur',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
locales: [],
|
|
219
|
+
},
|
|
196
220
|
}
|
|
@@ -32,9 +32,7 @@ export class ModerationDecision {
|
|
|
32
32
|
static merge(
|
|
33
33
|
...decisions: (ModerationDecision | undefined)[]
|
|
34
34
|
): ModerationDecision {
|
|
35
|
-
const decisionsFiltered
|
|
36
|
-
(v) => !!v,
|
|
37
|
-
) as ModerationDecision[]
|
|
35
|
+
const decisionsFiltered = decisions.filter((v) => v != null)
|
|
38
36
|
const decision = new ModerationDecision()
|
|
39
37
|
if (decisionsFiltered[0]) {
|
|
40
38
|
decision.did = decisionsFiltered[0].did
|
|
@@ -11,10 +11,23 @@ import { ModerationSubjectPost, ModerationOpts } from '../types'
|
|
|
11
11
|
import { hasMutedWord } from '../mutewords'
|
|
12
12
|
import { decideAccount } from './account'
|
|
13
13
|
import { decideProfile } from './profile'
|
|
14
|
+
import { $Typed } from '../../client/util'
|
|
14
15
|
|
|
15
16
|
export function decidePost(
|
|
16
17
|
subject: ModerationSubjectPost,
|
|
17
18
|
opts: ModerationOpts,
|
|
19
|
+
): ModerationDecision {
|
|
20
|
+
return ModerationDecision.merge(
|
|
21
|
+
decideSubject(subject, opts),
|
|
22
|
+
decideEmbed(subject.embed, opts)?.downgrade(),
|
|
23
|
+
decideAccount(subject.author, opts),
|
|
24
|
+
decideProfile(subject.author, opts),
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function decideSubject(
|
|
29
|
+
subject: ModerationSubjectPost,
|
|
30
|
+
opts: ModerationOpts,
|
|
18
31
|
): ModerationDecision {
|
|
19
32
|
const acc = new ModerationDecision()
|
|
20
33
|
|
|
@@ -30,43 +43,48 @@ export function decidePost(
|
|
|
30
43
|
acc.addMutedWord(checkMutedWords(subject, opts.prefs.mutedWords))
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
return acc
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function decideEmbed(
|
|
50
|
+
embed:
|
|
51
|
+
| undefined
|
|
52
|
+
| $Typed<AppBskyEmbedRecord.View>
|
|
53
|
+
| $Typed<AppBskyEmbedRecordWithMedia.View>
|
|
54
|
+
| { $type: string },
|
|
55
|
+
opts: ModerationOpts,
|
|
56
|
+
) {
|
|
57
|
+
if (embed) {
|
|
35
58
|
if (
|
|
36
|
-
(AppBskyEmbedRecord.isView(
|
|
37
|
-
AppBskyEmbedRecordWithMedia.isView(
|
|
38
|
-
AppBskyEmbedRecord.isViewRecord(
|
|
59
|
+
(AppBskyEmbedRecord.isView(embed) ||
|
|
60
|
+
AppBskyEmbedRecordWithMedia.isView(embed)) &&
|
|
61
|
+
AppBskyEmbedRecord.isViewRecord(embed.record)
|
|
39
62
|
) {
|
|
40
63
|
// quote post
|
|
41
|
-
|
|
64
|
+
return decideQuotedPost(embed.record, opts)
|
|
42
65
|
} else if (
|
|
43
|
-
AppBskyEmbedRecordWithMedia.isView(
|
|
44
|
-
AppBskyEmbedRecord.isViewRecord(
|
|
66
|
+
AppBskyEmbedRecordWithMedia.isView(embed) &&
|
|
67
|
+
AppBskyEmbedRecord.isViewRecord(embed.record.record)
|
|
45
68
|
) {
|
|
46
69
|
// quoted post with media
|
|
47
|
-
|
|
70
|
+
return decideQuotedPost(embed.record.record, opts)
|
|
48
71
|
} else if (
|
|
49
|
-
(AppBskyEmbedRecord.isView(
|
|
50
|
-
AppBskyEmbedRecordWithMedia.isView(
|
|
51
|
-
AppBskyEmbedRecord.isViewBlocked(
|
|
72
|
+
(AppBskyEmbedRecord.isView(embed) ||
|
|
73
|
+
AppBskyEmbedRecordWithMedia.isView(embed)) &&
|
|
74
|
+
AppBskyEmbedRecord.isViewBlocked(embed.record)
|
|
52
75
|
) {
|
|
53
76
|
// blocked quote post
|
|
54
|
-
|
|
77
|
+
return decideBlockedQuotedPost(embed.record, opts)
|
|
55
78
|
} else if (
|
|
56
|
-
AppBskyEmbedRecordWithMedia.isView(
|
|
57
|
-
AppBskyEmbedRecord.isViewBlocked(
|
|
79
|
+
AppBskyEmbedRecordWithMedia.isView(embed) &&
|
|
80
|
+
AppBskyEmbedRecord.isViewBlocked(embed.record.record)
|
|
58
81
|
) {
|
|
59
82
|
// blocked quoted post with media
|
|
60
|
-
|
|
83
|
+
return decideBlockedQuotedPost(embed.record.record, opts)
|
|
61
84
|
}
|
|
62
85
|
}
|
|
63
86
|
|
|
64
|
-
return
|
|
65
|
-
acc,
|
|
66
|
-
embedAcc?.downgrade(),
|
|
67
|
-
decideAccount(subject.author, opts),
|
|
68
|
-
decideProfile(subject.author, opts),
|
|
69
|
-
)
|
|
87
|
+
return undefined
|
|
70
88
|
}
|
|
71
89
|
|
|
72
90
|
function decideQuotedPost(
|
package/src/moderation/types.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
AppBskyNotificationListNotifications,
|
|
5
5
|
AppBskyGraphDefs,
|
|
6
6
|
ComAtprotoLabelDefs,
|
|
7
|
+
ChatBskyActorDefs,
|
|
7
8
|
} from '../client/index'
|
|
8
9
|
import { KnownLabelValue } from './const/labels'
|
|
9
10
|
|
|
@@ -87,6 +88,7 @@ export type ModerationSubjectProfile =
|
|
|
87
88
|
| AppBskyActorDefs.ProfileViewBasic
|
|
88
89
|
| AppBskyActorDefs.ProfileView
|
|
89
90
|
| AppBskyActorDefs.ProfileViewDetailed
|
|
91
|
+
| ChatBskyActorDefs.ProfileViewBasic
|
|
90
92
|
|
|
91
93
|
export type ModerationSubjectPost = AppBskyFeedDefs.PostView
|
|
92
94
|
|
|
@@ -378,12 +378,8 @@ function segmentToOutput(segment: RichTextSegment): string[] {
|
|
|
378
378
|
return [
|
|
379
379
|
segment.text,
|
|
380
380
|
segment.facet?.features.map((f) => {
|
|
381
|
-
if (isMention(f))
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
if (isLink(f)) {
|
|
385
|
-
return String(f.uri)
|
|
386
|
-
}
|
|
381
|
+
if (isMention(f)) return f.did
|
|
382
|
+
if (isLink(f)) return f.uri
|
|
387
383
|
return undefined
|
|
388
384
|
})?.[0] || '',
|
|
389
385
|
]
|