Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Jan 3, 2024
2 parents 70536aa + 5560b7a commit a2f41ca
Show file tree
Hide file tree
Showing 39 changed files with 924 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-bsky-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- main
- timeline-limit-1-opt
- appeal-report
env:
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }}
Expand Down
22 changes: 21 additions & 1 deletion lexicons/com/atproto/admin/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"#modEventLabel",
"#modEventAcknowledge",
"#modEventEscalate",
"#modEventMute"
"#modEventMute",
"#modEventResolveAppeal"
]
},
"subject": {
Expand Down Expand Up @@ -167,9 +168,18 @@
"type": "string",
"format": "datetime"
},
"lastAppealedAt": {
"type": "string",
"format": "datetime",
"description": "Timestamp referencing when the author of the subject appealed a moderation action"
},
"takendown": {
"type": "boolean"
},
"appealed": {
"type": "boolean",
"description": "True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators."
},
"suspendUntil": {
"type": "string",
"format": "datetime"
Expand Down Expand Up @@ -470,6 +480,16 @@
}
}
},
"modEventResolveAppeal": {
"type": "object",
"description": "Resolve appeal on a subject",
"properties": {
"comment": {
"type": "string",
"description": "Describe resolution."
}
}
},
"modEventComment": {
"type": "object",
"description": "Add a comment to a subject",
Expand Down
4 changes: 4 additions & 0 deletions lexicons/com/atproto/admin/queryModerationStatuses.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
"type": "boolean",
"description": "Get subjects that were taken down"
},
"appealed": {
"type": "boolean",
"description": "Get subjects in unresolved appealed status"
},
"limit": {
"type": "integer",
"minimum": 1,
Expand Down
7 changes: 6 additions & 1 deletion lexicons/com/atproto/moderation/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"com.atproto.moderation.defs#reasonMisleading",
"com.atproto.moderation.defs#reasonSexual",
"com.atproto.moderation.defs#reasonRude",
"com.atproto.moderation.defs#reasonOther"
"com.atproto.moderation.defs#reasonOther",
"com.atproto.moderation.defs#reasonAppeal"
]
},
"reasonSpam": {
Expand All @@ -36,6 +37,10 @@
"reasonOther": {
"type": "token",
"description": "Other: reports not falling under another report category"
},
"reasonAppeal": {
"type": "token",
"description": "Appeal: appeal a previously taken moderation action"
}
}
}
1 change: 1 addition & 0 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export const COM_ATPROTO_MODERATION = {
DefsReasonSexual: 'com.atproto.moderation.defs#reasonSexual',
DefsReasonRude: 'com.atproto.moderation.defs#reasonRude',
DefsReasonOther: 'com.atproto.moderation.defs#reasonOther',
DefsReasonAppeal: 'com.atproto.moderation.defs#reasonAppeal',
}
export const APP_BSKY_GRAPH = {
DefsModlist: 'app.bsky.graph.defs#modlist',
Expand Down
31 changes: 31 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const schemaDict = {
'lex:com.atproto.admin.defs#modEventAcknowledge',
'lex:com.atproto.admin.defs#modEventEscalate',
'lex:com.atproto.admin.defs#modEventMute',
'lex:com.atproto.admin.defs#modEventResolveAppeal',
],
},
subject: {
Expand Down Expand Up @@ -237,9 +238,20 @@ export const schemaDict = {
type: 'string',
format: 'datetime',
},
lastAppealedAt: {
type: 'string',
format: 'datetime',
description:
'Timestamp referencing when the author of the subject appealed a moderation action',
},
takendown: {
type: 'boolean',
},
appealed: {
type: 'boolean',
description:
'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.',
},
suspendUntil: {
type: 'string',
format: 'datetime',
Expand Down Expand Up @@ -723,6 +735,16 @@ export const schemaDict = {
},
},
},
modEventResolveAppeal: {
type: 'object',
description: 'Resolve appeal on a subject',
properties: {
comment: {
type: 'string',
description: 'Describe resolution.',
},
},
},
modEventComment: {
type: 'object',
description: 'Add a comment to a subject',
Expand Down Expand Up @@ -1406,6 +1428,10 @@ export const schemaDict = {
type: 'boolean',
description: 'Get subjects that were taken down',
},
appealed: {
type: 'boolean',
description: 'Get subjects in unresolved appealed status',
},
limit: {
type: 'integer',
minimum: 1,
Expand Down Expand Up @@ -1991,6 +2017,7 @@ export const schemaDict = {
'com.atproto.moderation.defs#reasonSexual',
'com.atproto.moderation.defs#reasonRude',
'com.atproto.moderation.defs#reasonOther',
'com.atproto.moderation.defs#reasonAppeal',
],
},
reasonSpam: {
Expand Down Expand Up @@ -2018,6 +2045,10 @@ export const schemaDict = {
type: 'token',
description: 'Other: reports not falling under another report category',
},
reasonAppeal: {
type: 'token',
description: 'Appeal: appeal a previously taken moderation action',
},
},
},
ComAtprotoRepoApplyWrites: {
Expand Down
26 changes: 26 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 @@ -76,6 +76,7 @@ export interface ModEventViewDetail {
| ModEventAcknowledge
| ModEventEscalate
| ModEventMute
| ModEventResolveAppeal
| { $type: string; [k: string]: unknown }
subject:
| RepoView
Expand Down Expand Up @@ -147,7 +148,11 @@ export interface SubjectStatusView {
lastReviewedBy?: string
lastReviewedAt?: string
lastReportedAt?: string
/** Timestamp referencing when the author of the subject appealed a moderation action */
lastAppealedAt?: string
takendown?: boolean
/** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */
appealed?: boolean
suspendUntil?: string
[k: string]: unknown
}
Expand Down Expand Up @@ -539,6 +544,27 @@ export function validateModEventReverseTakedown(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v)
}

/** Resolve appeal on a subject */
export interface ModEventResolveAppeal {
/** Describe resolution. */
comment?: string
[k: string]: unknown
}

export function isModEventResolveAppeal(
v: unknown,
): v is ModEventResolveAppeal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#modEventResolveAppeal'
)
}

