From 3bdca0b90cf8bf5dfd6ff1ab482d857abb4acd2d Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Thu, 5 Jun 2025 22:30:51 +0800 Subject: feat(deno): move deno (mail-server) to top level. --- deno/mail-relay/aws/context.ts | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 deno/mail-relay/aws/context.ts (limited to 'deno/mail-relay/aws/context.ts') diff --git a/deno/mail-relay/aws/context.ts b/deno/mail-relay/aws/context.ts deleted file mode 100644 index b1e0336..0000000 --- a/deno/mail-relay/aws/context.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - CopyObjectCommand, - DeleteObjectCommand, - S3Client, -} from "@aws-sdk/client-s3"; -import { FetchHttpHandler } from "@smithy/fetch-http-handler"; - -import config from "../config.ts"; - -export class AwsContext { - readonly credentials = () => - Promise.resolve({ - accessKeyId: config.get("awsUser"), - secretAccessKey: config.get("awsPassword"), - }); - readonly requestHandler = new FetchHttpHandler(); - - get region() { - return config.get("awsRegion"); - } -} - -export async function s3MoveObject( - client: S3Client, - bucket: string, - path: string, - newPath: string, -): Promise { - const copyCommand = new CopyObjectCommand({ - Bucket: bucket, - Key: newPath, - CopySource: `${bucket}/${path}`, - }); - await client.send(copyCommand); - - const deleteCommand = new DeleteObjectCommand({ - Bucket: bucket, - Key: path, - }); - await client.send(deleteCommand); -} -- cgit v1.2.3