@ccci/micro-server 1.0.202 → 1.0.204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -303604,13 +303604,15 @@ class UploaderS3 {
303604
303604
  throw error;
303605
303605
  }
303606
303606
  }
303607
- static async deleteFile(bucketName, key) {
303607
+ static async deleteFile(request2) {
303608
303608
  try {
303609
- const headCommand = new import_client_s3.HeadObjectCommand({ Bucket: bucketName, Key: key });
303609
+ const headCommand = new import_client_s3.HeadObjectCommand({ Bucket: request2.Bucket, Key: request2.Key });
303610
303610
  const { VersionId } = await UploaderS3.client.send(headCommand);
303611
- const data = await UploaderS3.client.send(new import_client_s3.DeleteObjectCommand({ Bucket: bucketName, Key: key, VersionId }));
303612
- Logger.info(`deleted key : ${key} `);
303613
- Logger.info(`data : ${JSON.stringify(data)} `);
303611
+ const payload = request2;
303612
+ payload.VersionId = VersionId;
303613
+ const data = await UploaderS3.client.send(new import_client_s3.DeleteObjectCommand(payload));
303614
+ Logger.info(`deleted key : ${request2.Key} `);
303615
+ Logger.info(`data : ${JSON.stringify(data.$metadata)}`);
303614
303616
  } catch (error) {
303615
303617
  Logger.error(error);
303616
303618
  throw error;
@@ -7,5 +7,17 @@ export type AttachmentMetadataType = {
7
7
  Thumbnail?: string;
8
8
  isHls?: boolean;
9
9
  };
10
+ export type DeleteObjectRequest = {
11
+ Bucket: string;
12
+ Key: string;
13
+ MFA?: string;
14
+ VersionId?: string;
15
+ RequestPayer?: 'requester';
16
+ BypassGovernanceRetention?: boolean;
17
+ ExpectedBucketOwner?: string;
18
+ IfMatch?: string;
19
+ IfMatchLastModifiedTime?: Date;
20
+ IfMatchSize?: number;
21
+ };
10
22
  export declare const mimeTypes: Record<string, string>;
11
23
  //# sourceMappingURL=AttachmentMetadataTypes.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { ApplicationOptionType } from "@/types/ApplicationOptionType";
3
- import { S3 } from "@aws-sdk/client-s3";
3
+ import { S3, DeleteObjectRequest } from "@aws-sdk/client-s3";
4
4
  import { AttachmentMetadataType } from "@/types/AttachmentMetadataTypes";
5
5
  export default class UploaderS3 {
6
6
  static client: S3;
@@ -63,6 +63,6 @@ export default class UploaderS3 {
63
63
  * @param bucketName S3 bucket name
64
64
  */
65
65
  static deleteIncompleteUploads(bucketName: string): Promise<void>;
66
- static deleteFile(bucketName: string, key: string): Promise<void>;
66
+ static deleteFile(request: DeleteObjectRequest): Promise<void>;
67
67
  }
68
68
  //# sourceMappingURL=uploader-s3.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.202",
3
+ "version": "1.0.204",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",