1 | |
2 |
|
3 | type Gdrive = { |
4 | token: string; |
5 | }; |
6 | export async function main( |
7 | gdrive_auth: Gdrive, |
8 | driveId: string, |
9 | useDomainAdminAccess: boolean = false, |
10 | ) { |
11 | const GET_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/${driveId}/?useDomainAdminAccess=${useDomainAdminAccess}`; |
12 |
|
13 | const token = gdrive_auth["token"]; |
14 |
|
15 | const response = await fetch(GET_SHARED_DRIVE_URL, { |
16 | method: "GET", |
17 | headers: { |
18 | Authorization: "Bearer " + token, |
19 | "Content-Type": "application/json", |
20 | }, |
21 | }); |
22 |
|
23 | return await response.text(); |
24 | } |
25 |
|