| 106 | 106 | | createdAt: string; |
| 107 | 107 | | }; |
| 108 | 108 | | |
| 109 | | − | /** A person's subscription to an issue or pull request. */ |
| 109 | + | /** A person's subscription to a work item or pull request. */ |
| 110 | 110 | | export type ThreadSubscription = { |
| 111 | 111 | | /** Whether they hear of what happens on it. */ |
| 112 | 112 | | subscribed: boolean; |
| ⋯ |
| 132 | 132 | | export const WATCH_LEVELS: WatchLevel[] = ["participating", "all", "ignore", "custom"]; |
| 133 | 133 | | |
| 134 | 134 | | /** The kinds of activity a custom watch can follow. */ |
| 135 | | − | export type WatchEvent = "issues" | "pulls" | "deployments" | "security"; |
| 135 | + | export type WatchEvent = "work_items" | "pulls" | "deployments" | "security"; |
| 136 | 136 | | |
| 137 | | − | export const WATCH_EVENTS: WatchEvent[] = ["issues", "pulls", "deployments", "security"]; |
| 137 | + | export const WATCH_EVENTS: WatchEvent[] = ["work_items", "pulls", "deployments", "security"]; |
| 138 | 138 | | |
| 139 | 139 | | export type Watching = { |
| 140 | 140 | | repoId: string; |
| ⋯ |
| 213 | 213 | | until?: string | null; |
| 214 | 214 | | }; |
| 215 | 215 | | |
| 216 | | − | /** Which issue or pull request: a thread's id, or a repository and number. */ |
| 217 | | − | export type SubscriptionTarget = { id: string } | { repoId: string; number: number }; |
| 216 | + | /** |
| 217 | + | * Which work item or pull request: a thread's id, a work item's id (with its |
| 218 | + | * number, to say back), or a pull request's repository and number. |
| 219 | + | */ |
| 220 | + | export type SubscriptionTarget = { id: string } | { itemId: string; number: number } | { repoId: string; number: number }; |
| 218 | 221 | | |
| 219 | 222 | | export interface InboxApi { |
| 220 | 223 | | /** |
| ⋯ |
| 227 | 230 | | mark(username: string, args: InboxMarkArgs): Promise<number>; |
| 228 | 231 | | /** One of the viewer's threads with its history, or null. */ |
| 229 | 232 | | thread(viewer: User, id: string): Promise<InboxThread | null>; |
| 230 | | − | /** The viewer's subscription to an issue or pull request; null when there is none to have. */ |
| 233 | + | /** The viewer's subscription to a work item or pull request; null when there is none to have. */ |
| 231 | 234 | | subscription(viewer: User, target: SubscriptionTarget): Promise<ThreadSubscription | null>; |
| 232 | 235 | | /** |
| 233 | 236 | | * Subscribes (`true`), unsubscribes (`false`), ignores, or goes back to |