@firebase/storage 0.9.14 → 0.10.0-canary.37f31c57b

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.
@@ -77,7 +77,7 @@ var StorageError = /** @class */ (function (_super) {
77
77
  */
78
78
  function StorageError(code, message, status_) {
79
79
  if (status_ === void 0) { status_ = 0; }
80
- var _this = _super.call(this, prependCode(code), "Firebase Storage: " + message + " (" + prependCode(code) + ")") || this;
80
+ var _this = _super.call(this, prependCode(code), "Firebase Storage: ".concat(message, " (").concat(prependCode(code), ")")) || this;
81
81
  _this.status_ = status_;
82
82
  /**
83
83
  * Stores custom error data unque to StorageError.
@@ -115,7 +115,7 @@ var StorageError = /** @class */ (function (_super) {
115
115
  set: function (serverResponse) {
116
116
  this.customData.serverResponse = serverResponse;
117
117
  if (this.customData.serverResponse) {
118
- this.message = this._baseMessage + "\n" + this.customData.serverResponse;
118
+ this.message = "".concat(this._baseMessage, "\n").concat(this.customData.serverResponse);
119
119
  }
120
120
  else {
121
121
  this.message = this._baseMessage;
@@ -132,13 +132,13 @@ function prependCode(code) {
132
132
  function unknown() {
133
133
  var message = 'An unknown error occurred, please check the error payload for ' +
134
134
  'server response.';
135
- return new StorageError("unknown" /* UNKNOWN */, message);
135
+ return new StorageError("unknown" /* StorageErrorCode.UNKNOWN */, message);
136
136
  }
137
137
  function objectNotFound(path) {
138
- return new StorageError("object-not-found" /* OBJECT_NOT_FOUND */, "Object '" + path + "' does not exist.");
138
+ return new StorageError("object-not-found" /* StorageErrorCode.OBJECT_NOT_FOUND */, "Object '" + path + "' does not exist.");
139
139
  }
140
140
  function quotaExceeded(bucket) {
141
- return new StorageError("quota-exceeded" /* QUOTA_EXCEEDED */, "Quota for bucket '" +
141
+ return new StorageError("quota-exceeded" /* StorageErrorCode.QUOTA_EXCEEDED */, "Quota for bucket '" +
142
142
  bucket +
143
143
  "' exceeded, please view quota on " +
144
144
  'https://firebase.google.com/pricing/.');
@@ -146,52 +146,52 @@ function quotaExceeded(bucket) {
146
146
  function unauthenticated() {
147
147
  var message = 'User is not authenticated, please authenticate using Firebase ' +
148
148
  'Authentication and try again.';
149
- return new StorageError("unauthenticated" /* UNAUTHENTICATED */, message);
149
+ return new StorageError("unauthenticated" /* StorageErrorCode.UNAUTHENTICATED */, message);
150
150
  }
151
151
  function unauthorizedApp() {
152
- return new StorageError("unauthorized-app" /* UNAUTHORIZED_APP */, 'This app does not have permission to access Firebase Storage on this project.');
152
+ return new StorageError("unauthorized-app" /* StorageErrorCode.UNAUTHORIZED_APP */, 'This app does not have permission to access Firebase Storage on this project.');
153
153
  }
154
154
  function unauthorized(path) {
155
- return new StorageError("unauthorized" /* UNAUTHORIZED */, "User does not have permission to access '" + path + "'.");
155
+ return new StorageError("unauthorized" /* StorageErrorCode.UNAUTHORIZED */, "User does not have permission to access '" + path + "'.");
156
156
  }
157
157
  function retryLimitExceeded() {
158
- return new StorageError("retry-limit-exceeded" /* RETRY_LIMIT_EXCEEDED */, 'Max retry time for operation exceeded, please try again.');
158
+ return new StorageError("retry-limit-exceeded" /* StorageErrorCode.RETRY_LIMIT_EXCEEDED */, 'Max retry time for operation exceeded, please try again.');
159
159
  }
160
160
  function canceled() {
161
- return new StorageError("canceled" /* CANCELED */, 'User canceled the upload/download.');
161
+ return new StorageError("canceled" /* StorageErrorCode.CANCELED */, 'User canceled the upload/download.');
162
162
  }
163
163
  function invalidUrl(url) {
164
- return new StorageError("invalid-url" /* INVALID_URL */, "Invalid URL '" + url + "'.");
164
+ return new StorageError("invalid-url" /* StorageErrorCode.INVALID_URL */, "Invalid URL '" + url + "'.");
165
165
  }
166
166
  function invalidDefaultBucket(bucket) {
167
- return new StorageError("invalid-default-bucket" /* INVALID_DEFAULT_BUCKET */, "Invalid default bucket '" + bucket + "'.");
167
+ return new StorageError("invalid-default-bucket" /* StorageErrorCode.INVALID_DEFAULT_BUCKET */, "Invalid default bucket '" + bucket + "'.");
168
168
  }
169
169
  function noDefaultBucket() {
170
- return new StorageError("no-default-bucket" /* NO_DEFAULT_BUCKET */, 'No default bucket ' +
170
+ return new StorageError("no-default-bucket" /* StorageErrorCode.NO_DEFAULT_BUCKET */, 'No default bucket ' +
171
171
  "found. Did you set the '" +
172
172
  CONFIG_STORAGE_BUCKET_KEY +
173
173
  "' property when initializing the app?");
174
174
  }
175
175
  function cannotSliceBlob() {
176
- return new StorageError("cannot-slice-blob" /* CANNOT_SLICE_BLOB */, 'Cannot slice blob for upload. Please retry the upload.');
176
+ return new StorageError("cannot-slice-blob" /* StorageErrorCode.CANNOT_SLICE_BLOB */, 'Cannot slice blob for upload. Please retry the upload.');
177
177
  }
178
178
  function serverFileWrongSize() {
179
- return new StorageError("server-file-wrong-size" /* SERVER_FILE_WRONG_SIZE */, 'Server recorded incorrect upload file size, please retry the upload.');
179
+ return new StorageError("server-file-wrong-size" /* StorageErrorCode.SERVER_FILE_WRONG_SIZE */, 'Server recorded incorrect upload file size, please retry the upload.');
180
180
  }
181
181
  function noDownloadURL() {
182
- return new StorageError("no-download-url" /* NO_DOWNLOAD_URL */, 'The given file does not have any download URLs.');
182
+ return new StorageError("no-download-url" /* StorageErrorCode.NO_DOWNLOAD_URL */, 'The given file does not have any download URLs.');
183
183
  }
184
184
  function missingPolyFill(polyFill) {
185
- return new StorageError("unsupported-environment" /* UNSUPPORTED_ENVIRONMENT */, polyFill + " is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.");
185
+ return new StorageError("unsupported-environment" /* StorageErrorCode.UNSUPPORTED_ENVIRONMENT */, "".concat(polyFill, " is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information."));
186
186
  }
187
187
  /**
188
188
  * @internal
189
189
  */
190
190
  function invalidArgument(message) {
191
- return new StorageError("invalid-argument" /* INVALID_ARGUMENT */, message);
191
+ return new StorageError("invalid-argument" /* StorageErrorCode.INVALID_ARGUMENT */, message);
192
192
  }
193
193
  function appDeleted() {
194
- return new StorageError("app-deleted" /* APP_DELETED */, 'The Firebase app was deleted.');
194
+ return new StorageError("app-deleted" /* StorageErrorCode.APP_DELETED */, 'The Firebase app was deleted.');
195
195
  }
196
196
  /**
197
197
  * @param name - The name of the operation that was invalid.
@@ -199,7 +199,7 @@ function appDeleted() {
199
199
  * @internal
200
200
  */
201
201
  function invalidRootOperation(name) {
202
- return new StorageError("invalid-root-operation" /* INVALID_ROOT_OPERATION */, "The operation '" +
202
+ return new StorageError("invalid-root-operation" /* StorageErrorCode.INVALID_ROOT_OPERATION */, "The operation '" +
203
203
  name +
204
204
  "' cannot be performed on a root reference, create a non-root " +
205
205
  "reference using child, such as .child('file.png').");
@@ -209,13 +209,13 @@ function invalidRootOperation(name) {
209
209
  * @param message - A message describing the format violation.
210
210
  */
211
211
  function invalidFormat(format, message) {
212
- return new StorageError("invalid-format" /* INVALID_FORMAT */, "String does not match format '" + format + "': " + message);
212
+ return new StorageError("invalid-format" /* StorageErrorCode.INVALID_FORMAT */, "String does not match format '" + format + "': " + message);
213
213
  }
214
214
  /**
215
215
  * @param message - A message describing the internal error.
216
216
  */
217
217
  function internalError(message) {
218
- throw new StorageError("internal-error" /* INTERNAL_ERROR */, 'Internal error: ' + message);
218
+ throw new StorageError("internal-error" /* StorageErrorCode.INTERNAL_ERROR */, 'Internal error: ' + message);
219
219
  }
220
220
 
221
221
  /**
@@ -300,13 +300,13 @@ var Location = /** @class */ (function () {
300
300
  var version = 'v[A-Za-z0-9_]+';
301
301
  var firebaseStorageHost = host.replace(/[.]/g, '\\.');
302
302
  var firebaseStoragePath = '(/([^?#]*).*)?$';
303
- var firebaseStorageRegExp = new RegExp("^https?://" + firebaseStorageHost + "/" + version + "/b/" + bucketDomain + "/o" + firebaseStoragePath, 'i');
303
+ var firebaseStorageRegExp = new RegExp("^https?://".concat(firebaseStorageHost, "/").concat(version, "/b/").concat(bucketDomain, "/o").concat(firebaseStoragePath), 'i');
304
304
  var firebaseStorageIndices = { bucket: 1, path: 3 };
305
305
  var cloudStorageHost = host === DEFAULT_HOST
306
306
  ? '(?:storage.googleapis.com|storage.cloud.google.com)'
307
307
  : host;
308
308
  var cloudStoragePath = '([^?#]*)';
309
- var cloudStorageRegExp = new RegExp("^https?://" + cloudStorageHost + "/" + bucketDomain + "/" + cloudStoragePath, 'i');
309
+ var cloudStorageRegExp = new RegExp("^https?://".concat(cloudStorageHost, "/").concat(bucketDomain, "/").concat(cloudStoragePath), 'i');
310
310
  var cloudStorageIndices = { bucket: 1, path: 2 };
311
311
  var groups = [
312
312
  { regex: gsRegex, indices: gsIndices, postModify: gsModify },
@@ -438,13 +438,13 @@ backoffCompleteCb, timeout) {
438
438
  }
439
439
  if (success) {
440
440
  clearGlobalTimeout();
441
- triggerCallback.call.apply(triggerCallback, __spreadArray([null, success], args));
441
+ triggerCallback.call.apply(triggerCallback, __spreadArray([null, success], args, false));
442
442
  return;
443
443
  }
444
444
  var mustStop = canceled() || hitTimeout;
445
445
  if (mustStop) {
446
446
  clearGlobalTimeout();
447
- triggerCallback.call.apply(triggerCallback, __spreadArray([null, success], args));
447
+ triggerCallback.call.apply(triggerCallback, __spreadArray([null, success], args, false));
448
448
  return;
449
449
  }
450
450
  if (waitSeconds < 64) {
@@ -541,10 +541,10 @@ function isNativeBlobDefined() {
541
541
  }
542
542
  function validateNumber(argument, minValue, maxValue, value) {
543
543
  if (value < minValue) {
544
- throw invalidArgument("Invalid value for '" + argument + "'. Expected " + minValue + " or greater.");
544
+ throw invalidArgument("Invalid value for '".concat(argument, "'. Expected ").concat(minValue, " or greater."));
545
545
  }
546
546
  if (value > maxValue) {
547
- throw invalidArgument("Invalid value for '" + argument + "'. Expected " + maxValue + " or less.");
547
+ throw invalidArgument("Invalid value for '".concat(argument, "'. Expected ").concat(maxValue, " or less."));
548
548
  }
549
549
  }
550
550
 
@@ -567,9 +567,9 @@ function validateNumber(argument, minValue, maxValue, value) {
567
567
  function makeUrl(urlPart, host, protocol) {
568
568
  var origin = host;
569
569
  if (protocol == null) {
570
- origin = "https://" + host;
570
+ origin = "https://".concat(host);
571
571
  }
572
- return protocol + "://" + origin + "/v0" + urlPart;
572
+ return "".concat(protocol, "://").concat(origin, "/v0").concat(urlPart);
573
573
  }
574
574
  function makeQueryString(params) {
575
575
  var encode = encodeURIComponent;
@@ -674,8 +674,8 @@ function isRetryStatusCode(status, additionalRetryCodes) {
674
674
  */
675
675
  var NetworkRequest = /** @class */ (function () {
676
676
  function NetworkRequest(url_, method_, headers_, body_, successCodes_, additionalRetryCodes_, callback_, errorCallback_, timeout_, progressCallback_, connectionFactory_, retry) {
677
- var _this = this;
678
677
  if (retry === void 0) { retry = true; }
678
+ var _this = this;
679
679
  this.url_ = url_;
680
680
  this.method_ = method_;
681
681
  this.headers_ = headers_;
@@ -905,7 +905,7 @@ function getBlob$1() {
905
905
  return new Blob(args);
906
906
  }
907
907
  else {
908
- throw new StorageError("unsupported-environment" /* UNSUPPORTED_ENVIRONMENT */, "This browser doesn't seem to support creating Blobs");
908
+ throw new StorageError("unsupported-environment" /* StorageErrorCode.UNSUPPORTED_ENVIRONMENT */, "This browser doesn't seem to support creating Blobs");
909
909
  }
910
910
  }
911
911
  }
@@ -1750,7 +1750,7 @@ function getBytes$1(service, location, maxDownloadSizeBytes) {
1750
1750
  var requestInfo = new RequestInfo(url, method, function (_, data) { return data; }, timeout);
1751
1751
  requestInfo.errorHandler = objectErrorHandler(location);
1752
1752
  if (maxDownloadSizeBytes !== undefined) {
1753
- requestInfo.headers['Range'] = "bytes=0-" + maxDownloadSizeBytes;
1753
+ requestInfo.headers['Range'] = "bytes=0-".concat(maxDownloadSizeBytes);
1754
1754
  requestInfo.successCodes = [200 /* OK */, 206 /* Partial Content */];
1755
1755
  }
1756
1756
  return requestInfo;
@@ -1885,7 +1885,7 @@ function createResumableUpload(service, location, mappings, blob, metadata) {
1885
1885
  var headers = {
1886
1886
  'X-Goog-Upload-Protocol': 'resumable',
1887
1887
  'X-Goog-Upload-Command': 'start',
1888
- 'X-Goog-Upload-Header-Content-Length': "" + blob.size(),
1888
+ 'X-Goog-Upload-Header-Content-Length': "".concat(blob.size()),
1889
1889
  'X-Goog-Upload-Header-Content-Type': metadataForUpload['contentType'],
1890
1890
  'Content-Type': 'application/json; charset=utf-8'
1891
1891
  };
@@ -1987,7 +1987,7 @@ function continueResumableUpload(location, service, url, blob, chunkSize, mappin
1987
1987
  }
1988
1988
  var headers = {
1989
1989
  'X-Goog-Upload-Command': uploadCommand,
1990
- 'X-Goog-Upload-Offset': "" + status_.current
1990
+ 'X-Goog-Upload-Offset': "".concat(status_.current)
1991
1991
  };
1992
1992
  var body = blob.slice(startByte, endByte);
1993
1993
  if (body === null) {
@@ -2074,17 +2074,17 @@ var TaskState = {
2074
2074
  };
2075
2075
  function taskStateFromInternalTaskState(state) {
2076
2076
  switch (state) {
2077
- case "running" /* RUNNING */:
2078
- case "pausing" /* PAUSING */:
2079
- case "canceling" /* CANCELING */:
2077
+ case "running" /* InternalTaskState.RUNNING */:
2078
+ case "pausing" /* InternalTaskState.PAUSING */:
2079
+ case "canceling" /* InternalTaskState.CANCELING */:
2080
2080
  return TaskState.RUNNING;
2081
- case "paused" /* PAUSED */:
2081
+ case "paused" /* InternalTaskState.PAUSED */:
2082
2082
  return TaskState.PAUSED;
2083
- case "success" /* SUCCESS */:
2083
+ case "success" /* InternalTaskState.SUCCESS */:
2084
2084
  return TaskState.SUCCESS;
2085
- case "canceled" /* CANCELED */:
2085
+ case "canceled" /* InternalTaskState.CANCELED */:
2086
2086
  return TaskState.CANCELED;
2087
- case "error" /* ERROR */:
2087
+ case "error" /* InternalTaskState.ERROR */:
2088
2088
  return TaskState.ERROR;
2089
2089
  default:
2090
2090
  // TODO(andysoto): assert(false);
@@ -2339,8 +2339,8 @@ var UploadTask = /** @class */ (function () {
2339
2339
  * @param blob - The blob to upload.
2340
2340
  */
2341
2341
  function UploadTask(ref, blob, metadata) {
2342
- var _this = this;
2343
2342
  if (metadata === void 0) { metadata = null; }
2343
+ var _this = this;
2344
2344
  /**
2345
2345
  * Number of bytes transferred so far.
2346
2346
  */
@@ -2359,11 +2359,11 @@ var UploadTask = /** @class */ (function () {
2359
2359
  this._metadata = metadata;
2360
2360
  this._mappings = getMappings();
2361
2361
  this._resumable = this._shouldDoResumable(this._blob);
2362
- this._state = "running" /* RUNNING */;
2362
+ this._state = "running" /* InternalTaskState.RUNNING */;
2363
2363
  this._errorHandler = function (error) {
2364
2364
  _this._request = undefined;
2365
2365
  _this._chunkMultiplier = 1;
2366
- if (error._codeEquals("canceled" /* CANCELED */)) {
2366
+ if (error._codeEquals("canceled" /* StorageErrorCode.CANCELED */)) {
2367
2367
  _this._needToFetchStatus = true;
2368
2368
  _this.completeTransitions_();
2369
2369
  }
@@ -2381,17 +2381,17 @@ var UploadTask = /** @class */ (function () {
2381
2381
  }
2382
2382
  }
2383
2383
  _this._error = error;
2384
- _this._transition("error" /* ERROR */);
2384
+ _this._transition("error" /* InternalTaskState.ERROR */);
2385
2385
  }
2386
2386
  };
2387
2387
  this._metadataErrorHandler = function (error) {
2388
2388
  _this._request = undefined;
2389
- if (error._codeEquals("canceled" /* CANCELED */)) {
2389
+ if (error._codeEquals("canceled" /* StorageErrorCode.CANCELED */)) {
2390
2390
  _this.completeTransitions_();
2391
2391
  }
2392
2392
  else {
2393
2393
  _this._error = error;
2394
- _this._transition("error" /* ERROR */);
2394
+ _this._transition("error" /* InternalTaskState.ERROR */);
2395
2395
  }
2396
2396
  };
2397
2397
  this.sleepTime = 0;
@@ -2418,7 +2418,7 @@ var UploadTask = /** @class */ (function () {
2418
2418
  };
2419
2419
  UploadTask.prototype._start = function () {
2420
2420
  var _this = this;
2421
- if (this._state !== "running" /* RUNNING */) {
2421
+ if (this._state !== "running" /* InternalTaskState.RUNNING */) {
2422
2422
  // This can happen if someone pauses us in a resume callback, for example.
2423
2423
  return;
2424
2424
  }
@@ -2460,14 +2460,14 @@ var UploadTask = /** @class */ (function () {
2460
2460
  ]).then(function (_a) {
2461
2461
  var authToken = _a[0], appCheckToken = _a[1];
2462
2462
  switch (_this._state) {
2463
- case "running" /* RUNNING */:
2463
+ case "running" /* InternalTaskState.RUNNING */:
2464
2464
  callback(authToken, appCheckToken);
2465
2465
  break;
2466
- case "canceling" /* CANCELING */:
2467
- _this._transition("canceled" /* CANCELED */);
2466
+ case "canceling" /* InternalTaskState.CANCELING */:
2467
+ _this._transition("canceled" /* InternalTaskState.CANCELED */);
2468
2468
  break;
2469
- case "pausing" /* PAUSING */:
2470
- _this._transition("paused" /* PAUSED */);
2469
+ case "pausing" /* InternalTaskState.PAUSING */:
2470
+ _this._transition("paused" /* InternalTaskState.PAUSED */);
2471
2471
  break;
2472
2472
  }
2473
2473
  });
@@ -2520,7 +2520,7 @@ var UploadTask = /** @class */ (function () {
2520
2520
  }
2521
2521
  catch (e) {
2522
2522
  _this._error = e;
2523
- _this._transition("error" /* ERROR */);
2523
+ _this._transition("error" /* InternalTaskState.ERROR */);
2524
2524
  return;
2525
2525
  }
2526
2526
  var uploadRequest = _this._ref.storage._makeRequest(requestInfo, newTextConnection, authToken, appCheckToken,
@@ -2533,7 +2533,7 @@ var UploadTask = /** @class */ (function () {
2533
2533
  _this._updateProgress(newStatus.current);
2534
2534
  if (newStatus.finalized) {
2535
2535
  _this._metadata = newStatus.metadata;
2536
- _this._transition("success" /* SUCCESS */);
2536
+ _this._transition("success" /* InternalTaskState.SUCCESS */);
2537
2537
  }
2538
2538
  else {
2539
2539
  _this.completeTransitions_();
@@ -2557,7 +2557,7 @@ var UploadTask = /** @class */ (function () {
2557
2557
  metadataRequest.getPromise().then(function (metadata) {
2558
2558
  _this._request = undefined;
2559
2559
  _this._metadata = metadata;
2560
- _this._transition("success" /* SUCCESS */);
2560
+ _this._transition("success" /* InternalTaskState.SUCCESS */);
2561
2561
  }, _this._metadataErrorHandler);
2562
2562
  });
2563
2563
  };
@@ -2571,7 +2571,7 @@ var UploadTask = /** @class */ (function () {
2571
2571
  _this._request = undefined;
2572
2572
  _this._metadata = metadata;
2573
2573
  _this._updateProgress(_this._blob.size());
2574
- _this._transition("success" /* SUCCESS */);
2574
+ _this._transition("success" /* InternalTaskState.SUCCESS */);
2575
2575
  }, _this._errorHandler);
2576
2576
  });
2577
2577
  };
@@ -2590,8 +2590,8 @@ var UploadTask = /** @class */ (function () {
2590
2590
  return;
2591
2591
  }
2592
2592
  switch (state) {
2593
- case "canceling" /* CANCELING */:
2594
- case "pausing" /* PAUSING */:
2593
+ case "canceling" /* InternalTaskState.CANCELING */:
2594
+ case "pausing" /* InternalTaskState.PAUSING */:
2595
2595
  // TODO(andysoto):
2596
2596
  // assert(this.state_ === InternalTaskState.RUNNING ||
2597
2597
  // this.state_ === InternalTaskState.PAUSING);
@@ -2605,24 +2605,24 @@ var UploadTask = /** @class */ (function () {
2605
2605
  this.completeTransitions_();
2606
2606
  }
2607
2607
  break;
2608
- case "running" /* RUNNING */:
2608
+ case "running" /* InternalTaskState.RUNNING */:
2609
2609
  // TODO(andysoto):
2610
2610
  // assert(this.state_ === InternalTaskState.PAUSED ||
2611
2611
  // this.state_ === InternalTaskState.PAUSING);
2612
- var wasPaused = this._state === "paused" /* PAUSED */;
2612
+ var wasPaused = this._state === "paused" /* InternalTaskState.PAUSED */;
2613
2613
  this._state = state;
2614
2614
  if (wasPaused) {
2615
2615
  this._notifyObservers();
2616
2616
  this._start();
2617
2617
  }
2618
2618
  break;
2619
- case "paused" /* PAUSED */:
2619
+ case "paused" /* InternalTaskState.PAUSED */:
2620
2620
  // TODO(andysoto):
2621
2621
  // assert(this.state_ === InternalTaskState.PAUSING);
2622
2622
  this._state = state;
2623
2623
  this._notifyObservers();
2624
2624
  break;
2625
- case "canceled" /* CANCELED */:
2625
+ case "canceled" /* InternalTaskState.CANCELED */:
2626
2626
  // TODO(andysoto):
2627
2627
  // assert(this.state_ === InternalTaskState.PAUSED ||
2628
2628
  // this.state_ === InternalTaskState.CANCELING);
@@ -2630,7 +2630,7 @@ var UploadTask = /** @class */ (function () {
2630
2630
  this._state = state;
2631
2631
  this._notifyObservers();
2632
2632
  break;
2633
- case "error" /* ERROR */:
2633
+ case "error" /* InternalTaskState.ERROR */:
2634
2634
  // TODO(andysoto):
2635
2635
  // assert(this.state_ === InternalTaskState.RUNNING ||
2636
2636
  // this.state_ === InternalTaskState.PAUSING ||
@@ -2638,7 +2638,7 @@ var UploadTask = /** @class */ (function () {
2638
2638
  this._state = state;
2639
2639
  this._notifyObservers();
2640
2640
  break;
2641
- case "success" /* SUCCESS */:
2641
+ case "success" /* InternalTaskState.SUCCESS */:
2642
2642
  // TODO(andysoto):
2643
2643
  // assert(this.state_ === InternalTaskState.RUNNING ||
2644
2644
  // this.state_ === InternalTaskState.PAUSING ||
@@ -2650,13 +2650,13 @@ var UploadTask = /** @class */ (function () {
2650
2650
  };
2651
2651
  UploadTask.prototype.completeTransitions_ = function () {
2652
2652
  switch (this._state) {
2653
- case "pausing" /* PAUSING */:
2654
- this._transition("paused" /* PAUSED */);
2653
+ case "pausing" /* InternalTaskState.PAUSING */:
2654
+ this._transition("paused" /* InternalTaskState.PAUSED */);
2655
2655
  break;
2656
- case "canceling" /* CANCELING */:
2657
- this._transition("canceled" /* CANCELED */);
2656
+ case "canceling" /* InternalTaskState.CANCELING */:
2657
+ this._transition("canceled" /* InternalTaskState.CANCELED */);
2658
2658
  break;
2659
- case "running" /* RUNNING */:
2659
+ case "running" /* InternalTaskState.RUNNING */:
2660
2660
  this._start();
2661
2661
  break;
2662
2662
  }
@@ -2800,10 +2800,10 @@ var UploadTask = /** @class */ (function () {
2800
2800
  * @returns True if the operation took effect, false if ignored.
2801
2801
  */
2802
2802
  UploadTask.prototype.resume = function () {
2803
- var valid = this._state === "paused" /* PAUSED */ ||
2804
- this._state === "pausing" /* PAUSING */;
2803
+ var valid = this._state === "paused" /* InternalTaskState.PAUSED */ ||
2804
+ this._state === "pausing" /* InternalTaskState.PAUSING */;
2805
2805
  if (valid) {
2806
- this._transition("running" /* RUNNING */);
2806
+ this._transition("running" /* InternalTaskState.RUNNING */);
2807
2807
  }
2808
2808
  return valid;
2809
2809
  };
@@ -2812,9 +2812,9 @@ var UploadTask = /** @class */ (function () {
2812
2812
  * @returns True if the operation took effect, false if ignored.
2813
2813
  */
2814
2814
  UploadTask.prototype.pause = function () {
2815
- var valid = this._state === "running" /* RUNNING */;
2815
+ var valid = this._state === "running" /* InternalTaskState.RUNNING */;
2816
2816
  if (valid) {
2817
- this._transition("pausing" /* PAUSING */);
2817
+ this._transition("pausing" /* InternalTaskState.PAUSING */);
2818
2818
  }
2819
2819
  return valid;
2820
2820
  };
@@ -2824,10 +2824,10 @@ var UploadTask = /** @class */ (function () {
2824
2824
  * @returns True if the operation took effect, false if ignored.
2825
2825
  */
2826
2826
  UploadTask.prototype.cancel = function () {
2827
- var valid = this._state === "running" /* RUNNING */ ||
2828
- this._state === "pausing" /* PAUSING */;
2827
+ var valid = this._state === "running" /* InternalTaskState.RUNNING */ ||
2828
+ this._state === "pausing" /* InternalTaskState.PAUSING */;
2829
2829
  if (valid) {
2830
- this._transition("canceling" /* CANCELING */);
2830
+ this._transition("canceling" /* InternalTaskState.CANCELING */);
2831
2831
  }
2832
2832
  return valid;
2833
2833
  };
@@ -3288,7 +3288,7 @@ function extractBucket(host, config) {
3288
3288
  }
3289
3289
  function connectStorageEmulator$1(storage, host, port, options) {
3290
3290
  if (options === void 0) { options = {}; }
3291
- storage.host = host + ":" + port;
3291
+ storage.host = "".concat(host, ":").concat(port);
3292
3292
  storage._protocol = 'http';
3293
3293
  var mockUserToken = options.mockUserToken;
3294
3294
  if (mockUserToken) {
@@ -3496,7 +3496,7 @@ var FirebaseStorageImpl = /** @class */ (function () {
3496
3496
  }());
3497
3497
 
3498
3498
  var name = "@firebase/storage";
3499
- var version = "0.9.14";
3499
+ var version = "0.10.0-canary.37f31c57b";
3500
3500
 
3501
3501
  /**
3502
3502
  * @license
@@ -3698,7 +3698,7 @@ function getStorage(app, bucketUrl) {
3698
3698
  });
3699
3699
  var emulator = getDefaultEmulatorHostnameAndPort('storage');
3700
3700
  if (emulator) {
3701
- connectStorageEmulator.apply(void 0, __spreadArray([storageInstance], emulator));
3701
+ connectStorageEmulator.apply(void 0, __spreadArray([storageInstance], emulator, false));
3702
3702
  }
3703
3703
  return storageInstance;
3704
3704
  }
@@ -3782,7 +3782,7 @@ function factory(container, _a) {
3782
3782
  return new FirebaseStorageImpl(app, authProvider, appCheckProvider, url, SDK_VERSION);
3783
3783
  }
3784
3784
  function registerStorage() {
3785
- _registerComponent(new Component(STORAGE_TYPE, factory, "PUBLIC" /* PUBLIC */).setMultipleInstances(true));
3785
+ _registerComponent(new Component(STORAGE_TYPE, factory, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
3786
3786
  //RUNTIME_ENV will be replaced during the compilation to "node" for nodejs and an empty string for browser
3787
3787
  registerVersion(name, version, '');
3788
3788
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation