Attach run artifacts to app notifications
This commit is contained in:
@@ -56,6 +56,7 @@ type NotificationPolicy struct {
|
||||
On []string `json:"on"`
|
||||
Destination string `json:"destination"`
|
||||
Artifacts []string `json:"artifacts,omitempty"`
|
||||
Open string `json:"open,omitempty"`
|
||||
}
|
||||
|
||||
// Public phone setup only. Never include publishing endpoints or credentials.
|
||||
|
||||
@@ -72,17 +72,29 @@ type AppNotification struct {
|
||||
Kind string `json:"kind"`
|
||||
Title string `json:"title"`
|
||||
Message string `json:"message"`
|
||||
// Click is the same deep link ntfy gets (pipelines://run/<id>,
|
||||
// pipelines://chat/<id>).
|
||||
Click string `json:"click"`
|
||||
Priority int `json:"priority"`
|
||||
Tags []string `json:"tags"`
|
||||
// Click is the app tap target (normally the same run deep link ntfy gets).
|
||||
Click string `json:"click"`
|
||||
RunClick string `json:"run_click,omitempty"`
|
||||
Artifact *NotificationArtifact `json:"artifact,omitempty"`
|
||||
Preview string `json:"preview,omitempty"`
|
||||
Priority int `json:"priority"`
|
||||
Tags []string `json:"tags"`
|
||||
// CreatedAt is RFC3339 (UTC).
|
||||
CreatedAt string `json:"created_at"`
|
||||
// Group is "run:<id>" or "chat:<id>" for Android notification grouping.
|
||||
Group string `json:"group"`
|
||||
}
|
||||
|
||||
// NotificationArtifact is the run artifact opened by an app notification.
|
||||
type NotificationArtifact struct {
|
||||
RunID int64 `json:"run_id"`
|
||||
Sequence int `json:"sequence"`
|
||||
Path string `json:"path"`
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
MediaType string `json:"media_type"`
|
||||
}
|
||||
|
||||
// ValidateClearNotifications checks a clear_notifications id list.
|
||||
func ValidateClearNotifications(ids []string) ([]string, error) {
|
||||
if len(ids) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user