type Gdrive = {
token: string;
};
export async function main(gdrive_auth: Gdrive, title: string) {
const supportsAllDrives = true;
const CREATE_FOLDER_URL = `https://www.googleapis.com/drive/v3/file/?supportsAllDrives=${supportsAllDrives}`;
const token = gdrive_auth["token"];
const body = {
name: title,
mimeType: "application/vnd.google-apps.folder",
};
const response = await fetch(CREATE_FOLDER_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by admin 468 days ago
type Gdrive = {
token: string;
};
export async function main(
gdrive_auth: Gdrive,
title: string,
) {
const supportsAllDrives = true;
const CREATE_FOLDER_URL = `https://www.googleapis.com/drive/v3/file/?supportsAllDrives=${supportsAllDrives}`;
const token = gdrive_auth["token"];
const body = {
"name": title,
"mimeType": "application/vnd.google-apps.folder"
};
const response = await fetch(CREATE_FOLDER_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by admin 471 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">,
title: string,
) {
const supportsAllDrives = true;
const CREATE_FOLDER_URL = `https://www.googleapis.com/drive/v3/file/?supportsAllDrives=${supportsAllDrives}`;
const token = gdrive_auth["token"];
const body = {
"name": title,
"mimeType": "application/vnd.google-apps.folder"
};
const response = await fetch(CREATE_FOLDER_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by adam186 599 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">,
title: string,
) {
const supportsAllDrives = true;
const CREATE_FOLDER_URL = `https://www.googleapis.com/drive/v3/file/?supportsAllDrives=${supportsAllDrives}`;
const token = gdrive_auth["token"];
const body = {
"name": title,
"mimeType": "application/vnd.google-apps.folder"
};
const response = await fetch(CREATE_FOLDER_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by adam186 634 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">,
title: string,
) {
const supportsAllDrives = true;
const CREATE_FOLDER_URL = `https://www.googleapis.com/drive/v3/file/?supportsAllDrives=${supportsAllDrives}`;
const token = gdrive_auth["token"];
const body = {
"name": title,
"mimeType": "application/vnd.google-apps.folder"
};
const response = await fetch(CREATE_FOLDER_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by rossmccrann 850 days ago