@supabase/storage-js 2.1.0-next.3 → 2.1.0
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.
- package/README.md +2 -2
- package/dist/main/lib/types.d.ts +12 -0
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/packages/StorageFileApi.d.ts +4 -4
- package/dist/main/packages/StorageFileApi.js +4 -4
- package/dist/module/lib/types.d.ts +12 -0
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/packages/StorageFileApi.d.ts +4 -4
- package/dist/module/packages/StorageFileApi.js +4 -4
- package/package.json +1 -1
- package/src/lib/types.ts +12 -0
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageFileApi.ts +4 -4
package/README.md
CHANGED
|
@@ -15,12 +15,12 @@ npm install @supabase/storage-js
|
|
|
15
15
|
### Connecting to the storage backend
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
|
-
import {
|
|
18
|
+
import { StorageClient } from '@supabase/storage-js'
|
|
19
19
|
|
|
20
20
|
const STORAGE_URL = 'https://<project_ref>.supabase.co/storage/v1'
|
|
21
21
|
const SERVICE_KEY = '<service_role>' //! service key, not anon key
|
|
22
22
|
|
|
23
|
-
const storageClient = new
|
|
23
|
+
const storageClient = new StorageClient(STORAGE_URL, {
|
|
24
24
|
apikey: SERVICE_KEY,
|
|
25
25
|
Authorization: `Bearer ${SERVICE_KEY}`,
|
|
26
26
|
})
|
package/dist/main/lib/types.d.ts
CHANGED
|
@@ -63,8 +63,20 @@ export interface Metadata {
|
|
|
63
63
|
name: string;
|
|
64
64
|
}
|
|
65
65
|
export interface TransformOptions {
|
|
66
|
+
/**
|
|
67
|
+
* The width of the image in pixels.
|
|
68
|
+
*/
|
|
66
69
|
width?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The height of the image in pixels.
|
|
72
|
+
*/
|
|
67
73
|
height?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The resize mode can be cover, contain or fill. Defaults to cover.
|
|
76
|
+
* Cover resizes the image to maintain it's aspect ratio while filling the entire width and height.
|
|
77
|
+
* Contain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.
|
|
78
|
+
* Fill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit.
|
|
79
|
+
*/
|
|
68
80
|
resize?: 'cover' | 'contain' | 'fill';
|
|
69
81
|
}
|
|
70
82
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,WAAW,CAAC,EAA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AM;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAGD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;CACtC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.1.0
|
|
1
|
+
export declare const version = "2.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/main/lib/version.js
CHANGED
|
@@ -86,7 +86,7 @@ export default class StorageFileApi {
|
|
|
86
86
|
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
87
87
|
* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
|
88
88
|
* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
89
|
-
* @param options.transform
|
|
89
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
90
90
|
*/
|
|
91
91
|
createSignedUrl(path: string, expiresIn: number, options?: {
|
|
92
92
|
download?: string | boolean;
|
|
@@ -124,7 +124,7 @@ export default class StorageFileApi {
|
|
|
124
124
|
* Downloads a file.
|
|
125
125
|
*
|
|
126
126
|
* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
|
|
127
|
-
* @param options.
|
|
127
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
128
128
|
*/
|
|
129
129
|
download(path: string, options?: {
|
|
130
130
|
transform?: TransformOptions;
|
|
@@ -140,8 +140,8 @@ export default class StorageFileApi {
|
|
|
140
140
|
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
141
141
|
*
|
|
142
142
|
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
143
|
-
* @param options.download
|
|
144
|
-
* @param options.transform
|
|
143
|
+
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
144
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
145
145
|
*/
|
|
146
146
|
getPublicUrl(path: string, options?: {
|
|
147
147
|
download?: string | boolean;
|
|
@@ -153,7 +153,7 @@ class StorageFileApi {
|
|
|
153
153
|
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
154
154
|
* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
|
155
155
|
* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
156
|
-
* @param options.transform
|
|
156
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
157
157
|
*/
|
|
158
158
|
createSignedUrl(path, expiresIn, options) {
|
|
159
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -208,7 +208,7 @@ class StorageFileApi {
|
|
|
208
208
|
* Downloads a file.
|
|
209
209
|
*
|
|
210
210
|
* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
|
|
211
|
-
* @param options.
|
|
211
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
212
212
|
*/
|
|
213
213
|
download(path, options) {
|
|
214
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -238,8 +238,8 @@ class StorageFileApi {
|
|
|
238
238
|
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
239
239
|
*
|
|
240
240
|
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
241
|
-
* @param options.download
|
|
242
|
-
* @param options.transform
|
|
241
|
+
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
242
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
243
243
|
*/
|
|
244
244
|
getPublicUrl(path, options) {
|
|
245
245
|
const _path = this._getFinalPath(path);
|
|
@@ -63,8 +63,20 @@ export interface Metadata {
|
|
|
63
63
|
name: string;
|
|
64
64
|
}
|
|
65
65
|
export interface TransformOptions {
|
|
66
|
+
/**
|
|
67
|
+
* The width of the image in pixels.
|
|
68
|
+
*/
|
|
66
69
|
width?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The height of the image in pixels.
|
|
72
|
+
*/
|
|
67
73
|
height?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The resize mode can be cover, contain or fill. Defaults to cover.
|
|
76
|
+
* Cover resizes the image to maintain it's aspect ratio while filling the entire width and height.
|
|
77
|
+
* Contain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.
|
|
78
|
+
* Fill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit.
|
|
79
|
+
*/
|
|
68
80
|
resize?: 'cover' | 'contain' | 'fill';
|
|
69
81
|
}
|
|
70
82
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,M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;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAGD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;CACtC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.1.0
|
|
1
|
+
export declare const version = "2.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -86,7 +86,7 @@ export default class StorageFileApi {
|
|
|
86
86
|
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
87
87
|
* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
|
88
88
|
* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
89
|
-
* @param options.transform
|
|
89
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
90
90
|
*/
|
|
91
91
|
createSignedUrl(path: string, expiresIn: number, options?: {
|
|
92
92
|
download?: string | boolean;
|
|
@@ -124,7 +124,7 @@ export default class StorageFileApi {
|
|
|
124
124
|
* Downloads a file.
|
|
125
125
|
*
|
|
126
126
|
* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
|
|
127
|
-
* @param options.
|
|
127
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
128
128
|
*/
|
|
129
129
|
download(path: string, options?: {
|
|
130
130
|
transform?: TransformOptions;
|
|
@@ -140,8 +140,8 @@ export default class StorageFileApi {
|
|
|
140
140
|
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
141
141
|
*
|
|
142
142
|
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
143
|
-
* @param options.download
|
|
144
|
-
* @param options.transform
|
|
143
|
+
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
144
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
145
145
|
*/
|
|
146
146
|
getPublicUrl(path: string, options?: {
|
|
147
147
|
download?: string | boolean;
|
|
@@ -151,7 +151,7 @@ export default class StorageFileApi {
|
|
|
151
151
|
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
152
152
|
* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
|
153
153
|
* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
154
|
-
* @param options.transform
|
|
154
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
155
155
|
*/
|
|
156
156
|
createSignedUrl(path, expiresIn, options) {
|
|
157
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -206,7 +206,7 @@ export default class StorageFileApi {
|
|
|
206
206
|
* Downloads a file.
|
|
207
207
|
*
|
|
208
208
|
* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
|
|
209
|
-
* @param options.
|
|
209
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
210
210
|
*/
|
|
211
211
|
download(path, options) {
|
|
212
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -236,8 +236,8 @@ export default class StorageFileApi {
|
|
|
236
236
|
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
237
237
|
*
|
|
238
238
|
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
239
|
-
* @param options.download
|
|
240
|
-
* @param options.transform
|
|
239
|
+
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
240
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
241
241
|
*/
|
|
242
242
|
getPublicUrl(path, options) {
|
|
243
243
|
const _path = this._getFinalPath(path);
|
package/package.json
CHANGED
package/src/lib/types.ts
CHANGED
|
@@ -74,7 +74,19 @@ export interface Metadata {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export interface TransformOptions {
|
|
77
|
+
/**
|
|
78
|
+
* The width of the image in pixels.
|
|
79
|
+
*/
|
|
77
80
|
width?: number
|
|
81
|
+
/**
|
|
82
|
+
* The height of the image in pixels.
|
|
83
|
+
*/
|
|
78
84
|
height?: number
|
|
85
|
+
/**
|
|
86
|
+
* The resize mode can be cover, contain or fill. Defaults to cover.
|
|
87
|
+
* Cover resizes the image to maintain it's aspect ratio while filling the entire width and height.
|
|
88
|
+
* Contain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.
|
|
89
|
+
* Fill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit.
|
|
90
|
+
*/
|
|
79
91
|
resize?: 'cover' | 'contain' | 'fill'
|
|
80
92
|
}
|
package/src/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '2.1.0
|
|
2
|
+
export const version = '2.1.0'
|
|
@@ -265,7 +265,7 @@ export default class StorageFileApi {
|
|
|
265
265
|
* @param path The file path, including the current file name. For example `folder/image.png`.
|
|
266
266
|
* @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
|
|
267
267
|
* @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
268
|
-
* @param options.transform
|
|
268
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
269
269
|
*/
|
|
270
270
|
async createSignedUrl(
|
|
271
271
|
path: string,
|
|
@@ -359,7 +359,7 @@ export default class StorageFileApi {
|
|
|
359
359
|
* Downloads a file.
|
|
360
360
|
*
|
|
361
361
|
* @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
|
|
362
|
-
* @param options.
|
|
362
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
363
363
|
*/
|
|
364
364
|
async download(
|
|
365
365
|
path: string,
|
|
@@ -401,8 +401,8 @@ export default class StorageFileApi {
|
|
|
401
401
|
* This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
|
|
402
402
|
*
|
|
403
403
|
* @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
|
|
404
|
-
* @param options.download
|
|
405
|
-
* @param options.transform
|
|
404
|
+
* @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
|
|
405
|
+
* @param options.transform Transform the asset before serving it to the client.
|
|
406
406
|
*/
|
|
407
407
|
getPublicUrl(
|
|
408
408
|
path: string,
|