Skip to content

Commit 9c5f591

Browse files
committed
improve comments in adapter
1 parent 104ccca commit 9c5f591

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

adminforth/types/Adapters.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export interface StorageAdapter {
145145
* The PUT method should fail if the file already exists.
146146
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
147147
* @param expiresIn - The expiration time in seconds for the presigned URL
148+
* @param contentType - The content type of the file to be uploaded
148149
*/
149150
getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
150151

@@ -157,20 +158,23 @@ export interface StorageAdapter {
157158

158159
/**
159160
* This method should mark the file for deletion.
161+
* If file is marked for delation and exists more then 24h (since creation date) it should be deleted.
162+
* This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
160163
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
161164
*/
162165
markKeyForDeletation(key: string): Promise<string>;
163166

164167

165168
/**
166-
* This method should return the list of files in the storage.
167-
* @param key
169+
* This method should mark the file to not be deleted.
170+
* This method should be used to cancel the deletion of the file if it was marked for deletion.
171+
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
168172
*/
169173
markKeyForNotDeletation(key: string): Promise<string>;
170174

171175

172176
/**
173-
* THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
177+
* This method can start needed schedullers, cron jobs, etc. to clean up the storage.
174178
*/
175179
setupLifecycle(): Promise<void>;
176180

0 commit comments

Comments
 (0)