Skip to content

Commit

Permalink
Add displayed_notifications filter and donation_old category to JSON …
Browse files Browse the repository at this point in the history
…schema.
  • Loading branch information
Sancus committed Sep 19, 2024
1 parent 132a400 commit 37286d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions NotificationSchema.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class OperatingSystemEnum(str, Enum):
other = "other"

class Profile(BaseModel):
displayed_notifications: list[str] | None = None
locales: list[str] | None = None
versions: list[str] | None = None
channels: list[ChannelEnum] | None = None
Expand All @@ -38,6 +39,7 @@ class SeverityEnum(int, Enum):

class TypeEnum(str, Enum):
donation = "donation"
donation_old = "donation_old"
message = "message"
security = "security"
blog = "blog"
Expand Down
28 changes: 19 additions & 9 deletions schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://notifications.thunderbird.net/schemas/1.0/schema.json",
"title": "Thunderbird In-App Notifications",
"type": "array",
"items": {
Expand Down Expand Up @@ -42,7 +43,7 @@
"description": "Severity level, where 1 is the most important/urgent and 5 is the least."
},
"type": {
"enum": ["donation", "message", "security", "blog"],
"enum": ["donation", "donation_old", "message", "security", "blog"],
"description": "Category of notification."
},
"targeting": {
Expand Down Expand Up @@ -84,23 +85,25 @@
"profile": {
"type": "object",
"properties": {
"locales": {
"channels": {
"type": "array",
"items": {
"type": "string"
"enum": ["default", "esr", "release", "beta", "daily"],
"description": "The client release channel name."
}
},
"versions": {
"displayed_notifications": {
"type": "array",
"items": {
"type": "string"
"type": "string",
"description": "An id of an event previously displayed by the client."
}
},
"channels": {
"locales": {
"type": "array",
"items": {
"enum": ["default", "esr", "release", "beta", "daily"],
"description": "Channel"
"type": "string",
"description": "The selected UI language of the client."
}
},
"operating_systems": {
Expand All @@ -116,7 +119,14 @@
"solaris",
"other"
],
"description": "Operating System"
"description": "The operating system the client is running under."
}
},
"versions": {
"type": "array",
"items": {
"type": "string",
"description": "A client application version string."
}
}
}
Expand Down

0 comments on commit 37286d6

Please sign in to comment.