@supabase/storage-js 2.87.4-canary.2 → 2.87.4-canary.4

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.
Files changed (206) hide show
  1. package/README.md +2 -106
  2. package/dist/index.cjs +3019 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +2601 -0
  5. package/dist/index.d.cts.map +1 -0
  6. package/dist/index.d.mts +2601 -0
  7. package/dist/index.d.mts.map +1 -0
  8. package/dist/index.mjs +2998 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/dist/umd/supabase.js +1 -1
  11. package/package.json +21 -12
  12. package/src/lib/version.ts +1 -1
  13. package/dist/main/StorageClient.d.ts +0 -64
  14. package/dist/main/StorageClient.d.ts.map +0 -1
  15. package/dist/main/StorageClient.js +0 -74
  16. package/dist/main/StorageClient.js.map +0 -1
  17. package/dist/main/index.d.ts +0 -7
  18. package/dist/main/index.d.ts.map +0 -1
  19. package/dist/main/index.js +0 -12
  20. package/dist/main/index.js.map +0 -1
  21. package/dist/main/lib/constants.d.ts +0 -4
  22. package/dist/main/lib/constants.d.ts.map +0 -1
  23. package/dist/main/lib/constants.js +0 -8
  24. package/dist/main/lib/constants.js.map +0 -1
  25. package/dist/main/lib/errors.d.ts +0 -21
  26. package/dist/main/lib/errors.d.ts.map +0 -1
  27. package/dist/main/lib/errors.js +0 -41
  28. package/dist/main/lib/errors.js.map +0 -1
  29. package/dist/main/lib/fetch.d.ts +0 -16
  30. package/dist/main/lib/fetch.d.ts.map +0 -1
  31. package/dist/main/lib/fetch.js +0 -95
  32. package/dist/main/lib/fetch.js.map +0 -1
  33. package/dist/main/lib/helpers.d.ts +0 -28
  34. package/dist/main/lib/helpers.d.ts.map +0 -1
  35. package/dist/main/lib/helpers.js +0 -87
  36. package/dist/main/lib/helpers.js.map +0 -1
  37. package/dist/main/lib/index.d.ts +0 -6
  38. package/dist/main/lib/index.d.ts.map +0 -1
  39. package/dist/main/lib/index.js +0 -9
  40. package/dist/main/lib/index.js.map +0 -1
  41. package/dist/main/lib/types.d.ts +0 -226
  42. package/dist/main/lib/types.d.ts.map +0 -1
  43. package/dist/main/lib/types.js +0 -3
  44. package/dist/main/lib/types.js.map +0 -1
  45. package/dist/main/lib/vectors/StorageVectorsClient.d.ts +0 -505
  46. package/dist/main/lib/vectors/StorageVectorsClient.d.ts.map +0 -1
  47. package/dist/main/lib/vectors/StorageVectorsClient.js +0 -582
  48. package/dist/main/lib/vectors/StorageVectorsClient.js.map +0 -1
  49. package/dist/main/lib/vectors/VectorBucketApi.d.ts +0 -32
  50. package/dist/main/lib/vectors/VectorBucketApi.d.ts.map +0 -1
  51. package/dist/main/lib/vectors/VectorBucketApi.js +0 -102
  52. package/dist/main/lib/vectors/VectorBucketApi.js.map +0 -1
  53. package/dist/main/lib/vectors/VectorDataApi.d.ts +0 -32
  54. package/dist/main/lib/vectors/VectorDataApi.d.ts.map +0 -1
  55. package/dist/main/lib/vectors/VectorDataApi.js +0 -147
  56. package/dist/main/lib/vectors/VectorDataApi.js.map +0 -1
  57. package/dist/main/lib/vectors/VectorIndexApi.d.ts +0 -47
  58. package/dist/main/lib/vectors/VectorIndexApi.d.ts.map +0 -1
  59. package/dist/main/lib/vectors/VectorIndexApi.js +0 -104
  60. package/dist/main/lib/vectors/VectorIndexApi.js.map +0 -1
  61. package/dist/main/lib/vectors/constants.d.ts +0 -5
  62. package/dist/main/lib/vectors/constants.d.ts.map +0 -1
  63. package/dist/main/lib/vectors/constants.js +0 -9
  64. package/dist/main/lib/vectors/constants.js.map +0 -1
  65. package/dist/main/lib/vectors/errors.d.ts +0 -55
  66. package/dist/main/lib/vectors/errors.d.ts.map +0 -1
  67. package/dist/main/lib/vectors/errors.js +0 -76
  68. package/dist/main/lib/vectors/errors.js.map +0 -1
  69. package/dist/main/lib/vectors/fetch.d.ts +0 -57
  70. package/dist/main/lib/vectors/fetch.d.ts.map +0 -1
  71. package/dist/main/lib/vectors/fetch.js +0 -167
  72. package/dist/main/lib/vectors/fetch.js.map +0 -1
  73. package/dist/main/lib/vectors/helpers.d.ts +0 -46
  74. package/dist/main/lib/vectors/helpers.d.ts.map +0 -1
  75. package/dist/main/lib/vectors/helpers.js +0 -74
  76. package/dist/main/lib/vectors/helpers.js.map +0 -1
  77. package/dist/main/lib/vectors/index.d.ts +0 -11
  78. package/dist/main/lib/vectors/index.d.ts.map +0 -1
  79. package/dist/main/lib/vectors/index.js +0 -31
  80. package/dist/main/lib/vectors/index.js.map +0 -1
  81. package/dist/main/lib/vectors/types.d.ts +0 -279
  82. package/dist/main/lib/vectors/types.d.ts.map +0 -1
  83. package/dist/main/lib/vectors/types.js +0 -3
  84. package/dist/main/lib/vectors/types.js.map +0 -1
  85. package/dist/main/lib/version.d.ts +0 -2
  86. package/dist/main/lib/version.d.ts.map +0 -1
  87. package/dist/main/lib/version.js +0 -11
  88. package/dist/main/lib/version.js.map +0 -1
  89. package/dist/main/packages/BlobDownloadBuilder.d.ts +0 -16
  90. package/dist/main/packages/BlobDownloadBuilder.d.ts.map +0 -1
  91. package/dist/main/packages/BlobDownloadBuilder.js +0 -55
  92. package/dist/main/packages/BlobDownloadBuilder.js.map +0 -1
  93. package/dist/main/packages/StorageAnalyticsClient.d.ts +0 -324
  94. package/dist/main/packages/StorageAnalyticsClient.d.ts.map +0 -1
  95. package/dist/main/packages/StorageAnalyticsClient.js +0 -395
  96. package/dist/main/packages/StorageAnalyticsClient.js.map +0 -1
  97. package/dist/main/packages/StorageBucketApi.d.ts +0 -266
  98. package/dist/main/packages/StorageBucketApi.d.ts.map +0 -1
  99. package/dist/main/packages/StorageBucketApi.js +0 -362
  100. package/dist/main/packages/StorageBucketApi.js.map +0 -1
  101. package/dist/main/packages/StorageFileApi.d.ts +0 -680
  102. package/dist/main/packages/StorageFileApi.d.ts.map +0 -1
  103. package/dist/main/packages/StorageFileApi.js +0 -1002
  104. package/dist/main/packages/StorageFileApi.js.map +0 -1
  105. package/dist/main/packages/StreamDownloadBuilder.d.ts +0 -9
  106. package/dist/main/packages/StreamDownloadBuilder.d.ts.map +0 -1
  107. package/dist/main/packages/StreamDownloadBuilder.js +0 -35
  108. package/dist/main/packages/StreamDownloadBuilder.js.map +0 -1
  109. package/dist/module/StorageClient.d.ts +0 -64
  110. package/dist/module/StorageClient.d.ts.map +0 -1
  111. package/dist/module/StorageClient.js +0 -69
  112. package/dist/module/StorageClient.js.map +0 -1
  113. package/dist/module/index.d.ts +0 -7
  114. package/dist/module/index.d.ts.map +0 -1
  115. package/dist/module/index.js +0 -6
  116. package/dist/module/index.js.map +0 -1
  117. package/dist/module/lib/constants.d.ts +0 -4
  118. package/dist/module/lib/constants.d.ts.map +0 -1
  119. package/dist/module/lib/constants.js +0 -5
  120. package/dist/module/lib/constants.js.map +0 -1
  121. package/dist/module/lib/errors.d.ts +0 -21
  122. package/dist/module/lib/errors.d.ts.map +0 -1
  123. package/dist/module/lib/errors.js +0 -34
  124. package/dist/module/lib/errors.js.map +0 -1
  125. package/dist/module/lib/fetch.d.ts +0 -16
  126. package/dist/module/lib/fetch.d.ts.map +0 -1
  127. package/dist/module/lib/fetch.js +0 -88
  128. package/dist/module/lib/fetch.js.map +0 -1
  129. package/dist/module/lib/helpers.d.ts +0 -28
  130. package/dist/module/lib/helpers.d.ts.map +0 -1
  131. package/dist/module/lib/helpers.js +0 -79
  132. package/dist/module/lib/helpers.js.map +0 -1
  133. package/dist/module/lib/index.d.ts +0 -6
  134. package/dist/module/lib/index.d.ts.map +0 -1
  135. package/dist/module/lib/index.js +0 -6
  136. package/dist/module/lib/index.js.map +0 -1
  137. package/dist/module/lib/types.d.ts +0 -226
  138. package/dist/module/lib/types.d.ts.map +0 -1
  139. package/dist/module/lib/types.js +0 -2
  140. package/dist/module/lib/types.js.map +0 -1
  141. package/dist/module/lib/vectors/StorageVectorsClient.d.ts +0 -505
  142. package/dist/module/lib/vectors/StorageVectorsClient.d.ts.map +0 -1
  143. package/dist/module/lib/vectors/StorageVectorsClient.js +0 -576
  144. package/dist/module/lib/vectors/StorageVectorsClient.js.map +0 -1
  145. package/dist/module/lib/vectors/VectorBucketApi.d.ts +0 -32
  146. package/dist/module/lib/vectors/VectorBucketApi.d.ts.map +0 -1
  147. package/dist/module/lib/vectors/VectorBucketApi.js +0 -99
  148. package/dist/module/lib/vectors/VectorBucketApi.js.map +0 -1
  149. package/dist/module/lib/vectors/VectorDataApi.d.ts +0 -32
  150. package/dist/module/lib/vectors/VectorDataApi.d.ts.map +0 -1
  151. package/dist/module/lib/vectors/VectorDataApi.js +0 -144
  152. package/dist/module/lib/vectors/VectorDataApi.js.map +0 -1
  153. package/dist/module/lib/vectors/VectorIndexApi.d.ts +0 -47
  154. package/dist/module/lib/vectors/VectorIndexApi.d.ts.map +0 -1
  155. package/dist/module/lib/vectors/VectorIndexApi.js +0 -101
  156. package/dist/module/lib/vectors/VectorIndexApi.js.map +0 -1
  157. package/dist/module/lib/vectors/constants.d.ts +0 -5
  158. package/dist/module/lib/vectors/constants.d.ts.map +0 -1
  159. package/dist/module/lib/vectors/constants.js +0 -6
  160. package/dist/module/lib/vectors/constants.js.map +0 -1
  161. package/dist/module/lib/vectors/errors.d.ts +0 -55
  162. package/dist/module/lib/vectors/errors.d.ts.map +0 -1
  163. package/dist/module/lib/vectors/errors.js +0 -69
  164. package/dist/module/lib/vectors/errors.js.map +0 -1
  165. package/dist/module/lib/vectors/fetch.d.ts +0 -57
  166. package/dist/module/lib/vectors/fetch.d.ts.map +0 -1
  167. package/dist/module/lib/vectors/fetch.js +0 -161
  168. package/dist/module/lib/vectors/fetch.js.map +0 -1
  169. package/dist/module/lib/vectors/helpers.d.ts +0 -46
  170. package/dist/module/lib/vectors/helpers.d.ts.map +0 -1
  171. package/dist/module/lib/vectors/helpers.js +0 -66
  172. package/dist/module/lib/vectors/helpers.js.map +0 -1
  173. package/dist/module/lib/vectors/index.d.ts +0 -11
  174. package/dist/module/lib/vectors/index.d.ts.map +0 -1
  175. package/dist/module/lib/vectors/index.js +0 -11
  176. package/dist/module/lib/vectors/index.js.map +0 -1
  177. package/dist/module/lib/vectors/types.d.ts +0 -279
  178. package/dist/module/lib/vectors/types.d.ts.map +0 -1
  179. package/dist/module/lib/vectors/types.js +0 -2
  180. package/dist/module/lib/vectors/types.js.map +0 -1
  181. package/dist/module/lib/version.d.ts +0 -2
  182. package/dist/module/lib/version.d.ts.map +0 -1
  183. package/dist/module/lib/version.js +0 -8
  184. package/dist/module/lib/version.js.map +0 -1
  185. package/dist/module/packages/BlobDownloadBuilder.d.ts +0 -16
  186. package/dist/module/packages/BlobDownloadBuilder.d.ts.map +0 -1
  187. package/dist/module/packages/BlobDownloadBuilder.js +0 -53
  188. package/dist/module/packages/BlobDownloadBuilder.js.map +0 -1
  189. package/dist/module/packages/StorageAnalyticsClient.d.ts +0 -324
  190. package/dist/module/packages/StorageAnalyticsClient.d.ts.map +0 -1
  191. package/dist/module/packages/StorageAnalyticsClient.js +0 -392
  192. package/dist/module/packages/StorageAnalyticsClient.js.map +0 -1
  193. package/dist/module/packages/StorageBucketApi.d.ts +0 -266
  194. package/dist/module/packages/StorageBucketApi.d.ts.map +0 -1
  195. package/dist/module/packages/StorageBucketApi.js +0 -359
  196. package/dist/module/packages/StorageBucketApi.js.map +0 -1
  197. package/dist/module/packages/StorageFileApi.d.ts +0 -680
  198. package/dist/module/packages/StorageFileApi.d.ts.map +0 -1
  199. package/dist/module/packages/StorageFileApi.js +0 -999
  200. package/dist/module/packages/StorageFileApi.js.map +0 -1
  201. package/dist/module/packages/StreamDownloadBuilder.d.ts +0 -9
  202. package/dist/module/packages/StreamDownloadBuilder.d.ts.map +0 -1
  203. package/dist/module/packages/StreamDownloadBuilder.js +0 -32
  204. package/dist/module/packages/StreamDownloadBuilder.js.map +0 -1
  205. package/dist/tsconfig.module.tsbuildinfo +0 -1
  206. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,999 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- import { isStorageError, StorageError, StorageUnknownError } from '../lib/errors';
