MCPcopy
hub / github.com/gitify-app/gitify / listNotificationsForAuthenticatedUser

Function listNotificationsForAuthenticatedUser

src/renderer/utils/api/client.ts:56–89  ·  view source on GitHub ↗
(
  account: Account,
  settings: SettingsState,
)

Source from the content-addressed store, hash-verified

54 * Endpoint documentation: https://docs.github.com/en/rest/activity/notifications#list-notifications-for-the-authenticated-user
55 */
56export async function listNotificationsForAuthenticatedUser(
57 account: Account,
58 settings: SettingsState,
59): Promise<ListNotificationsForAuthenticatedUserResponse> {
60 const octokit = await createOctokitClient(account, 'rest');
61
62 if (settings.fetchAllNotifications) {
63 // Fetch all pages using Octokit's pagination
64 return await octokit.paginate(
65 octokit.rest.activity.listNotificationsForAuthenticatedUser,
66 {
67 participating: settings.participating,
68 all: settings.fetchReadNotifications,
69 per_page: 100,
70 headers: {
71 'Cache-Control': 'no-cache', // Prevent caching
72 },
73 },
74 );
75 }
76
77 // Single page request
78 const response =
79 await octokit.rest.activity.listNotificationsForAuthenticatedUser({
80 participating: settings.participating,
81 all: settings.fetchReadNotifications,
82 per_page: 100,
83 headers: {
84 'Cache-Control': 'no-cache', // Prevent caching
85 },
86 });
87
88 return response.data;
89}
90
91/**
92 * Marks a thread as "read." Marking a thread as "read" is equivalent to

Callers 2

getNotificationsFunction · 0.90
client.test.tsFile · 0.90

Calls 1

createOctokitClientFunction · 0.90

Tested by

no test coverage detected