type Gdrive = {
token: string;
};
export async function main(
gdrive_auth: Gdrive,
fileId: string,
mimeType: string,
) {
const DOWNLOAD_FILE_URL = `https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by admin 479 days ago
type Gdrive = {
token: string;
};
export async function main(
gdrive_auth: Gdrive,
fileId: string,
mimeType: string
) {
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by admin 482 days ago
import * as wmill from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(
gdrive_auth: wmill.Resource<"gdrive">,
fileId: string,
mimeType: string
) {
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by adam186 610 days ago
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(
gdrive_auth: wmill.Resource<"gdrive">,
fileId: string,
mimeType: string
) {
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by adam186 645 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gdrive_auth: wmill.Resource<"gdrive">,
fileId: string,
mimeType: string
) {
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by rossmccrann 862 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gdrive_auth: wmill.Resource<"gdrive">,
fileId: string,
mimeType: string /*
MIME Type Description
application/vnd.google-apps.audio
application/vnd.google-apps.document Google Docs
application/vnd.google-apps.drive-sdk 3rd party shortcut
application/vnd.google-apps.drawing Google Drawing
application/vnd.google-apps.file Google Drive file
application/vnd.google-apps.folder Google Drive folder
application/vnd.google-apps.form Google Forms
application/vnd.google-apps.fusiontable Google Fusion Tables
application/vnd.google-apps.jam Google Jamboard
application/vnd.google-apps.map Google My Maps
application/vnd.google-apps.photo
application/vnd.google-apps.presentation Google Slides
application/vnd.google-apps.script Google Apps Scripts
application/vnd.google-apps.shortcut Shortcut
application/vnd.google-apps.site Google Sites
application/vnd.google-apps.spreadsheet Google Sheets
application/vnd.google-apps.unknown
application/vnd.google-apps.video
*/
) {
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by rossmccrann 862 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gdrive_auth: wmill.Resource<"gdrive">,
fileId: string,
mimeType: string
) {
/*
MIME Type Description
application/vnd.google-apps.audio
application/vnd.google-apps.document Google Docs
application/vnd.google-apps.drive-sdk 3rd party shortcut
application/vnd.google-apps.drawing Google Drawing
application/vnd.google-apps.file Google Drive file
application/vnd.google-apps.folder Google Drive folder
application/vnd.google-apps.form Google Forms
application/vnd.google-apps.fusiontable Google Fusion Tables
application/vnd.google-apps.jam Google Jamboard
application/vnd.google-apps.map Google My Maps
application/vnd.google-apps.photo
application/vnd.google-apps.presentation Google Slides
application/vnd.google-apps.script Google Apps Scripts
application/vnd.google-apps.shortcut Shortcut
application/vnd.google-apps.site Google Sites
application/vnd.google-apps.spreadsheet Google Sheets
application/vnd.google-apps.unknown
application/vnd.google-apps.video
*/
const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
const token = gdrive_auth["token"];
const response = await fetch(DOWNLOAD_FILE_URL, {
method: "GET",
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by rossmccrann 862 days ago