Skip to content

Commit 7fb5238

Browse files
committed
docs: imporove storage adapter interface comments
1 parent 4a91c0e commit 7fb5238

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

adminforth/types/Adapters.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,14 @@ export interface OAuth2Adapter {
141141

142142
export interface StorageAdapter {
143143
/**
144-
* This method should return the presigned URL for the given key capable of upload (PUT multipart form data to it).
144+
* This method should return the presigned URL for the given key capable of upload (adapter user will call PUT multipart form data to this URL within expiresIn seconds after link generation).
145+
* By default file which will be uploaded on PUT should be marked for deletion. So if during 24h it is not marked for not deletion, it adapter should delete it forever.
145146
* The PUT method should fail if the file already exists.
147+
*
148+
* Adapter user will always pass next parameters to the method:
146149
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
147150
* @param expiresIn - The expiration time in seconds for the presigned URL
148-
* @param contentType - The content type of the file to be uploaded
151+
* @param contentType - The content type of the file to be uploaded, e.g. "image/png"
149152
*
150153
* @returns A promise that resolves to an object containing the upload URL and any extra parameters which should be sent with PUT multipart form data
151154
*/
@@ -155,7 +158,7 @@ export interface StorageAdapter {
155158
}>;
156159

157160
/**
158-
* This method should return the URL for the given key capable of download (200 GET request with response or 200 HEAD request without response).
161+
* This method should return the URL for the given key capable of download (200 GET request with response body or 200 HEAD request without response body).
159162
* If adapter configured to use public storage, this method should return the public URL of the file.
160163
* If adapter configured to use private storage, this method should return the presigned URL for the file.
161164
*

0 commit comments

Comments
 (0)