Compare commits

..

2 Commits

Author SHA1 Message Date
jan
0bdb6f553b TypeScript baseUrl Deprecation beheben
All checks were successful
CI / Build and Deploy (push) Successful in 2m20s
2026-05-06 10:54:48 +02:00
jan
f525279f2b Shared Drive Uploads unterstuetzen 2026-05-06 10:43:49 +02:00
2 changed files with 8 additions and 7 deletions

View File

@@ -224,7 +224,8 @@ export async function uploadExpenseProofToDrive(input: {
mimeType: input.mimeType,
body: Readable.from(input.buffer)
},
fields: "id, webViewLink"
fields: "id, name, webViewLink, webContentLink",
supportsAllDrives: true
}).catch((error: unknown) => {
throw mapDriveError(error, "DRIVE_UPLOAD_FAILED", "Google Drive konnte den Rechnungsbeleg nicht hochladen.", [
`Zielordner: ${config.folderId}`,
@@ -243,7 +244,8 @@ export async function uploadExpenseProofToDrive(input: {
requestBody: {
type: "anyone",
role: "reader"
}
},
supportsAllDrives: true
}).catch((error: unknown) => {
throw mapDriveError(error, "DRIVE_PERMISSION_FAILED", "Google Drive konnte den Freigabe-Link nicht erstellen.", [
`Die Datei wurde vermutlich bereits erstellt. Drive-Datei-ID: ${response.data.id}`
@@ -273,7 +275,8 @@ export async function runDriveDiagnostics() {
mimeType: "text/plain",
body: Readable.from(Buffer.from("RFP Finanzen Drive API Test\n", "utf8"))
},
fields: "id, webViewLink"
fields: "id, name, webViewLink, webContentLink",
supportsAllDrives: true
});
createdFileId = response.data.id ?? null;
@@ -282,7 +285,7 @@ export async function runDriveDiagnostics() {
throw new DriveIntegrationError("Google Drive hat für die Testdatei keine Datei-ID zurückgegeben.", "DRIVE_FILE_ID_MISSING");
}
await drive.files.delete({ fileId: createdFileId });
await drive.files.delete({ fileId: createdFileId, supportsAllDrives: true });
return {
ok: true,
@@ -296,7 +299,7 @@ export async function runDriveDiagnostics() {
};
} catch (error) {
if (createdFileId) {
await drive.files.delete({ fileId: createdFileId }).catch((cleanupError: unknown) => {
await drive.files.delete({ fileId: createdFileId, supportsAllDrives: true }).catch((cleanupError: unknown) => {
throw new DriveIntegrationError(
"Drive-Test ist fehlgeschlagen und die temporäre Testdatei konnte nicht gelöscht werden.",
"DRIVE_DIAGNOSTIC_CLEANUP_FAILED",

View File

@@ -13,7 +13,6 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"plugins": [
{
"name": "next"
@@ -26,4 +25,3 @@
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}