DevPlace CI / test (push) Failing after 3h10m39s
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
89 lines
3.5 KiB
Python
89 lines
3.5 KiB
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from .._shared import endpoint, field
|
|
|
|
GROUP = {
|
|
"slug": "notifications",
|
|
"title": "Notifications",
|
|
"intro": """
|
|
# Notifications
|
|
|
|
Read your notification feed and mark items read. With grouping on (the default, a profile setting), similar events share one entry in `event_entries` and the unread counts count groups; with it off, entries stay one per event. Repeat external alerts are throttled to one per similar event group per 5 minutes unless the user turned throttling off; in-app rows are never throttled. The unread counts endpoint backs the badges in the navigation bar. Deliver these to the browser with [Web Push](/docs/push.html).
|
|
|
|
Every endpoint follows the shared [Conventions & Errors](/docs/conventions.html) (auth, content
|
|
negotiation, pagination, status codes); see [Authentication](/docs/authentication.html) for the
|
|
four ways to sign requests.
|
|
""",
|
|
"endpoints": [
|
|
endpoint(
|
|
id="notifications-list",
|
|
method="GET",
|
|
path="/notifications",
|
|
title="View notifications",
|
|
summary="Render your notifications. Returns an HTML page.",
|
|
auth="user",
|
|
interactive=True,
|
|
params=[
|
|
field("before", "query", "string", False, "", "Pagination cursor.")
|
|
],
|
|
),
|
|
endpoint(
|
|
id="notifications-counts",
|
|
method="GET",
|
|
path="/notifications/counts",
|
|
title="Unread counts",
|
|
summary="Unread notification and message counts.",
|
|
auth="public",
|
|
notes=[
|
|
'Guests receive `{ "notifications": 0, "messages": 0 }` instead of an error, so the navigation badge works before login.'
|
|
],
|
|
sample_response={"notifications": 2, "messages": 1},
|
|
),
|
|
endpoint(
|
|
id="notifications-open",
|
|
method="GET",
|
|
path="/notifications/open/{notification_uid}",
|
|
title="Open a notification",
|
|
summary="Mark a notification read and redirect to its target.",
|
|
auth="user",
|
|
interactive=False,
|
|
params=[
|
|
field(
|
|
"notification_uid",
|
|
"path",
|
|
"string",
|
|
True,
|
|
"NOTIFICATION_UID",
|
|
"UID of the notification.",
|
|
)
|
|
],
|
|
),
|
|
endpoint(
|
|
id="notifications-mark-read",
|
|
method="POST",
|
|
path="/notifications/mark-read/{notification_uid}",
|
|
title="Mark one read",
|
|
summary="Mark a single notification as read.",
|
|
auth="user",
|
|
params=[
|
|
field(
|
|
"notification_uid",
|
|
"path",
|
|
"string",
|
|
True,
|
|
"NOTIFICATION_UID",
|
|
"UID of the notification.",
|
|
)
|
|
],
|
|
),
|
|
endpoint(
|
|
id="notifications-mark-all-read",
|
|
method="POST",
|
|
path="/notifications/mark-all-read",
|
|
title="Mark all read",
|
|
summary="Mark every notification as read.",
|
|
auth="user",
|
|
),
|
|
],
|
|
}
|