From 73f40e63abe3283efc0a27eef781c00b497caad1 Mon Sep 17 00:00:00 2001 From: Daniel Holmgren Date: Wed, 30 Oct 2024 18:30:41 -0500 Subject: [PATCH] Add threat signatures to ozone repo views (#2931) * add threat signatures to ozone repo views * explicitly add to views --- .changeset/wet-cars-doubt.md | 5 +++++ lexicons/tools/ozone/moderation/defs.json | 18 ++++++++++++++++-- packages/api/src/client/lexicons.ts | 14 ++++++++++++++ .../types/tools/ozone/moderation/defs.ts | 2 ++ packages/ozone/src/api/util.ts | 3 +++ packages/ozone/src/lexicon/lexicons.ts | 14 ++++++++++++++ .../types/tools/ozone/moderation/defs.ts | 2 ++ packages/pds/src/lexicon/lexicons.ts | 14 ++++++++++++++ .../types/tools/ozone/moderation/defs.ts | 2 ++ 9 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .changeset/wet-cars-doubt.md diff --git a/.changeset/wet-cars-doubt.md b/.changeset/wet-cars-doubt.md new file mode 100644 index 00000000000..91286c77421 --- /dev/null +++ b/.changeset/wet-cars-doubt.md @@ -0,0 +1,5 @@ +--- +"@atproto/api": patch +--- + +Add threatSignatures to ozone repo views diff --git a/lexicons/tools/ozone/moderation/defs.json b/lexicons/tools/ozone/moderation/defs.json index 9bfabb0a9f6..6e0bc400b33 100644 --- a/lexicons/tools/ozone/moderation/defs.json +++ b/lexicons/tools/ozone/moderation/defs.json @@ -412,7 +412,14 @@ }, "invitesDisabled": { "type": "boolean" }, "inviteNote": { "type": "string" }, - "deactivatedAt": { "type": "string", "format": "datetime" } + "deactivatedAt": { "type": "string", "format": "datetime" }, + "threatSignatures": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#threatSignature" + } + } } }, "repoViewDetail": { @@ -449,7 +456,14 @@ "invitesDisabled": { "type": "boolean" }, "inviteNote": { "type": "string" }, "emailConfirmedAt": { "type": "string", "format": "datetime" }, - "deactivatedAt": { "type": "string", "format": "datetime" } + "deactivatedAt": { "type": "string", "format": "datetime" }, + "threatSignatures": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#threatSignature" + } + } } }, "repoViewNotFound": { diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index daffef40c4c..9042d881745 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -11295,6 +11295,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewDetail: { @@ -11364,6 +11371,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewNotFound: { diff --git a/packages/api/src/client/types/tools/ozone/moderation/defs.ts b/packages/api/src/client/types/tools/ozone/moderation/defs.ts index 1e3d00a0cc7..461e46968d8 100644 --- a/packages/api/src/client/types/tools/ozone/moderation/defs.ts +++ b/packages/api/src/client/types/tools/ozone/moderation/defs.ts @@ -483,6 +483,7 @@ export interface RepoView { invitesDisabled?: boolean inviteNote?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown } @@ -512,6 +513,7 @@ export interface RepoViewDetail { inviteNote?: string emailConfirmedAt?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown } diff --git a/packages/ozone/src/api/util.ts b/packages/ozone/src/api/util.ts index 3be33a5d169..7d9c335c876 100644 --- a/packages/ozone/src/api/util.ts +++ b/packages/ozone/src/api/util.ts @@ -65,6 +65,7 @@ export const addAccountInfoToRepoViewDetail = ( invitedBy, invites, invitesDisabled, + threatSignatures, // pick some duplicate/unwanted details out did: _did, handle: _handle, @@ -82,6 +83,7 @@ export const addAccountInfoToRepoViewDetail = ( invites, emailConfirmedAt, deactivatedAt, + threatSignatures, } } @@ -98,6 +100,7 @@ export const addAccountInfoToRepoView = ( invitesDisabled: accountInfo.invitesDisabled, inviteNote: accountInfo.inviteNote, deactivatedAt: accountInfo.deactivatedAt, + threatSignatures: accountInfo.threatSignatures, } } diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index daffef40c4c..9042d881745 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -11295,6 +11295,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewDetail: { @@ -11364,6 +11371,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewNotFound: { diff --git a/packages/ozone/src/lexicon/types/tools/ozone/moderation/defs.ts b/packages/ozone/src/lexicon/types/tools/ozone/moderation/defs.ts index 6e95049aec1..03be0722f6b 100644 --- a/packages/ozone/src/lexicon/types/tools/ozone/moderation/defs.ts +++ b/packages/ozone/src/lexicon/types/tools/ozone/moderation/defs.ts @@ -483,6 +483,7 @@ export interface RepoView { invitesDisabled?: boolean inviteNote?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown } @@ -512,6 +513,7 @@ export interface RepoViewDetail { inviteNote?: string emailConfirmedAt?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown } diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index daffef40c4c..9042d881745 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -11295,6 +11295,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewDetail: { @@ -11364,6 +11371,13 @@ export const schemaDict = { type: 'string', format: 'datetime', }, + threatSignatures: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#threatSignature', + }, + }, }, }, repoViewNotFound: { diff --git a/packages/pds/src/lexicon/types/tools/ozone/moderation/defs.ts b/packages/pds/src/lexicon/types/tools/ozone/moderation/defs.ts index 6e95049aec1..03be0722f6b 100644 --- a/packages/pds/src/lexicon/types/tools/ozone/moderation/defs.ts +++ b/packages/pds/src/lexicon/types/tools/ozone/moderation/defs.ts @@ -483,6 +483,7 @@ export interface RepoView { invitesDisabled?: boolean inviteNote?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown } @@ -512,6 +513,7 @@ export interface RepoViewDetail { inviteNote?: string emailConfirmedAt?: string deactivatedAt?: string + threatSignatures?: ComAtprotoAdminDefs.ThreatSignature[] [k: string]: unknown }