@firebase/storage-compat 0.3.12 → 0.3.13

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.
@@ -347,7 +347,7 @@ function isUrl(path) {
347
347
  }
348
348
 
349
349
  const name = "@firebase/storage-compat";
350
- const version = "0.3.12";
350
+ const version = "0.3.13";
351
351
 
352
352
  /**
353
353
  * @license
package/dist/index.cjs.js CHANGED
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var firebase = require('@firebase/app-compat');
6
6
  var storage = require('@firebase/storage');
7
- var tslib = require('tslib');
8
7
  var component = require('@firebase/component');
9
8
 
10
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -27,42 +26,25 @@ var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
27
26
  * See the License for the specific language governing permissions and
28
27
  * limitations under the License.
29
28
  */
30
- var UploadTaskSnapshotCompat = /** @class */ (function () {
31
- function UploadTaskSnapshotCompat(_delegate, task, ref) {
29
+ class UploadTaskSnapshotCompat {
30
+ constructor(_delegate, task, ref) {
32
31
  this._delegate = _delegate;
33
32
  this.task = task;
34
33
  this.ref = ref;
35
34
  }
36
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "bytesTransferred", {
37
- get: function () {
38
- return this._delegate.bytesTransferred;
39
- },
40
- enumerable: false,
41
- configurable: true
42
- });
43
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "metadata", {
44
- get: function () {
45
- return this._delegate.metadata;
46
- },
47
- enumerable: false,
48
- configurable: true
49
- });
50
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "state", {
51
- get: function () {
52
- return this._delegate.state;
53
- },
54
- enumerable: false,
55
- configurable: true
56
- });
57
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "totalBytes", {
58
- get: function () {
59
- return this._delegate.totalBytes;
60
- },
61
- enumerable: false,
62
- configurable: true
63
- });
64
- return UploadTaskSnapshotCompat;
65
- }());
35
+ get bytesTransferred() {
36
+ return this._delegate.bytesTransferred;
37
+ }
38
+ get metadata() {
39
+ return this._delegate.metadata;
40
+ }
41
+ get state() {
42
+ return this._delegate.state;
43
+ }
44
+ get totalBytes() {
45
+ return this._delegate.totalBytes;
46
+ }
47
+ }
66
48
 
