@firebase/storage 0.3.31-canary.daf63c2c → 0.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +19 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm2017.js +19 -9
- package/dist/index.esm2017.js.map +1 -1
- package/dist/src/implementation/list.d.ts +2 -2
- package/dist/src/implementation/requests.d.ts +2 -2
- package/package.json +8 -8
package/dist/index.esm2017.js
CHANGED
|
@@ -158,6 +158,12 @@ function invalidUrl(url) {
|
|
|
158
158
|
function invalidDefaultBucket(bucket) {
|
|
159
159
|
return new FirebaseStorageError(Code.INVALID_DEFAULT_BUCKET, "Invalid default bucket '" + bucket + "'.");
|
|
160
160
|
}
|
|
161
|
+
function noDefaultBucket() {
|
|
162
|
+
return new FirebaseStorageError(Code.NO_DEFAULT_BUCKET, 'No default bucket ' +
|
|
163
|
+
"found. Did you set the '" +
|
|
164
|
+
CONFIG_STORAGE_BUCKET_KEY +
|
|
165
|
+
"' property when initializing the app?");
|
|
166
|
+
}
|
|
161
167
|
function cannotSliceBlob() {
|
|
162
168
|
return new FirebaseStorageError(Code.CANNOT_SLICE_BLOB, 'Cannot slice blob for upload. Please retry the upload.');
|
|
163
169
|
}
|
|
@@ -1303,7 +1309,7 @@ function metadataValidator(p) {
|
|
|
1303
1309
|
|
|
1304
1310
|
/**
|
|
1305
1311
|
* @license
|
|
1306
|
-
* Copyright 2019 Google
|
|
1312
|
+
* Copyright 2019 Google Inc.
|
|
1307
1313
|
*
|
|
1308
1314
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1309
1315
|
* you may not use this file except in compliance with the License.
|
|
@@ -1322,12 +1328,16 @@ const MAX_MAX_RESULTS = 1000;
|
|
|
1322
1328
|
const PAGE_TOKEN_KEY = 'pageToken';
|
|
1323
1329
|
const PREFIXES_KEY = 'prefixes';
|
|
1324
1330
|
const ITEMS_KEY = 'items';
|
|
1325
|
-
function fromBackendResponse(authWrapper,
|
|
1331
|
+
function fromBackendResponse(authWrapper, resource) {
|
|
1326
1332
|
const listResult = {
|
|
1327
1333
|
prefixes: [],
|
|
1328
1334
|
items: [],
|
|
1329
1335
|
nextPageToken: resource['nextPageToken']
|
|
1330
1336
|
};
|
|
1337
|
+
const bucket = authWrapper.bucket();
|
|
1338
|
+
if (bucket === null) {
|
|
1339
|
+
throw noDefaultBucket();
|
|
1340
|
+
}
|
|
1331
1341
|
if (resource[PREFIXES_KEY]) {
|
|
1332
1342
|
for (const path of resource[PREFIXES_KEY]) {
|
|
1333
1343
|
const pathWithoutTrailingSlash = path.replace(/\/$/, '');
|
|
@@ -1343,13 +1353,13 @@ function fromBackendResponse(authWrapper, bucket, resource) {
|
|
|
1343
1353
|
}
|
|
1344
1354
|
return listResult;
|
|
1345
1355
|
}
|
|
1346
|
-
function fromResponseString(authWrapper,
|
|
1356
|
+
function fromResponseString(authWrapper, resourceString) {
|
|
1347
1357
|
const obj = jsonObjectOrNull(resourceString);
|
|
1348
1358
|
if (obj === null) {
|
|
1349
1359
|
return null;
|
|
1350
1360
|
}
|
|
1351
1361
|
const resource = obj;
|
|
1352
|
-
return fromBackendResponse(authWrapper,
|
|
1362
|
+
return fromBackendResponse(authWrapper, resource);
|
|
1353
1363
|
}
|
|
1354
1364
|
function listOptionsValidator(p) {
|
|
1355
1365
|
if (!isObject(p) || !p) {
|
|
@@ -1406,7 +1416,7 @@ class RequestInfo {
|
|
|
1406
1416
|
|
|
1407
1417
|
/**
|
|
1408
1418
|
* @license
|
|
1409
|
-
* Copyright 2017 Google
|
|
1419
|
+
* Copyright 2017 Google Inc.
|
|
1410
1420
|
*
|
|
1411
1421
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1412
1422
|
* you may not use this file except in compliance with the License.
|
|
@@ -1436,9 +1446,9 @@ function metadataHandler(authWrapper, mappings) {
|
|
|
1436
1446
|
}
|
|
1437
1447
|
return handler;
|
|
1438
1448
|
}
|
|
1439
|
-
function listHandler(authWrapper
|
|
1449
|
+
function listHandler(authWrapper) {
|
|
1440
1450
|
function handler(xhr, text) {
|
|
1441
|
-
const listResult = fromResponseString(authWrapper,
|
|
1451
|
+
const listResult = fromResponseString(authWrapper, text);
|
|
1442
1452
|
handlerCheck(listResult !== null);
|
|
1443
1453
|
return listResult;
|
|
1444
1454
|
}
|
|
@@ -1518,7 +1528,7 @@ function list(authWrapper, location, delimiter, pageToken, maxResults) {
|
|
|
1518
1528
|
const url = makeUrl(urlPart);
|
|
1519
1529
|
const method = 'GET';
|
|
1520
1530
|
const timeout = authWrapper.maxOperationRetryTime();
|
|
1521
|
-
const requestInfo = new RequestInfo(url, method, listHandler(authWrapper
|
|
1531
|
+
const requestInfo = new RequestInfo(url, method, listHandler(authWrapper), timeout);
|
|
1522
1532
|
requestInfo.urlParams = urlParams;
|
|
1523
1533
|
requestInfo.errorHandler = sharedErrorHandler(location);
|
|
1524
1534
|
return requestInfo;
|
|
@@ -3385,7 +3395,7 @@ class ServiceInternals {
|
|
|
3385
3395
|
}
|
|
3386
3396
|
|
|
3387
3397
|
const name = "@firebase/storage";
|
|
3388
|
-
const version = "0.3.31
|
|
3398
|
+
const version = "0.3.31";
|
|
3389
3399
|
|
|
3390
3400
|
/**
|
|
3391
3401
|
* @license
|