diff libervia/backend/bridge/bridge_constructor/bridge_template.ini @ 4130:02f0adc745c6

core: notifications implementation, first draft: add a new table for notifications, and methods/bridge methods to manipulate them.
author Goffi <goffi@goffi.org>
date Mon, 16 Oct 2023 17:29:31 +0200
parents 4b842c1fb686
children a8a0fa678ce2
line wrap: on
line diff
--- a/libervia/backend/bridge/bridge_constructor/bridge_template.ini	Wed Oct 18 15:30:07 2023 +0200
+++ b/libervia/backend/bridge/bridge_constructor/bridge_template.ini	Mon Oct 16 17:29:31 2023 +0200
@@ -147,6 +147,31 @@
 doc_param_2=value: New value
 doc_param_3=%(doc_profile)s
 
+[notification_new]
+type=signal
+category=core
+sig_in=sdssssbidss
+doc=A new notification has been emitted
+doc_param_0=id: unique identifier of the notification
+doc_param_1=timestamp: notification creation time
+doc_param_2=type: type of the notification
+doc_param_3=body_plain: plain text body of the notification
+doc_param_4=body_rich: rich text (XHTML) body of the notification. Optional.
+doc_param_5=title: optional title of the notification
+doc_param_6=requires_action: True if the notification requires user action (e.g. a dialog needs to be answered), False otherwise
+doc_param_7=priority: how urgent the notification is, represented as an enumeration value
+doc_param_8=expire_at: expiration timestamp for the notification. Optional.
+doc_param_9=extra: additional serialized data associated with the notification
+doc_param_10=profile: profile associated with the notification. C.PROF_KEY_ALL can be used for global notifications.
+
+[notification_deleted]
+type=signal
+category=core
+sig_in=ss
+doc=A new notification has been emitted
+doc_param_0=id: id of the deleted notification
+doc_param_1=profile: profile of the deleted application, or C.PROF_KEY_ALL for a global notification
+
 [progress_started]
 type=signal
 category=core
@@ -1024,3 +1049,49 @@
 doc_param_4=profile_key: either profile_key or empty string to use common cache
     this parameter is used only when dest is empty
 doc_return=path to the new converted image
+
+[notification_add]
+type=method
+category=core
+sig_in=ssssbbsdss
+sig_out=
+doc=Add a new notification
+doc_param_0=type_: Notification type
+doc_param_1=body_plain: Plain text body of the notification
+doc_param_2=body_rich: Rich text body of the notification (optional, can be empty string for default)
+doc_param_3=title: Title of the notification (optional, can be empty string for default)
+doc_param_4=is_global: True if the notification is for all profiles
+doc_param_5=requires_action: Indicates if the notification requires action
+doc_param_7=priority: Priority level of the notification (e.g. MEDIUM, HIGH, etc.)
+doc_param_8=expire_at: Expiration timestamp for the notification (optional, can be 0 for none)
+doc_param_9=extra: Additional details for the notification as a dictionary (optional, can be empty dictionary)
+doc_param_10=%(doc_profile_key)s: Profile key (use "@ALL@" for all profiles)
+
+[notifications_get]
+type=method
+category=core
+sig_in=ss
+sig_out=s
+doc=Retrieve notifications based on provided filters
+doc_param_0=filters: a dictionary with filter criteria for notifications retrieval
+doc_param_1=%(doc_profile_key)s or @ALL@ for all profiles
+doc_return=list of Notification objects. The exact structure will depend on your Notification class.
+
+[notification_delete]
+type=method
+category=core
+sig_in=sbs
+sig_out=
+doc=Delete a notification
+doc_param_0=id_: ID of the notification to delete
+doc_param_1=is_global: true if the notification is a global one
+doc_param_2=profile_key: Profile key (use "@ALL@" for all profiles)
+
+[notifications_expired_clean]
+type=method
+category=core
+sig_in=ds
+sig_out=
+doc=Cleans expired notifications and older profile-specific notifications
+doc_param_0=limit_timestamp: Timestamp limit for older notifications. If -1.0, only truly expired notifications are removed.
+doc_param_1=profile_key: Profile key (use "@NONE@" to indicate no specific profile, otherwise only notification for given profile will be expired, in addition to truly expired notifications).