( config: GoogleDriveIntegrationConfig, tokenStore?: GoogleDriveTokenStore, )
| 490 | `${DRIVE_WARNING_OBJECT_PREFIX}/${folderPath}/${DRIVE_WARNING_FILE_NAME}`; |
| 491 | |
| 492 | export const getGoogleDriveUserEmail = ( |
| 493 | config: GoogleDriveIntegrationConfig, |
| 494 | tokenStore?: GoogleDriveTokenStore, |
| 495 | ) => |
| 496 | driveFetch( |
| 497 | config, |
| 498 | `${DRIVE_API_BASE}/about?fields=user(emailAddress)`, |
| 499 | undefined, |
| 500 | tokenStore, |
| 501 | ).pipe( |
| 502 | Effect.flatMap((response) => |
| 503 | Effect.tryPromise({ |
| 504 | try: async () => { |
| 505 | const body = (await parseDriveJson<{ |
| 506 | user?: { emailAddress?: string }; |
| 507 | }>(response)) as { user?: { emailAddress?: string } }; |
| 508 | return body.user?.emailAddress; |
| 509 | }, |
| 510 | catch: (cause) => new Storage.StorageError({ cause }), |
| 511 | }), |
| 512 | ), |
| 513 | ); |
| 514 | |
| 515 | export const getGoogleDriveStorageQuota = ( |
| 516 | config: GoogleDriveIntegrationConfig, |
no test coverage detected