@@ -71,6 +71,7 @@ export function listNotificationsForAuthenticatedUser(
7171 const url = getGitHubAPIBaseUrl ( account . hostname ) ;
7272 url . pathname += 'notifications' ;
7373 url . searchParams . append ( 'participating' , String ( settings . participating ) ) ;
74+
7475 return apiRequestAuth (
7576 url . toString ( ) as Link ,
7677 'GET' ,
@@ -87,14 +88,13 @@ export function listNotificationsForAuthenticatedUser(
8788 * Endpoint documentation: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-read
8889 */
8990export function markNotificationThreadAsRead (
91+ account : Account ,
9092 threadId : string ,
91- hostname : Hostname ,
92- token : Token ,
9393) : AxiosPromise < void > {
94- const url = getGitHubAPIBaseUrl ( hostname ) ;
94+ const url = getGitHubAPIBaseUrl ( account . hostname ) ;
9595 url . pathname += `notifications/threads/${ threadId } ` ;
9696
97- return apiRequestAuth ( url . toString ( ) as Link , 'PATCH' , token , { } ) ;
97+ return apiRequestAuth ( url . toString ( ) as Link , 'PATCH' , account . token , { } ) ;
9898}
9999
100100/**
@@ -106,13 +106,13 @@ export function markNotificationThreadAsRead(
106106 * Endpoint documentation: https://docs.github.com/en/rest/activity/notifications#mark-a-thread-as-done
107107 */
108108export function markNotificationThreadAsDone (
109+ account : Account ,
109110 threadId : string ,
110- hostname : Hostname ,
111- token : Token ,
112111) : AxiosPromise < void > {
113- const url = getGitHubAPIBaseUrl ( hostname ) ;
112+ const url = getGitHubAPIBaseUrl ( account . hostname ) ;
114113 url . pathname += `notifications/threads/${ threadId } ` ;
115- return apiRequestAuth ( url . toString ( ) as Link , 'DELETE' , token , { } ) ;
114+
115+ return apiRequestAuth ( url . toString ( ) as Link , 'DELETE' , account . token , { } ) ;
116116}
117117
118118/**
@@ -121,14 +121,13 @@ export function markNotificationThreadAsDone(
121121 * Endpoint documentation: https://docs.github.com/en/rest/activity/notifications#delete-a-thread-subscription
122122 */
123123export function ignoreNotificationThreadSubscription (
124+ account : Account ,
124125 threadId : string ,
125- hostname : Hostname ,
126- token : Token ,
127126) : AxiosPromise < NotificationThreadSubscription > {
128- const url = getGitHubAPIBaseUrl ( hostname ) ;
127+ const url = getGitHubAPIBaseUrl ( account . hostname ) ;
129128 url . pathname += `notifications/threads/${ threadId } /subscription` ;
130129
131- return apiRequestAuth ( url . toString ( ) as Link , 'PUT' , token , {
130+ return apiRequestAuth ( url . toString ( ) as Link , 'PUT' , account . token , {
132131 ignored : true ,
133132 } ) ;
134133}
@@ -138,8 +137,8 @@ export function ignoreNotificationThreadSubscription(
138137 *
139138 * Endpoint documentation: https://docs.github.com/en/rest/commits/commits#get-a-commit
140139 */
141- export function getCommit ( url : Link , token : Token ) : AxiosPromise < Commit > {
142- return apiRequestAuth ( url , 'GET' , token ) ;
140+ export function getCommit ( account : Account , url : Link ) : AxiosPromise < Commit > {
141+ return apiRequestAuth ( url , 'GET' , account . token ) ;
143142}
144143
145144/**
@@ -149,19 +148,19 @@ export function getCommit(url: Link, token: Token): AxiosPromise<Commit> {
149148
150149 */
151150export function getCommitComment (
151+ account : Account ,
152152 url : Link ,
153- token : Token ,
154153) : AxiosPromise < CommitComment > {
155- return apiRequestAuth ( url , 'GET' , token ) ;
154+ return apiRequestAuth ( url , 'GET' , account . token ) ;
156155}
157156
158157/**
159158 * Get details of an issue.
160159 *
161160 * Endpoint documentation: https://docs.github.com/en/rest/issues/issues#get-an-issue
162161 */
163- export function getIssue ( url : Link , token : Token ) : AxiosPromise < Issue > {
164- return apiRequestAuth ( url , 'GET' , token ) ;
162+ export function getIssue ( account : Account , url : Link ) : AxiosPromise < Issue > {
163+ return apiRequestAuth ( url , 'GET' , account . token ) ;
165164}
166165
167166/**
@@ -171,10 +170,10 @@ export function getIssue(url: Link, token: Token): AxiosPromise<Issue> {
171170 * Endpoint documentation: https://docs.github.com/en/rest/issues/comments#get-an-issue-comment
172171 */
173172export function getIssueOrPullRequestComment (
173+ account : Account ,
174174 url : Link ,
175- token : Token ,
176175) : AxiosPromise < IssueOrPullRequestComment > {
177- return apiRequestAuth ( url , 'GET' , token ) ;
176+ return apiRequestAuth ( url , 'GET' , account . token ) ;
178177}
179178
180179/**
@@ -183,10 +182,10 @@ export function getIssueOrPullRequestComment(
183182 * Endpoint documentation: https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request
184183 */
185184export function getPullRequest (
185+ account : Account ,
186186 url : Link ,
187- token : Token ,
188187) : AxiosPromise < PullRequest > {
189- return apiRequestAuth ( url , 'GET' , token ) ;
188+ return apiRequestAuth ( url , 'GET' , account . token ) ;
190189}
191190
192191/**
@@ -195,27 +194,27 @@ export function getPullRequest(
195194 * Endpoint documentation: https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request
196195 */
197196export function getPullRequestReviews (
197+ account : Account ,
198198 url : Link ,
199- token : Token ,
200199) : AxiosPromise < PullRequestReview [ ] > {
201- return apiRequestAuth ( url , 'GET' , token ) ;
200+ return apiRequestAuth ( url , 'GET' , account . token ) ;
202201}
203202
204203/**
205204 * Gets a public release with the specified release ID.
206205 *
207206 * Endpoint documentation: https://docs.github.com/en/rest/releases/releases#get-a-release
208207 */
209- export function getRelease ( url : Link , token : Token ) : AxiosPromise < Release > {
210- return apiRequestAuth ( url , 'GET' , token ) ;
208+ export function getRelease ( account : Account , url : Link ) : AxiosPromise < Release > {
209+ return apiRequestAuth ( url , 'GET' , account . token ) ;
211210}
212211
213212/**
214213 * Get the `html_url` from the GitHub response
215214 */
216- export async function getHtmlUrl ( url : Link , token : Token ) : Promise < string > {
215+ export async function getHtmlUrl ( account : Account , url : Link ) : Promise < string > {
217216 try {
218- const response = ( await apiRequestAuth ( url , 'GET' , token ) ) . data ;
217+ const response = ( await apiRequestAuth ( url , 'GET' , account . token ) ) . data ;
219218 return response . html_url ;
220219 } catch ( err ) {
221220 rendererLogError (
0 commit comments