* Resolves the authenticated user's numeric ID via GET /2/users/me.
( accessToken: string, retryOptions?: Parameters<typeof fetchWithRetry>[2] )
| 163 | * Resolves the authenticated user's numeric ID via GET /2/users/me. |
| 164 | */ |
| 165 | async function resolveMyUserId( |
| 166 | accessToken: string, |
| 167 | retryOptions?: Parameters<typeof fetchWithRetry>[2] |
| 168 | ): Promise<string> { |
| 169 | const data = (await xApiGet('/users/me', accessToken, undefined, retryOptions)) as { |
| 170 | data?: { id?: string } |
| 171 | } |
| 172 | const id = data.data?.id |
| 173 | if (!id) throw new Error('Failed to resolve authenticated user ID') |
| 174 | return id |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Resolves a public username to its numeric user ID via |