@firebase/storage 0.14.4 → 0.14.5
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/dist/index.browser.cjs.js +1 -1
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +1 -1
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/storage-public.d.ts +52 -3
- package/package.json +5 -5
package/dist/storage-public.d.ts
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import { CompleteFn } from '@firebase/util';
|
|
8
|
+
import { EmulatorMockTokenOptions } from '@firebase/util';
|
|
7
9
|
import { FirebaseApp } from '@firebase/app';
|
|
10
|
+
import { FirebaseError } from '@firebase/util';
|
|
11
|
+
import { NextFn } from '@firebase/util';
|
|
12
|
+
import { Subscribe } from '@firebase/util';
|
|
13
|
+
import { Unsubscribe } from '@firebase/util';
|
|
8
14
|
/**
|
|
9
15
|
* Modify this {@link FirebaseStorage} instance to communicate with the Cloud Storage emulator.
|
|
10
16
|
*
|
|
@@ -18,7 +24,9 @@ import { FirebaseApp } from '@firebase/app';
|
|
|
18
24
|
export declare function connectStorageEmulator(storage: FirebaseStorage, host: string, port: number, options?: {
|
|
19
25
|
mockUserToken?: EmulatorMockTokenOptions | string;
|
|
20
26
|
}): void;
|
|
27
|
+
|
|
21
28
|
/* Excluded from this release type: _dataFromString */
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* Deletes the object at this location.
|
|
24
32
|
* @public
|
|
@@ -26,9 +34,11 @@ export declare function connectStorageEmulator(storage: FirebaseStorage, host: s
|
|
|
26
34
|
* @returns A `Promise` that resolves if the deletion succeeds.
|
|
27
35
|
*/
|
|
28
36
|
export declare function deleteObject(ref: StorageReference): Promise<void>;
|
|
29
|
-
export { EmulatorMockTokenOptions }
|
|
37
|
+
export { EmulatorMockTokenOptions }
|
|
30
38
|
/* Excluded from this release type: _FbsBlob */
|
|
39
|
+
|
|
31
40
|
/* Excluded from this release type: _FirebaseService */
|
|
41
|
+
|
|
32
42
|
/**
|
|
33
43
|
* A Firebase Storage instance.
|
|
34
44
|
* @public
|
|
@@ -48,7 +58,9 @@ export declare interface FirebaseStorage {
|
|
|
48
58
|
*/
|
|
49
59
|
maxOperationRetryTime: number;
|
|
50
60
|
}
|
|
61
|
+
|
|
51
62
|
/* Excluded from this release type: _FirebaseStorageImpl */
|
|
63
|
+
|
|
52
64
|
/**
|
|
53
65
|
* The full set of object metadata, including read-only properties.
|
|
54
66
|
* @public
|
|
@@ -98,6 +110,7 @@ export declare interface FullMetadata extends UploadMetadata {
|
|
|
98
110
|
*/
|
|
99
111
|
ref?: StorageReference | undefined;
|
|
100
112
|
}
|
|
113
|
+
|
|
101
114
|
/**
|
|
102
115
|
* Downloads the data at the object's location. Returns an error if the object
|
|
103
116
|
* is not found.
|
|
@@ -115,6 +128,7 @@ export declare interface FullMetadata extends UploadMetadata {
|
|
|
115
128
|
* @returns A Promise that resolves with a Blob containing the object's bytes
|
|
116
129
|
*/
|
|
117
130
|
export declare function getBlob(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<Blob>;
|
|
131
|
+
|
|
118
132
|
/**
|
|
119
133
|
* Downloads the data at the object's location. Returns an error if the object
|
|
120
134
|
* is not found.
|
|
@@ -130,7 +144,9 @@ export declare function getBlob(ref: StorageReference, maxDownloadSizeBytes?: nu
|
|
|
130
144
|
* @returns A Promise containing the object's bytes
|
|
131
145
|
*/
|
|
132
146
|
export declare function getBytes(ref: StorageReference, maxDownloadSizeBytes?: number): Promise<ArrayBuffer>;
|
|
147
|
+
|
|
133
148
|
/* Excluded from this release type: _getChild */
|
|
149
|
+
|
|
134
150
|
/**
|
|
135
151
|
* Returns the download URL for the given {@link StorageReference}.
|
|
136
152
|
* @public
|
|
@@ -139,6 +155,7 @@ export declare function getBytes(ref: StorageReference, maxDownloadSizeBytes?: n
|
|
|
139
155
|
* URL for this object.
|
|
140
156
|
*/
|
|
141
157
|
export declare function getDownloadURL(ref: StorageReference): Promise<string>;
|
|
158
|
+
|
|
142
159
|
/**
|
|
143
160
|
* A `Promise` that resolves with the metadata for this object. If this
|
|
144
161
|
* object doesn't exist or metadata cannot be retrieved, the promise is
|
|
@@ -147,6 +164,7 @@ export declare function getDownloadURL(ref: StorageReference): Promise<string>;
|
|
|
147
164
|
* @param ref - {@link StorageReference} to get metadata from.
|
|
148
165
|
*/
|
|
149
166
|
export declare function getMetadata(ref: StorageReference): Promise<FullMetadata>;
|
|
167
|
+
|
|
150
168
|
/**
|
|
151
169
|
* Gets a {@link FirebaseStorage} instance for the given Firebase app.
|
|
152
170
|
* @public
|
|
@@ -156,6 +174,7 @@ export declare function getMetadata(ref: StorageReference): Promise<FullMetadata
|
|
|
156
174
|
* @returns A {@link FirebaseStorage} instance.
|
|
157
175
|
*/
|
|
158
176
|
export declare function getStorage(app?: FirebaseApp, bucketUrl?: string): FirebaseStorage;
|
|
177
|
+
|
|
159
178
|
/**
|
|
160
179
|
* Downloads the data at the object's location. Raises an error event if the
|
|
161
180
|
* object is not found.
|
|
@@ -170,7 +189,9 @@ export declare function getStorage(app?: FirebaseApp, bucketUrl?: string): Fireb
|
|
|
170
189
|
*/
|
|
171
190
|
export declare function getStream(ref: StorageReference, maxDownloadSizeBytes?: number): ReadableStream;
|
|
172
191
|
/* Excluded from this release type: _invalidArgument */
|
|
192
|
+
|
|
173
193
|
/* Excluded from this release type: _invalidRootOperation */
|
|
194
|
+
|
|
174
195
|
/**
|
|
175
196
|
* List items (files) and prefixes (folders) under this storage reference.
|
|
176
197
|
*
|
|
@@ -194,6 +215,7 @@ export declare function getStream(ref: StorageReference, maxDownloadSizeBytes?:
|
|
|
194
215
|
* can be used to get the rest of the results.
|
|
195
216
|
*/
|
|
196
217
|
export declare function list(ref: StorageReference, options?: ListOptions): Promise<ListResult>;
|
|
218
|
+
|
|
197
219
|
/**
|
|
198
220
|
* List all items (files) and prefixes (folders) under this storage reference.
|
|
199
221
|
*
|
|
@@ -214,6 +236,7 @@ export declare function list(ref: StorageReference, options?: ListOptions): Prom
|
|
|
214
236
|
* folder. `nextPageToken` is never returned.
|
|
215
237
|
*/
|
|
216
238
|
export declare function listAll(ref: StorageReference): Promise<ListResult>;
|
|
239
|
+
|
|
217
240
|
/**
|
|
218
241
|
* The options `list()` accepts.
|
|
219
242
|
* @public
|
|
@@ -230,6 +253,7 @@ export declare interface ListOptions {
|
|
|
230
253
|
*/
|
|
231
254
|
pageToken?: string | null;
|
|
232
255
|
}
|
|
256
|
+
|
|
233
257
|
/**
|
|
234
258
|
* Result returned by list().
|
|
235
259
|
* @public
|
|
@@ -254,6 +278,8 @@ export declare interface ListResult {
|
|
|
254
278
|
*/
|
|
255
279
|
nextPageToken?: string;
|
|
256
280
|
}
|
|
281
|
+
|
|
282
|
+
/* Excluded from this release type: _Location */
|
|
257
283
|
/**
|
|
258
284
|
* Returns a {@link StorageReference} for the given url.
|
|
259
285
|
* @param storage - {@link FirebaseStorage} instance.
|
|
@@ -261,6 +287,7 @@ export declare interface ListResult {
|
|
|
261
287
|
* @public
|
|
262
288
|
*/
|
|
263
289
|
export declare function ref(storage: FirebaseStorage, url?: string): StorageReference;
|
|
290
|
+
|
|
264
291
|
/**
|
|
265
292
|
* Returns a {@link StorageReference} for the given path in the
|
|
266
293
|
* default bucket.
|
|
@@ -270,6 +297,9 @@ export declare function ref(storage: FirebaseStorage, url?: string): StorageRefe
|
|
|
270
297
|
* @public
|
|
271
298
|
*/
|
|
272
299
|
export declare function ref(storageOrRef: FirebaseStorage | StorageReference, path?: string): StorageReference;
|
|
300
|
+
|
|
301
|
+
/* Excluded from this release type: _Reference */
|
|
302
|
+
|
|
273
303
|
/**
|
|
274
304
|
* Object metadata that can be set at any time.
|
|
275
305
|
* @public
|
|
@@ -302,6 +332,7 @@ export declare interface SettableMetadata {
|
|
|
302
332
|
[key: string]: string;
|
|
303
333
|
} | undefined;
|
|
304
334
|
}
|
|
335
|
+
|
|
305
336
|
/**
|
|
306
337
|
* An error returned by the Firebase Storage SDK.
|
|
307
338
|
* @public
|
|
@@ -329,6 +360,7 @@ export declare class StorageError extends FirebaseError {
|
|
|
329
360
|
get serverResponse(): null | string;
|
|
330
361
|
set serverResponse(serverResponse: string | null);
|
|
331
362
|
}
|
|
363
|
+
|
|
332
364
|
/**
|
|
333
365
|
* @public
|
|
334
366
|
* Error codes that can be attached to `StorageError` objects.
|
|
@@ -360,6 +392,7 @@ export declare enum StorageErrorCode {
|
|
|
360
392
|
INTERNAL_ERROR = "internal-error",
|
|
361
393
|
UNSUPPORTED_ENVIRONMENT = "unsupported-environment"
|
|
362
394
|
}
|
|
395
|
+
|
|
363
396
|
/**
|
|
364
397
|
* A stream observer for Firebase Storage.
|
|
365
398
|
* @public
|
|
@@ -369,6 +402,7 @@ export declare interface StorageObserver<T> {
|
|
|
369
402
|
error?: (error: StorageError) => void | null;
|
|
370
403
|
complete?: CompleteFn | null;
|
|
371
404
|
}
|
|
405
|
+
|
|
372
406
|
/**
|
|
373
407
|
* Represents a reference to a Google Cloud Storage object. Developers can
|
|
374
408
|
* upload, download, and delete objects, as well as get/set object metadata.
|
|
@@ -408,6 +442,7 @@ export declare interface StorageReference {
|
|
|
408
442
|
*/
|
|
409
443
|
parent: StorageReference | null;
|
|
410
444
|
}
|
|
445
|
+
|
|
411
446
|
/**
|
|
412
447
|
* @license
|
|
413
448
|
* Copyright 2017 Google LLC
|
|
@@ -429,6 +464,7 @@ export declare interface StorageReference {
|
|
|
429
464
|
* @public
|
|
430
465
|
*/
|
|
431
466
|
export declare type StringFormat = (typeof StringFormat)[keyof typeof StringFormat];
|
|
467
|
+
|
|
432
468
|
/**
|
|
433
469
|
* An enumeration of the possible string formats for upload.
|
|
434
470
|
* @public
|
|
@@ -472,12 +508,16 @@ export declare const StringFormat: {
|
|
|
472
508
|
* @public
|
|
473
509
|
*/
|
|
474
510
|
export declare type TaskEvent = 'state_changed';
|
|
511
|
+
|
|
475
512
|
/* Excluded from this release type: _TaskEvent */
|
|
513
|
+
|
|
476
514
|
/**
|
|
477
515
|
* Represents the current state of a running upload.
|
|
478
516
|
* @public
|
|
479
517
|
*/
|
|
480
518
|
export declare type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error';
|
|
519
|
+
|
|
520
|
+
/* Excluded from this release type: _TaskState */
|
|
481
521
|
/**
|
|
482
522
|
* Updates the metadata for this object.
|
|
483
523
|
* @public
|
|
@@ -488,6 +528,7 @@ export declare type TaskState = 'running' | 'paused' | 'success' | 'canceled' |
|
|
|
488
528
|
* @returns A `Promise` that resolves with the new metadata for this object.
|
|
489
529
|
*/
|
|
490
530
|
export declare function updateMetadata(ref: StorageReference, metadata: SettableMetadata): Promise<FullMetadata>;
|
|
531
|
+
|
|
491
532
|
/**
|
|
492
533
|
* Uploads data to this object's location.
|
|
493
534
|
* The upload is not resumable.
|
|
@@ -498,6 +539,7 @@ export declare function updateMetadata(ref: StorageReference, metadata: Settable
|
|
|
498
539
|
* @returns A Promise containing an UploadResult
|
|
499
540
|
*/
|
|
500
541
|
export declare function uploadBytes(ref: StorageReference, data: Blob | Uint8Array | ArrayBuffer, metadata?: UploadMetadata): Promise<UploadResult>;
|
|
542
|
+
|
|
501
543
|
/**
|
|
502
544
|
* Uploads data to this object's location.
|
|
503
545
|
* The upload can be paused and resumed, and exposes progress updates.
|
|
@@ -508,6 +550,7 @@ export declare function uploadBytes(ref: StorageReference, data: Blob | Uint8Arr
|
|
|
508
550
|
* @returns An UploadTask
|
|
509
551
|
*/
|
|
510
552
|
export declare function uploadBytesResumable(ref: StorageReference, data: Blob | Uint8Array | ArrayBuffer, metadata?: UploadMetadata): UploadTask;
|
|
553
|
+
|
|
511
554
|
/**
|
|
512
555
|
* Object metadata that can be set at upload.
|
|
513
556
|
* @public
|
|
@@ -518,6 +561,7 @@ export declare interface UploadMetadata extends SettableMetadata {
|
|
|
518
561
|
*/
|
|
519
562
|
md5Hash?: string | undefined;
|
|
520
563
|
}
|
|
564
|
+
|
|
521
565
|
/**
|
|
522
566
|
* Result returned from a non-resumable upload.
|
|
523
567
|
* @public
|
|
@@ -532,6 +576,7 @@ export declare interface UploadResult {
|
|
|
532
576
|
*/
|
|
533
577
|
readonly ref: StorageReference;
|
|
534
578
|
}
|
|
579
|
+
|
|
535
580
|
/**
|
|
536
581
|
* Uploads a string to this object's location.
|
|
537
582
|
* The upload is not resumable.
|
|
@@ -543,6 +588,7 @@ export declare interface UploadResult {
|
|
|
543
588
|
* @returns A Promise containing an UploadResult
|
|
544
589
|
*/
|
|
545
590
|
export declare function uploadString(ref: StorageReference, value: string, format?: StringFormat, metadata?: UploadMetadata): Promise<UploadResult>;
|
|
591
|
+
|
|
546
592
|
/**
|
|
547
593
|
* Represents the process of uploading an object. Allows you to monitor and
|
|
548
594
|
* manage the upload.
|
|
@@ -690,7 +736,9 @@ export declare interface UploadTask {
|
|
|
690
736
|
*/
|
|
691
737
|
then(onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null, onRejected?: ((error: StorageError) => unknown) | null): Promise<unknown>;
|
|
692
738
|
}
|
|
739
|
+
|
|
693
740
|
/* Excluded from this release type: _UploadTask */
|
|
741
|
+
|
|
694
742
|
/**
|
|
695
743
|
* Holds data about the current state of the upload task.
|
|
696
744
|
* @public
|
|
@@ -722,4 +770,5 @@ export declare interface UploadTaskSnapshot {
|
|
|
722
770
|
*/
|
|
723
771
|
totalBytes: number;
|
|
724
772
|
}
|
|
725
|
-
|
|
773
|
+
|
|
774
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/storage",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
},
|
|
47
47
|
"license": "Apache-2.0",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@firebase/util": "1.15.
|
|
50
|
-
"@firebase/component": "0.7.
|
|
49
|
+
"@firebase/util": "1.15.3",
|
|
50
|
+
"@firebase/component": "0.7.5",
|
|
51
51
|
"tslib": "^2.1.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@firebase/app": "0.x"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@firebase/app": "0.16.
|
|
58
|
-
"@firebase/auth": "1.13.
|
|
57
|
+
"@firebase/app": "0.16.1",
|
|
58
|
+
"@firebase/auth": "1.13.5",
|
|
59
59
|
"rollup": "4.62.2",
|
|
60
60
|
"@rollup/plugin-alias": "5.1.1",
|
|
61
61
|
"@rollup/plugin-json": "6.1.0",
|