Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/moderation-api-v2' into multi-pd…
Browse files Browse the repository at this point in the history
…s-auth-moderation-api-v2
  • Loading branch information
devinivy committed Nov 28, 2023
2 parents eeaf684 + 0697ffc commit 32a65a6
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lexicons/com/atproto/admin/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@
"type": "object",
"description": "Take down a subject permanently or temporarily",
"properties": {
"comment": {
"type": "string"
},
"durationInHours": {
"type": "integer",
"description": "Indicates how long the takedown should be in effect before automatically expiring."
Expand Down Expand Up @@ -499,6 +502,9 @@
"description": "Apply/Negate labels on a subject",
"required": ["createLabelVals", "negateLabelVals"],
"properties": {
"comment": {
"type": "string"
},
"createLabelVals": {
"type": "array",
"items": { "type": "string" }
Expand Down
6 changes: 6 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ export const schemaDict = {
type: 'object',
description: 'Take down a subject permanently or temporarily',
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description:
Expand Down Expand Up @@ -747,6 +750,9 @@ export const schemaDict = {
description: 'Apply/Negate labels on a subject',
required: ['createLabelVals', 'negateLabelVals'],
properties: {
comment: {
type: 'string',
},
createLabelVals: {
type: 'array',
items: {
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/client/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed'

/** Take down a subject permanently or temporarily */
export interface ModEventTakedown {
comment?: string
/** Indicates how long the takedown should be in effect before automatically expiring. */
durationInHours?: number
[k: string]: unknown
Expand Down Expand Up @@ -578,6 +579,7 @@ export function validateModEventReport(v: unknown): ValidationResult {

/** Apply/Negate labels on a subject */
export interface ModEventLabel {
comment?: string
createLabelVals: string[]
negateLabelVals: string[]
[k: string]: unknown
Expand Down
6 changes: 6 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ export const schemaDict = {
type: 'object',
description: 'Take down a subject permanently or temporarily',
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description:
Expand Down Expand Up @@ -747,6 +750,9 @@ export const schemaDict = {
description: 'Apply/Negate labels on a subject',
required: ['createLabelVals', 'negateLabelVals'],
properties: {
comment: {
type: 'string',
},
createLabelVals: {
type: 'array',
items: {
Expand Down
2 changes: 2 additions & 0 deletions packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed'

/** Take down a subject permanently or temporarily */
export interface ModEventTakedown {
comment?: string
/** Indicates how long the takedown should be in effect before automatically expiring. */
durationInHours?: number
[k: string]: unknown
Expand Down Expand Up @@ -578,6 +579,7 @@ export function validateModEventReport(v: unknown): ValidationResult {

/** Apply/Negate labels on a subject */
export interface ModEventLabel {
comment?: string
createLabelVals: string[]
negateLabelVals: string[]
[k: string]: unknown
Expand Down
4 changes: 2 additions & 2 deletions packages/bsky/src/services/moderation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class ModerationService {
$type: isRevertingTakedown
? 'com.atproto.admin.defs#modEventReverseTakedown'
: 'com.atproto.admin.defs#modEventUnmute',
comment,
comment: comment ?? undefined,
},
createdAt,
createdBy,
Expand Down Expand Up @@ -513,7 +513,7 @@ export class ModerationService {
event: {
$type: 'com.atproto.admin.defs#modEventReport',
reportType: reasonType,
comment: reason || null,
comment: reason,
},
createdBy: reportedBy,
subject,
Expand Down
6 changes: 6 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ export const schemaDict = {
type: 'object',
description: 'Take down a subject permanently or temporarily',
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description:
Expand Down Expand Up @@ -747,6 +750,9 @@ export const schemaDict = {
description: 'Apply/Negate labels on a subject',
required: ['createLabelVals', 'negateLabelVals'],
properties: {
comment: {
type: 'string',
},
createLabelVals: {
type: 'array',
items: {
Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/lexicon/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export const REVIEWCLOSED = 'com.atproto.admin.defs#reviewClosed'

/** Take down a subject permanently or temporarily */
export interface ModEventTakedown {
comment?: string
/** Indicates how long the takedown should be in effect before automatically expiring. */
durationInHours?: number
[k: string]: unknown
Expand Down Expand Up @@ -578,6 +579,7 @@ export function validateModEventReport(v: unknown): ValidationResult {

/** Apply/Negate labels on a subject */
export interface ModEventLabel {
comment?: string
createLabelVals: string[]
negateLabelVals: string[]
[k: string]: unknown
Expand Down

0 comments on commit 32a65a6

Please sign in to comment.