//#region src/sync/gmail-push-watch.ts
async function registerGmailWatch(accessToken, topicName) {
	const res = await fetch("https://gmail.googleapis.com/gmail/v1/users/me/watch", {
		method: "POST",
		headers: {
			Authorization: `Bearer ${accessToken}`,
			"Content-Type": "application/json"
		},
		body: JSON.stringify({
			topicName,
			labelIds: ["INBOX"]
		})
	});
	if (!res.ok) throw new Error(`Gmail watch registration failed: ${res.status}`);
	return res.json();
}
//#endregion
export { registerGmailWatch };

//# sourceMappingURL=gmail-push-watch-DELQFMPk.js.map