( accessToken: string, fileId: string, logger: Logger )
| 269 | } |
| 270 | |
| 271 | async function getDriveFileModifiedTime( |
| 272 | accessToken: string, |
| 273 | fileId: string, |
| 274 | logger: Logger |
| 275 | ): Promise<string | undefined> { |
| 276 | try { |
| 277 | const response = await fetch( |
| 278 | `https://www.googleapis.com/drive/v3/files/${fileId}?fields=modifiedTime`, |
| 279 | { headers: { Authorization: `Bearer ${accessToken}` } } |
| 280 | ) |
| 281 | if (!response.ok) return undefined |
| 282 | const data = await response.json() |
| 283 | return data.modifiedTime as string | undefined |
| 284 | } catch { |
| 285 | return undefined |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * Fetches the sheet (A:Z) and returns the row count, auto-detected headers, |
no outgoing calls
no test coverage detected