Skip to content

Commit

Permalink
🐛 Define durationInHours as optional for reporter mute for permanent …
Browse files Browse the repository at this point in the history
…mutes (bluesky-social#2988)

* 🐛 Define durationInHours as optional for reporter mute for permanent mutes

* 📝 Add changeset
  • Loading branch information
foysalit authored Nov 13, 2024
1 parent bac9be2 commit 48d08a4
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 26 deletions.
6 changes: 6 additions & 0 deletions .changeset/plenty-stingrays-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@atproto/ozone": patch
"@atproto/api": patch
---

Make durationInHours optional for mute reporter event
3 changes: 1 addition & 2 deletions lexicons/tools/ozone/moderation/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,11 @@
"modEventMuteReporter": {
"type": "object",
"description": "Mute incoming reports from an account",
"required": ["durationInHours"],
"properties": {
"comment": { "type": "string" },
"durationInHours": {
"type": "integer",
"description": "Indicates how long the account should remain muted."
"description": "Indicates how long the account should remain muted. Falsy value here means a permanent mute."
}
}
},
Expand Down
9 changes: 4 additions & 5 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11185,14 +11185,14 @@ export const schemaDict = {
modEventMuteReporter: {
type: 'object',
description: 'Mute incoming reports from an account',
required: ['durationInHours'],
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description: 'Indicates how long the account should remain muted.',
description:
'Indicates how long the account should remain muted. Falsy value here means a permanent mute.',
},
},
},
Expand Down Expand Up @@ -13327,9 +13327,8 @@ export const schemaDict = {
},
},
},
} as const satisfies Record<string, LexiconDoc>

export const schemas = Object.values(schemaDict)
}
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
export const lexicons: Lexicons = new Lexicons(schemas)
export const ids = {
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/client/types/tools/ozone/moderation/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
/** Mute incoming reports from an account */
export interface ModEventMuteReporter {
comment?: string
/** Indicates how long the account should remain muted. */
durationInHours: number
/** Indicates how long the account should remain muted. Falsy value here means a permanent mute. */
durationInHours?: number
[k: string]: unknown
}

Expand Down
5 changes: 2 additions & 3 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10566,9 +10566,8 @@ export const schemaDict = {
},
},
},
} as const satisfies Record<string, LexiconDoc>

export const schemas = Object.values(schemaDict)
}
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
export const lexicons: Lexicons = new Lexicons(schemas)
export const ids = {
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
Expand Down
9 changes: 4 additions & 5 deletions packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11185,14 +11185,14 @@ export const schemaDict = {
modEventMuteReporter: {
type: 'object',
description: 'Mute incoming reports from an account',
required: ['durationInHours'],
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description: 'Indicates how long the account should remain muted.',
description:
'Indicates how long the account should remain muted. Falsy value here means a permanent mute.',
},
},
},
Expand Down Expand Up @@ -13327,9 +13327,8 @@ export const schemaDict = {
},
},
},
} as const satisfies Record<string, LexiconDoc>

export const schemas = Object.values(schemaDict)
}
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
export const lexicons: Lexicons = new Lexicons(schemas)
export const ids = {
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
/** Mute incoming reports from an account */
export interface ModEventMuteReporter {
comment?: string
/** Indicates how long the account should remain muted. */
durationInHours: number
/** Indicates how long the account should remain muted. Falsy value here means a permanent mute. */
durationInHours?: number
[k: string]: unknown
}

Expand Down
9 changes: 4 additions & 5 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11185,14 +11185,14 @@ export const schemaDict = {
modEventMuteReporter: {
type: 'object',
description: 'Mute incoming reports from an account',
required: ['durationInHours'],
properties: {
comment: {
type: 'string',
},
durationInHours: {
type: 'integer',
description: 'Indicates how long the account should remain muted.',
description:
'Indicates how long the account should remain muted. Falsy value here means a permanent mute.',
},
},
},
Expand Down Expand Up @@ -13327,9 +13327,8 @@ export const schemaDict = {
},
},
},
} as const satisfies Record<string, LexiconDoc>

export const schemas = Object.values(schemaDict)
}
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
export const lexicons: Lexicons = new Lexicons(schemas)
export const ids = {
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
Expand Down
4 changes: 2 additions & 2 deletions packages/pds/src/lexicon/types/tools/ozone/moderation/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
/** Mute incoming reports from an account */
export interface ModEventMuteReporter {
comment?: string
/** Indicates how long the account should remain muted. */
durationInHours: number
/** Indicates how long the account should remain muted. Falsy value here means a permanent mute. */
durationInHours?: number
[k: string]: unknown
}

Expand Down

0 comments on commit 48d08a4

Please sign in to comment.