adminforth 1.21.0-next.15 → 1.21.0-next.16

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,43 @@ 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
148
149
  */
149
150
  getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
150
151
 
151
152
  /**
152
- * This method should return the presigned URL for the given key capable of download
153
+ * This method should return the URL for the given key capable of download (200 GET request with response or 200 HEAD request without response).
154
+ * If adapter configured to use public storage, this method should return the public URL of the file.
155
+ * If adapter configured to use private storage, this method should return the presigned URL for the file.
156
+ *
153
157
  * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
154
158
  * @param expiresIn - The expiration time in seconds for the presigned URL
155
159
  */
156
- getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
160
+ getDownloadUrl(key: string, expiresIn?: number): Promise<string>;
157
161
 
158
162
  /**
159
163
  * This method should mark the file for deletion.
164
+ * If file is marked for delation and exists more then 24h (since creation date) it should be deleted.
165
+ * This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
160
166
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
161
167
  */
162
168
  markKeyForDeletation(key: string): Promise<string>;
163
169
 
164
170
 
165
171
  /**
166
- * This method should return the list of files in the storage.
167
- * @param key
172
+ * This method should mark the file to not be deleted.
173
+ * This method should be used to cancel the deletion of the file if it was marked for deletion.
174
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
168
175
  */
169
176
  markKeyForNotDeletation(key: string): Promise<string>;
170
177
 
171
178
 
172
179
  /**
173
- * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
180
+ * This method can start needed schedullers, cron jobs, etc. to clean up the storage.
174
181
  */
175
182
  setupLifecycle(): Promise<void>;
176
183
 
@@ -105,30 +105,37 @@ 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
112
113
  */
113
114
  getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
114
115
  /**
115
- * This method should return the presigned URL for the given key capable of download
116
+ * This method should return the URL for the given key capable of download (200 GET request with response or 200 HEAD request without response).
117
+ * If adapter configured to use public storage, this method should return the public URL of the file.
118
+ * If adapter configured to use private storage, this method should return the presigned URL for the file.
119
+ *
116
120
  * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
117
121
  * @param expiresIn - The expiration time in seconds for the presigned URL
118
122
  */
119
- getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
123
+ getDownloadUrl(key: string, expiresIn?: number): Promise<string>;
120
124
  /**
121
125
  * This method should mark the file for deletion.
126
+ * If file is marked for delation and exists more then 24h (since creation date) it should be deleted.
127
+ * This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
122
128
  * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
123
129
  */
124
130
  markKeyForDeletation(key: string): Promise<string>;
125
131
  /**
126
- * This method should return the list of files in the storage.
127
- * @param key
132
+ * This method should mark the file to not be deleted.
133
+ * This method should be used to cancel the deletion of the file if it was marked for deletion.
134
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
128
135
  */
129
136
  markKeyForNotDeletation(key: string): Promise<string>;
130
137
  /**
131
- * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
138
+ * This method can start needed schedullers, cron jobs, etc. to clean up the storage.
132
139
  */
133
140
  setupLifecycle(): Promise<void>;
134
141
  }
@@ -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;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;IAEjB;;OAEG;IACH,6BAA6B,IAAI,MAAM,CAAC;IAExC;;OAEG;IACH,yBAAyB,IAAI,MAAM,EAAE,CAAC;IAEtC;;OAEG;IACH,2BAA2B,IAAI,MAAM,EAAE,CAAC;IAExC;;;;;;;OAOG;IACH,QAAQ,CAAC,EACP,MAAM,EACN,UAAU,EACV,CAAC,EACD,IAAI,GACL,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MA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WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,IAAI,MAAM,CAAC;IAErB;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjF;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,IAAI,MAAM,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,IAAI,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1F;;;;;;;OAOG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjE;;;;;OAKG;IACH,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD;;;;OAIG;IACH,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,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.16",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",