@aws-amplify/predictions 4.0.46 → 4.0.47-next.2
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@4.0.47...@aws-amplify/predictions@4.0.48) (2022-08-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/predictions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.0.47](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@4.0.46...@aws-amplify/predictions@4.0.47) (2022-07-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-amplify/predictions
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [4.0.46](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@4.0.45...@aws-amplify/predictions@4.0.46) (2022-07-21)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @aws-amplify/predictions
|
|
@@ -95610,6 +95610,41 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
95610
95610
|
};
|
|
95611
95611
|
}
|
|
95612
95612
|
};
|
|
95613
|
+
|
|
95614
|
+
var __read = undefined && undefined.__read || function (o, n) {
|
|
95615
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
95616
|
+
if (!m) return o;
|
|
95617
|
+
var i = m.call(o),
|
|
95618
|
+
r,
|
|
95619
|
+
ar = [],
|
|
95620
|
+
e;
|
|
95621
|
+
|
|
95622
|
+
try {
|
|
95623
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
95624
|
+
ar.push(r.value);
|
|
95625
|
+
}
|
|
95626
|
+
} catch (error) {
|
|
95627
|
+
e = {
|
|
95628
|
+
error: error
|
|
95629
|
+
};
|
|
95630
|
+
} finally {
|
|
95631
|
+
try {
|
|
95632
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
95633
|
+
} finally {
|
|
95634
|
+
if (e) throw e.error;
|
|
95635
|
+
}
|
|
95636
|
+
}
|
|
95637
|
+
|
|
95638
|
+
return ar;
|
|
95639
|
+
};
|
|
95640
|
+
|
|
95641
|
+
var __spread = undefined && undefined.__spread || function () {
|
|
95642
|
+
for (var ar = [], i = 0; i < arguments.length; i++) {
|
|
95643
|
+
ar = ar.concat(__read(arguments[i]));
|
|
95644
|
+
}
|
|
95645
|
+
|
|
95646
|
+
return ar;
|
|
95647
|
+
};
|
|
95613
95648
|
/*
|
|
95614
95649
|
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95615
95650
|
*
|
|
@@ -96243,6 +96278,45 @@ function () {
|
|
|
96243
96278
|
});
|
|
96244
96279
|
});
|
|
96245
96280
|
};
|
|
96281
|
+
|
|
96282
|
+
AWSS3Provider.prototype._list = function (params, opt, prefix) {
|
|
96283
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
96284
|
+
var result, s3, listObjectsV2Command, response;
|
|
96285
|
+
return __generator(this, function (_a) {
|
|
96286
|
+
switch (_a.label) {
|
|
96287
|
+
case 0:
|
|
96288
|
+
result = {
|
|
96289
|
+
contents: [],
|
|
96290
|
+
nextToken: ''
|
|
96291
|
+
};
|
|
96292
|
+
s3 = this._createNewS3Client(opt);
|
|
96293
|
+
listObjectsV2Command = new _aws_sdk_client_s3__WEBPACK_IMPORTED_MODULE_1__["ListObjectsV2Command"](__assign({}, params));
|
|
96294
|
+
return [4
|
|
96295
|
+
/*yield*/
|
|
96296
|
+
, s3.send(listObjectsV2Command)];
|
|
96297
|
+
|
|
96298
|
+
case 1:
|
|
96299
|
+
response = _a.sent();
|
|
96300
|
+
|
|
96301
|
+
if (response && response.Contents) {
|
|
96302
|
+
result.contents = response.Contents.map(function (item) {
|
|
96303
|
+
return {
|
|
96304
|
+
key: item.Key.substr(prefix.length),
|
|
96305
|
+
eTag: item.ETag,
|
|
96306
|
+
lastModified: item.LastModified,
|
|
96307
|
+
size: item.Size
|
|
96308
|
+
};
|
|
96309
|
+
});
|
|
96310
|
+
result.nextToken = response.NextContinuationToken;
|
|
96311
|
+
}
|
|
96312
|
+
|
|
96313
|
+
return [2
|
|
96314
|
+
/*return*/
|
|
96315
|
+
, result];
|
|
96316
|
+
}
|
|
96317
|
+
});
|
|
96318
|
+
});
|
|
96319
|
+
};
|
|
96246
96320
|
/**
|
|
96247
96321
|
* List bucket objects relative to the level and prefix specified
|
|
96248
96322
|
* @param {string} path - the path that contains objects
|
|
@@ -96254,7 +96328,7 @@ function () {
|
|
|
96254
96328
|
|
|
96255
96329
|
AWSS3Provider.prototype.list = function (path, config) {
|
|
96256
96330
|
return __awaiter(this, void 0, void 0, function () {
|
|
96257
|
-
var credentialsOK, opt, bucket, track, maxKeys, prefix, final_path,
|
|
96331
|
+
var credentialsOK, opt, bucket, track, maxKeys, prefix, final_path, list, token, listResult, params, error_5;
|
|
96258
96332
|
return __generator(this, function (_a) {
|
|
96259
96333
|
switch (_a.label) {
|
|
96260
96334
|
case 0:
|
|
@@ -96273,38 +96347,62 @@ function () {
|
|
|
96273
96347
|
bucket = opt.bucket, track = opt.track, maxKeys = opt.maxKeys;
|
|
96274
96348
|
prefix = this._prefix(opt);
|
|
96275
96349
|
final_path = prefix + path;
|
|
96276
|
-
s3 = this._createNewS3Client(opt);
|
|
96277
96350
|
logger.debug('list ' + path + ' from ' + final_path);
|
|
96351
|
+
_a.label = 2;
|
|
96352
|
+
|
|
96353
|
+
case 2:
|
|
96354
|
+
_a.trys.push([2, 10,, 11]);
|
|
96355
|
+
|
|
96356
|
+
list = [];
|
|
96357
|
+
token = void 0;
|
|
96358
|
+
listResult = void 0;
|
|
96278
96359
|
params = {
|
|
96279
96360
|
Bucket: bucket,
|
|
96280
96361
|
Prefix: final_path,
|
|
96281
|
-
MaxKeys:
|
|
96362
|
+
MaxKeys: 1000
|
|
96282
96363
|
};
|
|
96283
|
-
|
|
96284
|
-
|
|
96285
|
-
|
|
96286
|
-
|
|
96287
|
-
_a.trys.push([2, 4,, 5]);
|
|
96364
|
+
if (!(maxKeys === 'ALL')) return [3
|
|
96365
|
+
/*break*/
|
|
96366
|
+
, 7];
|
|
96367
|
+
_a.label = 3;
|
|
96288
96368
|
|
|
96369
|
+
case 3:
|
|
96370
|
+
params.ContinuationToken = token;
|
|
96371
|
+
params.MaxKeys = 1000;
|
|
96289
96372
|
return [4
|
|
96290
96373
|
/*yield*/
|
|
96291
|
-
,
|
|
96374
|
+
, this._list(params, opt, prefix)];
|
|
96292
96375
|
|
|
96293
|
-
case
|
|
96294
|
-
|
|
96295
|
-
list
|
|
96376
|
+
case 4:
|
|
96377
|
+
listResult = _a.sent();
|
|
96378
|
+
list.push.apply(list, __spread(listResult.contents));
|
|
96379
|
+
if (listResult.nextToken) token = listResult.nextToken;
|
|
96380
|
+
_a.label = 5;
|
|
96296
96381
|
|
|
96297
|
-
|
|
96298
|
-
|
|
96299
|
-
|
|
96300
|
-
|
|
96301
|
-
|
|
96302
|
-
lastModified: item.LastModified,
|
|
96303
|
-
size: item.Size
|
|
96304
|
-
};
|
|
96305
|
-
});
|
|
96306
|
-
}
|
|
96382
|
+
case 5:
|
|
96383
|
+
if (listResult.nextToken) return [3
|
|
96384
|
+
/*break*/
|
|
96385
|
+
, 3];
|
|
96386
|
+
_a.label = 6;
|
|
96307
96387
|
|
|
96388
|
+
case 6:
|
|
96389
|
+
return [3
|
|
96390
|
+
/*break*/
|
|
96391
|
+
, 9];
|
|
96392
|
+
|
|
96393
|
+
case 7:
|
|
96394
|
+
maxKeys < 1000 || typeof maxKeys === 'string' ? params.MaxKeys = maxKeys : params.MaxKeys = 1000;
|
|
96395
|
+
return [4
|
|
96396
|
+
/*yield*/
|
|
96397
|
+
, this._list(params, opt, prefix)];
|
|
96398
|
+
|
|
96399
|
+
case 8:
|
|
96400
|
+
listResult = _a.sent();
|
|
96401
|
+
list.push.apply(list, __spread(listResult.contents));
|
|
96402
|
+
if (maxKeys > 1000) logger.warn("maxkeys can be from 0 - 1000 or 'ALL'. To list all files you can set maxKeys to 'ALL'.");
|
|
96403
|
+
_a.label = 9;
|
|
96404
|
+
|
|
96405
|
+
case 9:
|
|
96308
96406
|
Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'list', {
|
|
96309
96407
|
method: 'list',
|
|
96310
96408
|
result: 'success'
|
|
@@ -96314,7 +96412,7 @@ function () {
|
|
|
96314
96412
|
/*return*/
|
|
96315
96413
|
, list];
|
|
96316
96414
|
|
|
96317
|
-
case
|
|
96415
|
+
case 10:
|
|
96318
96416
|
error_5 = _a.sent();
|
|
96319
96417
|
logger.warn('list error', error_5);
|
|
96320
96418
|
Object(_common_StorageUtils__WEBPACK_IMPORTED_MODULE_7__["dispatchStorageEvent"])(track, 'list', {
|
|
@@ -96323,7 +96421,7 @@ function () {
|
|
|
96323
96421
|
}, null, "Listing items failed: " + error_5.message);
|
|
96324
96422
|
throw error_5;
|
|
96325
96423
|
|
|
96326
|
-
case
|
|
96424
|
+
case 11:
|
|
96327
96425
|
return [2
|
|
96328
96426
|
/*return*/
|
|
96329
96427
|
];
|