Comparing version 7.0.24 to 7.0.25
@@ -155,3 +155,4 @@ "use strict"; | ||
queries.push(`list-type=2`); // escape every value in query string, except maxKeys | ||
queries.push(`list-type=2`); | ||
queries.push(`encoding-type=url`); // escape every value in query string, except maxKeys | ||
@@ -158,0 +159,0 @@ queries.push(`prefix=${(0, _helpers.uriEscape)(prefix)}`); |
@@ -39,3 +39,3 @@ "use strict"; | ||
exports.sanitizeETag = sanitizeETag; | ||
exports.toSha256 = exports.toMd5 = void 0; | ||
exports.toSha256 = exports.toMd5 = exports.toArray = exports.sanitizeObjectKey = void 0; | ||
exports.uriEscape = uriEscape; | ||
@@ -467,5 +467,27 @@ exports.uriResourceEscape = uriResourceEscape; | ||
return Crypto.createHash('sha256').update(payload).digest('hex'); | ||
}; // toArray returns a single element array with param being the element, | ||
// if param is just a string, and returns 'param' back if it is an array | ||
// So, it makes sure param is always an array | ||
exports.toSha256 = toSha256; | ||
var toArray = function toArray(param) { | ||
if (!Array.isArray(param)) { | ||
return Array(param); | ||
} | ||
return param; | ||
}; | ||
exports.toSha256 = toSha256; | ||
exports.toArray = toArray; | ||
var sanitizeObjectKey = function sanitizeObjectKey(objectName) { | ||
// + symbol characters are not decoded as spaces in JS. so replace them first and decode to get the correct result. | ||
var asStrName = (objectName || "").replace(/\+/g, ' '); | ||
var sanitizedName = decodeURIComponent(asStrName); | ||
return sanitizedName; | ||
}; | ||
exports.sanitizeObjectKey = sanitizeObjectKey; | ||
//# sourceMappingURL=helpers.js.map |
@@ -65,13 +65,2 @@ "use strict"; | ||
return result; | ||
}; // toArray returns a single element array with param being the element, | ||
// if param is just a string, and returns 'param' back if it is an array | ||
// So, it makes sure param is always an array | ||
var toArray = function toArray(param) { | ||
if (!Array.isArray(param)) { | ||
return Array(param); | ||
} | ||
return param; | ||
}; // Parse XML and return information as Javascript types | ||
@@ -140,5 +129,5 @@ // parse error XML response | ||
if (xmlobj.CommonPrefixes) { | ||
toArray(xmlobj.CommonPrefixes).forEach(function (prefix) { | ||
(0, _helpers.toArray)(xmlobj.CommonPrefixes).forEach(function (prefix) { | ||
result.prefixes.push({ | ||
prefix: toArray(prefix)[0] | ||
prefix: (0, _helpers.toArray)(prefix)[0] | ||
}); | ||
@@ -149,3 +138,3 @@ }); | ||
if (xmlobj.Upload) { | ||
toArray(xmlobj.Upload).forEach(function (upload) { | ||
(0, _helpers.toArray)(xmlobj.Upload).forEach(function (upload) { | ||
var key = upload.Key; | ||
@@ -190,3 +179,3 @@ var uploadId = upload.UploadId; | ||
if (xmlobj.Buckets.Bucket) { | ||
toArray(xmlobj.Buckets.Bucket).forEach(function (bucket) { | ||
(0, _helpers.toArray)(xmlobj.Buckets.Bucket).forEach(function (bucket) { | ||
var name = bucket.Name; | ||
@@ -217,3 +206,3 @@ var creationDate = new Date(bucket.CreationDate); | ||
if (events) { | ||
toArray(events).forEach(function (s3event) { | ||
(0, _helpers.toArray)(events).forEach(function (s3event) { | ||
result.push(s3event); | ||
@@ -231,11 +220,11 @@ }); | ||
if (filters) { | ||
filters = toArray(filters); | ||
filters = (0, _helpers.toArray)(filters); | ||
if (filters[0].S3Key) { | ||
filters[0].S3Key = toArray(filters[0].S3Key); | ||
filters[0].S3Key = (0, _helpers.toArray)(filters[0].S3Key); | ||
if (filters[0].S3Key[0].FilterRule) { | ||
toArray(filters[0].S3Key[0].FilterRule).forEach(function (rule) { | ||
var Name = toArray(rule.Name)[0]; | ||
var Value = toArray(rule.Value)[0]; | ||
(0, _helpers.toArray)(filters[0].S3Key[0].FilterRule).forEach(function (rule) { | ||
var Name = (0, _helpers.toArray)(rule.Name)[0]; | ||
var Value = (0, _helpers.toArray)(rule.Value)[0]; | ||
result.push({ | ||
@@ -257,5 +246,5 @@ Name, | ||
if (xmlobj.TopicConfiguration) { | ||
toArray(xmlobj.TopicConfiguration).forEach(function (config) { | ||
var Id = toArray(config.Id)[0]; | ||
var Topic = toArray(config.Topic)[0]; | ||
(0, _helpers.toArray)(xmlobj.TopicConfiguration).forEach(function (config) { | ||
var Id = (0, _helpers.toArray)(config.Id)[0]; | ||
var Topic = (0, _helpers.toArray)(config.Topic)[0]; | ||
var Event = genEvents(config.Event); | ||
@@ -274,5 +263,5 @@ var Filter = genFilterRules(config.Filter); | ||
if (xmlobj.QueueConfiguration) { | ||
toArray(xmlobj.QueueConfiguration).forEach(function (config) { | ||
var Id = toArray(config.Id)[0]; | ||
var Queue = toArray(config.Queue)[0]; | ||
(0, _helpers.toArray)(xmlobj.QueueConfiguration).forEach(function (config) { | ||
var Id = (0, _helpers.toArray)(config.Id)[0]; | ||
var Queue = (0, _helpers.toArray)(config.Queue)[0]; | ||
var Event = genEvents(config.Event); | ||
@@ -291,5 +280,5 @@ var Filter = genFilterRules(config.Filter); | ||
if (xmlobj.CloudFunctionConfiguration) { | ||
toArray(xmlobj.CloudFunctionConfiguration).forEach(function (config) { | ||
var Id = toArray(config.Id)[0]; | ||
var CloudFunction = toArray(config.CloudFunction)[0]; | ||
(0, _helpers.toArray)(xmlobj.CloudFunctionConfiguration).forEach(function (config) { | ||
var Id = (0, _helpers.toArray)(config.Id)[0]; | ||
var CloudFunction = (0, _helpers.toArray)(config.CloudFunction)[0]; | ||
var Event = genEvents(config.Event); | ||
@@ -330,7 +319,7 @@ var Filter = genFilterRules(config.Filter); | ||
if (xmlobj.IsTruncated) result.isTruncated = xmlobj.IsTruncated; | ||
if (xmlobj.NextPartNumberMarker) result.marker = +toArray(xmlobj.NextPartNumberMarker)[0]; | ||
if (xmlobj.NextPartNumberMarker) result.marker = +(0, _helpers.toArray)(xmlobj.NextPartNumberMarker)[0]; | ||
if (xmlobj.Part) { | ||
toArray(xmlobj.Part).forEach(function (p) { | ||
var part = +toArray(p.PartNumber)[0]; | ||
(0, _helpers.toArray)(xmlobj.Part).forEach(function (p) { | ||
var part = +(0, _helpers.toArray)(p.PartNumber)[0]; | ||
var lastModified = new Date(p.LastModified); | ||
@@ -367,4 +356,4 @@ var etag = p.ETag.replace(/^"/g, '').replace(/"$/g, '').replace(/^"/g, '').replace(/"$/g, '').replace(/^"/g, '').replace(/"$/g, ''); | ||
if (xmlobj.Location) { | ||
var location = toArray(xmlobj.Location)[0]; | ||
var bucket = toArray(xmlobj.Bucket)[0]; | ||
var location = (0, _helpers.toArray)(xmlobj.Location)[0]; | ||
var bucket = (0, _helpers.toArray)(xmlobj.Bucket)[0]; | ||
var key = xmlobj.Key; | ||
@@ -382,4 +371,4 @@ var etag = xmlobj.ETag.replace(/^"/g, '').replace(/"$/g, '').replace(/^"/g, '').replace(/"$/g, '').replace(/^"/g, '').replace(/"$/g, ''); | ||
if (xmlobj.Code && xmlobj.Message) { | ||
var errCode = toArray(xmlobj.Code)[0]; | ||
var errMessage = toArray(xmlobj.Message)[0]; | ||
var errCode = (0, _helpers.toArray)(xmlobj.Code)[0]; | ||
var errMessage = (0, _helpers.toArray)(xmlobj.Message)[0]; | ||
return { | ||
@@ -405,5 +394,5 @@ errCode, | ||
var name = toArray(Key)[0]; | ||
var lastModified = new Date(toArray(LastModified)[0]); | ||
var etag = (0, _helpers.sanitizeETag)(toArray(ETag)[0]); | ||
var name = (0, _helpers.sanitizeObjectKey)((0, _helpers.toArray)(Key)[0]); | ||
var lastModified = new Date((0, _helpers.toArray)(LastModified)[0]); | ||
var etag = (0, _helpers.sanitizeETag)((0, _helpers.toArray)(ETag)[0]); | ||
return { | ||
@@ -432,4 +421,4 @@ name, | ||
if (responseEntity) { | ||
toArray(responseEntity).forEach(function (commonPrefix) { | ||
var prefix = toArray(commonPrefix.Prefix)[0]; | ||
(0, _helpers.toArray)(responseEntity).forEach(function (commonPrefix) { | ||
var prefix = (0, _helpers.toArray)(commonPrefix.Prefix)[0]; | ||
result.objects.push({ | ||
@@ -452,6 +441,6 @@ prefix, | ||
if (listBucketResult.Contents) { | ||
toArray(listBucketResult.Contents).forEach(function (content) { | ||
var name = toArray(content.Key)[0]; | ||
var lastModified = new Date(toArray(content.LastModified)[0]); | ||
var etag = (0, _helpers.sanitizeETag)(toArray(content.ETag)[0]); | ||
(0, _helpers.toArray)(listBucketResult.Contents).forEach(function (content) { | ||
var name = (0, _helpers.sanitizeObjectKey)((0, _helpers.toArray)(content.Key)[0]); | ||
var lastModified = new Date((0, _helpers.toArray)(content.LastModified)[0]); | ||
var etag = (0, _helpers.sanitizeETag)((0, _helpers.toArray)(content.ETag)[0]); | ||
var size = content.Size; | ||
@@ -480,3 +469,3 @@ result.objects.push({ | ||
if (listVersionsResult.Version) { | ||
toArray(listVersionsResult.Version).forEach(function (content) { | ||
(0, _helpers.toArray)(listVersionsResult.Version).forEach(function (content) { | ||
result.objects.push(formatObjInfo(content)); | ||
@@ -487,3 +476,3 @@ }); | ||
if (listVersionsResult.DeleteMarker) { | ||
toArray(listVersionsResult.DeleteMarker).forEach(function (content) { | ||
(0, _helpers.toArray)(listVersionsResult.DeleteMarker).forEach(function (content) { | ||
result.objects.push(formatObjInfo(content, { | ||
@@ -532,4 +521,4 @@ IsDeleteMarker: true | ||
if (xmlobj.Contents) { | ||
toArray(xmlobj.Contents).forEach(function (content) { | ||
var name = content.Key; | ||
(0, _helpers.toArray)(xmlobj.Contents).forEach(function (content) { | ||
var name = (0, _helpers.sanitizeObjectKey)((0, _helpers.toArray)(content.Key)[0]); | ||
var lastModified = new Date(content.LastModified); | ||
@@ -548,4 +537,4 @@ var etag = (0, _helpers.sanitizeETag)(content.ETag); | ||
if (xmlobj.CommonPrefixes) { | ||
toArray(xmlobj.CommonPrefixes).forEach(function (commonPrefix) { | ||
var prefix = toArray(commonPrefix.Prefix)[0]; | ||
(0, _helpers.toArray)(xmlobj.CommonPrefixes).forEach(function (commonPrefix) { | ||
var prefix = (0, _helpers.toArray)(commonPrefix.Prefix)[0]; | ||
var size = 0; | ||
@@ -579,4 +568,4 @@ result.objects.push({ | ||
if (xmlobj.Contents) { | ||
toArray(xmlobj.Contents).forEach(function (content) { | ||
var name = content.Key; | ||
(0, _helpers.toArray)(xmlobj.Contents).forEach(function (content) { | ||
var name = (0, _helpers.sanitizeObjectKey)(content.Key); | ||
var lastModified = new Date(content.LastModified); | ||
@@ -588,3 +577,3 @@ var etag = (0, _helpers.sanitizeETag)(content.ETag); | ||
if (content.UserMetadata != null) { | ||
metadata = toArray(content.UserMetadata)[0]; | ||
metadata = (0, _helpers.toArray)(content.UserMetadata)[0]; | ||
} else { | ||
@@ -605,4 +594,4 @@ metadata = null; | ||
if (xmlobj.CommonPrefixes) { | ||
toArray(xmlobj.CommonPrefixes).forEach(function (commonPrefix) { | ||
var prefix = toArray(commonPrefix.Prefix)[0]; | ||
(0, _helpers.toArray)(xmlobj.CommonPrefixes).forEach(function (commonPrefix) { | ||
var prefix = (0, _helpers.toArray)(commonPrefix.Prefix)[0]; | ||
var size = 0; | ||
@@ -696,3 +685,3 @@ result.objects.push({ | ||
role: xmlObj.ReplicationConfiguration.Role, | ||
rules: toArray(xmlObj.ReplicationConfiguration.Rule) | ||
rules: (0, _helpers.toArray)(xmlObj.ReplicationConfiguration.Rule) | ||
} | ||
@@ -699,0 +688,0 @@ }; |
{ | ||
"name": "minio", | ||
"version": "7.0.24", | ||
"version": "7.0.25", | ||
"description": "S3 Compatible Cloud Storage client", | ||
@@ -38,2 +38,3 @@ "main": "./dist/main/minio.js", | ||
"browser-or-node": "^1.3.0", | ||
"crypto-browserify": "^3.12.0", | ||
"es6-error": "^4.1.1", | ||
@@ -40,0 +41,0 @@ "fast-xml-parser": "^3.17.5", |
Sorry, the diff of this file is too big to display
286739
5657
16
+ Addedcrypto-browserify@^3.12.0
+ Addedasn1.js@4.10.1(transitive)
+ Addedbn.js@4.12.15.2.1(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedbrowserify-aes@1.2.0(transitive)
+ Addedbrowserify-cipher@1.0.1(transitive)
+ Addedbrowserify-des@1.0.2(transitive)
+ Addedbrowserify-rsa@4.1.1(transitive)
+ Addedbrowserify-sign@4.2.3(transitive)
+ Addedbuffer-xor@1.0.3(transitive)
+ Addedcipher-base@1.0.6(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcreate-ecdh@4.0.4(transitive)
+ Addedcreate-hash@1.2.0(transitive)
+ Addedcreate-hmac@1.1.7(transitive)
+ Addedcrypto-browserify@3.12.1(transitive)
+ Addeddes.js@1.1.0(transitive)
+ Addeddiffie-hellman@5.0.3(transitive)
+ Addedelliptic@6.6.1(transitive)
+ Addedevp_bytestokey@1.0.3(transitive)
+ Addedhash-base@3.0.5(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedmd5.js@1.3.5(transitive)
+ Addedmiller-rabin@4.0.1(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addedparse-asn1@5.1.7(transitive)
+ Addedpbkdf2@3.1.2(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpublic-encrypt@4.0.3(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedrandomfill@1.0.4(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedripemd160@2.0.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsha.js@2.4.11(transitive)
+ Addedstring_decoder@1.1.1(transitive)
- Removedstring_decoder@1.3.0(transitive)