export function validateModEventResolveAppeal(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v)
}

/** Add a comment to a subject */
export interface ModEventComment {
comment: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface QueryParams {
sortDirection?: 'asc' | 'desc'
/** Get subjects that were taken down */
takendown?: boolean
/** Get subjects in unresolved appealed status */
appealed?: boolean
limit?: number
cursor?: string
}
Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/client/types/com/atproto/moderation/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type ReasonType =
| 'com.atproto.moderation.defs#reasonSexual'
| 'com.atproto.moderation.defs#reasonRude'
| 'com.atproto.moderation.defs#reasonOther'
| 'com.atproto.moderation.defs#reasonAppeal'
| (string & {})

/** Spam: frequent unwanted promotion, replies, mentions */
Expand All @@ -27,3 +28,5 @@ export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
/** Other: reports not falling under another report category */
export const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'
/** Appeal: appeal a previously taken moderation action */
export const REASONAPPEAL = 'com.atproto.moderation.defs#reasonAppeal'
1 change: 1 addition & 0 deletions packages/bsky/src/lexicon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const COM_ATPROTO_MODERATION = {
DefsReasonSexual: 'com.atproto.moderation.defs#reasonSexual',
DefsReasonRude: 'com.atproto.moderation.defs#reasonRude',
DefsReasonOther: 'com.atproto.moderation.defs#reasonOther',
DefsReasonAppeal: 'com.atproto.moderation.defs#reasonAppeal',
}
export const APP_BSKY_GRAPH = {
DefsModlist: 'app.bsky.graph.defs#modlist',
Expand Down
31 changes: 31 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const schemaDict = {
'lex:com.atproto.admin.defs#modEventAcknowledge',
'lex:com.atproto.admin.defs#modEventEscalate',
'lex:com.atproto.admin.defs#modEventMute',
'lex:com.atproto.admin.defs#modEventResolveAppeal',
],
},
subject: {
Expand Down Expand Up @@ -237,9 +238,20 @@ export const schemaDict = {
type: 'string',
format: 'datetime',
},
lastAppealedAt: {
type: 'string',
format: 'datetime',
description:
'Timestamp referencing when the author of the subject appealed a moderation action',
},
takendown: {
type: 'boolean',
},
appealed: {
type: 'boolean',
description:
'True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.',
},
suspendUntil: {
type: 'string',
format: 'datetime',
Expand Down Expand Up @@ -723,6 +735,16 @@ export const schemaDict = {
},
},
},
modEventResolveAppeal: {
type: 'object',
description: 'Resolve appeal on a subject',
properties: {
comment: {
type: 'string',
description: 'Describe resolution.',
},
},
},
modEventComment: {
type: 'object',
description: 'Add a comment to a subject',
Expand Down Expand Up @@ -1406,6 +1428,10 @@ export const schemaDict = {
type: 'boolean',
description: 'Get subjects that were taken down',
},
appealed: {
type: 'boolean',
description: 'Get subjects in unresolved appealed status',
},
limit: {
type: 'integer',
minimum: 1,
Expand Down Expand Up @@ -1991,6 +2017,7 @@ export const schemaDict = {
'com.atproto.moderation.defs#reasonSexual',
'com.atproto.moderation.defs#reasonRude',
'com.atproto.moderation.defs#reasonOther',
'com.atproto.moderation.defs#reasonAppeal',
],
},
reasonSpam: {
Expand Down Expand Up @@ -2018,6 +2045,10 @@ export const schemaDict = {
type: 'token',
description: 'Other: reports not falling under another report category',
},
reasonAppeal: {
type: 'token',
description: 'Appeal: appeal a previously taken moderation action',
},
},
},
ComAtprotoRepoApplyWrites: {
Expand Down
26 changes: 26 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 @@ -76,6 +76,7 @@ export interface ModEventViewDetail {
| ModEventAcknowledge
| ModEventEscalate
| ModEventMute
| ModEventResolveAppeal
| { $type: string; [k: string]: unknown }
subject:
| RepoView
Expand Down Expand Up @@ -147,7 +148,11 @@ export interface SubjectStatusView {
lastReviewedBy?: string
lastReviewedAt?: string
lastReportedAt?: string
/** Timestamp referencing when the author of the subject appealed a moderation action */
lastAppealedAt?: string
takendown?: boolean
/** True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. */
appealed?: boolean
suspendUntil?: string
[k: string]: unknown
}
Expand Down Expand Up @@ -539,6 +544,27 @@ export function validateModEventReverseTakedown(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#modEventReverseTakedown', v)
}

/** Resolve appeal on a subject */
export interface ModEventResolveAppeal {
/** Describe resolution. */
comment?: string
[k: string]: unknown
}

export function isModEventResolveAppeal(
v: unknown,
): v is ModEventResolveAppeal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#modEventResolveAppeal'
)
}

export function validateModEventResolveAppeal(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#modEventResolveAppeal', v)
}

/** Add a comment to a subject */
export interface ModEventComment {
comment: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export interface QueryParams {
sortDirection: 'asc' | 'desc'
/** Get subjects that were taken down */
takendown?: boolean
/** Get subjects in unresolved appealed status */
appealed?: boolean
limit: number
cursor?: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type ReasonType =
| 'com.atproto.moderation.defs#reasonSexual'
| 'com.atproto.moderation.defs#reasonRude'
| 'com.atproto.moderation.defs#reasonOther'
| 'com.atproto.moderation.defs#reasonAppeal'
| (string & {})

/** Spam: frequent unwanted promotion, replies, mentions */
Expand All @@ -27,3 +28,5 @@ export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
/** Other: reports not falling under another report category */
export const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'
/** Appeal: appeal a previously taken moderation action */
export const REASONAPPEAL = 'com.atproto.moderation.defs#reasonAppeal'
Loading

0 comments on commit a2f41ca

Please sign in to comment.