🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/google-drive

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/google-drive - npm Package Compare versions

Comparing version
0.1.1
to
0.3.0
+31
dist/google-drive.d.ts
/**
* RobinPath Google Drive Module (Node port)
*
* Drive API v3 with **service-account** authentication. The user creates
* a service account in Google Cloud, downloads its JSON key, and stores
* the `client_email` + `private_key` fields in a `google_service_account`
* credential. The module signs a JWT (RS256) with the private key and
* exchanges it for an OAuth2 access token at every call (cached for ~50min
* in-process).
*
* Because service accounts act like standalone users, the user MUST either:
* (a) share each file/folder with the service account's email, OR
* (b) configure domain-wide delegation in their Workspace admin console.
*
* Uploads use `multipart/related` POSTs to the upload endpoint. Metadata,
* listing, and search calls hit the JSON API. Binary downloads stream bytes
* and (optionally) save to disk.
*
* Credential type declared by this module (shared with google-sheets):
* - google_service_account : { client_email, private_key, scopes? }
*
* Mirror of packages/php/google-drive/src/index.php — shares the same
* credential contract, metadata shape, and error taxonomy.
*/
import type { BuiltinHandler, CredentialTypeSchema, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core";
export declare function configureGoogleDrive(h: ModuleHost): void;
export declare const GoogleDriveFunctions: Record<string, BuiltinHandler>;
export declare const GoogleDriveCredentialTypes: CredentialTypeSchema[];
export declare const GoogleDriveFunctionMetadata: Record<string, FunctionMetadata>;
export declare const GoogleDriveModuleMetadata: ModuleMetadata;
//# sourceMappingURL=google-drive.d.ts.map
{"version":3,"file":"google-drive.d.ts","sourceRoot":"","sources":["../src/google-drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAezB,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAExD;AAq+BD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAc/D,CAAC;AAIF,eAAO,MAAM,0BAA0B,EAAE,oBAAoB,EAoC5D,CAAC;AAgFF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAugBxE,CAAC;AAIF,eAAO,MAAM,yBAAyB,EAAE,cAuCvC,CAAC"}
/**
* RobinPath Google Drive Module (Node port)
*
* Drive API v3 with **service-account** authentication. The user creates
* a service account in Google Cloud, downloads its JSON key, and stores
* the `client_email` + `private_key` fields in a `google_service_account`
* credential. The module signs a JWT (RS256) with the private key and
* exchanges it for an OAuth2 access token at every call (cached for ~50min
* in-process).
*
* Because service accounts act like standalone users, the user MUST either:
* (a) share each file/folder with the service account's email, OR
* (b) configure domain-wide delegation in their Workspace admin console.
*
* Uploads use `multipart/related` POSTs to the upload endpoint. Metadata,
* listing, and search calls hit the JSON API. Binary downloads stream bytes
* and (optionally) save to disk.
*
* Credential type declared by this module (shared with google-sheets):
* - google_service_account : { client_email, private_key, scopes? }
*
* Mirror of packages/php/google-drive/src/index.php — shares the same
* credential contract, metadata shape, and error taxonomy.
*/
import { Buffer } from "node:buffer";
import { createSign, randomBytes } from "node:crypto";
import { readFile, mkdir, writeFile } from "node:fs/promises";
import { dirname } from "node:path";
// ── Module-local state (populated by configure hook) ────────────────────
const state = {};
function host() {
if (!state.host) {
throw new Error("Google Drive module not initialized. Pass the adapter to rp.registerModule() via loadModule so its configure() hook runs first.");
}
return state.host;
}
export function configureGoogleDrive(h) {
state.host = h;
}
// ── Constants ──────────────────────────────────────────────────────────
const TOKEN_URL = "https://oauth2.googleapis.com/token";
const DRIVE_API = "https://www.googleapis.com/drive/v3/";
const UPLOAD_API = "https://www.googleapis.com/upload/drive/v3/";
const DEFAULT_SCOPE = "https://www.googleapis.com/auth/drive";
const TOKEN_TTL_MS = 3000 * 1000; // 50 minutes; tokens last 60min, leave a buffer.
const FOLDER_MIME = "application/vnd.google-apps.folder";
const DEFAULT_MIME = "application/octet-stream";
const DEFAULT_FIELDS = "id,name,mimeType,size,modifiedTime,createdTime,parents,webViewLink,webContentLink,iconLink";
const CREDENTIAL_TYPE = "google_service_account";
function errorReturn(error, code, extra = {}) {
return { error, code, ...extra };
}
function isErrorReturn(v) {
return typeof v === "object" && v !== null && "error" in v && "code" in v;
}
const tokenCache = new Map();
// ── JWT / token helpers ────────────────────────────────────────────────
function b64url(data) {
const buf = typeof data === "string" ? Buffer.from(data, "utf8") : data;
return buf
.toString("base64")
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
}
function buildJwt(email, privateKey, scope) {
const now = Math.floor(Date.now() / 1000);
const header = { alg: "RS256", typ: "JWT" };
const payload = {
iss: email,
scope,
aud: TOKEN_URL,
exp: now + 3600,
iat: now,
};
const h = b64url(JSON.stringify(header));
const p = b64url(JSON.stringify(payload));
const signingInput = `${h}.${p}`;
try {
const signer = createSign("RSA-SHA256");
signer.update(signingInput);
signer.end();
const signature = signer.sign(privateKey);
return `${signingInput}.${b64url(signature)}`;
}
catch (e) {
const msg = e instanceof Error ? e.message : String(e);
if (/pem|private|parse|asymmetric|decode/i.test(msg)) {
return errorReturn("Could not parse private key (is it PEM?).", "jwt_sign_failed");
}
return errorReturn(`openssl_sign failed: ${msg}`, "jwt_sign_failed");
}
}
async function getAccessToken(credentialSlug) {
if (!credentialSlug) {
return errorReturn("Credential slug is required.", "credential_not_found");
}
let fields;
try {
fields = await host().credentials.get(credentialSlug);
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "credential_not_found");
}
if (!fields) {
return errorReturn(`Credential '${credentialSlug}' not found.`, "credential_not_found");
}
const email = String(fields.client_email ?? "");
let key = String(fields.private_key ?? "");
const scope = String(fields.scopes ?? "") || DEFAULT_SCOPE;
if (!email || !key) {
return errorReturn("Credential is missing `client_email` or `private_key`.", "private_key_missing");
}
// Normalize keys copy-pasted from JSON (literal \n → real newlines).
if (key.includes("\\n") && !key.includes("\n")) {
key = key.replace(/\\n/g, "\n");
}
const cacheKey = `${email}|${scope}`;
const cached = tokenCache.get(cacheKey);
if (cached && cached.expiresAt > Date.now()) {
return cached.token;
}
const jwt = buildJwt(email, key, scope);
if (typeof jwt !== "string")
return jwt;
let response;
try {
response = await fetch(TOKEN_URL, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
assertion: jwt,
}).toString(),
});
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "transport");
}
const raw = await response.text();
let decoded = null;
try {
decoded = raw ? JSON.parse(raw) : null;
}
catch {
decoded = null;
}
const accessToken = decoded && typeof decoded.access_token === "string"
? decoded.access_token
: "";
if (response.status < 200 || response.status >= 300 || !accessToken) {
let message = "Token exchange failed.";
if (decoded) {
if (typeof decoded.error_description === "string") {
message = decoded.error_description;
}
else if (typeof decoded.error === "string") {
message = decoded.error;
}
}
return errorReturn(message, "token_exchange_failed", {
status: response.status,
});
}
tokenCache.set(cacheKey, {
token: accessToken,
expiresAt: Date.now() + TOKEN_TTL_MS,
});
return accessToken;
}
// ── Error body mapper ──────────────────────────────────────────────────
function httpErrorFromBody(status, rawBody) {
let decoded = null;
try {
decoded = rawBody ? JSON.parse(rawBody) : null;
}
catch {
decoded = null;
}
const errField = decoded && typeof decoded === "object" && "error" in decoded
? decoded.error
: null;
let code = "drive_error";
if (status === 429) {
code = "rate_limited";
}
else if (status === 404) {
code = "not_found";
}
else if (status === 401 || status === 403) {
// Inspect reason if present.
let reason = "";
if (errField && typeof errField === "object" && "errors" in errField) {
const errs = errField.errors;
if (Array.isArray(errs) && errs.length > 0) {
const first = errs[0];
if (first && typeof first === "object" && "reason" in first) {
const r = first.reason;
if (typeof r === "string")
reason = r;
}
}
}
if (reason === "userRateLimitExceeded" || reason === "rateLimitExceeded") {
code = "rate_limited";
}
else if (reason === "storageQuotaExceeded") {
code = "quota_exceeded";
}
else {
code = "permission_denied";
}
}
let message = `Drive API returned HTTP ${status}.`;
if (errField && typeof errField === "object" && "message" in errField) {
const m = errField.message;
if (typeof m === "string")
message = m;
}
return {
error: message,
code,
status,
drive_error: decoded && typeof decoded === "object" ? decoded : { raw: rawBody },
};
}
// ── HTTP helper (JSON, normalized envelope) ────────────────────────────
async function call(cred, method, path, body) {
const token = await getAccessToken(cred);
if (typeof token !== "string")
return token;
const init = {
method,
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
};
if (body !== null && body !== undefined) {
init.body = JSON.stringify(body);
}
let response;
try {
response = await fetch(`${DRIVE_API}${path}`, init);
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "transport");
}
const status = response.status;
// 204 No Content (DELETE) — success with no body.
if (status === 204) {
return { success: true };
}
const raw = await response.text();
if (status >= 200 && status < 300) {
let decoded;
try {
decoded = raw ? JSON.parse(raw) : null;
}
catch {
decoded = null;
}
return decoded && typeof decoded === "object" ? decoded : { raw };
}
return httpErrorFromBody(status, raw);
}
// ── Multipart/related upload helper ────────────────────────────────────
async function uploadMultipart(cred, method, path, metadata, bytes, mimeType) {
const token = await getAccessToken(cred);
if (typeof token !== "string")
return token;
const boundary = "robinpath_" + randomBytes(8).toString("hex");
const eol = "\r\n";
const head = `--${boundary}${eol}` +
`Content-Type: application/json; charset=UTF-8${eol}${eol}` +
`${JSON.stringify(metadata)}${eol}` +
`--${boundary}${eol}` +
`Content-Type: ${mimeType}${eol}` +
`Content-Transfer-Encoding: binary${eol}${eol}`;
const tail = `${eol}--${boundary}--${eol}`;
const body = Buffer.concat([
Buffer.from(head, "utf8"),
bytes,
Buffer.from(tail, "utf8"),
]);
let response;
try {
response = await fetch(`${UPLOAD_API}${path}`, {
method,
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": `multipart/related; boundary=${boundary}`,
"Content-Length": String(body.length),
},
body,
});
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "transport");
}
const status = response.status;
const raw = await response.text();
if (status >= 200 && status < 300) {
let decoded;
try {
decoded = raw ? JSON.parse(raw) : null;
}
catch {
decoded = null;
}
return decoded && typeof decoded === "object" ? decoded : { raw };
}
return httpErrorFromBody(status, raw);
}
// ── Query helpers ──────────────────────────────────────────────────────
function buildQueryString(params) {
const qs = new URLSearchParams();
for (const [k, v] of Object.entries(params)) {
if (v !== null && v !== undefined && v !== "")
qs.set(k, v);
}
return qs.toString();
}
function buildListQuery(opts) {
const pairs = {};
for (const k of ["q", "pageSize", "pageToken", "orderBy", "spaces", "corpora", "driveId"]) {
const v = opts[k];
if (v !== undefined && v !== null && String(v) !== "") {
pairs[k] = String(v);
}
}
pairs.fields =
typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: `nextPageToken,files(${DEFAULT_FIELDS})`;
if (opts.includeItemsFromAllDrives)
pairs.includeItemsFromAllDrives = "true";
if (opts.supportsAllDrives)
pairs.supportsAllDrives = "true";
return buildQueryString(pairs);
}
function toList(value) {
if (Array.isArray(value)) {
return value.map((v) => String(v));
}
const s = value === null || value === undefined ? "" : String(value);
if (s === "")
return [];
return [s];
}
function applyMetadataOptions(metadata, opts) {
if (opts.parents !== undefined) {
metadata.parents = toList(opts.parents);
}
else if (opts.parentId !== undefined) {
metadata.parents = [String(opts.parentId)];
}
else if (opts.folderId !== undefined) {
metadata.parents = [String(opts.folderId)];
}
for (const k of ["description", "starred", "properties", "appProperties"]) {
if (Object.prototype.hasOwnProperty.call(opts, k)) {
metadata[k] = opts[k];
}
}
}
async function resolveContent(content, hintMime) {
const hint = typeof hintMime === "string" && hintMime !== "" ? hintMime : null;
let mime = hint;
// { _file: path } | { file: path }
if (content && typeof content === "object" && !Array.isArray(content)) {
const obj = content;
const path = typeof obj._file === "string"
? obj._file
: typeof obj.file === "string"
? obj.file
: "";
if (path === "") {
// Fall through: JSON-encode the object as bytes.
const jsonBytes = Buffer.from(JSON.stringify(obj), "utf8");
return { bytes: jsonBytes, mimeType: mime ?? "application/json" };
}
let bytes;
try {
bytes = await readFile(path);
}
catch (e) {
const msg = e instanceof Error ? e.message : String(e);
if (/ENOENT|EACCES|EPERM/i.test(msg)) {
return errorReturn(`File not readable: ${path}`, "drive_error");
}
return errorReturn(`Failed to read file: ${path}`, "drive_error");
}
if (mime === null)
mime = DEFAULT_MIME;
return { bytes, mimeType: mime };
}
// Scalar → string.
const str = typeof content === "string"
? content
: typeof content === "number" || typeof content === "boolean"
? String(content)
: "";
// data:<mime>;base64,<payload>
if (str !== "" && str.startsWith("data:")) {
const comma = str.indexOf(",");
if (comma !== -1) {
const header = str.slice(5, comma);
const payload = str.slice(comma + 1);
const isB64 = header.includes(";base64");
const dataMime = header.split(";")[0]?.trim() ?? "";
if (dataMime !== "" && mime === null) {
mime = dataMime;
}
let bytes;
try {
if (isB64) {
const cleaned = payload.replace(/\s+/g, "");
bytes = Buffer.from(cleaned, "base64");
// Round-trip sanity check.
const normalized = cleaned.replace(/=+$/, "");
const reencoded = bytes.toString("base64").replace(/=+$/, "");
if (normalized.length > 0 && reencoded !== normalized) {
return errorReturn("Invalid base64 in data URI.", "drive_error");
}
}
else {
bytes = Buffer.from(decodeURIComponent(payload), "utf8");
}
}
catch {
return errorReturn("Invalid base64 in data URI.", "drive_error");
}
return { bytes, mimeType: mime ?? DEFAULT_MIME };
}
}
if (mime === null)
mime = "text/plain";
return { bytes: Buffer.from(str, "utf8"), mimeType: mime };
}
// ── Handlers ───────────────────────────────────────────────────────────
const listFiles = async (args) => {
const cred = String(args[0] ?? "");
const opts = (args[1] && typeof args[1] === "object" ? args[1] : {});
const query = buildListQuery(opts);
const path = `files${query !== "" ? `?${query}` : ""}`;
return (await call(cred, "GET", path, null));
};
const search = async (args) => {
const cred = String(args[0] ?? "");
const q = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (q === "") {
return errorReturn("query is required.", "drive_error");
}
// `q` in options is overridden by the explicit argument.
const merged = { ...opts, q };
return listFiles([cred, merged]);
};
const getFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
const qs = buildQueryString({
fields: typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS,
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await call(cred, "GET", `files/${encodeURIComponent(fileId)}?${qs}`, null));
};
const createFile = async (args) => {
const cred = String(args[0] ?? "");
const name = String(args[1] ?? "");
const content = args[2] ?? "";
const opts = (args[3] && typeof args[3] === "object" ? args[3] : {});
if (name === "") {
return errorReturn("name is required.", "drive_error");
}
const resolved = await resolveContent(content, opts.mimeType);
if (isErrorReturn(resolved))
return resolved;
const metadata = {
name,
mimeType: resolved.mimeType,
};
applyMetadataOptions(metadata, opts);
const fieldsMask = typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS;
const qs = buildQueryString({
uploadType: "multipart",
fields: fieldsMask,
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await uploadMultipart(cred, "POST", `files?${qs}`, metadata, resolved.bytes, resolved.mimeType));
};
const updateFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const content = args[2] ?? "";
const opts = (args[3] && typeof args[3] === "object" ? args[3] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
const resolved = await resolveContent(content, opts.mimeType);
if (isErrorReturn(resolved))
return resolved;
const metadata = {};
// mimeType only included if caller explicitly set it.
if (opts.mimeType !== undefined) {
metadata.mimeType = resolved.mimeType;
}
for (const k of ["name", "description", "starred"]) {
if (Object.prototype.hasOwnProperty.call(opts, k)) {
metadata[k] = opts[k];
}
}
const fieldsMask = typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS;
const qs = buildQueryString({
uploadType: "multipart",
fields: fieldsMask,
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await uploadMultipart(cred, "PATCH", `files/${encodeURIComponent(fileId)}?${qs}`, metadata, resolved.bytes, resolved.mimeType));
};
const downloadFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
const exportMime = typeof opts.exportMimeType === "string" ? opts.exportMimeType : "";
const savePath = typeof opts.savePath === "string" ? opts.savePath : "";
const asText = Object.prototype.hasOwnProperty.call(opts, "asText")
? Boolean(opts.asText)
: null;
const qsPairs = {};
let endpoint;
if (exportMime !== "") {
qsPairs.mimeType = exportMime;
endpoint = `files/${encodeURIComponent(fileId)}/export`;
}
else {
qsPairs.alt = "media";
endpoint = `files/${encodeURIComponent(fileId)}`;
}
if (opts.supportsAllDrives)
qsPairs.supportsAllDrives = "true";
const token = await getAccessToken(cred);
if (typeof token !== "string")
return token;
const url = `${DRIVE_API}${endpoint}?${buildQueryString(qsPairs)}`;
let response;
try {
response = await fetch(url, {
method: "GET",
headers: { Authorization: `Bearer ${token}` },
});
}
catch (e) {
return errorReturn(e instanceof Error ? e.message : String(e), "transport");
}
const status = response.status;
if (status < 200 || status >= 300) {
const raw = await response.text();
return httpErrorFromBody(status, raw);
}
const contentType = response.headers.get("content-type") ?? "";
const mime = contentType.split(";")[0]?.trim() || contentType;
const ab = await response.arrayBuffer();
const buf = Buffer.from(ab);
const size = buf.length;
const result = {
fileId,
mimeType: mime,
size,
};
if (savePath !== "") {
try {
const dir = dirname(savePath);
if (dir && dir !== ".") {
await mkdir(dir, { recursive: true });
}
}
catch {
return errorReturn(`Could not create directory: ${dirname(savePath)}`, "drive_error");
}
try {
await writeFile(savePath, buf);
}
catch {
return errorReturn(`Could not write to: ${savePath}`, "drive_error");
}
result.savedTo = savePath;
result.bytesWritten = size;
return result;
}
const isTextual = asText === null
? mime.startsWith("text/") ||
mime === "application/json" ||
mime === "application/xml"
: asText;
if (isTextual) {
result.content = buf.toString("utf8");
}
result.content_base64 = buf.toString("base64");
return result;
};
const copyFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
const body = {};
for (const k of ["name", "description"]) {
if (Object.prototype.hasOwnProperty.call(opts, k)) {
body[k] = opts[k];
}
}
if (opts.parents !== undefined) {
body.parents = toList(opts.parents);
}
else if (opts.folderId !== undefined) {
body.parents = [String(opts.folderId)];
}
const qs = buildQueryString({
fields: typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS,
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await call(cred, "POST", `files/${encodeURIComponent(fileId)}/copy?${qs}`, body));
};
const moveFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
let add = [];
if (opts.addParents !== undefined) {
add = toList(opts.addParents);
}
else if (opts.newFolderId !== undefined) {
add = [String(opts.newFolderId)];
}
else if (opts.parents !== undefined) {
add = toList(opts.parents);
}
if (add.length === 0 && opts.removeParents === undefined) {
return errorReturn("moveFile requires `addParents` (or `newFolderId`).", "drive_error");
}
let remove;
if (opts.removeParents !== undefined) {
remove = toList(opts.removeParents);
}
else {
const cur = await call(cred, "GET", `files/${encodeURIComponent(fileId)}?fields=parents`, null);
if (isErrorReturn(cur))
return cur;
remove =
cur && typeof cur === "object" && Array.isArray(cur.parents)
? cur.parents.map((p) => String(p))
: [];
}
const qsPairs = {
fields: typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS,
};
if (add.length > 0)
qsPairs.addParents = add.join(",");
if (remove.length > 0)
qsPairs.removeParents = remove.join(",");
if (opts.supportsAllDrives)
qsPairs.supportsAllDrives = "true";
// Empty PATCH body — API requires a body, so send `{}`.
return (await call(cred, "PATCH", `files/${encodeURIComponent(fileId)}?${buildQueryString(qsPairs)}`, {}));
};
const deleteFile = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
let path = `files/${encodeURIComponent(fileId)}`;
if (opts.supportsAllDrives) {
path += "?supportsAllDrives=true";
}
const result = await call(cred, "DELETE", path, null);
if (isErrorReturn(result))
return result;
return { deleted: true, fileId };
};
const createFolder = async (args) => {
const cred = String(args[0] ?? "");
const name = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (name === "") {
return errorReturn("name is required.", "drive_error");
}
const metadata = {
name,
mimeType: FOLDER_MIME,
};
if (opts.parentId !== undefined) {
metadata.parents = [String(opts.parentId)];
}
else if (opts.parents !== undefined) {
metadata.parents = toList(opts.parents);
}
if (opts.description !== undefined) {
metadata.description = String(opts.description);
}
const qs = buildQueryString({
fields: typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: DEFAULT_FIELDS,
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await call(cred, "POST", `files?${qs}`, metadata));
};
const share = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
let permission = args[2] ?? null;
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
// Shortcut: passing just an email string.
if (typeof permission === "string") {
permission = {
type: "user",
role: "reader",
emailAddress: permission,
};
}
if (!permission ||
typeof permission !== "object" ||
Array.isArray(permission) ||
Object.keys(permission).length === 0) {
return errorReturn("permission is required.", "drive_error");
}
const perm = { ...permission };
const sendNotif = Object.prototype.hasOwnProperty.call(perm, "sendNotificationEmail")
? Boolean(perm.sendNotificationEmail)
: null;
const emailMessage = Object.prototype.hasOwnProperty.call(perm, "emailMessage")
? String(perm.emailMessage ?? "")
: null;
const supportsAllDrives = Object.prototype.hasOwnProperty.call(perm, "supportsAllDrives")
? Boolean(perm.supportsAllDrives)
: null;
delete perm.sendNotificationEmail;
delete perm.emailMessage;
delete perm.supportsAllDrives;
perm.type = String(perm.type ?? "user");
perm.role = String(perm.role ?? "reader");
const qsPairs = {};
if (sendNotif !== null) {
qsPairs.sendNotificationEmail = sendNotif ? "true" : "false";
}
if (emailMessage !== null && emailMessage !== "") {
qsPairs.emailMessage = emailMessage;
}
if (supportsAllDrives === true) {
qsPairs.supportsAllDrives = "true";
}
qsPairs.fields = "id,type,role,emailAddress,domain,displayName";
return (await call(cred, "POST", `files/${encodeURIComponent(fileId)}/permissions?${buildQueryString(qsPairs)}`, perm));
};
const listPermissions = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const opts = (args[2] && typeof args[2] === "object" ? args[2] : {});
if (fileId === "") {
return errorReturn("fileId is required.", "drive_error");
}
const qs = buildQueryString({
fields: typeof opts.fields === "string" && opts.fields !== ""
? opts.fields
: "permissions(id,type,role,emailAddress,domain,displayName,deleted)",
supportsAllDrives: opts.supportsAllDrives ? "true" : null,
});
return (await call(cred, "GET", `files/${encodeURIComponent(fileId)}/permissions?${qs}`, null));
};
const deletePermission = async (args) => {
const cred = String(args[0] ?? "");
const fileId = String(args[1] ?? "");
const permissionId = String(args[2] ?? "");
const opts = (args[3] && typeof args[3] === "object" ? args[3] : {});
if (fileId === "" || permissionId === "") {
return errorReturn("fileId and permissionId are required.", "drive_error");
}
let path = `files/${encodeURIComponent(fileId)}/permissions/${encodeURIComponent(permissionId)}`;
if (opts.supportsAllDrives) {
path += "?supportsAllDrives=true";
}
const result = await call(cred, "DELETE", path, null);
if (isErrorReturn(result))
return result;
return { deleted: true, fileId, permissionId };
};
// ── Exports: functions map ─────────────────────────────────────────────
export const GoogleDriveFunctions = {
listFiles,
search,
getFile,
createFile,
updateFile,
downloadFile,
copyFile,
moveFile,
deleteFile,
createFolder,
share,
listPermissions,
deletePermission,
};
// ── Exports: credential types ──────────────────────────────────────────
export const GoogleDriveCredentialTypes = [
{
slug: CREDENTIAL_TYPE,
title: "Google Service Account",
icon: "key-square",
fields: [
{
name: "client_email",
title: "Service account email",
type: "text",
required: true,
placeholder: "name@project-id.iam.gserviceaccount.com",
description: "The `client_email` field from your service-account JSON key. Share each Drive item with this address.",
pattern: "@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com$",
},
{
name: "private_key",
title: "Private key (PEM)",
type: "textarea",
required: true,
placeholder: "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----\n",
description: "The `private_key` field from your service-account JSON. Paste it as-is, including the BEGIN/END lines. Literal `\\n` sequences from a copy-pasted JSON blob are normalized automatically.",
},
{
name: "scopes",
title: "Scopes",
type: "text",
required: false,
placeholder: "https://www.googleapis.com/auth/drive",
description: "Space-separated OAuth scopes. Defaults to `https://www.googleapis.com/auth/drive` (full access). Use `drive.file` for app-created files only, or `drive.readonly` for read-only.",
},
],
},
];
// ── Metadata: parameter builders ───────────────────────────────────────
const credentialParam = {
name: "credential",
title: "Credential",
description: "Slug of a saved `google_service_account` credential.",
dataType: "string",
formInputType: "resource",
required: true,
allowExpression: true,
placeholder: "my_drive_sa",
resource: {
type: "credential",
listFn: "credential.list",
modes: ["list", "expression"],
searchable: true,
filter: { type: CREDENTIAL_TYPE },
},
};
const fileIdParam = {
name: "fileId",
title: "File ID",
description: "The Drive file ID from the URL: `drive.google.com/file/d/{ID}/view` or the `id` returned by `listFiles` / `createFile`. Works for folders too.",
dataType: "string",
formInputType: "text",
required: true,
allowExpression: true,
placeholder: "1AbC2dEfG…",
};
const nameParam = {
name: "name",
title: "File name",
description: "Display name for the file in Drive. Extension is not auto-appended — include it yourself if you want one (e.g. `report.csv`).",
dataType: "string",
formInputType: "text",
required: true,
allowExpression: true,
placeholder: "report.csv",
};
const contentParam = {
name: "content",
title: "Content",
description: "Raw file bytes. Accepts:\n - a plain string (treated as UTF-8 text / whatever `mimeType` says)\n - `data:<mime>;base64,<payload>` data-URI (base64 decoded automatically)\n - `{_file:\"/absolute/path\"}` object (file on disk is read)\nLeave empty to create a file with no content (rare).",
dataType: "string",
formInputType: "textarea",
required: true,
allowExpression: true,
rows: 8,
placeholder: "Hello, world!\n",
};
const commonErrors = {
credential_not_found: "No credential with that slug exists in the vault.",
private_key_missing: "The credential is missing `client_email` or `private_key`.",
jwt_sign_failed: "Could not sign the JWT — `private_key` is malformed (must be PEM).",
token_exchange_failed: "Google rejected the JWT — check the service account email + private key match.",
transport: "Network failure calling Google API.",
drive_error: "Drive API returned an error — see `drive_error.error`.",
permission_denied: "Service account does not have access — share the file/folder with the credential's email.",
rate_limited: "Drive API rate limit (~1000 req/100s/user by default).",
not_found: "File/folder/permission not found — check the ID, or the service account does not have visibility.",
quota_exceeded: "Drive storage quota for the owning user is full.",
};
// ── Exports: function metadata ─────────────────────────────────────────
export const GoogleDriveFunctionMetadata = {
listFiles: {
title: "List files",
summary: "List files (optionally filtered and paged)",
description: "Calls `GET /files` with an optional Drive query. Returns files the service account can see — share files/folders with the credential's email first.\n\nHandy queries:\n mimeType = 'application/pdf'\n 'FOLDER_ID' in parents\n name contains 'invoice' and trashed = false\n modifiedTime > '2024-01-01T00:00:00'",
group: "discovery",
action: "query",
icon: "list",
capability: "manage_options",
sideEffects: ["makes_http_call"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "list", "files"],
parameters: [
credentialParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n q : Drive query string (see Google's reference)\n pageSize : 1-1000 (default 100)\n pageToken : cursor from a previous response\n orderBy : 'modifiedTime desc' | 'createdTime' | 'name' | 'folder,modifiedTime desc'\n fields : comma-separated field mask (overrides default)\n spaces : 'drive' (default) | 'appDataFolder' | 'photos'\n includeItemsFromAllDrives : bool (set true + `supportsAllDrives=true` for shared drives)\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 5,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ files: [{id, name, mimeType, size, modifiedTime, parents, …}], nextPageToken?: string }",
errors: commonErrors,
examples: [
{
title: "List PDFs in a folder",
code: "google-drive.listFiles \"my_drive_sa\" {q:\"'FOLDER_ID' in parents and mimeType='application/pdf' and trashed=false\", pageSize:50, orderBy:\"modifiedTime desc\"}",
},
],
example: 'google-drive.listFiles "my_drive_sa" {pageSize:20}',
},
search: {
title: "Search",
summary: "Convenience wrapper over `listFiles` for a Drive query string",
description: "Shortcut for `listFiles` when all you want is to pass a query. Equivalent to `listFiles(cred, {q, ...options})`.",
group: "discovery",
action: "query",
icon: "search",
capability: "manage_options",
sideEffects: ["makes_http_call"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "search", "query"],
parameters: [
credentialParam,
{
name: "query",
title: "Query (Drive query language)",
description: "See https://developers.google.com/drive/api/guides/search-files. Common operators: `=`, `!=`, `contains`, `in`, `and`, `or`, `not`. Strings must be single-quoted.",
dataType: "string",
formInputType: "text",
required: true,
allowExpression: true,
placeholder: "name contains 'invoice' and trashed = false",
},
{
name: "options",
title: "Options",
description: "Same extra keys as `listFiles` (pageSize, orderBy, fields, pageToken, spaces, …). The `q` key is ignored — use the `query` argument.",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 4,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ files: [...], nextPageToken?: string }",
errors: commonErrors,
example: "google-drive.search \"my_drive_sa\" \"name contains 'invoice'\"",
},
getFile: {
title: "Get file metadata",
summary: "Fetch metadata for a single file or folder",
description: "Calls `GET /files/{fileId}`. Returns the default field set plus `webViewLink` and `webContentLink`. Does not return file content — use `downloadFile` for that.",
group: "discovery",
action: "read",
icon: "info",
capability: "manage_options",
sideEffects: ["makes_http_call"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "metadata", "read"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n fields : comma-separated field mask (overrides default)\n supportsAllDrives : bool — set true for shared-drive files",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 3,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ id, name, mimeType, size, modifiedTime, parents, webViewLink, … }",
errors: commonErrors,
example: 'google-drive.getFile "my_drive_sa" "1AbC..."',
},
createFile: {
title: "Create / upload file",
summary: "Upload a new file with content",
description: "Multipart upload to `POST /upload/drive/v3/files?uploadType=multipart`. Metadata and bytes are sent in one request — fine for anything under ~5 MB. For larger files consider chunked/resumable uploads (not yet implemented).\n\nContent can be a plain string, a `data:` URI (base64 decoded), or `{_file:\"path\"}` to read from disk.",
group: "files",
action: "create",
icon: "upload",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: false,
since: "1.0.0",
tags: ["drive", "upload", "create"],
parameters: [
credentialParam,
nameParam,
contentParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n mimeType : defaults to 'application/octet-stream' (or 'text/plain' if content is a plain string)\n parents : array of folder IDs — put file inside these folders\n description : string\n starred : bool\n properties : { key: value } — custom user properties\n appProperties : { key: value } — app-private properties\n fields : field mask for the response\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 5,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ id, name, mimeType, size, … }",
errors: commonErrors,
examples: [
{
title: "Upload CSV into a folder",
code: "google-drive.createFile \"my_drive_sa\" \"report.csv\" \"a,b,c\\n1,2,3\" {mimeType:\"text/csv\", parents:[\"FOLDER_ID\"]}",
},
],
example: 'google-drive.createFile "my_drive_sa" "hello.txt" "hi!"',
},
updateFile: {
title: "Update file contents",
summary: "Replace the bytes of an existing file",
description: "Multipart upload to `PATCH /upload/drive/v3/files/{fileId}?uploadType=multipart`. Keeps the same file ID (so shares/links stay valid). Metadata keys in `options` are optional — pass only what you want to change.",
group: "files",
action: "update",
icon: "save",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: false,
since: "1.0.0",
tags: ["drive", "upload", "update"],
parameters: [
credentialParam,
fileIdParam,
contentParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n mimeType : override content type\n name : rename the file\n description : update description\n starred : bool\n fields : response field mask\n supportsAllDrives : bool\nNote: `parents` cannot be changed here — use `moveFile`.",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 5,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ id, name, mimeType, size, modifiedTime, … }",
errors: commonErrors,
example: 'google-drive.updateFile "my_drive_sa" "1AbC..." "new contents" {mimeType:"text/plain"}',
},
downloadFile: {
title: "Download file",
summary: "Fetch the raw bytes of a file",
description: "Calls `GET /files/{id}?alt=media`. Returns the bytes either inline (base64-encoded in `content_base64` plus `content` for text payloads) or writes them to disk if `savePath` is set.\n\nFor Google-native types (Docs / Sheets / Slides), use `exportMimeType` to export to PDF / DOCX / XLSX / etc. A raw `alt=media` call on a Google-native file will return 403.",
group: "files",
action: "read",
icon: "download",
capability: "manage_options",
sideEffects: ["makes_http_call", "reads_remote", "writes_local"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "download", "bytes", "export"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n savePath : absolute path to write the bytes to; when set, response omits `content_base64`\n exportMimeType : for Google-native files — export format. E.g. 'application/pdf', 'text/csv', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n asText : bool — decode bytes as UTF-8 into `content`; default auto (true for text/*)\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 5,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ fileId, mimeType, size, content?, content_base64?, savedTo? }",
errors: commonErrors,
examples: [
{
title: "Save a PDF to disk",
code: "google-drive.downloadFile \"my_drive_sa\" \"1AbC...\" {savePath:\"/tmp/report.pdf\"}",
},
{
title: "Export a Google Doc as PDF",
code: "google-drive.downloadFile \"my_drive_sa\" \"1AbC...\" {exportMimeType:\"application/pdf\", savePath:\"/tmp/doc.pdf\"}",
},
],
example: 'google-drive.downloadFile "my_drive_sa" "1AbC..."',
},
copyFile: {
title: "Copy file",
summary: "Duplicate a file (optionally rename / move the copy)",
description: "Calls `POST /files/{fileId}/copy`. Returns the metadata of the newly-created copy. Folders cannot be copied via this API — list + recreate recursively if needed.",
group: "files",
action: "create",
icon: "copy",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: false,
since: "1.0.0",
tags: ["drive", "copy", "duplicate"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n name : new name for the copy (defaults to 'Copy of …')\n parents : array of folder IDs\n description : string\n fields : response field mask\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 4,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ id, name, mimeType, parents, … }",
errors: commonErrors,
example: 'google-drive.copyFile "my_drive_sa" "1AbC..." {name:"Copy of Report",parents:["FOLDER_ID"]}',
},
moveFile: {
title: "Move file",
summary: "Change a file's parent folder(s)",
description: "Calls `PATCH /files/{fileId}?addParents=…&removeParents=…`. Without options, the old parents are read via a `GET /files/{id}?fields=parents` and all of them are removed before `addParents` is applied. Override via `removeParents` to be explicit.",
group: "files",
action: "update",
icon: "move",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "move", "parents"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys (at least one of `addParents` / `removeParents` required):\n addParents : string | array — folder ID(s) to add\n removeParents : string | array — folder ID(s) to remove (default: all current parents)\n newFolderId : alias for `addParents` (single folder move; older syntax)\n fields : response field mask\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: true,
allowExpression: true,
language: "json",
rows: 4,
},
],
returnType: "object",
returnDescription: "{ id, name, parents, … }",
errors: commonErrors,
example: 'google-drive.moveFile "my_drive_sa" "1AbC..." {addParents:"DEST_FOLDER_ID"}',
},
deleteFile: {
title: "Delete file",
summary: "Permanently delete a file or folder",
description: "Calls `DELETE /files/{fileId}`. This bypasses the trash — gone immediately. For a recoverable delete, use `updateFile` with `options:{trashed:true}` (not shown here).",
group: "files",
action: "delete",
icon: "trash",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote", "destructive"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "delete", "destructive"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 2,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ deleted: true, fileId }",
errors: commonErrors,
example: 'google-drive.deleteFile "my_drive_sa" "1AbC..."',
},
createFolder: {
title: "Create folder",
summary: "Create a new folder",
description: "Calls `POST /files` with `mimeType=application/vnd.google-apps.folder`. Nested folders: pass the parent's ID in `options.parents`.",
group: "folders",
action: "create",
icon: "folder-plus",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: false,
since: "1.0.0",
tags: ["drive", "folder", "create"],
parameters: [
credentialParam,
nameParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n parents : array of folder IDs (or a single string) — place inside these folders\n parentId : shorthand for `parents:[parentId]`\n description : string\n fields : response field mask\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 4,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ id, name, mimeType, parents, … }",
errors: commonErrors,
example: 'google-drive.createFolder "my_drive_sa" "Reports 2026" {parentId:"ROOT_FOLDER_ID"}',
},
share: {
title: "Share file",
summary: "Grant a user, group, or domain access to a file",
description: "Calls `POST /files/{fileId}/permissions`. Default role is `reader`. For email notifications, set `sendNotificationEmail:true` and optionally `emailMessage`.\n\nPermission types: `user`, `group`, `domain`, `anyone`. Roles: `owner`, `organizer`, `fileOrganizer`, `writer`, `commenter`, `reader`.",
group: "permissions",
action: "create",
icon: "share",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote"],
idempotent: false,
since: "1.0.0",
tags: ["drive", "share", "permissions"],
parameters: [
credentialParam,
fileIdParam,
{
name: "permission",
title: "Permission",
description: "Permission descriptor. Required keys depend on `type`:\n { type:'user', role:'writer', emailAddress:'ada@example.com' }\n { type:'group', role:'reader', emailAddress:'team@example.com' }\n { type:'domain', role:'reader', domain:'example.com' }\n { type:'anyone', role:'reader' }\nExtras: `sendNotificationEmail` (bool), `emailMessage` (string), `supportsAllDrives` (bool).\nShortcut: pass a plain string and it's treated as `{type:'user', role:'reader', emailAddress:<string>}`.",
dataType: "object",
formInputType: "json",
required: true,
allowExpression: true,
language: "json",
rows: 5,
placeholder: '{\n "type": "user",\n "role": "writer",\n "emailAddress": "ada@example.com"\n}',
},
],
returnType: "object",
returnDescription: "{ id, type, role, emailAddress?, domain?, … }",
errors: commonErrors,
example: 'google-drive.share "my_drive_sa" "1AbC..." {type:"user",role:"writer",emailAddress:"ada@example.com"}',
},
listPermissions: {
title: "List permissions",
summary: "List everyone the file is shared with",
description: "Calls `GET /files/{fileId}/permissions`. Useful before revoking access.",
group: "permissions",
action: "query",
icon: "users",
capability: "manage_options",
sideEffects: ["makes_http_call"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "permissions", "list"],
parameters: [
credentialParam,
fileIdParam,
{
name: "options",
title: "Options",
description: "Recognized keys:\n fields : comma-separated field mask (default: permissions(id,type,role,emailAddress,domain,displayName))\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 3,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ permissions: [{id, type, role, emailAddress?, …}] }",
errors: commonErrors,
example: 'google-drive.listPermissions "my_drive_sa" "1AbC..."',
},
deletePermission: {
title: "Delete permission",
summary: "Revoke a share",
description: "Calls `DELETE /files/{fileId}/permissions/{permissionId}`. Get `permissionId` from `listPermissions` or `share` response.",
group: "permissions",
action: "delete",
icon: "user-x",
capability: "manage_options",
sideEffects: ["makes_http_call", "writes_remote", "destructive"],
idempotent: true,
since: "1.0.0",
tags: ["drive", "permissions", "revoke"],
parameters: [
credentialParam,
fileIdParam,
{
name: "permissionId",
title: "Permission ID",
description: "The permission's `id`, obtained from `listPermissions` or the response of `share`.",
dataType: "string",
formInputType: "text",
required: true,
allowExpression: true,
placeholder: "01234567890123456789",
},
{
name: "options",
title: "Options",
description: "Recognized keys:\n supportsAllDrives : bool",
dataType: "object",
formInputType: "json",
required: false,
allowExpression: true,
language: "json",
rows: 2,
advanced: true,
},
],
returnType: "object",
returnDescription: "{ deleted: true, fileId, permissionId }",
errors: commonErrors,
example: 'google-drive.deletePermission "my_drive_sa" "1AbC..." "01234567890"',
},
};
// ── Exports: module metadata ───────────────────────────────────────────
export const GoogleDriveModuleMetadata = {
slug: "google-drive",
title: "Google Drive",
summary: "Upload, download, search, share, copy, and move files in Google Drive — service-account auth (no user OAuth needed)",
description: "Programmatic access to Google Drive. Back up generated reports into a folder, archive email attachments, sync exports, share files with teammates, build a Drive-backed CMS.\n\nAuthentication uses a service account — create one at console.cloud.google.com (enable the Drive API on the project), download the JSON key, and paste `client_email` + `private_key` into a `google_service_account` credential.\n\n**Sharing model**: service accounts are standalone identities — they do **not** inherit a user's Drive. Before touching a file or folder, share it with the service account's email (Editor to upload/modify, Viewer to read). For organization-wide access, configure domain-wide delegation in Google Workspace admin.",
category: "productivity",
icon: "icon.svg",
color: "#1FA463",
version: "0.2.0",
docsUrl: "https://docs.robinpath.com/modules/google-drive",
status: "stable",
requires: [],
minNodeVersion: "18.0.0",
credentialsType: CREDENTIAL_TYPE,
operationGroups: {
files: {
title: "Files",
description: "Upload, download, update, copy, move, delete.",
order: 1,
},
folders: {
title: "Folders",
description: "Create and manage folder hierarchy.",
order: 2,
},
discovery: {
title: "Discovery",
description: "List, search, and inspect file metadata.",
order: 3,
},
permissions: {
title: "Permissions",
description: "Share files and manage access.",
order: 4,
},
},
methods: Object.keys(GoogleDriveFunctions),
};
//# sourceMappingURL=google-drive.js.map
{"version":3,"file":"google-drive.js","sourceRoot":"","sources":["../src/google-drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,2EAA2E;AAE3E,MAAM,KAAK,GAA0B,EAAE,CAAC;AAExC,SAAS,IAAI;IACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,iIAAiI,CAClI,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,CAAa;IAChD,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACjB,CAAC;AAED,0EAA0E;AAE1E,MAAM,SAAS,GAAG,qCAAqC,CAAC;AACxD,MAAM,SAAS,GAAG,sCAAsC,CAAC;AACzD,MAAM,UAAU,GAAG,6CAA6C,CAAC;AACjE,MAAM,aAAa,GAAG,uCAAuC,CAAC;AAC9D,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,iDAAiD;AACnF,MAAM,WAAW,GAAG,oCAAoC,CAAC;AACzD,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,cAAc,GAClB,4FAA4F,CAAC;AAC/F,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAWjD,SAAS,WAAW,CAClB,KAAa,EACb,IAAY,EACZ,QAAiC,EAAE;IAEnC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB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AS;YAChB,WAAW,EAAE,qCAAqC;YAClD,KAAK,EAAE,CAAC;SACT;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0CAA0C;YACvD,KAAK,EAAE,CAAC;SACT;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,gCAAgC;YAC7C,KAAK,EAAE,CAAC;SACT;KACF;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;CAC3C,CAAC"}
import type { ModuleAdapter } from "@robinpath/core";
declare const GoogleDriveModule: ModuleAdapter;
export default GoogleDriveModule;
export { GoogleDriveModule };
export { GoogleDriveFunctions, GoogleDriveFunctionMetadata, GoogleDriveModuleMetadata, GoogleDriveCredentialTypes, configureGoogleDrive, } from "./google-drive.js";
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,QAAA,MAAM,iBAAiB,EAAE,aAQxB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}
import { GoogleDriveFunctions, GoogleDriveFunctionMetadata, GoogleDriveModuleMetadata, GoogleDriveCredentialTypes, configureGoogleDrive, } from "./google-drive.js";
const GoogleDriveModule = {
name: "google-drive",
functions: GoogleDriveFunctions,
functionMetadata: GoogleDriveFunctionMetadata,
moduleMetadata: GoogleDriveModuleMetadata,
credentialTypes: GoogleDriveCredentialTypes,
configure: configureGoogleDrive,
global: false,
};
export default GoogleDriveModule;
export { GoogleDriveModule };
export { GoogleDriveFunctions, GoogleDriveFunctionMetadata, GoogleDriveModuleMetadata, GoogleDriveCredentialTypes, configureGoogleDrive, } from "./google-drive.js";
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,iBAAiB,GAAkB;IACvC,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,oBAAoB;IAC/B,gBAAgB,EAAE,2BAA2B;IAC7C,cAAc,EAAE,yBAAyB;IACzC,eAAe,EAAE,0BAA0B;IAC3C,SAAS,EAAE,oBAAoB;IAC/B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}
+22
-8
{
"name": "@robinpath/google-drive",
"version": "0.1.1",
"version": "0.3.0",
"publishConfig": {

@@ -23,12 +23,20 @@ "access": "public"

"peerDependencies": {
"@robinpath/core": ">=0.20.0"
"@robinpath/core": ">=0.40.0"
},
"devDependencies": {
"@robinpath/core": "^0.30.1",
"@robinpath/core": "^0.40.0",
"typescript": "^5.6.0"
},
"description": "Google Drive module for RobinPath.",
"description": "Google Drive integration — upload, download, search, copy, move, share, and manage permissions on files and folders. Service-account authentication using a JWT exchange (no user OAuth dance).",
"keywords": [
"googledrive",
"cloud storage"
"cloud storage",
"google",
"drive",
"google-drive",
"storage",
"files",
"service-account",
"upload",
"download"
],

@@ -38,7 +46,13 @@ "license": "MIT",

"category": "cloud-storage",
"type": "integration",
"auth": "api-key",
"type": "module",
"auth": "credential-vault",
"functionCount": 10,
"baseUrl": "https://www.googleapis.com"
"baseUrl": "https://www.googleapis.com",
"language": "nodejs",
"platforms": [
"cloud",
"cli",
"desktop"
]
}
}

@@ -22,3 +22,3 @@ # @robinpath/google-drive

```bash
npm install @robinpath/google-drive
robinpath add @robinpath/google-drive
```

@@ -25,0 +25,0 @@