import { TusUploadMetadata } from "../../../types/index.mjs"; import { S3 } from "@aws-sdk/client-s3"; import { Upload } from "@tus/utils"; //#region src/tus/stores/s3/metadataManager.d.ts type GenerateInfoKeyArgs = { id: string; }; type GeneratePartKeyArgs = { id: string; prefix?: string; isIncomplete?: boolean; }; type GetMetadataArgs = { id: string; }; type SaveMetadataArgs = { upload: Upload; uploadId: string; }; type CompleteMetadataArgs = { upload: Upload; }; declare class S3MetadataManager { private client; private bucket; private shouldUseExpirationTags; private generateCompleteTag; constructor(client: S3, bucket: string, shouldUseExpirationTags: () => boolean, generateCompleteTag: (value: 'false' | 'true') => string | undefined); /** * Generates the S3 key for metadata info files * @param args - The function arguments * @param args.id - The file ID * @returns The S3 key for the metadata file */ generateInfoKey(args: GenerateInfoKeyArgs): string; /** * Generates the S3 key for part files * @param args - The function arguments * @param args.id - The file ID * @param args.prefix - Path prefix for nested media items * @param args.isIncomplete - Whether this is an incomplete part * @returns The S3 key for the part file */ generatePartKey(args: GeneratePartKeyArgs): string; /** * Retrieves upload metadata previously saved in `${file_id}.info`. * Always fetches fresh data from S3 to ensure correctness. * @param args - The function arguments * @param args.id - The file ID to retrieve metadata for * @returns Promise that resolves to the upload metadata */ getMetadata(args: GetMetadataArgs): Promise; /** * Saves upload metadata to a `${file_id}.info` file on S3. * The upload-id is stored in the S3 object metadata. * @param args - The function arguments * @param args.upload - The upload object containing metadata * @param args.uploadId - The upload ID for the multipart upload * @returns Promise that resolves when metadata is saved */ saveMetadata(args: SaveMetadataArgs): Promise; /** * Completes metadata by updating it with completion tags * @param args - The function arguments * @param args.upload - The completed upload object * @returns Promise that resolves when metadata is updated */ completeMetadata(args: CompleteMetadataArgs): Promise; } //#endregion export { S3MetadataManager }; //# sourceMappingURL=metadataManager.d.mts.map