This commit is contained in:
Matt Kane
2026-04-01 11:51:57 +01:00
parent c8e318da5c
commit ca3c2b77e1
88 changed files with 313 additions and 481 deletions

View File

@@ -10,8 +10,8 @@
* Do not import at config time.
*/
import { createRemoteJWKSet, jwtVerify, type JWTPayload } from "jose";
import type { AuthResult } from "emdash";
import { createRemoteJWKSet, jwtVerify, type JWTPayload } from "jose";
/**
* Configuration for Cloudflare Access authentication

View File

@@ -22,8 +22,8 @@
import type { MiddlewareHandler } from "astro";
import { env } from "cloudflare:workers";
import { Kysely } from "kysely";
import { runWithContext } from "emdash/request-context";
import { Kysely } from "kysely";
import { ulid } from "ulidx";
import type { EmDashPreviewDB } from "./do-class.js";

View File

@@ -61,11 +61,7 @@ export class R2Storage implements Storage {
};
} catch (error) {
if (error instanceof EmDashStorageError) throw error;
throw new EmDashStorageError(
`Failed to upload file: ${options.key}`,
"UPLOAD_FAILED",
error,
);
throw new EmDashStorageError(`Failed to upload file: ${options.key}`, "UPLOAD_FAILED", error);
}
}
@@ -107,11 +103,7 @@ export class R2Storage implements Storage {
const object = await this.bucket.head(key);
return object !== null;
} catch (error) {
throw new EmDashStorageError(
`Failed to check file existence: ${key}`,
"HEAD_FAILED",
error,
);
throw new EmDashStorageError(`Failed to check file existence: ${key}`, "HEAD_FAILED", error);
}
}