@atproto/api
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -42,2 +42,3 @@ import { ValidationResult } from '@atproto/lexicon'; | ||
uri: string; | ||
notFound: true; | ||
[k: string]: unknown; | ||
@@ -49,2 +50,4 @@ } | ||
uri: string; | ||
blocked: true; | ||
author: AppBskyFeedDefs.BlockedAuthor; | ||
[k: string]: unknown; | ||
@@ -51,0 +54,0 @@ } |
@@ -10,2 +10,3 @@ import { AppBskyGraphDefs } from '../client/index'; | ||
addBlockedBy(blockedBy: boolean | undefined): void; | ||
addBlockOther(blockOther: boolean | undefined): void; | ||
addLabel(label: Label, opts: ModerationOpts): void; | ||
@@ -12,0 +13,0 @@ addMuted(muted: boolean | undefined): void; |
@@ -65,2 +65,6 @@ import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyGraphDefs, ComAtprotoLabelDefs } from '../client/index'; | ||
} | { | ||
type: 'block-other'; | ||
source: ModerationCauseSource; | ||
priority: 4; | ||
} | { | ||
type: 'label'; | ||
@@ -67,0 +71,0 @@ source: ModerationCauseSource; |
{ | ||
"name": "@atproto/api", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -87,2 +87,3 @@ /** | ||
uri: string | ||
notFound: true | ||
[k: string]: unknown | ||
@@ -105,2 +106,4 @@ } | ||
uri: string | ||
blocked: true | ||
author: AppBskyFeedDefs.BlockedAuthor | ||
[k: string]: unknown | ||
@@ -107,0 +110,0 @@ } |
@@ -41,2 +41,12 @@ import { AppBskyGraphDefs } from '../client/index' | ||
addBlockOther(blockOther: boolean | undefined) { | ||
if (blockOther) { | ||
this.causes.push({ | ||
type: 'block-other', | ||
source: { type: 'user' }, | ||
priority: 4, | ||
}) | ||
} | ||
} | ||
addLabel(label: Label, opts: ModerationOpts) { | ||
@@ -138,3 +148,7 @@ // look up the label definition | ||
// blocked user | ||
if (mod.cause.type === 'blocking' || mod.cause.type === 'blocked-by') { | ||
if ( | ||
mod.cause.type === 'blocking' || | ||
mod.cause.type === 'blocked-by' || | ||
mod.cause.type === 'block-other' | ||
) { | ||
// filter and blur, dont allow override | ||
@@ -141,0 +155,0 @@ mod.filter = true |
@@ -20,2 +20,11 @@ import { AppBskyEmbedRecord, AppBskyEmbedRecordWithMedia } from '../../client' | ||
} | ||
} else if (AppBskyEmbedRecord.isViewBlocked(subject.record)) { | ||
acc.setDid(subject.record.author.did) | ||
if (subject.record.author.viewer?.blocking) { | ||
acc.addBlocking(subject.record.author.viewer?.blocking) | ||
} else if (subject.record.author.viewer?.blockedBy) { | ||
acc.addBlockedBy(subject.record.author.viewer?.blockedBy) | ||
} else { | ||
acc.addBlockOther(true) | ||
} | ||
} | ||
@@ -50,2 +59,11 @@ | ||
} | ||
} else if (AppBskyEmbedRecord.isViewBlocked(subject.record.record)) { | ||
acc.setDid(subject.record.record.author.did) | ||
if (subject.record.record.author.viewer?.blocking) { | ||
acc.addBlocking(subject.record.record.author.viewer?.blocking) | ||
} else if (subject.record.record.author.viewer?.blockedBy) { | ||
acc.addBlockedBy(subject.record.record.author.viewer?.blockedBy) | ||
} else { | ||
acc.addBlockOther(true) | ||
} | ||
} | ||
@@ -52,0 +70,0 @@ |
@@ -103,2 +103,3 @@ import { | ||
| { type: 'blocked-by'; source: ModerationCauseSource; priority: 4 } | ||
| { type: 'block-other'; source: ModerationCauseSource; priority: 4 } | ||
| { | ||
@@ -105,0 +106,0 @@ type: 'label' |
@@ -73,9 +73,3 @@ import { | ||
export function isQuotedPost(embed: unknown): embed is AppBskyEmbedRecord.View { | ||
return Boolean( | ||
embed && | ||
AppBskyEmbedRecord.isView(embed) && | ||
AppBskyEmbedRecord.isViewRecord(embed.record) && | ||
AppBskyFeedPost.isRecord(embed.record.value) && | ||
AppBskyFeedPost.validateRecord(embed.record.value).success, | ||
) | ||
return Boolean(embed && AppBskyEmbedRecord.isView(embed)) | ||
} | ||
@@ -86,9 +80,3 @@ | ||
): embed is AppBskyEmbedRecordWithMedia.View { | ||
return Boolean( | ||
embed && | ||
AppBskyEmbedRecordWithMedia.isView(embed) && | ||
AppBskyEmbedRecord.isViewRecord(embed.record.record) && | ||
AppBskyFeedPost.isRecord(embed.record.record.value) && | ||
AppBskyFeedPost.validateRecord(embed.record.record.value).success, | ||
) | ||
return Boolean(embed && AppBskyEmbedRecordWithMedia.isView(embed)) | ||
} | ||
@@ -95,0 +83,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4199693
63455