Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Contracts: watch work items, and subscribe to one by its id

WATCH_EVENTS names work_items in place of issues, and SubscriptionArgs (with the TypeScript SubscriptionTarget) takes a work item's id.

G1T-Session:
ses_01m566c3bte71t8fa4g03g1c8v
syntaqxcommitted Parente0d904bBrowse files
2 files+14−80/2 viewed
+5−2
459459 pub updated_at: Option<String>,
460460 }
461461
462−/// Which work item or pull request: by a thread's id, or by its repository and
462+/// Which work item or pull request: by a thread's id, by a work item's id
463+/// (with its number, to say back), or by a pull request's repository and
463464 /// number.
464465 #[derive(Clone, Debug, Default, Serialize, Deserialize)]
465466 #[serde(rename_all = "camelCase")]
468469 #[serde(default)]
469470 pub id: Option<String>,
470471 #[serde(default)]
472+ pub item_id: Option<String>,
473+ #[serde(default)]
471474 pub repo_id: Option<String>,
472475 #[serde(default)]
473476 pub number: Option<u32>,
522525 }
523526
524527 /// The kinds of activity a custom watch can follow.
525−pub const WATCH_EVENTS: [&str; 4] = ["issues", "pulls", "deployments", "security"];
528+pub const WATCH_EVENTS: [&str; 4] = ["work_items", "pulls", "deployments", "security"];
526529
527530 /// How a person watches one repository.
528531 #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
+9−6
106106 createdAt: string;
107107 };
108108
109−/** A person's subscription to an issue or pull request. */
109+/** A person's subscription to a work item or pull request. */
110110 export type ThreadSubscription = {
111111 /** Whether they hear of what happens on it. */
112112 subscribed: boolean;
132132 export const WATCH_LEVELS: WatchLevel[] = ["participating", "all", "ignore", "custom"];
133133
134134 /** 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";
136136
137−export const WATCH_EVENTS: WatchEvent[] = ["issues", "pulls", "deployments", "security"];
137+export const WATCH_EVENTS: WatchEvent[] = ["work_items", "pulls", "deployments", "security"];
138138
139139 export type Watching = {
140140 repoId: string;
213213 until?: string | null;
214214 };
215215
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 };
218221
219222 export interface InboxApi {
220223 /**
227230 mark(username: string, args: InboxMarkArgs): Promise<number>;
228231 /** One of the viewer's threads with its history, or null. */
229232 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. */
231234 subscription(viewer: User, target: SubscriptionTarget): Promise<ThreadSubscription | null>;
232235 /**
233236 * Subscribes (`true`), unsubscribes (`false`), ignores, or goes back to

Comments

Sign in to comment.