67
49
  /**
68
50
  * @license
@@ -80,8 +62,8 @@ var UploadTaskSnapshotCompat = /** @class */ (function () {
80
62
  * See the License for the specific language governing permissions and
81
63
  * limitations under the License.
82
64
  */
83
- var UploadTaskCompat = /** @class */ (function () {
84
- function UploadTaskCompat(_delegate, _ref) {
65
+ class UploadTaskCompat {
66
+ constructor(_delegate, _ref) {
85
67
  this._delegate = _delegate;
86
68
  this._ref = _ref;
87
69
  this.cancel = this._delegate.cancel.bind(this._delegate);
@@ -89,36 +71,26 @@ var UploadTaskCompat = /** @class */ (function () {
89
71
  this.pause = this._delegate.pause.bind(this._delegate);
90
72
  this.resume = this._delegate.resume.bind(this._delegate);
91
73
  }
92
- Object.defineProperty(UploadTaskCompat.prototype, "snapshot", {
93
- get: function () {
94
- return new UploadTaskSnapshotCompat(this._delegate.snapshot, this, this._ref);
95
- },
96
- enumerable: false,
97
- configurable: true
98
- });
99
- UploadTaskCompat.prototype.then = function (onFulfilled, onRejected) {
100
- var _this = this;
101
- return this._delegate.then(function (snapshot) {
74
+ get snapshot() {
75
+ return new UploadTaskSnapshotCompat(this._delegate.snapshot, this, this._ref);
76
+ }
77
+ then(onFulfilled, onRejected) {
78
+ return this._delegate.then(snapshot => {
102
79
  if (onFulfilled) {
103
- return onFulfilled(new UploadTaskSnapshotCompat(snapshot, _this, _this._ref));
80
+ return onFulfilled(new UploadTaskSnapshotCompat(snapshot, this, this._ref));
104
81
  }
105
82
  }, onRejected);
106
- };
107
- UploadTaskCompat.prototype.on = function (type, nextOrObserver, error, completed) {
108
- var _this = this;
109
- var wrappedNextOrObserver = undefined;
83
+ }
84
+ on(type, nextOrObserver, error, completed) {
85
+ let wrappedNextOrObserver = undefined;
110
86
  if (!!nextOrObserver) {
111
87
  if (typeof nextOrObserver === 'function') {
112
- wrappedNextOrObserver = function (taskSnapshot) {
113
- return nextOrObserver(new UploadTaskSnapshotCompat(taskSnapshot, _this, _this._ref));
114
- };
88
+ wrappedNextOrObserver = (taskSnapshot) => nextOrObserver(new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref));
115
89
  }
116
90
  else {
117
91
  wrappedNextOrObserver = {
118
92
  next: !!nextOrObserver.next
119
- ? function (taskSnapshot) {
120
- return nextOrObserver.next(new UploadTaskSnapshotCompat(taskSnapshot, _this, _this._ref));
121
- }
93
+ ? (taskSnapshot) => nextOrObserver.next(new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref))
122
94
  : undefined,
123
95
  complete: nextOrObserver.complete || undefined,
124
96
  error: nextOrObserver.error || undefined
@@ -126,40 +98,24 @@ var UploadTaskCompat = /** @class */ (function () {
126
98
  }
127
99
  }
128
100
  return this._delegate.on(type, wrappedNextOrObserver, error || undefined, completed || undefined);
129
- };
130
- return UploadTaskCompat;
131
- }());
101
+ }
102
+ }
132
103
 
133
- var ListResultCompat = /** @class */ (function () {
134
- function ListResultCompat(_delegate, _service) {
104
+ class ListResultCompat {
105
+ constructor(_delegate, _service) {
135
106
  this._delegate = _delegate;
136
107
  this._service = _service;
137
108
  }
138
- Object.defineProperty(ListResultCompat.prototype, "prefixes", {
139
- get: function () {
140
- var _this = this;
141
- return this._delegate.prefixes.map(function (ref) { return new ReferenceCompat(ref, _this._service); });
142
- },
143
- enumerable: false,
144
- configurable: true
145
- });
146
- Object.defineProperty(ListResultCompat.prototype, "items", {
147
- get: function () {
148
- var _this = this;
149
- return this._delegate.items.map(function (ref) { return new ReferenceCompat(ref, _this._service); });
150
- },
151
- enumerable: false,
152
- configurable: true
153
- });
154
- Object.defineProperty(ListResultCompat.prototype, "nextPageToken", {
155
- get: function () {
156
- return this._delegate.nextPageToken || null;
157
- },
158
- enumerable: false,
159
- configurable: true
160
- });
161
- return ListResultCompat;
162
- }());
109
+ get prefixes() {
110
+ return this._delegate.prefixes.map(ref => new ReferenceCompat(ref, this._service));
111
+ }
112
+ get items() {
113
+ return this._delegate.items.map(ref => new ReferenceCompat(ref, this._service));
114
+ }
115
+ get nextPageToken() {
116
+ return this._delegate.nextPageToken || null;
117
+ }
118
+ }
163
119
 
164
120
  /**
165
121
  * @license
@@ -177,76 +133,56 @@ var ListResultCompat = /** @class */ (function () {
177
133
  * See the License for the specific language governing permissions and
178
134
  * limitations under the License.
179
135
  */
180
- var ReferenceCompat = /** @class */ (function () {
181
- function ReferenceCompat(_delegate, storage) {
136
+ class ReferenceCompat {
137
+ constructor(_delegate, storage) {
182
138
  this._delegate = _delegate;
183
139
  this.storage = storage;
184
140
  }
185
- Object.defineProperty(ReferenceCompat.prototype, "name", {
186
- get: function () {
187
- return this._delegate.name;
188
- },
189
- enumerable: false,
190
- configurable: true
191
- });
192
- Object.defineProperty(ReferenceCompat.prototype, "bucket", {
193
- get: function () {
194
- return this._delegate.bucket;
195
- },
196
- enumerable: false,
197
- configurable: true
198
- });
199
- Object.defineProperty(ReferenceCompat.prototype, "fullPath", {
200
- get: function () {
201
- return this._delegate.fullPath;
202
- },
203
- enumerable: false,
204
- configurable: true
205
- });
206
- ReferenceCompat.prototype.toString = function () {
141
+ get name() {
142
+ return this._delegate.name;
143
+ }
144
+ get bucket() {
145
+ return this._delegate.bucket;
146
+ }
147
+ get fullPath() {
148
+ return this._delegate.fullPath;
149
+ }
150
+ toString() {
207
151
  return this._delegate.toString();
208
- };
152
+ }
209
153
  /**
210
154
  * @returns A reference to the object obtained by
211
155
  * appending childPath, removing any duplicate, beginning, or trailing
212
156
  * slashes.
213
157
  */
214
- ReferenceCompat.prototype.child = function (childPath) {
215
- var reference = storage._getChild(this._delegate, childPath);
158
+ child(childPath) {
159
+ const reference = storage._getChild(this._delegate, childPath);
216
160
  return new ReferenceCompat(reference, this.storage);
217
- };
218
- Object.defineProperty(ReferenceCompat.prototype, "root", {
219
- get: function () {
220
- return new ReferenceCompat(this._delegate.root, this.storage);
221
- },
222
- enumerable: false,
223
- configurable: true
224
- });
225
- Object.defineProperty(ReferenceCompat.prototype, "parent", {
226
- /**
227
- * @returns A reference to the parent of the
228
- * current object, or null if the current object is the root.
229
- */
230
- get: function () {
231
- var reference = this._delegate.parent;
232
- if (reference == null) {
233
- return null;
234
- }
235
- return new ReferenceCompat(reference, this.storage);
236
- },
237
- enumerable: false,
238
- configurable: true
239
- });
161
+ }
162
+ get root() {
163
+ return new ReferenceCompat(this._delegate.root, this.storage);
164
+ }
165
+ /**
166
+ * @returns A reference to the parent of the
167
+ * current object, or null if the current object is the root.
168
+ */
169
+ get parent() {
170
+ const reference = this._delegate.parent;
171
+ if (reference == null) {
172
+ return null;
173
+ }
174
+ return new ReferenceCompat(reference, this.storage);
175
+ }
240
176
  /**
241
177
  * Uploads a blob to this object's location.
242
178
  * @param data - The blob to upload.
243
179
  * @returns An UploadTask that lets you control and
244
180
  * observe the upload.
245
181
  */
246
- ReferenceCompat.prototype.put = function (data, metadata) {
182
+ put(data, metadata) {
247
183
  this._throwIfRoot('put');
248
184
  return new UploadTaskCompat(storage.uploadBytesResumable(this._delegate, data, metadata), this);
249
- };
185
+ }
250
186
  /**
251
187
  * Uploads a string to this object's location.
252
188
  * @param value - The string to upload.
@@ -254,16 +190,15 @@ var ReferenceCompat = /** @class */ (function () {
254
190
  * @returns An UploadTask that lets you control and
255
191
  * observe the upload.
256
192
  */
257
- ReferenceCompat.prototype.putString = function (value, format, metadata) {
258
- if (format === void 0) { format = storage.StringFormat.RAW; }
193
+ putString(value, format = storage.StringFormat.RAW, metadata) {
259
194
  this._throwIfRoot('putString');
260
- var data = storage._dataFromString(format, value);
261
- var metadataClone = tslib.__assign({}, metadata);
195
+ const data = storage._dataFromString(format, value);
196
+ const metadataClone = Object.assign({}, metadata);
262
197
  if (metadataClone['contentType'] == null && data.contentType != null) {
263
198
  metadataClone['contentType'] = data.contentType;
264
199
  }
265
200
  return new UploadTaskCompat(new storage._UploadTask(this._delegate, new storage._FbsBlob(data.data, true), metadataClone), this);
266
- };
201
+ }
267
202
  /**
268
203
  * List all items (files) and prefixes (folders) under this storage reference.
269
204
  *
@@ -281,10 +216,9 @@ var ReferenceCompat = /** @class */ (function () {
281
216
  * sub-directories and `items` contains references to objects in this
282
217
  * folder. `nextPageToken` is never returned.
283
218
  */
284
- ReferenceCompat.prototype.listAll = function () {
285
- var _this = this;
286
- return storage.listAll(this._delegate).then(function (r) { return new ListResultCompat(r, _this.storage); });
287
- };
219
+ listAll() {
220
+ return storage.listAll(this._delegate).then(r => new ListResultCompat(r, this.storage));
221
+ }
288
222
  /**
289
223
  * List items (files) and prefixes (folders) under this storage reference.
290
224
  *
@@ -304,18 +238,17 @@ var ReferenceCompat = /** @class */ (function () {
304
238
  * contains references to objects in this folder. `nextPageToken`
305
239
  * can be used to get the rest of the results.
306
240
  */
307
- ReferenceCompat.prototype.list = function (options) {
308
- var _this = this;
309
- return storage.list(this._delegate, options || undefined).then(function (r) { return new ListResultCompat(r, _this.storage); });
310
- };
241
+ list(options) {
242
+ return storage.list(this._delegate, options || undefined).then(r => new ListResultCompat(r, this.storage));
243
+ }
311
244
  /**
312
245
  * A `Promise` that resolves with the metadata for this object. If this
313
246
  * object doesn't exist or metadata cannot be retrieved, the promise is
314
247
  * rejected.
315
248
  */
316
- ReferenceCompat.prototype.getMetadata = function () {
249
+ getMetadata() {
317
250
  return storage.getMetadata(this._delegate);
318
- };
251
+ }
319
252
  /**
320
253
  * Updates the metadata for this object.
321
254
  * @param metadata - The new metadata for the object.
@@ -325,31 +258,30 @@ var ReferenceCompat = /** @class */ (function () {
325
258
  * with the new metadata for this object.
326
259
  * @see firebaseStorage.Reference.prototype.getMetadata
327
260
  */
328
- ReferenceCompat.prototype.updateMetadata = function (metadata) {
261
+ updateMetadata(metadata) {
329
262
  return storage.updateMetadata(this._delegate, metadata);
330
- };
263
+ }
331
264
  /**
332
265
  * @returns A `Promise` that resolves with the download
333
266
  * URL for this object.
334
267
  */
335
- ReferenceCompat.prototype.getDownloadURL = function () {
268
+ getDownloadURL() {
336
269
  return storage.getDownloadURL(this._delegate);
337
- };
270
+ }
338
271
  /**
339
272
  * Deletes the object at this location.
340
273
  * @returns A `Promise` that resolves if the deletion succeeds.
341
274
  */
342
- ReferenceCompat.prototype.delete = function () {
275
+ delete() {
343
276
  this._throwIfRoot('delete');
344
277
  return storage.deleteObject(this._delegate);
345
- };
346
- ReferenceCompat.prototype._throwIfRoot = function (name) {
278
+ }
279
+ _throwIfRoot(name) {
347
280
  if (this._delegate._location.path === '') {
348
281
  throw storage._invalidRootOperation(name);
349
282
  }
350
- };
351
- return ReferenceCompat;
352
- }());
283
+ }
284
+ }
353
285
 
354
286
  /**
355
287
  * @license
@@ -371,40 +303,32 @@ var ReferenceCompat = /** @class */ (function () {
371
303
  * A service that provides firebaseStorage.Reference instances.
372
304
  * @param opt_url gs:// url to a custom Storage Bucket
373
305
  */
374
- var StorageServiceCompat = /** @class */ (function () {
375
- function StorageServiceCompat(app, _delegate) {
306
+ class StorageServiceCompat {
307
+ constructor(app, _delegate) {
376
308
  this.app = app;
377
309
  this._delegate = _delegate;
378
310
  }
379
- Object.defineProperty(StorageServiceCompat.prototype, "maxOperationRetryTime", {
380
- get: function () {
381
- return this._delegate.maxOperationRetryTime;
382
- },
383
- enumerable: false,
384
- configurable: true
385
- });
386
- Object.defineProperty(StorageServiceCompat.prototype, "maxUploadRetryTime", {
387
- get: function () {
388
- return this._delegate.maxUploadRetryTime;
389
- },
390
- enumerable: false,
391
- configurable: true
392
- });
311
+ get maxOperationRetryTime() {
312
+ return this._delegate.maxOperationRetryTime;
313
+ }
314
+ get maxUploadRetryTime() {
315
+ return this._delegate.maxUploadRetryTime;
316
+ }
393
317
  /**
394
318
  * Returns a firebaseStorage.Reference for the given path in the default
395
319
  * bucket.
396
320
  */
397
- StorageServiceCompat.prototype.ref = function (path) {
321
+ ref(path) {
398
322
  if (isUrl(path)) {
399
323
  throw storage._invalidArgument('ref() expected a child path but got a URL, use refFromURL instead.');
400
324
  }
401
325
  return new ReferenceCompat(storage.ref(this._delegate, path), this);
402
- };
326
+ }
403
327
  /**
404
328
  * Returns a firebaseStorage.Reference object for the given absolute URL,
405
329
  * which must be a gs:// or http[s]:// URL.
406
330
  */
407
- StorageServiceCompat.prototype.refFromURL = function (url) {
331
+ refFromURL(url) {
408
332
  if (!isUrl(url)) {
409
333
  throw storage._invalidArgument('refFromURL() expected a full URL but got a child path, use ref() instead.');
410
334
  }
@@ -415,25 +339,23 @@ var StorageServiceCompat = /** @class */ (function () {
415
339
  throw storage._invalidArgument('refFromUrl() expected a valid full URL but got an invalid one.');
416
340
  }
417
341
  return new ReferenceCompat(storage.ref(this._delegate, url), this);
418
- };
419
- StorageServiceCompat.prototype.setMaxUploadRetryTime = function (time) {
342
+ }
343
+ setMaxUploadRetryTime(time) {
420
344
  this._delegate.maxUploadRetryTime = time;
421
- };
422
- StorageServiceCompat.prototype.setMaxOperationRetryTime = function (time) {
345
+ }
346
+ setMaxOperationRetryTime(time) {
423
347
  this._delegate.maxOperationRetryTime = time;
424
- };
425
- StorageServiceCompat.prototype.useEmulator = function (host, port, options) {
426
- if (options === void 0) { options = {}; }
348
+ }
349
+ useEmulator(host, port, options = {}) {
427
350
  storage.connectStorageEmulator(this._delegate, host, port, options);
428
- };
429
- return StorageServiceCompat;
430
- }());
351
+ }
352
+ }
431
353
  function isUrl(path) {
432
354
  return /^[A-Za-z]+:\/\//.test(path);
433
355
  }
434
356
 
435
- var name = "@firebase/storage-compat";
436
- var version = "0.3.12";
357
+ const name = "@firebase/storage-compat";
358
+ const version = "0.3.13";
437
359
 
438
360
  /**
439
361
  * @license
@@ -454,19 +376,18 @@ var version = "0.3.12";
454
376
  /**
455
377
  * Type constant for Firebase Storage.
456
378
  */
457
- var STORAGE_TYPE = 'storage-compat';
458
- function factory(container, _a) {
459
- var url = _a.instanceIdentifier;
379
+ const STORAGE_TYPE = 'storage-compat';
380
+ function factory(container, { instanceIdentifier: url }) {
460
381
  // Dependencies
461
- var app = container.getProvider('app-compat').getImmediate();
462
- var storageExp = container
382
+ const app = container.getProvider('app-compat').getImmediate();
383
+ const storageExp = container
463
384
  .getProvider('storage')
464
385
  .getImmediate({ identifier: url });
465
- var storageServiceCompat = new StorageServiceCompat(app, storageExp);
386
+ const storageServiceCompat = new StorageServiceCompat(app, storageExp);
466
387
  return storageServiceCompat;
467
388
  }
468
389
  function registerStorage(instance) {
469
- var namespaceExports = {
390
+ const namespaceExports = {
470
391
  // no-inline
471
392
  TaskState: storage._TaskState,
472
393
  TaskEvent: storage._TaskEvent,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/tasksnapshot.ts","../src/task.ts","../src/list.ts","../src/reference.ts","../src/service.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UploadTaskSnapshot } from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { UploadTaskCompat } from './task';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskSnapshotCompat\n implements types.UploadTaskSnapshot, Compat<UploadTaskSnapshot>\n{\n constructor(\n readonly _delegate: UploadTaskSnapshot,\n readonly task: UploadTaskCompat,\n readonly ref: ReferenceCompat\n ) {}\n\n get bytesTransferred(): number {\n return this._delegate.bytesTransferred;\n }\n get metadata(): types.FullMetadata {\n return this._delegate.metadata as types.FullMetadata;\n }\n get state(): string {\n return this._delegate.state;\n }\n get totalBytes(): number {\n return this._delegate.totalBytes;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n UploadTask,\n StorageError,\n UploadTaskSnapshot,\n TaskEvent,\n StorageObserver\n} from '@firebase/storage';\nimport { UploadTaskSnapshotCompat } from './tasksnapshot';\nimport { ReferenceCompat } from './reference';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskCompat implements types.UploadTask, Compat<UploadTask> {\n constructor(\n readonly _delegate: UploadTask,\n private readonly _ref: ReferenceCompat\n ) {}\n\n get snapshot(): UploadTaskSnapshotCompat {\n return new UploadTaskSnapshotCompat(\n this._delegate.snapshot,\n this,\n this._ref\n );\n }\n\n cancel = this._delegate.cancel.bind(this._delegate);\n catch = this._delegate.catch.bind(this._delegate);\n pause = this._delegate.pause.bind(this._delegate);\n resume = this._delegate.resume.bind(this._delegate);\n\n then(\n onFulfilled?: ((a: UploadTaskSnapshotCompat) => unknown) | null,\n onRejected?: ((a: StorageError) => unknown) | null\n ): Promise<unknown> {\n return this._delegate.then(snapshot => {\n if (onFulfilled) {\n return onFulfilled(\n new UploadTaskSnapshotCompat(snapshot, this, this._ref)\n );\n }\n }, onRejected);\n }\n\n on(\n type: TaskEvent,\n nextOrObserver?:\n | types.StorageObserver<UploadTaskSnapshotCompat>\n | null\n | ((a: UploadTaskSnapshotCompat) => unknown),\n error?: ((error: StorageError) => void) | null,\n completed?: () => void | null\n ): Unsubscribe | Subscribe<UploadTaskSnapshotCompat> {\n let wrappedNextOrObserver:\n | StorageObserver<UploadTaskSnapshot>\n | undefined\n | ((a: UploadTaskSnapshot) => unknown) = undefined;\n if (!!nextOrObserver) {\n if (typeof nextOrObserver === 'function') {\n wrappedNextOrObserver = (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n );\n } else {\n wrappedNextOrObserver = {\n next: !!nextOrObserver.next\n ? (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver.next!(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n )\n : undefined,\n complete: nextOrObserver.complete || undefined,\n error: nextOrObserver.error || undefined\n };\n }\n }\n return this._delegate.on(\n type,\n wrappedNextOrObserver,\n error || undefined,\n completed || undefined\n );\n }\n}\n\n/**\n * Subscribes to an event stream.\n */\nexport type Subscribe<T> = (\n next?: NextFn<T> | StorageObserver<T>,\n error?: ErrorFn,\n complete?: CompleteFn\n) => Unsubscribe;\n\n/**\n * Unsubscribes from a stream.\n */\nexport type Unsubscribe = () => void;\n\n/**\n * Function that is called once for each value in a stream of values.\n */\nexport type NextFn<T> = (value: T) => void;\n\n/**\n * A function that is called with a `FirebaseStorageError`\n * if the event stream ends due to an error.\n */\nexport type ErrorFn = (error: StorageError) => void;\n\n/**\n * A function that is called if the event stream ends normally.\n */\nexport type CompleteFn = () => void;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ListResult } from '@firebase/storage';\nimport * as types from '@firebase/storage-types';\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport { Compat } from '@firebase/util';\n\nexport class ListResultCompat implements types.ListResult, Compat<ListResult> {\n constructor(\n readonly _delegate: ListResult,\n private readonly _service: StorageServiceCompat\n ) {}\n\n get prefixes(): ReferenceCompat[] {\n return this._delegate.prefixes.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get items(): ReferenceCompat[] {\n return this._delegate.items.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get nextPageToken(): string | null {\n return this._delegate.nextPageToken || null;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n StorageReference,\n uploadBytesResumable,\n list,\n listAll,\n getDownloadURL,\n getMetadata,\n updateMetadata,\n deleteObject,\n UploadTask,\n StringFormat,\n UploadMetadata,\n FullMetadata,\n SettableMetadata,\n _UploadTask,\n _getChild,\n _Reference,\n _FbsBlob,\n _dataFromString,\n _invalidRootOperation\n} from '@firebase/storage';\n\nimport { UploadTaskCompat } from './task';\nimport { ListResultCompat } from './list';\nimport { StorageServiceCompat } from './service';\n\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class ReferenceCompat\n implements types.Reference, Compat<StorageReference>\n{\n constructor(\n readonly _delegate: StorageReference,\n public storage: StorageServiceCompat\n ) {}\n\n get name(): string {\n return this._delegate.name;\n }\n\n get bucket(): string {\n return this._delegate.bucket;\n }\n\n get fullPath(): string {\n return this._delegate.fullPath;\n }\n\n toString(): string {\n return this._delegate.toString();\n }\n\n /**\n * @returns A reference to the object obtained by\n * appending childPath, removing any duplicate, beginning, or trailing\n * slashes.\n */\n child(childPath: string): types.Reference {\n const reference = _getChild(this._delegate, childPath);\n return new ReferenceCompat(reference, this.storage);\n }\n\n get root(): types.Reference {\n return new ReferenceCompat(this._delegate.root, this.storage);\n }\n\n /**\n * @returns A reference to the parent of the\n * current object, or null if the current object is the root.\n */\n get parent(): types.Reference | null {\n const reference = this._delegate.parent;\n if (reference == null) {\n return null;\n }\n return new ReferenceCompat(reference, this.storage);\n }\n\n /**\n * Uploads a blob to this object's location.\n * @param data - The blob to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n put(\n data: Blob | Uint8Array | ArrayBuffer,\n metadata?: types.FullMetadata\n ): types.UploadTask {\n this._throwIfRoot('put');\n return new UploadTaskCompat(\n uploadBytesResumable(this._delegate, data, metadata as UploadMetadata),\n this\n );\n }\n\n /**\n * Uploads a string to this object's location.\n * @param value - The string to upload.\n * @param format - The format of the string to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n putString(\n value: string,\n format: StringFormat = StringFormat.RAW,\n metadata?: types.UploadMetadata\n ): types.UploadTask {\n this._throwIfRoot('putString');\n const data = _dataFromString(format, value);\n const metadataClone = { ...metadata };\n if (metadataClone['contentType'] == null && data.contentType != null) {\n metadataClone['contentType'] = data.contentType;\n }\n return new UploadTaskCompat(\n new _UploadTask(\n this._delegate as _Reference,\n new _FbsBlob(data.data, true),\n metadataClone as FullMetadata & { [k: string]: string }\n ) as UploadTask,\n this\n );\n }\n\n /**\n * List all items (files) and prefixes (folders) under this storage reference.\n *\n * This is a helper method for calling list() repeatedly until there are\n * no more results. The default pagination size is 1000.\n *\n * Note: The results may not be consistent if objects are changed while this\n * operation is running.\n *\n * Warning: listAll may potentially consume too many resources if there are\n * too many results.\n *\n * @returns A Promise that resolves with all the items and prefixes under\n * the current storage reference. `prefixes` contains references to\n * sub-directories and `items` contains references to objects in this\n * folder. `nextPageToken` is never returned.\n */\n listAll(): Promise<types.ListResult> {\n return listAll(this._delegate).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * List items (files) and prefixes (folders) under this storage reference.\n *\n * List API is only available for Firebase Rules Version 2.\n *\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\n * delimited folder structure. Refer to GCS's List API if you want to learn more.\n *\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\n * support objects whose paths end with \"/\" or contain two consecutive\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\n * list() may fail if there are too many unsupported objects in the bucket.\n *\n * @param options - See ListOptions for details.\n * @returns A Promise that resolves with the items and prefixes.\n * `prefixes` contains references to sub-folders and `items`\n * contains references to objects in this folder. `nextPageToken`\n * can be used to get the rest of the results.\n */\n list(options?: types.ListOptions | null): Promise<types.ListResult> {\n return list(this._delegate, options || undefined).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * A `Promise` that resolves with the metadata for this object. If this\n * object doesn't exist or metadata cannot be retrieved, the promise is\n * rejected.\n */\n getMetadata(): Promise<types.FullMetadata> {\n return getMetadata(this._delegate) as Promise<types.FullMetadata>;\n }\n\n /**\n * Updates the metadata for this object.\n * @param metadata - The new metadata for the object.\n * Only values that have been explicitly set will be changed. Explicitly\n * setting a value to null will remove the metadata.\n * @returns A `Promise` that resolves\n * with the new metadata for this object.\n * @see firebaseStorage.Reference.prototype.getMetadata\n */\n updateMetadata(\n metadata: types.SettableMetadata\n ): Promise<types.FullMetadata> {\n return updateMetadata(\n this._delegate,\n metadata as SettableMetadata\n ) as Promise<types.FullMetadata>;\n }\n\n /**\n * @returns A `Promise` that resolves with the download\n * URL for this object.\n */\n getDownloadURL(): Promise<string> {\n return getDownloadURL(this._delegate);\n }\n\n /**\n * Deletes the object at this location.\n * @returns A `Promise` that resolves if the deletion succeeds.\n */\n delete(): Promise<void> {\n this._throwIfRoot('delete');\n return deleteObject(this._delegate);\n }\n\n private _throwIfRoot(name: string): void {\n if ((this._delegate as _Reference)._location.path === '') {\n throw _invalidRootOperation(name);\n }\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as types from '@firebase/storage-types';\nimport { FirebaseApp } from '@firebase/app-types';\n\nimport {\n ref,\n connectStorageEmulator,\n FirebaseStorage,\n _Location,\n _invalidArgument,\n _FirebaseStorageImpl\n} from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { Compat, EmulatorMockTokenOptions } from '@firebase/util';\n\n/**\n * A service that provides firebaseStorage.Reference instances.\n * @param opt_url gs:// url to a custom Storage Bucket\n */\nexport class StorageServiceCompat\n implements types.FirebaseStorage, Compat<FirebaseStorage>\n{\n constructor(public app: FirebaseApp, readonly _delegate: FirebaseStorage) {}\n\n get maxOperationRetryTime(): number {\n return this._delegate.maxOperationRetryTime;\n }\n\n get maxUploadRetryTime(): number {\n return this._delegate.maxUploadRetryTime;\n }\n\n /**\n * Returns a firebaseStorage.Reference for the given path in the default\n * bucket.\n */\n ref(path?: string): types.Reference {\n if (isUrl(path)) {\n throw _invalidArgument(\n 'ref() expected a child path but got a URL, use refFromURL instead.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, path), this);\n }\n\n /**\n * Returns a firebaseStorage.Reference object for the given absolute URL,\n * which must be a gs:// or http[s]:// URL.\n */\n refFromURL(url: string): types.Reference {\n if (!isUrl(url)) {\n throw _invalidArgument(\n 'refFromURL() expected a full URL but got a child path, use ref() instead.'\n );\n }\n try {\n _Location.makeFromUrl(url, (this._delegate as _FirebaseStorageImpl).host);\n } catch (e) {\n throw _invalidArgument(\n 'refFromUrl() expected a valid full URL but got an invalid one.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, url), this);\n }\n\n setMaxUploadRetryTime(time: number): void {\n this._delegate.maxUploadRetryTime = time;\n }\n\n setMaxOperationRetryTime(time: number): void {\n this._delegate.maxOperationRetryTime = time;\n }\n\n useEmulator(\n host: string,\n port: number,\n options: {\n mockUserToken?: EmulatorMockTokenOptions | string;\n } = {}\n ): void {\n connectStorageEmulator(this._delegate, host, port, options);\n }\n}\n\nfunction isUrl(path?: string): boolean {\n return /^[A-Za-z]+:\\/\\//.test(path as string);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport firebase from '@firebase/app-compat';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport {\n StringFormat,\n _TaskEvent as TaskEvent,\n _TaskState as TaskState\n} from '@firebase/storage';\n\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport * as types from '@firebase/storage-types';\nimport {\n Component,\n ComponentType,\n ComponentContainer,\n InstanceFactoryOptions\n} from '@firebase/component';\n\nimport { name, version } from '../package.json';\n\n/**\n * Type constant for Firebase Storage.\n */\nconst STORAGE_TYPE = 'storage-compat';\n\nfunction factory(\n container: ComponentContainer,\n { instanceIdentifier: url }: InstanceFactoryOptions\n): types.FirebaseStorage {\n // Dependencies\n const app = container.getProvider('app-compat').getImmediate();\n const storageExp = container\n .getProvider('storage')\n .getImmediate({ identifier: url });\n\n const storageServiceCompat: StorageServiceCompat = new StorageServiceCompat(\n app,\n storageExp\n );\n return storageServiceCompat;\n}\n\nexport function registerStorage(instance: _FirebaseNamespace): void {\n const namespaceExports = {\n // no-inline\n TaskState,\n TaskEvent,\n StringFormat,\n Storage: StorageServiceCompat,\n Reference: ReferenceCompat\n };\n instance.INTERNAL.registerComponent(\n new Component(STORAGE_TYPE, factory, ComponentType.PUBLIC)\n .setServiceProps(namespaceExports)\n .setMultipleInstances(true)\n );\n\n instance.registerVersion(name, version);\n}\n\nregisterStorage(firebase as unknown as _FirebaseNamespace);\n\n/**\n * Define extension behavior for `registerStorage`\n */\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n storage?: {\n (app?: FirebaseApp, url?: string): types.FirebaseStorage;\n Storage: typeof types.FirebaseStorage;\n\n StringFormat: {\n BASE64: types.StringFormat;\n BASE64URL: types.StringFormat;\n DATA_URL: types.StringFormat;\n RAW: types.StringFormat;\n };\n TaskEvent: {\n STATE_CHANGED: types.TaskEvent;\n };\n TaskState: {\n CANCELED: types.TaskState;\n ERROR: types.TaskState;\n PAUSED: types.TaskState;\n RUNNING: types.TaskState;\n SUCCESS: types.TaskState;\n };\n };\n }\n interface FirebaseApp {\n storage?(storageBucket?: string): types.FirebaseStorage;\n }\n}\n"],"names":["_getChild","uploadBytesResumable","StringFormat","_dataFromString","__assign","_UploadTask","_FbsBlob","listAll","list","getMetadata","updateMetadata","getDownloadURL","deleteObject","_invalidRootOperation","_invalidArgument","ref","_Location","connectStorageEmulator","TaskState","TaskEvent","Component","firebase"],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAQH,IAAA,wBAAA,kBAAA,YAAA;AAGE,IAAA,SAAA,wBAAA,CACW,SAA6B,EAC7B,IAAsB,EACtB,GAAoB,EAAA;QAFpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAoB;QAC7B,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAkB;QACtB,IAAG,CAAA,GAAA,GAAH,GAAG,CAAiB;KAC3B;AAEJ,IAAA,MAAA,CAAA,cAAA,CAAI,wBAAgB,CAAA,SAAA,EAAA,kBAAA,EAAA;AAApB,QAAA,GAAA,EAAA,YAAA;AACE,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CAAC;IAErC,IAAM,oBAAoB,GAAyB,IAAI,oBAAoB,CACzE,GAAG,EACH,UAAU,CACX,CAAC;AACF,IAAA,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAEK,SAAU,eAAe,CAAC,QAA4B,EAAA;AAC1D,IAAA,IAAM,gBAAgB,GAAG;;AAEvB,QAAA,SAAS,EAAAC,kBAAA;AACT,QAAA,SAAS,EAAAC,kBAAA;AACT,QAAA,YAAY,EAAAjB,oBAAA;AACZ,QAAA,OAAO,EAAE,oBAAoB;AAC7B,QAAA,SAAS,EAAE,eAAe;KAC3B,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CACjC,IAAIkB,mBAAS,CAAC,YAAY,EAAE,OAAO,EAAuB,QAAA,4BAAA;SACvD,eAAe,CAAC,gBAAgB,CAAC;AACjC,SAAA,oBAAoB,CAAC,IAAI,CAAC,CAC9B,CAAC;AAEF,IAAA,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,eAAe,CAACC,4BAAyC,CAAC;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/tasksnapshot.ts","../src/task.ts","../src/list.ts","../src/reference.ts","../src/service.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UploadTaskSnapshot } from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { UploadTaskCompat } from './task';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskSnapshotCompat\n implements types.UploadTaskSnapshot, Compat<UploadTaskSnapshot>\n{\n constructor(\n readonly _delegate: UploadTaskSnapshot,\n readonly task: UploadTaskCompat,\n readonly ref: ReferenceCompat\n ) {}\n\n get bytesTransferred(): number {\n return this._delegate.bytesTransferred;\n }\n get metadata(): types.FullMetadata {\n return this._delegate.metadata as types.FullMetadata;\n }\n get state(): string {\n return this._delegate.state;\n }\n get totalBytes(): number {\n return this._delegate.totalBytes;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n UploadTask,\n StorageError,\n UploadTaskSnapshot,\n TaskEvent,\n StorageObserver\n} from '@firebase/storage';\nimport { UploadTaskSnapshotCompat } from './tasksnapshot';\nimport { ReferenceCompat } from './reference';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskCompat implements types.UploadTask, Compat<UploadTask> {\n constructor(\n readonly _delegate: UploadTask,\n private readonly _ref: ReferenceCompat\n ) {}\n\n get snapshot(): UploadTaskSnapshotCompat {\n return new UploadTaskSnapshotCompat(\n this._delegate.snapshot,\n this,\n this._ref\n );\n }\n\n cancel = this._delegate.cancel.bind(this._delegate);\n catch = this._delegate.catch.bind(this._delegate);\n pause = this._delegate.pause.bind(this._delegate);\n resume = this._delegate.resume.bind(this._delegate);\n\n then(\n onFulfilled?: ((a: UploadTaskSnapshotCompat) => unknown) | null,\n onRejected?: ((a: StorageError) => unknown) | null\n ): Promise<unknown> {\n return this._delegate.then(snapshot => {\n if (onFulfilled) {\n return onFulfilled(\n new UploadTaskSnapshotCompat(snapshot, this, this._ref)\n );\n }\n }, onRejected);\n }\n\n on(\n type: TaskEvent,\n nextOrObserver?:\n | types.StorageObserver<UploadTaskSnapshotCompat>\n | null\n | ((a: UploadTaskSnapshotCompat) => unknown),\n error?: ((error: StorageError) => void) | null,\n completed?: () => void | null\n ): Unsubscribe | Subscribe<UploadTaskSnapshotCompat> {\n let wrappedNextOrObserver:\n | StorageObserver<UploadTaskSnapshot>\n | undefined\n | ((a: UploadTaskSnapshot) => unknown) = undefined;\n if (!!nextOrObserver) {\n if (typeof nextOrObserver === 'function') {\n wrappedNextOrObserver = (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n );\n } else {\n wrappedNextOrObserver = {\n next: !!nextOrObserver.next\n ? (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver.next!(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n )\n : undefined,\n complete: nextOrObserver.complete || undefined,\n error: nextOrObserver.error || undefined\n };\n }\n }\n return this._delegate.on(\n type,\n wrappedNextOrObserver,\n error || undefined,\n completed || undefined\n );\n }\n}\n\n/**\n * Subscribes to an event stream.\n */\nexport type Subscribe<T> = (\n next?: NextFn<T> | StorageObserver<T>,\n error?: ErrorFn,\n complete?: CompleteFn\n) => Unsubscribe;\n\n/**\n * Unsubscribes from a stream.\n */\nexport type Unsubscribe = () => void;\n\n/**\n * Function that is called once for each value in a stream of values.\n */\nexport type NextFn<T> = (value: T) => void;\n\n/**\n * A function that is called with a `FirebaseStorageError`\n * if the event stream ends due to an error.\n */\nexport type ErrorFn = (error: StorageError) => void;\n\n/**\n * A function that is called if the event stream ends normally.\n */\nexport type CompleteFn = () => void;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ListResult } from '@firebase/storage';\nimport * as types from '@firebase/storage-types';\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport { Compat } from '@firebase/util';\n\nexport class ListResultCompat implements types.ListResult, Compat<ListResult> {\n constructor(\n readonly _delegate: ListResult,\n private readonly _service: StorageServiceCompat\n ) {}\n\n get prefixes(): ReferenceCompat[] {\n return this._delegate.prefixes.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get items(): ReferenceCompat[] {\n return this._delegate.items.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get nextPageToken(): string | null {\n return this._delegate.nextPageToken || null;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n StorageReference,\n uploadBytesResumable,\n list,\n listAll,\n getDownloadURL,\n getMetadata,\n updateMetadata,\n deleteObject,\n UploadTask,\n StringFormat,\n UploadMetadata,\n FullMetadata,\n SettableMetadata,\n _UploadTask,\n _getChild,\n _Reference,\n _FbsBlob,\n _dataFromString,\n _invalidRootOperation\n} from '@firebase/storage';\n\nimport { UploadTaskCompat } from './task';\nimport { ListResultCompat } from './list';\nimport { StorageServiceCompat } from './service';\n\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class ReferenceCompat\n implements types.Reference, Compat<StorageReference>\n{\n constructor(\n readonly _delegate: StorageReference,\n public storage: StorageServiceCompat\n ) {}\n\n get name(): string {\n return this._delegate.name;\n }\n\n get bucket(): string {\n return this._delegate.bucket;\n }\n\n get fullPath(): string {\n return this._delegate.fullPath;\n }\n\n toString(): string {\n return this._delegate.toString();\n }\n\n /**\n * @returns A reference to the object obtained by\n * appending childPath, removing any duplicate, beginning, or trailing\n * slashes.\n */\n child(childPath: string): types.Reference {\n const reference = _getChild(this._delegate, childPath);\n return new ReferenceCompat(reference, this.storage);\n }\n\n get root(): types.Reference {\n return new ReferenceCompat(this._delegate.root, this.storage);\n }\n\n /**\n * @returns A reference to the parent of the\n * current object, or null if the current object is the root.\n */\n get parent(): types.Reference | null {\n const reference = this._delegate.parent;\n if (reference == null) {\n return null;\n }\n return new ReferenceCompat(reference, this.storage);\n }\n\n /**\n * Uploads a blob to this object's location.\n * @param data - The blob to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n put(\n data: Blob | Uint8Array | ArrayBuffer,\n metadata?: types.FullMetadata\n ): types.UploadTask {\n this._throwIfRoot('put');\n return new UploadTaskCompat(\n uploadBytesResumable(this._delegate, data, metadata as UploadMetadata),\n this\n );\n }\n\n /**\n * Uploads a string to this object's location.\n * @param value - The string to upload.\n * @param format - The format of the string to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n putString(\n value: string,\n format: StringFormat = StringFormat.RAW,\n metadata?: types.UploadMetadata\n ): types.UploadTask {\n this._throwIfRoot('putString');\n const data = _dataFromString(format, value);\n const metadataClone = { ...metadata };\n if (metadataClone['contentType'] == null && data.contentType != null) {\n metadataClone['contentType'] = data.contentType;\n }\n return new UploadTaskCompat(\n new _UploadTask(\n this._delegate as _Reference,\n new _FbsBlob(data.data, true),\n metadataClone as FullMetadata & { [k: string]: string }\n ) as UploadTask,\n this\n );\n }\n\n /**\n * List all items (files) and prefixes (folders) under this storage reference.\n *\n * This is a helper method for calling list() repeatedly until there are\n * no more results. The default pagination size is 1000.\n *\n * Note: The results may not be consistent if objects are changed while this\n * operation is running.\n *\n * Warning: listAll may potentially consume too many resources if there are\n * too many results.\n *\n * @returns A Promise that resolves with all the items and prefixes under\n * the current storage reference. `prefixes` contains references to\n * sub-directories and `items` contains references to objects in this\n * folder. `nextPageToken` is never returned.\n */\n listAll(): Promise<types.ListResult> {\n return listAll(this._delegate).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * List items (files) and prefixes (folders) under this storage reference.\n *\n * List API is only available for Firebase Rules Version 2.\n *\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\n * delimited folder structure. Refer to GCS's List API if you want to learn more.\n *\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\n * support objects whose paths end with \"/\" or contain two consecutive\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\n * list() may fail if there are too many unsupported objects in the bucket.\n *\n * @param options - See ListOptions for details.\n * @returns A Promise that resolves with the items and prefixes.\n * `prefixes` contains references to sub-folders and `items`\n * contains references to objects in this folder. `nextPageToken`\n * can be used to get the rest of the results.\n */\n list(options?: types.ListOptions | null): Promise<types.ListResult> {\n return list(this._delegate, options || undefined).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * A `Promise` that resolves with the metadata for this object. If this\n * object doesn't exist or metadata cannot be retrieved, the promise is\n * rejected.\n */\n getMetadata(): Promise<types.FullMetadata> {\n return getMetadata(this._delegate) as Promise<types.FullMetadata>;\n }\n\n /**\n * Updates the metadata for this object.\n * @param metadata - The new metadata for the object.\n * Only values that have been explicitly set will be changed. Explicitly\n * setting a value to null will remove the metadata.\n * @returns A `Promise` that resolves\n * with the new metadata for this object.\n * @see firebaseStorage.Reference.prototype.getMetadata\n */\n updateMetadata(\n metadata: types.SettableMetadata\n ): Promise<types.FullMetadata> {\n return updateMetadata(\n this._delegate,\n metadata as SettableMetadata\n ) as Promise<types.FullMetadata>;\n }\n\n /**\n * @returns A `Promise` that resolves with the download\n * URL for this object.\n */\n getDownloadURL(): Promise<string> {\n return getDownloadURL(this._delegate);\n }\n\n /**\n * Deletes the object at this location.\n * @returns A `Promise` that resolves if the deletion succeeds.\n */\n delete(): Promise<void> {\n this._throwIfRoot('delete');\n return deleteObject(this._delegate);\n }\n\n private _throwIfRoot(name: string): void {\n if ((this._delegate as _Reference)._location.path === '') {\n throw _invalidRootOperation(name);\n }\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as types from '@firebase/storage-types';\nimport { FirebaseApp } from '@firebase/app-types';\n\nimport {\n ref,\n connectStorageEmulator,\n FirebaseStorage,\n _Location,\n _invalidArgument,\n _FirebaseStorageImpl\n} from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { Compat, EmulatorMockTokenOptions } from '@firebase/util';\n\n/**\n * A service that provides firebaseStorage.Reference instances.\n * @param opt_url gs:// url to a custom Storage Bucket\n */\nexport class StorageServiceCompat\n implements types.FirebaseStorage, Compat<FirebaseStorage>\n{\n constructor(public app: FirebaseApp, readonly _delegate: FirebaseStorage) {}\n\n get maxOperationRetryTime(): number {\n return this._delegate.maxOperationRetryTime;\n }\n\n get maxUploadRetryTime(): number {\n return this._delegate.maxUploadRetryTime;\n }\n\n /**\n * Returns a firebaseStorage.Reference for the given path in the default\n * bucket.\n */\n ref(path?: string): types.Reference {\n if (isUrl(path)) {\n throw _invalidArgument(\n 'ref() expected a child path but got a URL, use refFromURL instead.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, path), this);\n }\n\n /**\n * Returns a firebaseStorage.Reference object for the given absolute URL,\n * which must be a gs:// or http[s]:// URL.\n */\n refFromURL(url: string): types.Reference {\n if (!isUrl(url)) {\n throw _invalidArgument(\n 'refFromURL() expected a full URL but got a child path, use ref() instead.'\n );\n }\n try {\n _Location.makeFromUrl(url, (this._delegate as _FirebaseStorageImpl).host);\n } catch (e) {\n throw _invalidArgument(\n 'refFromUrl() expected a valid full URL but got an invalid one.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, url), this);\n }\n\n setMaxUploadRetryTime(time: number): void {\n this._delegate.maxUploadRetryTime = time;\n }\n\n setMaxOperationRetryTime(time: number): void {\n this._delegate.maxOperationRetryTime = time;\n }\n\n useEmulator(\n host: string,\n port: number,\n options: {\n mockUserToken?: EmulatorMockTokenOptions | string;\n } = {}\n ): void {\n connectStorageEmulator(this._delegate, host, port, options);\n }\n}\n\nfunction isUrl(path?: string): boolean {\n return /^[A-Za-z]+:\\/\\//.test(path as string);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport firebase from '@firebase/app-compat';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport {\n StringFormat,\n _TaskEvent as TaskEvent,\n _TaskState as TaskState\n} from '@firebase/storage';\n\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport * as types from '@firebase/storage-types';\nimport {\n Component,\n ComponentType,\n ComponentContainer,\n InstanceFactoryOptions\n} from '@firebase/component';\n\nimport { name, version } from '../package.json';\n\n/**\n * Type constant for Firebase Storage.\n */\nconst STORAGE_TYPE = 'storage-compat';\n\nfunction factory(\n container: ComponentContainer,\n { instanceIdentifier: url }: InstanceFactoryOptions\n): types.FirebaseStorage {\n // Dependencies\n const app = container.getProvider('app-compat').getImmediate();\n const storageExp = container\n .getProvider('storage')\n .getImmediate({ identifier: url });\n\n const storageServiceCompat: StorageServiceCompat = new StorageServiceCompat(\n app,\n storageExp\n );\n return storageServiceCompat;\n}\n\nexport function registerStorage(instance: _FirebaseNamespace): void {\n const namespaceExports = {\n // no-inline\n TaskState,\n TaskEvent,\n StringFormat,\n Storage: StorageServiceCompat,\n Reference: ReferenceCompat\n };\n instance.INTERNAL.registerComponent(\n new Component(STORAGE_TYPE, factory, ComponentType.PUBLIC)\n .setServiceProps(namespaceExports)\n .setMultipleInstances(true)\n );\n\n instance.registerVersion(name, version);\n}\n\nregisterStorage(firebase as unknown as _FirebaseNamespace);\n\n/**\n * Define extension behavior for `registerStorage`\n */\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n storage?: {\n (app?: FirebaseApp, url?: string): types.FirebaseStorage;\n Storage: typeof types.FirebaseStorage;\n\n StringFormat: {\n BASE64: types.StringFormat;\n BASE64URL: types.StringFormat;\n DATA_URL: types.StringFormat;\n RAW: types.StringFormat;\n };\n TaskEvent: {\n STATE_CHANGED: types.TaskEvent;\n };\n TaskState: {\n CANCELED: types.TaskState;\n ERROR: types.TaskState;\n PAUSED: types.TaskState;\n RUNNING: types.TaskState;\n SUCCESS: types.TaskState;\n };\n };\n }\n interface FirebaseApp {\n storage?(storageBucket?: string): types.FirebaseStorage;\n }\n}\n"],"names":["_getChild","uploadBytesResumable","StringFormat","_dataFromString","_UploadTask","_FbsBlob","listAll","list","getMetadata","updateMetadata","getDownloadURL","deleteObject","_invalidRootOperation","_invalidArgument","ref","_Location","connectStorageEmulator","TaskState","TaskEvent","Component","firebase"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAQU,wBAAwB,CAAA;AAGnC,IAAA,WAAA,CACW,SAA6B,EAC7B,IAAsB,EACtB,GAAoB,EAAA;QAFpB,IAAS,CAAA,SAAA,GAAT,SAAS,CA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AIiB,mBAAS,CAAC,YAAY,EAAE,OAAO,EAAuB,QAAA,4BAAA;SACvD,eAAe,CAAC,gBAAgB,CAAC;AACjC,SAAA,oBAAoB,CAAC,IAAI,CAAC,CAC9B,CAAC;AAEF,IAAA,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,eAAe,CAACC,4BAAyC,CAAC;;;;"}
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "@firebase/storage-compat",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "The Firebase Firestore compatibility package",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "browser": "./dist/esm/index.esm2017.js",
8
8
  "module": "./dist/esm/index.esm2017.js",
9
- "esm5": "./dist/esm/index.esm5.js",
10
9
  "exports": {
11
10
  ".": {
12
11
  "types": "./dist/src/index.d.ts",
13
12
  "require": "./dist/index.cjs.js",
14
- "esm5": "./dist/esm/index.esm5.js",
15
13
  "default": "./dist/esm/index.esm2017.js"
16
14
  },
17
15
  "./package.json": "./package.json"
@@ -39,15 +37,15 @@
39
37
  "@firebase/app-compat": "0.x"
40
38
  },
41
39
  "dependencies": {
42
- "@firebase/storage": "0.13.2",
40
+ "@firebase/storage": "0.13.3",
43
41
  "@firebase/storage-types": "0.8.2",
44
- "@firebase/util": "1.10.0",
45
- "@firebase/component": "0.6.9",
42
+ "@firebase/util": "1.10.1",
43
+ "@firebase/component": "0.6.10",
46
44
  "tslib": "^2.1.0"
47
45
  },
48
46
  "devDependencies": {
49
- "@firebase/app-compat": "0.2.41",
50
- "@firebase/auth-compat": "0.5.14",
47
+ "@firebase/app-compat": "0.2.44",
48
+ "@firebase/auth-compat": "0.5.15",
51
49
  "rollup": "2.79.1",
52
50
  "@rollup/plugin-json": "4.1.0",
53
51
  "rollup-plugin-typescript2": "0.31.2",
@@ -63,5 +61,8 @@
63
61
  },
64
62
  "bugs": {
65
63
  "url": "https://github.com/firebase/firebase-js-sdk/issues"
64
+ },
65
+ "engines": {
66
+ "node": ">=18.0.0"
66
67
  }
67
68
  }
@@ -1,477 +0,0 @@
1
- import firebase from '@firebase/app-compat';
2
- import { _getChild, uploadBytesResumable, StringFormat, _dataFromString, _UploadTask, _FbsBlob, listAll, list, getMetadata, updateMetadata, getDownloadURL, deleteObject, _invalidRootOperation, _invalidArgument, ref, _Location, connectStorageEmulator, _TaskState, _TaskEvent } from '@firebase/storage';
3
- import { __assign } from 'tslib';
4
- import { Component } from '@firebase/component';
5
-
6
- /**
7
- * @license
8
- * Copyright 2020 Google LLC
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- var UploadTaskSnapshotCompat = /** @class */ (function () {
23
- function UploadTaskSnapshotCompat(_delegate, task, ref) {
24
- this._delegate = _delegate;
25
- this.task = task;
26
- this.ref = ref;
27
- }
28
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "bytesTransferred", {
29
- get: function () {
30
- return this._delegate.bytesTransferred;
31
- },
32
- enumerable: false,
33
- configurable: true
34
- });
35
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "metadata", {
36
- get: function () {
37
- return this._delegate.metadata;
38
- },
39
- enumerable: false,
40
- configurable: true
41
- });
42
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "state", {
43
- get: function () {
44
- return this._delegate.state;
45
- },
46
- enumerable: false,
47
- configurable: true
48
- });
49
- Object.defineProperty(UploadTaskSnapshotCompat.prototype, "totalBytes", {
50
- get: function () {
51
- return this._delegate.totalBytes;
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- return UploadTaskSnapshotCompat;
57
- }());
58
-
59
- /**
60
- * @license
61
- * Copyright 2020 Google LLC
62
- *
63
- * Licensed under the Apache License, Version 2.0 (the "License");
64
- * you may not use this file except in compliance with the License.
65
- * You may obtain a copy of the License at
66
- *
67
- * http://www.apache.org/licenses/LICENSE-2.0
68
- *
69
- * Unless required by applicable law or agreed to in writing, software
70
- * distributed under the License is distributed on an "AS IS" BASIS,
71
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
- * See the License for the specific language governing permissions and
73
- * limitations under the License.
74
- */
75
- var UploadTaskCompat = /** @class */ (function () {
76
- function UploadTaskCompat(_delegate, _ref) {
77
- this._delegate = _delegate;
78
- this._ref = _ref;
79
- this.cancel = this._delegate.cancel.bind(this._delegate);
80
- this.catch = this._delegate.catch.bind(this._delegate);
81
- this.pause = this._delegate.pause.bind(this._delegate);
82
- this.resume = this._delegate.resume.bind(this._delegate);
83
- }
84
- Object.defineProperty(UploadTaskCompat.prototype, "snapshot", {
85
- get: function () {
86
- return new UploadTaskSnapshotCompat(this._delegate.snapshot, this, this._ref);
87
- },
88
- enumerable: false,
89
- configurable: true
90
- });
91
- UploadTaskCompat.prototype.then = function (onFulfilled, onRejected) {
92
- var _this = this;
93
- return this._delegate.then(function (snapshot) {
94
- if (onFulfilled) {
95
- return onFulfilled(new UploadTaskSnapshotCompat(snapshot, _this, _this._ref));
96
- }
97
- }, onRejected);
98
- };
99
- UploadTaskCompat.prototype.on = function (type, nextOrObserver, error, completed) {
100
- var _this = this;
101
- var wrappedNextOrObserver = undefined;
102
- if (!!nextOrObserver) {
103
- if (typeof nextOrObserver === 'function') {
104
- wrappedNextOrObserver = function (taskSnapshot) {
105
- return nextOrObserver(new UploadTaskSnapshotCompat(taskSnapshot, _this, _this._ref));
106
- };
107
- }
108
- else {
109
- wrappedNextOrObserver = {
110
- next: !!nextOrObserver.next
111
- ? function (taskSnapshot) {
112
- return nextOrObserver.next(new UploadTaskSnapshotCompat(taskSnapshot, _this, _this._ref));
113
- }
114
- : undefined,
115
- complete: nextOrObserver.complete || undefined,
116
- error: nextOrObserver.error || undefined
117
- };
118
- }
119
- }
120
- return this._delegate.on(type, wrappedNextOrObserver, error || undefined, completed || undefined);
121
- };
122
- return UploadTaskCompat;
123
- }());
124
-
125
- var ListResultCompat = /** @class */ (function () {
126
- function ListResultCompat(_delegate, _service) {
127
- this._delegate = _delegate;
128
- this._service = _service;
129
- }
130
- Object.defineProperty(ListResultCompat.prototype, "prefixes", {
131
- get: function () {
132
- var _this = this;
133
- return this._delegate.prefixes.map(function (ref) { return new ReferenceCompat(ref, _this._service); });
134
- },
135
- enumerable: false,
136
- configurable: true
137
- });
138
- Object.defineProperty(ListResultCompat.prototype, "items", {
139
- get: function () {
140
- var _this = this;
141
- return this._delegate.items.map(function (ref) { return new ReferenceCompat(ref, _this._service); });
142
- },
143
- enumerable: false,
144
- configurable: true
145
- });
146
- Object.defineProperty(ListResultCompat.prototype, "nextPageToken", {
147
- get: function () {
148
- return this._delegate.nextPageToken || null;
149
- },
150
- enumerable: false,
151
- configurable: true
152
- });
153
- return ListResultCompat;
154
- }());
155
-
156
- /**
157
- * @license
158
- * Copyright 2020 Google LLC
159
- *
160
- * Licensed under the Apache License, Version 2.0 (the "License");
161
- * you may not use this file except in compliance with the License.
162
- * You may obtain a copy of the License at
163
- *
164
- * http://www.apache.org/licenses/LICENSE-2.0
165
- *
166
- * Unless required by applicable law or agreed to in writing, software
167
- * distributed under the License is distributed on an "AS IS" BASIS,
168
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
169
- * See the License for the specific language governing permissions and
170
- * limitations under the License.
171
- */
172
- var ReferenceCompat = /** @class */ (function () {
173
- function ReferenceCompat(_delegate, storage) {
174
- this._delegate = _delegate;
175
- this.storage = storage;
176
- }
177
- Object.defineProperty(ReferenceCompat.prototype, "name", {
178
- get: function () {
179
- return this._delegate.name;
180
- },
181
- enumerable: false,
182
- configurable: true
183
- });
184
- Object.defineProperty(ReferenceCompat.prototype, "bucket", {
185
- get: function () {
186
- return this._delegate.bucket;
187
- },
188
- enumerable: false,
189
- configurable: true
190
- });
191
- Object.defineProperty(ReferenceCompat.prototype, "fullPath", {
192
- get: function () {
193
- return this._delegate.fullPath;
194
- },
195
- enumerable: false,
196
- configurable: true
197
- });
198
- ReferenceCompat.prototype.toString = function () {
199
- return this._delegate.toString();
200
- };
201
- /**
202
- * @returns A reference to the object obtained by
203
- * appending childPath, removing any duplicate, beginning, or trailing
204
- * slashes.
205
- */
206
- ReferenceCompat.prototype.child = function (childPath) {
207
- var reference = _getChild(this._delegate, childPath);
208
- return new ReferenceCompat(reference, this.storage);
209
- };
210
- Object.defineProperty(ReferenceCompat.prototype, "root", {
211
- get: function () {
212
- return new ReferenceCompat(this._delegate.root, this.storage);
213
- },
214
- enumerable: false,
215
- configurable: true
216
- });
217
- Object.defineProperty(ReferenceCompat.prototype, "parent", {
218
- /**
219
- * @returns A reference to the parent of the
220
- * current object, or null if the current object is the root.
221
- */
222
- get: function () {
223
- var reference = this._delegate.parent;
224
- if (reference == null) {
225
- return null;
226
- }
227
- return new ReferenceCompat(reference, this.storage);
228
- },
229
- enumerable: false,
230
- configurable: true
231
- });
232
- /**
233
- * Uploads a blob to this object's location.
234
- * @param data - The blob to upload.
235
- * @returns An UploadTask that lets you control and
236
- * observe the upload.
237
- */
238
- ReferenceCompat.prototype.put = function (data, metadata) {
239
- this._throwIfRoot('put');
240
- return new UploadTaskCompat(uploadBytesResumable(this._delegate, data, metadata), this);
241
- };
242
- /**
243
- * Uploads a string to this object's location.
244
- * @param value - The string to upload.
245
- * @param format - The format of the string to upload.
246
- * @returns An UploadTask that lets you control and
247
- * observe the upload.
248
- */
249
- ReferenceCompat.prototype.putString = function (value, format, metadata) {
250
- if (format === void 0) { format = StringFormat.RAW; }
251
- this._throwIfRoot('putString');
252
- var data = _dataFromString(format, value);
253
- var metadataClone = __assign({}, metadata);
254
- if (metadataClone['contentType'] == null && data.contentType != null) {
255
- metadataClone['contentType'] = data.contentType;
256
- }
257
- return new UploadTaskCompat(new _UploadTask(this._delegate, new _FbsBlob(data.data, true), metadataClone), this);
258
- };
259
- /**
260
- * List all items (files) and prefixes (folders) under this storage reference.
261
- *
262
- * This is a helper method for calling list() repeatedly until there are
263
- * no more results. The default pagination size is 1000.
264
- *
265
- * Note: The results may not be consistent if objects are changed while this
266
- * operation is running.
267
- *
268
- * Warning: listAll may potentially consume too many resources if there are
269
- * too many results.
270
- *
271
- * @returns A Promise that resolves with all the items and prefixes under
272
- * the current storage reference. `prefixes` contains references to
273
- * sub-directories and `items` contains references to objects in this
274
- * folder. `nextPageToken` is never returned.
275
- */
276
- ReferenceCompat.prototype.listAll = function () {
277
- var _this = this;
278
- return listAll(this._delegate).then(function (r) { return new ListResultCompat(r, _this.storage); });
279
- };
280
- /**
281
- * List items (files) and prefixes (folders) under this storage reference.
282
- *
283
- * List API is only available for Firebase Rules Version 2.
284
- *
285
- * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'
286
- * delimited folder structure. Refer to GCS's List API if you want to learn more.
287
- *
288
- * To adhere to Firebase Rules's Semantics, Firebase Storage does not
289
- * support objects whose paths end with "/" or contain two consecutive
290
- * "/"s. Firebase Storage List API will filter these unsupported objects.
291
- * list() may fail if there are too many unsupported objects in the bucket.
292
- *
293
- * @param options - See ListOptions for details.
294
- * @returns A Promise that resolves with the items and prefixes.
295
- * `prefixes` contains references to sub-folders and `items`
296
- * contains references to objects in this folder. `nextPageToken`
297
- * can be used to get the rest of the results.
298
- */
299
- ReferenceCompat.prototype.list = function (options) {
300
- var _this = this;
301
- return list(this._delegate, options || undefined).then(function (r) { return new ListResultCompat(r, _this.storage); });
302
- };
303
- /**
304
- * A `Promise` that resolves with the metadata for this object. If this
305
- * object doesn't exist or metadata cannot be retrieved, the promise is
306
- * rejected.
307
- */
308
- ReferenceCompat.prototype.getMetadata = function () {
309
- return getMetadata(this._delegate);
310
- };
311
- /**
312
- * Updates the metadata for this object.
313
- * @param metadata - The new metadata for the object.
314
- * Only values that have been explicitly set will be changed. Explicitly
315
- * setting a value to null will remove the metadata.
316
- * @returns A `Promise` that resolves
317
- * with the new metadata for this object.
318
- * @see firebaseStorage.Reference.prototype.getMetadata
319
- */
320
- ReferenceCompat.prototype.updateMetadata = function (metadata) {
321
- return updateMetadata(this._delegate, metadata);
322
- };
323
- /**
324
- * @returns A `Promise` that resolves with the download
325
- * URL for this object.
326
- */
327
- ReferenceCompat.prototype.getDownloadURL = function () {
328
- return getDownloadURL(this._delegate);
329
- };
330
- /**
331
- * Deletes the object at this location.
332
- * @returns A `Promise` that resolves if the deletion succeeds.
333
- */
334
- ReferenceCompat.prototype.delete = function () {
335
- this._throwIfRoot('delete');
336
- return deleteObject(this._delegate);
337
- };
338
- ReferenceCompat.prototype._throwIfRoot = function (name) {
339
- if (this._delegate._location.path === '') {
340
- throw _invalidRootOperation(name);
341
- }
342
- };
343
- return ReferenceCompat;
344
- }());
345
-
346
- /**
347
- * @license
348
- * Copyright 2020 Google LLC
349
- *
350
- * Licensed under the Apache License, Version 2.0 (the "License");
351
- * you may not use this file except in compliance with the License.
352
- * You may obtain a copy of the License at
353
- *
354
- * http://www.apache.org/licenses/LICENSE-2.0
355
- *
356
- * Unless required by applicable law or agreed to in writing, software
357
- * distributed under the License is distributed on an "AS IS" BASIS,
358
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
359
- * See the License for the specific language governing permissions and
360
- * limitations under the License.
361
- */
362
- /**
363
- * A service that provides firebaseStorage.Reference instances.
364
- * @param opt_url gs:// url to a custom Storage Bucket
365
- */
366
- var StorageServiceCompat = /** @class */ (function () {
367
- function StorageServiceCompat(app, _delegate) {
368
- this.app = app;
369
- this._delegate = _delegate;
370
- }
371
- Object.defineProperty(StorageServiceCompat.prototype, "maxOperationRetryTime", {
372
- get: function () {
373
- return this._delegate.maxOperationRetryTime;
374
- },
375
- enumerable: false,
376
- configurable: true
377
- });
378
- Object.defineProperty(StorageServiceCompat.prototype, "maxUploadRetryTime", {
379
- get: function () {
380
- return this._delegate.maxUploadRetryTime;
381
- },
382
- enumerable: false,
383
- configurable: true
384
- });
385
- /**
386
- * Returns a firebaseStorage.Reference for the given path in the default
387
- * bucket.
388
- */
389
- StorageServiceCompat.prototype.ref = function (path) {
390
- if (isUrl(path)) {
391
- throw _invalidArgument('ref() expected a child path but got a URL, use refFromURL instead.');
392
- }
393
- return new ReferenceCompat(ref(this._delegate, path), this);
394
- };
395
- /**
396
- * Returns a firebaseStorage.Reference object for the given absolute URL,
397
- * which must be a gs:// or http[s]:// URL.
398
- */
399
- StorageServiceCompat.prototype.refFromURL = function (url) {
400
- if (!isUrl(url)) {
401
- throw _invalidArgument('refFromURL() expected a full URL but got a child path, use ref() instead.');
402
- }
403
- try {
404
- _Location.makeFromUrl(url, this._delegate.host);
405
- }
406
- catch (e) {
407
- throw _invalidArgument('refFromUrl() expected a valid full URL but got an invalid one.');
408
- }
409
- return new ReferenceCompat(ref(this._delegate, url), this);
410
- };
411
- StorageServiceCompat.prototype.setMaxUploadRetryTime = function (time) {
412
- this._delegate.maxUploadRetryTime = time;
413
- };
414
- StorageServiceCompat.prototype.setMaxOperationRetryTime = function (time) {
415
- this._delegate.maxOperationRetryTime = time;
416
- };
417
- StorageServiceCompat.prototype.useEmulator = function (host, port, options) {
418
- if (options === void 0) { options = {}; }
419
- connectStorageEmulator(this._delegate, host, port, options);
420
- };
421
- return StorageServiceCompat;
422
- }());
423
- function isUrl(path) {
424
- return /^[A-Za-z]+:\/\//.test(path);
425
- }
426
-
427
- var name = "@firebase/storage-compat";
428
- var version = "0.3.12";
429
-
430
- /**
431
- * @license
432
- * Copyright 2020 Google LLC
433
- *
434
- * Licensed under the Apache License, Version 2.0 (the "License");
435
- * you may not use this file except in compliance with the License.
436
- * You may obtain a copy of the License at
437
- *
438
- * http://www.apache.org/licenses/LICENSE-2.0
439
- *
440
- * Unless required by applicable law or agreed to in writing, software
441
- * distributed under the License is distributed on an "AS IS" BASIS,
442
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
443
- * See the License for the specific language governing permissions and
444
- * limitations under the License.
445
- */
446
- /**
447
- * Type constant for Firebase Storage.
448
- */
449
- var STORAGE_TYPE = 'storage-compat';
450
- function factory(container, _a) {
451
- var url = _a.instanceIdentifier;
452
- // Dependencies
453
- var app = container.getProvider('app-compat').getImmediate();
454
- var storageExp = container
455
- .getProvider('storage')
456
- .getImmediate({ identifier: url });
457
- var storageServiceCompat = new StorageServiceCompat(app, storageExp);
458
- return storageServiceCompat;
459
- }
460
- function registerStorage(instance) {
461
- var namespaceExports = {
462
- // no-inline
463
- TaskState: _TaskState,
464
- TaskEvent: _TaskEvent,
465
- StringFormat: StringFormat,
466
- Storage: StorageServiceCompat,
467
- Reference: ReferenceCompat
468
- };
469
- instance.INTERNAL.registerComponent(new Component(STORAGE_TYPE, factory, "PUBLIC" /* ComponentType.PUBLIC */)
470
- .setServiceProps(namespaceExports)
471
- .setMultipleInstances(true));
472
- instance.registerVersion(name, version);
473
- }
474
- registerStorage(firebase);
475
-
476
- export { registerStorage };
477
- //# sourceMappingURL=index.esm5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm5.js","sources":["../../src/tasksnapshot.ts","../../src/task.ts","../../src/list.ts","../../src/reference.ts","../../src/service.ts","../../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UploadTaskSnapshot } from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { UploadTaskCompat } from './task';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskSnapshotCompat\n implements types.UploadTaskSnapshot, Compat<UploadTaskSnapshot>\n{\n constructor(\n readonly _delegate: UploadTaskSnapshot,\n readonly task: UploadTaskCompat,\n readonly ref: ReferenceCompat\n ) {}\n\n get bytesTransferred(): number {\n return this._delegate.bytesTransferred;\n }\n get metadata(): types.FullMetadata {\n return this._delegate.metadata as types.FullMetadata;\n }\n get state(): string {\n return this._delegate.state;\n }\n get totalBytes(): number {\n return this._delegate.totalBytes;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n UploadTask,\n StorageError,\n UploadTaskSnapshot,\n TaskEvent,\n StorageObserver\n} from '@firebase/storage';\nimport { UploadTaskSnapshotCompat } from './tasksnapshot';\nimport { ReferenceCompat } from './reference';\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class UploadTaskCompat implements types.UploadTask, Compat<UploadTask> {\n constructor(\n readonly _delegate: UploadTask,\n private readonly _ref: ReferenceCompat\n ) {}\n\n get snapshot(): UploadTaskSnapshotCompat {\n return new UploadTaskSnapshotCompat(\n this._delegate.snapshot,\n this,\n this._ref\n );\n }\n\n cancel = this._delegate.cancel.bind(this._delegate);\n catch = this._delegate.catch.bind(this._delegate);\n pause = this._delegate.pause.bind(this._delegate);\n resume = this._delegate.resume.bind(this._delegate);\n\n then(\n onFulfilled?: ((a: UploadTaskSnapshotCompat) => unknown) | null,\n onRejected?: ((a: StorageError) => unknown) | null\n ): Promise<unknown> {\n return this._delegate.then(snapshot => {\n if (onFulfilled) {\n return onFulfilled(\n new UploadTaskSnapshotCompat(snapshot, this, this._ref)\n );\n }\n }, onRejected);\n }\n\n on(\n type: TaskEvent,\n nextOrObserver?:\n | types.StorageObserver<UploadTaskSnapshotCompat>\n | null\n | ((a: UploadTaskSnapshotCompat) => unknown),\n error?: ((error: StorageError) => void) | null,\n completed?: () => void | null\n ): Unsubscribe | Subscribe<UploadTaskSnapshotCompat> {\n let wrappedNextOrObserver:\n | StorageObserver<UploadTaskSnapshot>\n | undefined\n | ((a: UploadTaskSnapshot) => unknown) = undefined;\n if (!!nextOrObserver) {\n if (typeof nextOrObserver === 'function') {\n wrappedNextOrObserver = (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n );\n } else {\n wrappedNextOrObserver = {\n next: !!nextOrObserver.next\n ? (taskSnapshot: UploadTaskSnapshot) =>\n nextOrObserver.next!(\n new UploadTaskSnapshotCompat(taskSnapshot, this, this._ref)\n )\n : undefined,\n complete: nextOrObserver.complete || undefined,\n error: nextOrObserver.error || undefined\n };\n }\n }\n return this._delegate.on(\n type,\n wrappedNextOrObserver,\n error || undefined,\n completed || undefined\n );\n }\n}\n\n/**\n * Subscribes to an event stream.\n */\nexport type Subscribe<T> = (\n next?: NextFn<T> | StorageObserver<T>,\n error?: ErrorFn,\n complete?: CompleteFn\n) => Unsubscribe;\n\n/**\n * Unsubscribes from a stream.\n */\nexport type Unsubscribe = () => void;\n\n/**\n * Function that is called once for each value in a stream of values.\n */\nexport type NextFn<T> = (value: T) => void;\n\n/**\n * A function that is called with a `FirebaseStorageError`\n * if the event stream ends due to an error.\n */\nexport type ErrorFn = (error: StorageError) => void;\n\n/**\n * A function that is called if the event stream ends normally.\n */\nexport type CompleteFn = () => void;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ListResult } from '@firebase/storage';\nimport * as types from '@firebase/storage-types';\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport { Compat } from '@firebase/util';\n\nexport class ListResultCompat implements types.ListResult, Compat<ListResult> {\n constructor(\n readonly _delegate: ListResult,\n private readonly _service: StorageServiceCompat\n ) {}\n\n get prefixes(): ReferenceCompat[] {\n return this._delegate.prefixes.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get items(): ReferenceCompat[] {\n return this._delegate.items.map(\n ref => new ReferenceCompat(ref, this._service)\n );\n }\n get nextPageToken(): string | null {\n return this._delegate.nextPageToken || null;\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n StorageReference,\n uploadBytesResumable,\n list,\n listAll,\n getDownloadURL,\n getMetadata,\n updateMetadata,\n deleteObject,\n UploadTask,\n StringFormat,\n UploadMetadata,\n FullMetadata,\n SettableMetadata,\n _UploadTask,\n _getChild,\n _Reference,\n _FbsBlob,\n _dataFromString,\n _invalidRootOperation\n} from '@firebase/storage';\n\nimport { UploadTaskCompat } from './task';\nimport { ListResultCompat } from './list';\nimport { StorageServiceCompat } from './service';\n\nimport * as types from '@firebase/storage-types';\nimport { Compat } from '@firebase/util';\n\nexport class ReferenceCompat\n implements types.Reference, Compat<StorageReference>\n{\n constructor(\n readonly _delegate: StorageReference,\n public storage: StorageServiceCompat\n ) {}\n\n get name(): string {\n return this._delegate.name;\n }\n\n get bucket(): string {\n return this._delegate.bucket;\n }\n\n get fullPath(): string {\n return this._delegate.fullPath;\n }\n\n toString(): string {\n return this._delegate.toString();\n }\n\n /**\n * @returns A reference to the object obtained by\n * appending childPath, removing any duplicate, beginning, or trailing\n * slashes.\n */\n child(childPath: string): types.Reference {\n const reference = _getChild(this._delegate, childPath);\n return new ReferenceCompat(reference, this.storage);\n }\n\n get root(): types.Reference {\n return new ReferenceCompat(this._delegate.root, this.storage);\n }\n\n /**\n * @returns A reference to the parent of the\n * current object, or null if the current object is the root.\n */\n get parent(): types.Reference | null {\n const reference = this._delegate.parent;\n if (reference == null) {\n return null;\n }\n return new ReferenceCompat(reference, this.storage);\n }\n\n /**\n * Uploads a blob to this object's location.\n * @param data - The blob to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n put(\n data: Blob | Uint8Array | ArrayBuffer,\n metadata?: types.FullMetadata\n ): types.UploadTask {\n this._throwIfRoot('put');\n return new UploadTaskCompat(\n uploadBytesResumable(this._delegate, data, metadata as UploadMetadata),\n this\n );\n }\n\n /**\n * Uploads a string to this object's location.\n * @param value - The string to upload.\n * @param format - The format of the string to upload.\n * @returns An UploadTask that lets you control and\n * observe the upload.\n */\n putString(\n value: string,\n format: StringFormat = StringFormat.RAW,\n metadata?: types.UploadMetadata\n ): types.UploadTask {\n this._throwIfRoot('putString');\n const data = _dataFromString(format, value);\n const metadataClone = { ...metadata };\n if (metadataClone['contentType'] == null && data.contentType != null) {\n metadataClone['contentType'] = data.contentType;\n }\n return new UploadTaskCompat(\n new _UploadTask(\n this._delegate as _Reference,\n new _FbsBlob(data.data, true),\n metadataClone as FullMetadata & { [k: string]: string }\n ) as UploadTask,\n this\n );\n }\n\n /**\n * List all items (files) and prefixes (folders) under this storage reference.\n *\n * This is a helper method for calling list() repeatedly until there are\n * no more results. The default pagination size is 1000.\n *\n * Note: The results may not be consistent if objects are changed while this\n * operation is running.\n *\n * Warning: listAll may potentially consume too many resources if there are\n * too many results.\n *\n * @returns A Promise that resolves with all the items and prefixes under\n * the current storage reference. `prefixes` contains references to\n * sub-directories and `items` contains references to objects in this\n * folder. `nextPageToken` is never returned.\n */\n listAll(): Promise<types.ListResult> {\n return listAll(this._delegate).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * List items (files) and prefixes (folders) under this storage reference.\n *\n * List API is only available for Firebase Rules Version 2.\n *\n * GCS is a key-blob store. Firebase Storage imposes the semantic of '/'\n * delimited folder structure. Refer to GCS's List API if you want to learn more.\n *\n * To adhere to Firebase Rules's Semantics, Firebase Storage does not\n * support objects whose paths end with \"/\" or contain two consecutive\n * \"/\"s. Firebase Storage List API will filter these unsupported objects.\n * list() may fail if there are too many unsupported objects in the bucket.\n *\n * @param options - See ListOptions for details.\n * @returns A Promise that resolves with the items and prefixes.\n * `prefixes` contains references to sub-folders and `items`\n * contains references to objects in this folder. `nextPageToken`\n * can be used to get the rest of the results.\n */\n list(options?: types.ListOptions | null): Promise<types.ListResult> {\n return list(this._delegate, options || undefined).then(\n r => new ListResultCompat(r, this.storage)\n );\n }\n\n /**\n * A `Promise` that resolves with the metadata for this object. If this\n * object doesn't exist or metadata cannot be retrieved, the promise is\n * rejected.\n */\n getMetadata(): Promise<types.FullMetadata> {\n return getMetadata(this._delegate) as Promise<types.FullMetadata>;\n }\n\n /**\n * Updates the metadata for this object.\n * @param metadata - The new metadata for the object.\n * Only values that have been explicitly set will be changed. Explicitly\n * setting a value to null will remove the metadata.\n * @returns A `Promise` that resolves\n * with the new metadata for this object.\n * @see firebaseStorage.Reference.prototype.getMetadata\n */\n updateMetadata(\n metadata: types.SettableMetadata\n ): Promise<types.FullMetadata> {\n return updateMetadata(\n this._delegate,\n metadata as SettableMetadata\n ) as Promise<types.FullMetadata>;\n }\n\n /**\n * @returns A `Promise` that resolves with the download\n * URL for this object.\n */\n getDownloadURL(): Promise<string> {\n return getDownloadURL(this._delegate);\n }\n\n /**\n * Deletes the object at this location.\n * @returns A `Promise` that resolves if the deletion succeeds.\n */\n delete(): Promise<void> {\n this._throwIfRoot('delete');\n return deleteObject(this._delegate);\n }\n\n private _throwIfRoot(name: string): void {\n if ((this._delegate as _Reference)._location.path === '') {\n throw _invalidRootOperation(name);\n }\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as types from '@firebase/storage-types';\nimport { FirebaseApp } from '@firebase/app-types';\n\nimport {\n ref,\n connectStorageEmulator,\n FirebaseStorage,\n _Location,\n _invalidArgument,\n _FirebaseStorageImpl\n} from '@firebase/storage';\nimport { ReferenceCompat } from './reference';\nimport { Compat, EmulatorMockTokenOptions } from '@firebase/util';\n\n/**\n * A service that provides firebaseStorage.Reference instances.\n * @param opt_url gs:// url to a custom Storage Bucket\n */\nexport class StorageServiceCompat\n implements types.FirebaseStorage, Compat<FirebaseStorage>\n{\n constructor(public app: FirebaseApp, readonly _delegate: FirebaseStorage) {}\n\n get maxOperationRetryTime(): number {\n return this._delegate.maxOperationRetryTime;\n }\n\n get maxUploadRetryTime(): number {\n return this._delegate.maxUploadRetryTime;\n }\n\n /**\n * Returns a firebaseStorage.Reference for the given path in the default\n * bucket.\n */\n ref(path?: string): types.Reference {\n if (isUrl(path)) {\n throw _invalidArgument(\n 'ref() expected a child path but got a URL, use refFromURL instead.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, path), this);\n }\n\n /**\n * Returns a firebaseStorage.Reference object for the given absolute URL,\n * which must be a gs:// or http[s]:// URL.\n */\n refFromURL(url: string): types.Reference {\n if (!isUrl(url)) {\n throw _invalidArgument(\n 'refFromURL() expected a full URL but got a child path, use ref() instead.'\n );\n }\n try {\n _Location.makeFromUrl(url, (this._delegate as _FirebaseStorageImpl).host);\n } catch (e) {\n throw _invalidArgument(\n 'refFromUrl() expected a valid full URL but got an invalid one.'\n );\n }\n return new ReferenceCompat(ref(this._delegate, url), this);\n }\n\n setMaxUploadRetryTime(time: number): void {\n this._delegate.maxUploadRetryTime = time;\n }\n\n setMaxOperationRetryTime(time: number): void {\n this._delegate.maxOperationRetryTime = time;\n }\n\n useEmulator(\n host: string,\n port: number,\n options: {\n mockUserToken?: EmulatorMockTokenOptions | string;\n } = {}\n ): void {\n connectStorageEmulator(this._delegate, host, port, options);\n }\n}\n\nfunction isUrl(path?: string): boolean {\n return /^[A-Za-z]+:\\/\\//.test(path as string);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport firebase from '@firebase/app-compat';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport {\n StringFormat,\n _TaskEvent as TaskEvent,\n _TaskState as TaskState\n} from '@firebase/storage';\n\nimport { ReferenceCompat } from './reference';\nimport { StorageServiceCompat } from './service';\nimport * as types from '@firebase/storage-types';\nimport {\n Component,\n ComponentType,\n ComponentContainer,\n InstanceFactoryOptions\n} from '@firebase/component';\n\nimport { name, version } from '../package.json';\n\n/**\n * Type constant for Firebase Storage.\n */\nconst STORAGE_TYPE = 'storage-compat';\n\nfunction factory(\n container: ComponentContainer,\n { instanceIdentifier: url }: InstanceFactoryOptions\n): types.FirebaseStorage {\n // Dependencies\n const app = container.getProvider('app-compat').getImmediate();\n const storageExp = container\n .getProvider('storage')\n .getImmediate({ identifier: url });\n\n const storageServiceCompat: StorageServiceCompat = new StorageServiceCompat(\n app,\n storageExp\n );\n return storageServiceCompat;\n}\n\nexport function registerStorage(instance: _FirebaseNamespace): void {\n const namespaceExports = {\n // no-inline\n TaskState,\n TaskEvent,\n StringFormat,\n Storage: StorageServiceCompat,\n Reference: ReferenceCompat\n };\n instance.INTERNAL.registerComponent(\n new Component(STORAGE_TYPE, factory, ComponentType.PUBLIC)\n .setServiceProps(namespaceExports)\n .setMultipleInstances(true)\n );\n\n instance.registerVersion(name, version);\n}\n\nregisterStorage(firebase as unknown as _FirebaseNamespace);\n\n/**\n * Define extension behavior for `registerStorage`\n */\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n storage?: {\n (app?: FirebaseApp, url?: string): types.FirebaseStorage;\n Storage: typeof types.FirebaseStorage;\n\n StringFormat: {\n BASE64: types.StringFormat;\n BASE64URL: types.StringFormat;\n DATA_URL: types.StringFormat;\n RAW: types.StringFormat;\n };\n TaskEvent: {\n STATE_CHANGED: types.TaskEvent;\n };\n TaskState: {\n CANCELED: types.TaskState;\n ERROR: types.TaskState;\n PAUSED: types.TaskState;\n RUNNING: types.TaskState;\n SUCCESS: types.TaskState;\n };\n };\n }\n interface FirebaseApp {\n storage?(storageBucket?: string): types.FirebaseStorage;\n }\n}\n"],"names":["TaskState","TaskEvent"],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAQH,IAAA,wBAAA,kBAAA,YAAA;AAGE,IAAA,SAAA,wBAAA,CACW,SAA6B,EAC7B,IAAsB,EACtB,GAAoB,EAAA;QAFpB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAoB;QAC7B,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