Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import type { EnvRecord } from "@hivegrid/config";
|
||||
import { createS3StorageAdapter } from "@hivegrid/storage";
|
||||
import type { HandlerDependencies } from "./handlers.js";
|
||||
import { createS3StorageAdapter, type StorageAdapter } from "@hivegrid/storage";
|
||||
|
||||
type StorageEnv = EnvRecord & {
|
||||
STORAGE_ACCESS_KEY_ID?: string;
|
||||
@@ -11,21 +10,20 @@ type StorageEnv = EnvRecord & {
|
||||
STORAGE_REGION?: string;
|
||||
STORAGE_SECRET_ACCESS_KEY?: string;
|
||||
STORAGE_SESSION_TOKEN?: string;
|
||||
GDPR_EXPORT_SSE_C_KEY_BASE64?: string;
|
||||
};
|
||||
|
||||
export const requiredWorkerStorageEnv = [
|
||||
"STORAGE_ENDPOINT",
|
||||
"STORAGE_REGION",
|
||||
"STORAGE_BUCKET",
|
||||
"STORAGE_ACCESS_KEY_ID",
|
||||
"STORAGE_SECRET_ACCESS_KEY",
|
||||
] as const;
|
||||
export const requiredWorkerStorageEnv = ["STORAGE_ENDPOINT", "STORAGE_REGION", "STORAGE_BUCKET", "STORAGE_ACCESS_KEY_ID", "STORAGE_SECRET_ACCESS_KEY"] as const;
|
||||
|
||||
export function getMissingWorkerStorageEnv(env: StorageEnv): string[] {
|
||||
return requiredWorkerStorageEnv.filter((name) => !env[name]?.trim());
|
||||
}
|
||||
|
||||
export function createWorkerStorageDeleteService(env: StorageEnv): NonNullable<HandlerDependencies["storageDeleteService"]> {
|
||||
export function getMissingWorkerGdprExportStorageEnv(env: StorageEnv): string[] {
|
||||
return [...getMissingWorkerStorageEnv(env), ...(!env.GDPR_EXPORT_SSE_C_KEY_BASE64?.trim() ? ["GDPR_EXPORT_SSE_C_KEY_BASE64"] : [])];
|
||||
}
|
||||
|
||||
export function createWorkerStorageDeleteService(env: StorageEnv): StorageAdapter {
|
||||
const missing = getMissingWorkerStorageEnv(env);
|
||||
if (missing.length > 0) {
|
||||
throw new Error(`Export retention storage delete is missing required env: ${missing.join(", ")}`);
|
||||
|
||||
Reference in new issue
Block a user