adminforth 1.21.0-next.16 → 1.21.0-next.18
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,18 +141,26 @@ 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 (PUT multipart form data to
|
|
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.
|
|
145
146
|
* The PUT method should fail if the file already exists.
|
|
147
|
+
*
|
|
148
|
+
* Adapter user will always pass next parameters to the method:
|
|
146
149
|
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
|
|
147
150
|
* @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"
|
|
152
|
+
*
|
|
153
|
+
* @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
|
|
149
154
|
*/
|
|
150
|
-
getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<
|
|
155
|
+
getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<{
|
|
156
|
+
uploadUrl: string;
|
|
157
|
+
uploadExtraParams?: Record<string, string>;
|
|
158
|
+
}>;
|
|
151
159
|
|
|
152
160
|
/**
|
|
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
|
|
155
|
-
* If adapter configured to
|
|
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).
|
|
162
|
+
* If adapter configured to store objects publically, this method should return the public URL of the file.
|
|
163
|
+
* If adapter configured to no allow public storing of images, this method should return the presigned URL for the file.
|
|
156
164
|
*
|
|
157
165
|
* @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
|
|
158
166
|
* @param expiresIn - The expiration time in seconds for the presigned URL
|
|
@@ -181,6 +189,10 @@ export interface StorageAdapter {
|
|
|
181
189
|
*/
|
|
182
190
|
setupLifecycle(): Promise<void>;
|
|
183
191
|
|
|
192
|
+
/**
|
|
193
|
+
* If adapter is configured to publically, this method should return true.
|
|
194
|
+
*/
|
|
195
|
+
objectCanBeAccesedPublicly(key: string): Promise<boolean>;
|
|
184
196
|
}
|
|
185
197
|
|
|
186
198
|
|
package/dist/types/Adapters.d.ts
CHANGED
|
@@ -105,17 +105,25 @@ 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 (PUT multipart form data to
|
|
108
|
+
* 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).
|
|
109
|
+
* 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.
|
|
109
110
|
* The PUT method should fail if the file already exists.
|
|
111
|
+
*
|
|
112
|
+
* Adapter user will always pass next parameters to the method:
|
|
110
113
|
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
|
|
111
114
|
* @param expiresIn - The expiration time in seconds for the presigned URL
|
|
112
|
-
* @param contentType - The content type of the file to be uploaded
|
|
115
|
+
* @param contentType - The content type of the file to be uploaded, e.g. "image/png"
|
|
116
|
+
*
|
|
117
|
+
* @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
|
|
113
118
|
*/
|
|
114
|
-
getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<
|
|
119
|
+
getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<{
|
|
120
|
+
uploadUrl: string;
|
|
121
|
+
uploadExtraParams?: Record<string, string>;
|
|
122
|
+
}>;
|
|
115
123
|
/**
|
|
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
|
|
118
|
-
* If adapter configured to
|
|
124
|
+
* 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).
|
|
125
|
+
* If adapter configured to store objects publically, this method should return the public URL of the file.
|
|
126
|
+
* If adapter configured to no allow public storing of images, this method should return the presigned URL for the file.
|
|
119
127
|
*
|
|
120
128
|
* @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
|
|
121
129
|
* @param expiresIn - The expiration time in seconds for the presigned URL
|
|
@@ -138,5 +146,9 @@ export interface StorageAdapter {
|
|
|
138
146
|
* This method can start needed schedullers, cron jobs, etc. to clean up the storage.
|
|
139
147
|
*/
|
|
140
148
|
setupLifecycle(): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* If adapter is configured to publically, this method should return true.
|
|
151
|
+
*/
|
|
152
|
+
objectCanBeAccesedPublicly(key: string): Promise<boolean>;
|
|
141
153
|
}
|
|
142
154
|
//# sourceMappingURL=Adapters.d.ts.map
|
|
@@ -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,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
"name": "adminforth",
|
|
3
|
-
"version": "1.21.0-next.
|
|
3
|
+
"version": "1.21.0-next.18",
|
|
4
4
|
"description": "OpenSource Vue3 powered forth-generation admin panel",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,9 +20,7 @@
|
|
|
20
20
|
"rollout-doc": "cd documentation && npm run build && npm run deploy",
|
|
21
21
|
"docs": "typedoc",
|
|
22
22
|
"--comment_postinstall": "postinstall executed after package installed in other project package and when we do npm ci in the package",
|
|
23
|
-
"postinstall": "if test -d ./dist/spa/; then cd ./dist/spa/ && npm ci && echo 'installed spa dependencies'; fi"
|
|
24
|
-
"install-plugins": "cd ../plugins && bash install-plugins.sh",
|
|
25
|
-
"install-adapters": "cd ../adapters && bash install-adapters.sh"
|
|
23
|
+
"postinstall": "if test -d ./dist/spa/; then cd ./dist/spa/ && npm ci && echo 'installed spa dependencies'; fi"
|
|
26
24
|
},
|
|
27
25
|
"release": {
|
|
28
26
|
"plugins": [
|