adminforth 1.21.0-next.15 → 1.21.0-next.17

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.
@@ -141,36 +141,48 @@ export interface OAuth2Adapter {
141
141
 
142
142
  export interface StorageAdapter {
143
143
  /**
144
- * This method should return the presigned URL for the given key capable of upload.
144
+ * This method should return the presigned URL for the given key capable of upload (PUT multipart form data to it).
145
145
  * The PUT method should fail if the file already exists.
146
146
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
147
147
  * @param expiresIn - The expiration time in seconds for the presigned URL
148
+ * @param contentType - The content type of the file to be uploaded
149
+ *
150
+ * @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
148
151
  */
149
- getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
152
+ getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<{
153
+ uploadUrl: string;
154
+ uploadExtraParams?: Record<string, string>;
155
+ }>;
150
156
 
151
157
  /**
152
- * This method should return the presigned URL for the given key capable of download
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).
159
+ * If adapter configured to use public storage, this method should return the public URL of the file.
160
+ * If adapter configured to use private storage, this method should return the presigned URL for the file.
161
+ *
153
162
  * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
154
163
  * @param expiresIn - The expiration time in seconds for the presigned URL
155
164
  */
156
- getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
165
+ getDownloadUrl(key: string, expiresIn?: number): Promise<string>;
157
166
 
158
167
  /**
159
168
  * This method should mark the file for deletion.
169
+ * If file is marked for delation and exists more then 24h (since creation date) it should be deleted.
170
+ * This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
160
171
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
161
172
  */
162
173
  markKeyForDeletation(key: string): Promise<string>;
163
174
 
164
175
 
165
176
  /**
166
- * This method should return the list of files in the storage.
167
- * @param key
177
+ * This method should mark the file to not be deleted.
178
+ * This method should be used to cancel the deletion of the file if it was marked for deletion.
179
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
168
180
  */
169
181
  markKeyForNotDeletation(key: string): Promise<string>;
170
182
 
171
183
 
172
184
  /**
173
- * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
185
+ * This method can start needed schedullers, cron jobs, etc. to clean up the storage.
174
186
  */
175
187
  setupLifecycle(): Promise<void>;
176
188
 
@@ -105,30 +105,42 @@ export interface OAuth2Adapter {
105
105
  }
106
106
  export interface StorageAdapter {
107
107
  /**
108
- * This method should return the presigned URL for the given key capable of upload.
108
+ * This method should return the presigned URL for the given key capable of upload (PUT multipart form data to it).
109
109
  * The PUT method should fail if the file already exists.
110
110
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
111
111
  * @param expiresIn - The expiration time in seconds for the presigned URL
112
+ * @param contentType - The content type of the file to be uploaded
113
+ *
114
+ * @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
112
115
  */
113
- getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
116
+ getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<{
117
+ uploadUrl: string;
118
+ uploadExtraParams?: Record<string, string>;
119
+ }>;
114
120
  /**
115
- * This method should return the presigned URL for the given key capable of download
121
+ * This method should return the URL for the given key capable of download (200 GET request with response or 200 HEAD request without response).
122
+ * If adapter configured to use public storage, this method should return the public URL of the file.
123
+ * If adapter configured to use private storage, this method should return the presigned URL for the file.
124
+ *
116
125
  * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
117
126
  * @param expiresIn - The expiration time in seconds for the presigned URL
118
127
  */
119
- getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
128
+ getDownloadUrl(key: string, expiresIn?: number): Promise<string>;
120
129
  /**
121
130
  * This method should mark the file for deletion.
131
+ * If file is marked for delation and exists more then 24h (since creation date) it should be deleted.
132
+ * This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
122
133
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
123
134
  */
124
135
  markKeyForDeletation(key: string): Promise<string>;
125
136
  /**
126
- * This method should return the list of files in the storage.
127
- * @param key
137
+ * This method should mark the file to not be deleted.
138
+ * This method should be used to cancel the deletion of the file if it was marked for deletion.
139
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
128
140
  */
129
141
  markKeyForNotDeletation(key: string): Promise<string>;
130
142
  /**
131
- * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
143
+ * This method can start needed schedullers, cron jobs, etc. to clean up the storage.
132
144
  */
133
145
  setupLifecycle(): Promise<void>;
134
146
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Adapters.d.ts","sourceRoot":"","sources":["../../types/Adapters.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAE3B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;;;;OAOG;IACH,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,OAAO,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,iBAAiB;IAEhC;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;IAEjB;;;;;;OAMG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QACT,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,sBAAsB;IAErC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MAAM,CAAC,CAAC;IAGtD;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAEjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.21.0-next.15",
3
+ "version": "1.21.0-next.17",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",