From 207728d2b3b819af297ecb90e6373eb7721cbe34 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 11 Dec 2024 19:46:14 +0000 Subject: [PATCH] Add reasons param to listNotifications (#3222) * Add filter param to listNotifications * Codegen * Changeset * update schemas * tweak schema * filter -> reasons --------- Co-authored-by: dholms --- .changeset/stupid-feet-allow.md | 8 ++++++++ lexicons/app/bsky/notification/listNotifications.json | 8 ++++++++ packages/api/src/client/lexicons.ts | 9 +++++++++ .../types/app/bsky/notification/listNotifications.ts | 2 ++ packages/bsky/src/lexicon/lexicons.ts | 9 +++++++++ .../types/app/bsky/notification/listNotifications.ts | 2 ++ packages/ozone/src/lexicon/lexicons.ts | 9 +++++++++ .../types/app/bsky/notification/listNotifications.ts | 2 ++ packages/pds/src/lexicon/lexicons.ts | 9 +++++++++ .../types/app/bsky/notification/listNotifications.ts | 2 ++ 10 files changed, 60 insertions(+) create mode 100644 .changeset/stupid-feet-allow.md diff --git a/.changeset/stupid-feet-allow.md b/.changeset/stupid-feet-allow.md new file mode 100644 index 00000000000..1aef729861a --- /dev/null +++ b/.changeset/stupid-feet-allow.md @@ -0,0 +1,8 @@ +--- +"@atproto/ozone": patch +"@atproto/bsky": patch +"@atproto/api": patch +"@atproto/pds": patch +--- + +Add optional reasons param to listNotifications diff --git a/lexicons/app/bsky/notification/listNotifications.json b/lexicons/app/bsky/notification/listNotifications.json index c85a516723d..7ae3cf9c324 100644 --- a/lexicons/app/bsky/notification/listNotifications.json +++ b/lexicons/app/bsky/notification/listNotifications.json @@ -8,6 +8,14 @@ "parameters": { "type": "params", "properties": { + "reasons": { + "description": "Notification reasons to include in response.", + "type": "array", + "items": { + "type": "string", + "description": "A reason that matches the reason property of #notification." + } + }, "limit": { "type": "integer", "minimum": 1, diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 954fc444c0e..1e616f1b284 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -8944,6 +8944,15 @@ export const schemaDict = { parameters: { type: 'params', properties: { + reasons: { + description: 'Notification reasons to include in response.', + type: 'array', + items: { + type: 'string', + description: + 'A reason that matches the reason property of #notification.', + }, + }, limit: { type: 'integer', minimum: 1, diff --git a/packages/api/src/client/types/app/bsky/notification/listNotifications.ts b/packages/api/src/client/types/app/bsky/notification/listNotifications.ts index 10a5b7148f2..92b3a27fece 100644 --- a/packages/api/src/client/types/app/bsky/notification/listNotifications.ts +++ b/packages/api/src/client/types/app/bsky/notification/listNotifications.ts @@ -10,6 +10,8 @@ import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface QueryParams { + /** Notification reasons to include in response. */ + reasons?: string[] limit?: number priority?: boolean cursor?: string diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 4a2fad8d587..140e617917b 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -8944,6 +8944,15 @@ export const schemaDict = { parameters: { type: 'params', properties: { + reasons: { + description: 'Notification reasons to include in response.', + type: 'array', + items: { + type: 'string', + description: + 'A reason that matches the reason property of #notification.', + }, + }, limit: { type: 'integer', minimum: 1, diff --git a/packages/bsky/src/lexicon/types/app/bsky/notification/listNotifications.ts b/packages/bsky/src/lexicon/types/app/bsky/notification/listNotifications.ts index 70adc412701..88fe90a0518 100644 --- a/packages/bsky/src/lexicon/types/app/bsky/notification/listNotifications.ts +++ b/packages/bsky/src/lexicon/types/app/bsky/notification/listNotifications.ts @@ -11,6 +11,8 @@ import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface QueryParams { + /** Notification reasons to include in response. */ + reasons?: string[] limit: number priority?: boolean cursor?: string diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index 954fc444c0e..1e616f1b284 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -8944,6 +8944,15 @@ export const schemaDict = { parameters: { type: 'params', properties: { + reasons: { + description: 'Notification reasons to include in response.', + type: 'array', + items: { + type: 'string', + description: + 'A reason that matches the reason property of #notification.', + }, + }, limit: { type: 'integer', minimum: 1, diff --git a/packages/ozone/src/lexicon/types/app/bsky/notification/listNotifications.ts b/packages/ozone/src/lexicon/types/app/bsky/notification/listNotifications.ts index 70adc412701..88fe90a0518 100644 --- a/packages/ozone/src/lexicon/types/app/bsky/notification/listNotifications.ts +++ b/packages/ozone/src/lexicon/types/app/bsky/notification/listNotifications.ts @@ -11,6 +11,8 @@ import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface QueryParams { + /** Notification reasons to include in response. */ + reasons?: string[] limit: number priority?: boolean cursor?: string diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 954fc444c0e..1e616f1b284 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -8944,6 +8944,15 @@ export const schemaDict = { parameters: { type: 'params', properties: { + reasons: { + description: 'Notification reasons to include in response.', + type: 'array', + items: { + type: 'string', + description: + 'A reason that matches the reason property of #notification.', + }, + }, limit: { type: 'integer', minimum: 1, diff --git a/packages/pds/src/lexicon/types/app/bsky/notification/listNotifications.ts b/packages/pds/src/lexicon/types/app/bsky/notification/listNotifications.ts index 70adc412701..88fe90a0518 100644 --- a/packages/pds/src/lexicon/types/app/bsky/notification/listNotifications.ts +++ b/packages/pds/src/lexicon/types/app/bsky/notification/listNotifications.ts @@ -11,6 +11,8 @@ import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface QueryParams { + /** Notification reasons to include in response. */ + reasons?: string[] limit: number priority?: boolean cursor?: string