diff --git a/api/tangled/notificationdeleteNotification.go b/api/tangled/notificationdeleteNotification.go index 895994f8..ebf10bf8 100644 --- a/api/tangled/notificationdeleteNotification.go +++ b/api/tangled/notificationdeleteNotification.go @@ -16,8 +16,8 @@ const ( // TempNotificationDeleteNotification_Input is the input argument to a org.tangled.temp.notification.deleteNotification call. type TempNotificationDeleteNotification_Input struct { - // id: ID of the notification to delete. - Id int64 `json:"id" cborgen:"id"` + // uri: at-uri of the notification to delete. + Uri string `json:"uri" cborgen:"uri"` } // TempNotificationDeleteNotification calls the XRPC method "org.tangled.temp.notification.deleteNotification". diff --git a/api/tangled/notificationlistNotifications.go b/api/tangled/notificationlistNotifications.go index dc0ccc7d..0345dbe8 100644 --- a/api/tangled/notificationlistNotifications.go +++ b/api/tangled/notificationlistNotifications.go @@ -21,8 +21,6 @@ type TempNotificationListNotifications_Notification struct { // category: Broad category: 'social' or 'work'. Category string `json:"category" cborgen:"category"` CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // id: Stable numeric ID for this notification. - Id int64 `json:"id" cborgen:"id"` // issueAt: AT-URI of the related org.tangled.issue.issue record, if applicable. IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` // pullAt: AT-URI of the related org.tangled.pulls.pull record, if applicable. @@ -32,6 +30,8 @@ type TempNotificationListNotifications_Notification struct { RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` // type: Notification type: repo_starred, issue_created, issue_commented, issue_closed, issue_reopen, issue_assigned, issue_unassigned, pull_created, pull_commented, pull_merged, pull_closed, pull_reopen, pull_assigned, pull_unassigned, followed, user_mentioned. Type string `json:"type" cborgen:"type"` + // uri: at-uri of this notification; the stable key for read/unread state. + Uri string `json:"uri" cborgen:"uri"` } // TempNotificationListNotifications_Output is the output of a org.tangled.temp.notification.listNotifications call. diff --git a/api/tangled/notificationlistRecipients.go b/api/tangled/notificationlistRecipients.go new file mode 100644 index 00000000..103600a7 --- /dev/null +++ b/api/tangled/notificationlistRecipients.go @@ -0,0 +1,35 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.notification.listRecipients + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationListRecipientsNSID = "org.tangled.temp.notification.listRecipients" +) + +// TempNotificationListRecipients_Output is the output of a org.tangled.temp.notification.listRecipients call. +type TempNotificationListRecipients_Output struct { + Dids []string `json:"dids" cborgen:"dids"` +} + +// TempNotificationListRecipients calls the XRPC method "org.tangled.temp.notification.listRecipients". +// +// subject: at-uri of the entity (for entity-level subscribers) or a repo DID (for repo-level subscribers). +func TempNotificationListRecipients(ctx context.Context, c util.LexClient, subject string) (*TempNotificationListRecipients_Output, error) { + var out TempNotificationListRecipients_Output + + params := map[string]interface{}{} + params["subject"] = subject + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.listRecipients", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/notificationupdateSeen.go b/api/tangled/notificationupdateSeen.go index e263e44a..9e24c128 100644 --- a/api/tangled/notificationupdateSeen.go +++ b/api/tangled/notificationupdateSeen.go @@ -16,9 +16,9 @@ const ( // TempNotificationUpdateSeen_Input is the input argument to a org.tangled.temp.notification.updateSeen call. type TempNotificationUpdateSeen_Input struct { - // id: ID of the notification to update. - Id int64 `json:"id" cborgen:"id"` - Read bool `json:"read" cborgen:"read"` + Read bool `json:"read" cborgen:"read"` + // uri: at-uri of the notification to update. + Uri string `json:"uri" cborgen:"uri"` } // TempNotificationUpdateSeen calls the XRPC method "org.tangled.temp.notification.updateSeen". diff --git a/lexicons/temp/notification/deleteNotification.json b/lexicons/temp/notification/deleteNotification.json index e800350e..d41fce86 100644 --- a/lexicons/temp/notification/deleteNotification.json +++ b/lexicons/temp/notification/deleteNotification.json @@ -9,11 +9,12 @@ "encoding": "application/json", "schema": { "type": "object", - "required": ["id"], + "required": ["uri"], "properties": { - "id": { - "type": "integer", - "description": "ID of the notification to delete." + "uri": { + "type": "string", + "format": "at-uri", + "description": "at-uri of the notification to delete." } } } diff --git a/lexicons/temp/notification/listNotifications.json b/lexicons/temp/notification/listNotifications.json index 1554f9cc..06d319c9 100644 --- a/lexicons/temp/notification/listNotifications.json +++ b/lexicons/temp/notification/listNotifications.json @@ -55,11 +55,12 @@ }, "notification": { "type": "object", - "required": ["id", "type", "category", "actorDid", "read", "createdAt"], + "required": ["uri", "type", "category", "actorDid", "read", "createdAt"], "properties": { - "id": { - "type": "integer", - "description": "Stable numeric ID for this notification." + "uri": { + "type": "string", + "format": "at-uri", + "description": "at-uri of this notification; the stable key for read/unread state." }, "type": { "type": "string", diff --git a/lexicons/temp/notification/listRecipients.json b/lexicons/temp/notification/listRecipients.json new file mode 100644 index 00000000..ce6a897f --- /dev/null +++ b/lexicons/temp/notification/listRecipients.json @@ -0,0 +1,33 @@ +{ + "lexicon": 1, + "id": "org.tangled.temp.notification.listRecipients", + "defs": { + "main": { + "type": "query", + "description": "Service-internal. Hosted by bobbin. Given an entity at-uri or repo DID, returns the dids subscribed to it. deliberi calls this while ingesting the firehose to fan a notification out to subscribers.", + "parameters": { + "type": "params", + "required": ["subject"], + "properties": { + "subject": { + "type": "string", + "description": "at-uri of the entity (for entity-level subscribers) or a repo DID (for repo-level subscribers)." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["dids"], + "properties": { + "dids": { + "type": "array", + "items": { "type": "string", "format": "did" } + } + } + } + } + } + } +} diff --git a/lexicons/temp/notification/updateSeen.json b/lexicons/temp/notification/updateSeen.json index fda7e686..a72e51ce 100644 --- a/lexicons/temp/notification/updateSeen.json +++ b/lexicons/temp/notification/updateSeen.json @@ -9,11 +9,12 @@ "encoding": "application/json", "schema": { "type": "object", - "required": ["id", "read"], + "required": ["uri", "read"], "properties": { - "id": { - "type": "integer", - "description": "ID of the notification to update." + "uri": { + "type": "string", + "format": "at-uri", + "description": "at-uri of the notification to update." }, "read": { "type": "boolean"