3
- import { get, head, post, put, remove } from '../lib/fetch';
4
- import { recursiveToCamel, resolveFetch } from '../lib/helpers';
5
- import BlobDownloadBuilder from './BlobDownloadBuilder';
6
- const DEFAULT_SEARCH_OPTIONS = {
7
- limit: 100,
8
- offset: 0,
9
- sortBy: {
10
- column: 'name',
11
- order: 'asc',
12
- },
13
- };
14
- const DEFAULT_FILE_OPTIONS = {
15
- cacheControl: '3600',
16
- contentType: 'text/plain;charset=UTF-8',
17
- upsert: false,
18
- };
19
- export default class StorageFileApi {
20
- constructor(url, headers = {}, bucketId, fetch) {
21
- this.shouldThrowOnError = false;
22
- this.url = url;
23
- this.headers = headers;
24
- this.bucketId = bucketId;
25
- this.fetch = resolveFetch(fetch);
26
- }
27
- /**
28
- * Enable throwing errors instead of returning them.
29
- *
30
- * @category File Buckets
31
- */
32
- throwOnError() {
33
- this.shouldThrowOnError = true;
34
- return this;
35
- }
36
- /**
37
- * Uploads a file to an existing bucket or replaces an existing file at the specified path with a new one.
38
- *
39
- * @param method HTTP method.
40
- * @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
41
- * @param fileBody The body of the file to be stored in the bucket.
42
- */
43
- uploadOrUpdate(method, path, fileBody, fileOptions) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- try {
46
- let body;
47
- const options = Object.assign(Object.assign({}, DEFAULT_FILE_OPTIONS), fileOptions);
48
- let headers = Object.assign(Object.assign({}, this.headers), (method === 'POST' && { 'x-upsert': String(options.upsert) }));
49
- const metadata = options.metadata;
50
- if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
51
- body = new FormData();
52
- body.append('cacheControl', options.cacheControl);
53
- if (metadata) {
54
- body.append('metadata', this.encodeMetadata(metadata));
55
- }
56
- body.append('', fileBody);
57
- }
58
- else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
59
- body = fileBody;
60
- // Only append if not already present
61
- if (!body.has('cacheControl')) {
62
- body.append('cacheControl', options.cacheControl);
63
- }
64
- if (metadata && !body.has('metadata')) {
65
- body.append('metadata', this.encodeMetadata(metadata));
66
- }
67
- }
68
- else {
69
- body = fileBody;
70
- headers['cache-control'] = `max-age=${options.cacheControl}`;
71
- headers['content-type'] = options.contentType;
72
- if (metadata) {
73
- headers['x-metadata'] = this.toBase64(this.encodeMetadata(metadata));
74
- }
75
- // Node.js streams require duplex option for fetch in Node 20+
76
- // Check for both web ReadableStream and Node.js streams
77
- const isStream = (typeof ReadableStream !== 'undefined' && body instanceof ReadableStream) ||
78
- (body && typeof body === 'object' && 'pipe' in body && typeof body.pipe === 'function');
79
- if (isStream && !options.duplex) {
80
- options.duplex = 'half';
81
- }
82
- }
83
- if (fileOptions === null || fileOptions === void 0 ? void 0 : fileOptions.headers) {
84
- headers = Object.assign(Object.assign({}, headers), fileOptions.headers);
85
- }
86
- const cleanPath = this._removeEmptyFolders(path);
87
- const _path = this._getFinalPath(cleanPath);
88
- const data = yield (method == 'PUT' ? put : post)(this.fetch, `${this.url}/object/${_path}`, body, Object.assign({ headers }, ((options === null || options === void 0 ? void 0 : options.duplex) ? { duplex: options.duplex } : {})));
89
- return {
90
- data: { path: cleanPath, id: data.Id, fullPath: data.Key },
91
- error: null,
92
- };
93
- }
94
- catch (error) {
95
- if (this.shouldThrowOnError) {
96
- throw error;
97
- }
98
- if (isStorageError(error)) {
99
- return { data: null, error };
100
- }
101
- throw error;
102
- }
103
- });
104
- }
105
- /**
106
- * Uploads a file to an existing bucket.
107
- *
108
- * @category File Buckets
109
- * @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
110
- * @param fileBody The body of the file to be stored in the bucket.
111
- * @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.
112
- * @returns Promise with response containing file path, id, and fullPath or error
113
- *
114
- * @example Upload file
115
- * ```js
116
- * const avatarFile = event.target.files[0]
117
- * const { data, error } = await supabase
118
- * .storage
119
- * .from('avatars')
120
- * .upload('public/avatar1.png', avatarFile, {
121
- * cacheControl: '3600',
122
- * upsert: false
123
- * })
124
- * ```
125
- *
126
- * Response:
127
- * ```json
128
- * {
129
- * "data": {
130
- * "path": "public/avatar1.png",
131
- * "fullPath": "avatars/public/avatar1.png"
132
- * },
133
- * "error": null
134
- * }
135
- * ```
136
- *
137
- * @example Upload file using `ArrayBuffer` from base64 file data
138
- * ```js
139
- * import { decode } from 'base64-arraybuffer'
140
- *
141
- * const { data, error } = await supabase
142
- * .storage
143
- * .from('avatars')
144
- * .upload('public/avatar1.png', decode('base64FileData'), {
145
- * contentType: 'image/png'
146
- * })
147
- * ```
148
- */
149
- upload(path, fileBody, fileOptions) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- return this.uploadOrUpdate('POST', path, fileBody, fileOptions);
152
- });
153
- }
154
- /**
155
- * Upload a file with a token generated from `createSignedUploadUrl`.
156
- *
157
- * @category File Buckets
158
- * @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
159
- * @param token The token generated from `createSignedUploadUrl`
160
- * @param fileBody The body of the file to be stored in the bucket.
161
- * @param fileOptions HTTP headers (cacheControl, contentType, etc.).
162
- * **Note:** The `upsert` option has no effect here. To enable upsert behavior,
163
- * pass `{ upsert: true }` when calling `createSignedUploadUrl()` instead.
164
- * @returns Promise with response containing file path and fullPath or error
165
- *
166
- * @example Upload to a signed URL
167
- * ```js
168
- * const { data, error } = await supabase
169
- * .storage
170
- * .from('avatars')
171
- * .uploadToSignedUrl('folder/cat.jpg', 'token-from-createSignedUploadUrl', file)
172
- * ```
173
- *
174
- * Response:
175
- * ```json
176
- * {
177
- * "data": {
178
- * "path": "folder/cat.jpg",
179
- * "fullPath": "avatars/folder/cat.jpg"
180
- * },
181
- * "error": null
182
- * }
183
- * ```
184
- */
185
- uploadToSignedUrl(path, token, fileBody, fileOptions) {
186
- return __awaiter(this, void 0, void 0, function* () {
187
- const cleanPath = this._removeEmptyFolders(path);
188
- const _path = this._getFinalPath(cleanPath);
189
- const url = new URL(this.url + `/object/upload/sign/${_path}`);
190
- url.searchParams.set('token', token);
191
- try {
192
- let body;
193
- const options = Object.assign({ upsert: DEFAULT_FILE_OPTIONS.upsert }, fileOptions);
194
- const headers = Object.assign(Object.assign({}, this.headers), { 'x-upsert': String(options.upsert) });
195
- if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
196
- body = new FormData();
197
- body.append('cacheControl', options.cacheControl);
198
- body.append('', fileBody);
199
- }
200
- else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
201
- body = fileBody;
202
- body.append('cacheControl', options.cacheControl);
203
- }
204
- else {
205
- body = fileBody;
206
- headers['cache-control'] = `max-age=${options.cacheControl}`;
207
- headers['content-type'] = options.contentType;
208
- }
209
- const data = yield put(this.fetch, url.toString(), body, { headers });
210
- return {
211
- data: { path: cleanPath, fullPath: data.Key },
212
- error: null,
213
- };
214
- }
215
- catch (error) {
216
- if (this.shouldThrowOnError) {
217
- throw error;
218
- }
219
- if (isStorageError(error)) {
220
- return { data: null, error };
221
- }
222
- throw error;
223
- }
224
- });
225
- }
226
- /**
227
- * Creates a signed upload URL.
228
- * Signed upload URLs can be used to upload files to the bucket without further authentication.
229
- * They are valid for 2 hours.
230
- *
231
- * @category File Buckets
232
- * @param path The file path, including the current file name. For example `folder/image.png`.
233
- * @param options.upsert If set to true, allows the file to be overwritten if it already exists.
234
- * @returns Promise with response containing signed upload URL, token, and path or error
235
- *
236
- * @example Create Signed Upload URL
237
- * ```js
238
- * const { data, error } = await supabase
239
- * .storage
240
- * .from('avatars')
241
- * .createSignedUploadUrl('folder/cat.jpg')
242
- * ```
243
- *
244
- * Response:
245
- * ```json
246
- * {
247
- * "data": {
248
- * "signedUrl": "https://example.supabase.co/storage/v1/object/upload/sign/avatars/folder/cat.jpg?token=<TOKEN>",
249
- * "path": "folder/cat.jpg",
250
- * "token": "<TOKEN>"
251
- * },
252
- * "error": null
253
- * }
254
- * ```
255
- */
256
- createSignedUploadUrl(path, options) {
257
- return __awaiter(this, void 0, void 0, function* () {
258
- try {
259
- let _path = this._getFinalPath(path);
260
- const headers = Object.assign({}, this.headers);
261
- if (options === null || options === void 0 ? void 0 : options.upsert) {
262
- headers['x-upsert'] = 'true';
263
- }
264
- const data = yield post(this.fetch, `${this.url}/object/upload/sign/${_path}`, {}, { headers });
265
- const url = new URL(this.url + data.url);
266
- const token = url.searchParams.get('token');
267
- if (!token) {
268
- throw new StorageError('No token returned by API');
269
- }
270
- return { data: { signedUrl: url.toString(), path, token }, error: null };
271
- }
272
- catch (error) {
273
- if (this.shouldThrowOnError) {
274
- throw error;
275
- }
276
- if (isStorageError(error)) {
277
- return { data: null, error };
278
- }
279
- throw error;
280
- }
281
- });
282
- }
283
- /**
284
- * Replaces an existing file at the specified path with a new one.
285
- *
286
- * @category File Buckets
287
- * @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.
288
- * @param fileBody The body of the file to be stored in the bucket.
289
- * @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.
290
- * @returns Promise with response containing file path, id, and fullPath or error
291
- *
292
- * @example Update file
293
- * ```js
294
- * const avatarFile = event.target.files[0]
295
- * const { data, error } = await supabase
296
- * .storage
297
- * .from('avatars')
298
- * .update('public/avatar1.png', avatarFile, {
299
- * cacheControl: '3600',
300
- * upsert: true
301
- * })
302
- * ```
303
- *
304
- * Response:
305
- * ```json
306
- * {
307
- * "data": {
308
- * "path": "public/avatar1.png",
309
- * "fullPath": "avatars/public/avatar1.png"
310
- * },
311
- * "error": null
312
- * }
313
- * ```
314
- *
315
- * @example Update file using `ArrayBuffer` from base64 file data
316
- * ```js
317
- * import {decode} from 'base64-arraybuffer'
318
- *
319
- * const { data, error } = await supabase
320
- * .storage
321
- * .from('avatars')
322
- * .update('public/avatar1.png', decode('base64FileData'), {
323
- * contentType: 'image/png'
324
- * })
325
- * ```
326
- */
327
- update(path, fileBody, fileOptions) {
328
- return __awaiter(this, void 0, void 0, function* () {
329
- return this.uploadOrUpdate('PUT', path, fileBody, fileOptions);
330
- });
331
- }
332
- /**
333
- * Moves an existing file to a new path in the same bucket.
334
- *
335
- * @category File Buckets
336
- * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
337
- * @param toPath The new file path, including the new file name. For example `folder/image-new.png`.
338
- * @param options The destination options.
339
- * @returns Promise with response containing success message or error
340
- *
341
- * @example Move file
342
- * ```js
343
- * const { data, error } = await supabase
344
- * .storage
345
- * .from('avatars')
346
- * .move('public/avatar1.png', 'private/avatar2.png')
347
- * ```
348
- *
349
- * Response:
350
- * ```json
351
- * {
352
- * "data": {
353
- * "message": "Successfully moved"
354
- * },
355
- * "error": null
356
- * }
357
- * ```
358
- */
359
- move(fromPath, toPath, options) {
360
- return __awaiter(this, void 0, void 0, function* () {
361
- try {
362
- const data = yield post(this.fetch, `${this.url}/object/move`, {
363
- bucketId: this.bucketId,
364
- sourceKey: fromPath,
365
- destinationKey: toPath,
366
- destinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket,
367
- }, { headers: this.headers });
368
- return { data, error: null };
369
- }
370
- catch (error) {
371
- if (this.shouldThrowOnError) {
372
- throw error;
373
- }
374
- if (isStorageError(error)) {
375
- return { data: null, error };
376
- }
377
- throw error;
378
- }
379
- });
380
- }
381
- /**
382
- * Copies an existing file to a new path in the same bucket.
383
- *
384
- * @category File Buckets
385
- * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
386
- * @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
387
- * @param options The destination options.
388
- * @returns Promise with response containing copied file path or error
389
- *
390
- * @example Copy file
391
- * ```js
392
- * const { data, error } = await supabase
393
- * .storage
394
- * .from('avatars')
395
- * .copy('public/avatar1.png', 'private/avatar2.png')
396
- * ```
397
- *
398
- * Response:
399
- * ```json
400
- * {
401
- * "data": {
402
- * "path": "avatars/private/avatar2.png"
403
- * },
404
- * "error": null
405
- * }
406
- * ```
407
- */
408
- copy(fromPath, toPath, options) {
409
- return __awaiter(this, void 0, void 0, function* () {
410
- try {
411
- const data = yield post(this.fetch, `${this.url}/object/copy`, {
412
- bucketId: this.bucketId,
413
- sourceKey: fromPath,
414
- destinationKey: toPath,
415
- destinationBucket: options === null || options === void 0 ? void 0 : options.destinationBucket,
416
- }, { headers: this.headers });
417
- return { data: { path: data.Key }, error: null };
418
- }
419
- catch (error) {
420
- if (this.shouldThrowOnError) {
421
- throw error;
422
- }
423
- if (isStorageError(error)) {
424
- return { data: null, error };
425
- }
426
- throw error;
427
- }
428
- });
429
- }
430
- /**
431
- * Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.
432
- *
433
- * @category File Buckets
434
- * @param path The file path, including the current file name. For example `folder/image.png`.
435
- * @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
436
- * @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.
437
- * @param options.transform Transform the asset before serving it to the client.
438
- * @returns Promise with response containing signed URL or error
439
- *
440
- * @example Create Signed URL
441
- * ```js
442
- * const { data, error } = await supabase
443
- * .storage
444
- * .from('avatars')
445
- * .createSignedUrl('folder/avatar1.png', 60)
446
- * ```
447
- *
448
- * Response:
449
- * ```json
450
- * {
451
- * "data": {
452
- * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>"
453
- * },
454
- * "error": null
455
- * }
456
- * ```
457
- *
458
- * @example Create a signed URL for an asset with transformations
459
- * ```js
460
- * const { data } = await supabase
461
- * .storage
462
- * .from('avatars')
463
- * .createSignedUrl('folder/avatar1.png', 60, {
464
- * transform: {
465
- * width: 100,
466
- * height: 100,
467
- * }
468
- * })
469
- * ```
470
- *
471
- * @example Create a signed URL which triggers the download of the asset
472
- * ```js
473
- * const { data } = await supabase
474
- * .storage
475
- * .from('avatars')
476
- * .createSignedUrl('folder/avatar1.png', 60, {
477
- * download: true,
478
- * })
479
- * ```
480
- */
481
- createSignedUrl(path, expiresIn, options) {
482
- return __awaiter(this, void 0, void 0, function* () {
483
- try {
484
- let _path = this._getFinalPath(path);
485
- let data = yield post(this.fetch, `${this.url}/object/sign/${_path}`, Object.assign({ expiresIn }, ((options === null || options === void 0 ? void 0 : options.transform) ? { transform: options.transform } : {})), { headers: this.headers });
486
- const downloadQueryParam = (options === null || options === void 0 ? void 0 : options.download)
487
- ? `&download=${options.download === true ? '' : options.download}`
488
- : '';
489
- const signedUrl = encodeURI(`${this.url}${data.signedURL}${downloadQueryParam}`);
490
- data = { signedUrl };
491
- return { data, error: null };
492
- }
493
- catch (error) {
494
- if (this.shouldThrowOnError) {
495
- throw error;
496
- }
497
- if (isStorageError(error)) {
498
- return { data: null, error };
499
- }
500
- throw error;
501
- }
502
- });
503
- }
504
- /**
505
- * Creates multiple signed URLs. Use a signed URL to share a file for a fixed amount of time.
506
- *
507
- * @category File Buckets
508
- * @param paths The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`.
509
- * @param expiresIn The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute.
510
- * @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.
511
- * @returns Promise with response containing array of objects with signedUrl, path, and error or error
512
- *
513
- * @example Create Signed URLs
514
- * ```js
515
- * const { data, error } = await supabase
516
- * .storage
517
- * .from('avatars')
518
- * .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)
519
- * ```
520
- *
521
- * Response:
522
- * ```json
523
- * {
524
- * "data": [
525
- * {
526
- * "error": null,
527
- * "path": "folder/avatar1.png",
528
- * "signedURL": "/object/sign/avatars/folder/avatar1.png?token=<TOKEN>",
529
- * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>"
530
- * },
531
- * {
532
- * "error": null,
533
- * "path": "folder/avatar2.png",
534
- * "signedURL": "/object/sign/avatars/folder/avatar2.png?token=<TOKEN>",
535
- * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar2.png?token=<TOKEN>"
536
- * }
537
- * ],
538
- * "error": null
539
- * }
540
- * ```
541
- */
542
- createSignedUrls(paths, expiresIn, options) {
543
- return __awaiter(this, void 0, void 0, function* () {
544
- try {
545
- const data = yield post(this.fetch, `${this.url}/object/sign/${this.bucketId}`, { expiresIn, paths }, { headers: this.headers });
546
- const downloadQueryParam = (options === null || options === void 0 ? void 0 : options.download)
547
- ? `&download=${options.download === true ? '' : options.download}`
548
- : '';
549
- return {
550
- data: data.map((datum) => (Object.assign(Object.assign({}, datum), { signedUrl: datum.signedURL
551
- ? encodeURI(`${this.url}${datum.signedURL}${downloadQueryParam}`)
552
- : null }))),
553
- error: null,
554
- };
555
- }
556
- catch (error) {
557
- if (this.shouldThrowOnError) {
558
- throw error;
559
- }
560
- if (isStorageError(error)) {
561
- return { data: null, error };
562
- }
563
- throw error;
564
- }
565
- });
566
- }
567
- /**
568
- * Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead.
569
- *
570
- * @category File Buckets
571
- * @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
572
- * @param options.transform Transform the asset before serving it to the client.
573
- * @returns BlobDownloadBuilder instance for downloading the file
574
- *
575
- * @example Download file
576
- * ```js
577
- * const { data, error } = await supabase
578
- * .storage
579
- * .from('avatars')
580
- * .download('folder/avatar1.png')
581
- * ```
582
- *
583
- * Response:
584
- * ```json
585
- * {
586
- * "data": <BLOB>,
587
- * "error": null
588
- * }
589
- * ```
590
- *
591
- * @example Download file with transformations
592
- * ```js
593
- * const { data, error } = await supabase
594
- * .storage
595
- * .from('avatars')
596
- * .download('folder/avatar1.png', {
597
- * transform: {
598
- * width: 100,
599
- * height: 100,
600
- * quality: 80
601
- * }
602
- * })
603
- * ```
604
- */
605
- download(path, options) {
606
- const wantsTransformation = typeof (options === null || options === void 0 ? void 0 : options.transform) !== 'undefined';
607
- const renderPath = wantsTransformation ? 'render/image/authenticated' : 'object';
608
- const transformationQuery = this.transformOptsToQueryString((options === null || options === void 0 ? void 0 : options.transform) || {});
609
- const queryString = transformationQuery ? `?${transformationQuery}` : '';
610
- const _path = this._getFinalPath(path);
611
- const downloadFn = () => get(this.fetch, `${this.url}/${renderPath}/${_path}${queryString}`, {
612
- headers: this.headers,
613
- noResolveJson: true,
614
- });
615
- return new BlobDownloadBuilder(downloadFn, this.shouldThrowOnError);
616
- }
617
- /**
618
- * Retrieves the details of an existing file.
619
- *
620
- * @category File Buckets
621
- * @param path The file path, including the file name. For example `folder/image.png`.
622
- * @returns Promise with response containing file metadata or error
623
- *
624
- * @example Get file info
625
- * ```js
626
- * const { data, error } = await supabase
627
- * .storage
628
- * .from('avatars')
629
- * .info('folder/avatar1.png')
630
- * ```
631
- */
632
- info(path) {
633
- return __awaiter(this, void 0, void 0, function* () {
634
- const _path = this._getFinalPath(path);
635
- try {
636
- const data = yield get(this.fetch, `${this.url}/object/info/${_path}`, {
637
- headers: this.headers,
638
- });
639
- return { data: recursiveToCamel(data), error: null };
640
- }
641
- catch (error) {
642
- if (this.shouldThrowOnError) {
643
- throw error;
644
- }
645
- if (isStorageError(error)) {
646
- return { data: null, error };
647
- }
648
- throw error;
649
- }
650
- });
651
- }
652
- /**
653
- * Checks the existence of a file.
654
- *
655
- * @category File Buckets
656
- * @param path The file path, including the file name. For example `folder/image.png`.
657
- * @returns Promise with response containing boolean indicating file existence or error
658
- *
659
- * @example Check file existence
660
- * ```js
661
- * const { data, error } = await supabase
662
- * .storage
663
- * .from('avatars')
664
- * .exists('folder/avatar1.png')
665
- * ```
666
- */
667
- exists(path) {
668
- return __awaiter(this, void 0, void 0, function* () {
669
- const _path = this._getFinalPath(path);
670
- try {
671
- yield head(this.fetch, `${this.url}/object/${_path}`, {
672
- headers: this.headers,
673
- });
674
- return { data: true, error: null };
675
- }
676
- catch (error) {
677
- if (this.shouldThrowOnError) {
678
- throw error;
679
- }
680
- if (isStorageError(error) && error instanceof StorageUnknownError) {
681
- const originalError = error.originalError;
682
- if ([400, 404].includes(originalError === null || originalError === void 0 ? void 0 : originalError.status)) {
683
- return { data: false, error };
684
- }
685
- }
686
- throw error;
687
- }
688
- });
689
- }
690
- /**
691
- * A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.
692
- * 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.
693
- *
694
- * @category File Buckets
695
- * @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
696
- * @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.
697
- * @param options.transform Transform the asset before serving it to the client.
698
- * @returns Object with public URL
699
- *
700
- * @example Returns the URL for an asset in a public bucket
701
- * ```js
702
- * const { data } = supabase
703
- * .storage
704
- * .from('public-bucket')
705
- * .getPublicUrl('folder/avatar1.png')
706
- * ```
707
- *
708
- * Response:
709
- * ```json
710
- * {
711
- * "data": {
712
- * "publicUrl": "https://example.supabase.co/storage/v1/object/public/public-bucket/folder/avatar1.png"
713
- * }
714
- * }
715
- * ```
716
- *
717
- * @example Returns the URL for an asset in a public bucket with transformations
718
- * ```js
719
- * const { data } = supabase
720
- * .storage
721
- * .from('public-bucket')
722
- * .getPublicUrl('folder/avatar1.png', {
723
- * transform: {
724
- * width: 100,
725
- * height: 100,
726
- * }
727
- * })
728
- * ```
729
- *
730
- * @example Returns the URL which triggers the download of an asset in a public bucket
731
- * ```js
732
- * const { data } = supabase
733
- * .storage
734
- * .from('public-bucket')
735
- * .getPublicUrl('folder/avatar1.png', {
736
- * download: true,
737
- * })
738
- * ```
739
- */
740
- getPublicUrl(path, options) {
741
- const _path = this._getFinalPath(path);
742
- const _queryString = [];
743
- const downloadQueryParam = (options === null || options === void 0 ? void 0 : options.download)
744
- ? `download=${options.download === true ? '' : options.download}`
745
- : '';
746
- if (downloadQueryParam !== '') {
747
- _queryString.push(downloadQueryParam);
748
- }
749
- const wantsTransformation = typeof (options === null || options === void 0 ? void 0 : options.transform) !== 'undefined';
750
- const renderPath = wantsTransformation ? 'render/image' : 'object';
751
- const transformationQuery = this.transformOptsToQueryString((options === null || options === void 0 ? void 0 : options.transform) || {});
752
- if (transformationQuery !== '') {
753
- _queryString.push(transformationQuery);
754
- }
755
- let queryString = _queryString.join('&');
756
- if (queryString !== '') {
757
- queryString = `?${queryString}`;
758
- }
759
- return {
760
- data: { publicUrl: encodeURI(`${this.url}/${renderPath}/public/${_path}${queryString}`) },
761
- };
762
- }
763
- /**
764
- * Deletes files within the same bucket
765
- *
766
- * @category File Buckets
767
- * @param paths An array of files to delete, including the path and file name. For example [`'folder/image.png'`].
768
- * @returns Promise with response containing array of deleted file objects or error
769
- *
770
- * @example Delete file
771
- * ```js
772
- * const { data, error } = await supabase
773
- * .storage
774
- * .from('avatars')
775
- * .remove(['folder/avatar1.png'])
776
- * ```
777
- *
778
- * Response:
779
- * ```json
780
- * {
781
- * "data": [],
782
- * "error": null
783
- * }
784
- * ```
785
- */
786
- remove(paths) {
787
- return __awaiter(this, void 0, void 0, function* () {
788
- try {
789
- const data = yield remove(this.fetch, `${this.url}/object/${this.bucketId}`, { prefixes: paths }, { headers: this.headers });
790
- return { data, error: null };
791
- }
792
- catch (error) {
793
- if (this.shouldThrowOnError) {
794
- throw error;
795
- }
796
- if (isStorageError(error)) {
797
- return { data: null, error };
798
- }
799
- throw error;
800
- }
801
- });
802
- }
803
- /**
804
- * Get file metadata
805
- * @param id the file id to retrieve metadata
806
- */
807
- // async getMetadata(
808
- // id: string
809
- // ): Promise<
810
- // | {
811
- // data: Metadata
812
- // error: null
813
- // }
814
- // | {
815
- // data: null
816
- // error: StorageError
817
- // }
818
- // > {
819
- // try {
820
- // const data = await get(this.fetch, `${this.url}/metadata/${id}`, { headers: this.headers })
821
- // return { data, error: null }
822
- // } catch (error) {
823
- // if (isStorageError(error)) {
824
- // return { data: null, error }
825
- // }
826
- // throw error
827
- // }
828
- // }
829
- /**
830
- * Update file metadata
831
- * @param id the file id to update metadata
832
- * @param meta the new file metadata
833
- */
834
- // async updateMetadata(
835
- // id: string,
836
- // meta: Metadata
837
- // ): Promise<
838
- // | {
839
- // data: Metadata
840
- // error: null
841
- // }
842
- // | {
843
- // data: null
844
- // error: StorageError
845
- // }
846
- // > {
847
- // try {
848
- // const data = await post(
849
- // this.fetch,
850
- // `${this.url}/metadata/${id}`,
851
- // { ...meta },
852
- // { headers: this.headers }
853
- // )
854
- // return { data, error: null }
855
- // } catch (error) {
856
- // if (isStorageError(error)) {
857
- // return { data: null, error }
858
- // }
859
- // throw error
860
- // }
861
- // }
862
- /**
863
- * Lists all the files and folders within a path of the bucket.
864
- *
865
- * @category File Buckets
866
- * @param path The folder path.
867
- * @param options Search options including limit (defaults to 100), offset, sortBy, and search
868
- * @param parameters Optional fetch parameters including signal for cancellation
869
- * @returns Promise with response containing array of files or error
870
- *
871
- * @example List files in a bucket
872
- * ```js
873
- * const { data, error } = await supabase
874
- * .storage
875
- * .from('avatars')
876
- * .list('folder', {
877
- * limit: 100,
878
- * offset: 0,
879
- * sortBy: { column: 'name', order: 'asc' },
880
- * })
881
- * ```
882
- *
883
- * Response:
884
- * ```json
885
- * {
886
- * "data": [
887
- * {
888
- * "name": "avatar1.png",
889
- * "id": "e668cf7f-821b-4a2f-9dce-7dfa5dd1cfd2",
890
- * "updated_at": "2024-05-22T23:06:05.580Z",
891
- * "created_at": "2024-05-22T23:04:34.443Z",
892
- * "last_accessed_at": "2024-05-22T23:04:34.443Z",
893
- * "metadata": {
894
- * "eTag": "\"c5e8c553235d9af30ef4f6e280790b92\"",
895
- * "size": 32175,
896
- * "mimetype": "image/png",
897
- * "cacheControl": "max-age=3600",
898
- * "lastModified": "2024-05-22T23:06:05.574Z",
899
- * "contentLength": 32175,
900
- * "httpStatusCode": 200
901
- * }
902
- * }
903
- * ],
904
- * "error": null
905
- * }
906
- * ```
907
- *
908
- * @example Search files in a bucket
909
- * ```js
910
- * const { data, error } = await supabase
911
- * .storage
912
- * .from('avatars')
913
- * .list('folder', {
914
- * limit: 100,
915
- * offset: 0,
916
- * sortBy: { column: 'name', order: 'asc' },
917
- * search: 'jon'
918
- * })
919
- * ```
920
- */
921
- list(path, options, parameters) {
922
- return __awaiter(this, void 0, void 0, function* () {
923
- try {
924
- const body = Object.assign(Object.assign(Object.assign({}, DEFAULT_SEARCH_OPTIONS), options), { prefix: path || '' });
925
- const data = yield post(this.fetch, `${this.url}/object/list/${this.bucketId}`, body, { headers: this.headers }, parameters);
926
- return { data, error: null };
927
- }
928
- catch (error) {
929
- if (this.shouldThrowOnError) {
930
- throw error;
931
- }
932
- if (isStorageError(error)) {
933
- return { data: null, error };
934
- }
935
- throw error;
936
- }
937
- });
938
- }
939
- /**
940
- * @experimental this method signature might change in the future
941
- *
942
- * @category File Buckets
943
- * @param options search options
944
- * @param parameters
945
- */
946
- listV2(options, parameters) {
947
- return __awaiter(this, void 0, void 0, function* () {
948
- try {
949
- const body = Object.assign({}, options);
950
- const data = yield post(this.fetch, `${this.url}/object/list-v2/${this.bucketId}`, body, { headers: this.headers }, parameters);
951
- return { data, error: null };
952
- }
953
- catch (error) {
954
- if (this.shouldThrowOnError) {
955
- throw error;
956
- }
957
- if (isStorageError(error)) {
958
- return { data: null, error };
959
- }
960
- throw error;
961
- }
962
- });
963
- }
964
- encodeMetadata(metadata) {
965
- return JSON.stringify(metadata);
966
- }
967
- toBase64(data) {
968
- if (typeof Buffer !== 'undefined') {
969
- return Buffer.from(data).toString('base64');
970
- }
971
- return btoa(data);
972
- }
973
- _getFinalPath(path) {
974
- return `${this.bucketId}/${path.replace(/^\/+/, '')}`;
975
- }
976
- _removeEmptyFolders(path) {
977
- return path.replace(/^\/|\/$/g, '').replace(/\/+/g, '/');
978
- }
979
- transformOptsToQueryString(transform) {
980
- const params = [];
981
- if (transform.width) {
982
- params.push(`width=${transform.width}`);
983
- }
984
- if (transform.height) {
985
- params.push(`height=${transform.height}`);
986
- }
987
- if (transform.resize) {
988
- params.push(`resize=${transform.resize}`);
989
- }
990
- if (transform.format) {
991
- params.push(`format=${transform.format}`);
992
- }
993
- if (transform.quality) {
994
- params.push(`quality=${transform.quality}`);
995
- }
996
- return params.join('&');
997
- }
998
- }
999
- //# sourceMappingURL=StorageFileApi.js.map