azure-storage
Advanced tools
Comparing version 2.7.0 to 2.8.0
Note: This is the change log file for Azure Storage JavaScript Client Library. | ||
2018.02 Version 0.2.8-preview.14 | ||
* Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.8.0. | ||
2017.12 Version 0.2.7-preview.13 | ||
@@ -4,0 +8,0 @@ |
@@ -32,3 +32,3 @@ # Azure Storage JavaScript Client Library for Browsers | ||
|------------|----------|--------------------|-----------------| | ||
| v62 | v57 | v11 | v41 | | ||
| v64 | v58 | v11 | v41 | | ||
@@ -35,0 +35,0 @@ ## Generating a Custom Azure Storage JavaScript Client Library |
Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will | ||
be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node. | ||
2018.02 Version 2.8.0 | ||
ALL | ||
* Updated storage service version to 2017-07-29. | ||
BLOB | ||
* Added support for Soft Delete feature. | ||
* Fixed several blobuploader example issues. | ||
* Fixed a compatibility issue for `getBlobToLocalFile` and `createReadStream` with Node.js v9. | ||
* Fixed a bug that blob name will be wrongly trimmed to empty string when listing blobs. | ||
* Fixed a bug when blob size > 32M, GetBlobStream returns root blob data instead of snapshot data. | ||
FILE | ||
* Fixed a compatibility issue for `getFileToLocalFile` and `createReadStream` with Node.js v9. | ||
2017.12 Version 2.7.0 | ||
@@ -5,0 +20,0 @@ |
@@ -26,5 +26,5 @@ // | ||
function serializeRetentionPolicy(doc, policy){ | ||
if(policy !== null){ | ||
if (typeof policy === 'undefined'){ | ||
function serializeRetentionPolicy(doc, policy) { | ||
if (policy !== null) { | ||
if (typeof policy === 'undefined') { | ||
policy = {}; | ||
@@ -36,8 +36,8 @@ } | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(policy.Enabled) | ||
.up(); | ||
.txt(policy.Enabled) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(false) | ||
.up(); | ||
.txt(false) | ||
.up(); | ||
} | ||
@@ -47,8 +47,8 @@ | ||
doc = doc.ele(ServicePropertiesConstants.DAYS_ELEMENT) | ||
.txt(policy.Days) | ||
.up(); | ||
} else if (policy.Enabled === true){ | ||
.txt(policy.Days) | ||
.up(); | ||
} else if (policy.Enabled === true) { | ||
doc = doc.ele(ServicePropertiesConstants.DAYS_ELEMENT) | ||
.txt(1) | ||
.up(); | ||
.txt(1) | ||
.up(); | ||
} | ||
@@ -60,10 +60,40 @@ | ||
function serializeLogging(doc, logging){ | ||
function serializeDeleteRetentionPolicy(doc, policy) { | ||
if (policy !== null) { | ||
if (typeof policy === 'undefined') { | ||
policy = {}; | ||
} | ||
if (typeof policy.Enabled !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(policy.Enabled) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(false) | ||
.up(); | ||
} | ||
if (typeof policy.Days !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.DAYS_ELEMENT) | ||
.txt(policy.Days) | ||
.up(); | ||
} else if (policy.Enabled === true) { | ||
doc = doc.ele(ServicePropertiesConstants.DAYS_ELEMENT) | ||
.txt(1) | ||
.up(); | ||
} | ||
doc = doc.up(); | ||
} | ||
} | ||
function serializeLogging(doc, logging) { | ||
if (typeof logging.Version !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.VERSION_ELEMENT) | ||
.txt(logging.Version) | ||
.up(); | ||
.txt(logging.Version) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.VERSION_ELEMENT) | ||
.txt(ServicePropertiesConstants.DEFAULT_ANALYTICS_VERSION) | ||
.txt(ServicePropertiesConstants.DEFAULT_ANALYTICS_VERSION) | ||
.up(); | ||
@@ -74,7 +104,7 @@ } | ||
doc = doc.ele(ServicePropertiesConstants.DELETE_ELEMENT) | ||
.txt(logging.Delete) | ||
.up(); | ||
.txt(logging.Delete) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.DELETE_ELEMENT) | ||
.txt(false) | ||
.txt(false) | ||
.up(); | ||
@@ -85,7 +115,7 @@ } | ||
doc = doc.ele(ServicePropertiesConstants.READ_ELEMENT) | ||
.txt(logging.Read) | ||
.up(); | ||
.txt(logging.Read) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.READ_ELEMENT) | ||
.txt(false) | ||
.txt(false) | ||
.up(); | ||
@@ -96,7 +126,7 @@ } | ||
doc = doc.ele(ServicePropertiesConstants.WRITE_ELEMENT) | ||
.txt(logging.Write) | ||
.up(); | ||
.txt(logging.Write) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.WRITE_ELEMENT) | ||
.txt(false) | ||
.txt(false) | ||
.up(); | ||
@@ -110,10 +140,10 @@ } | ||
function serializeMetrics(doc, metrics){ | ||
function serializeMetrics(doc, metrics) { | ||
if (typeof metrics.Version !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.VERSION_ELEMENT) | ||
.txt(metrics.Version) | ||
.up(); | ||
.txt(metrics.Version) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.VERSION_ELEMENT) | ||
.txt(ServicePropertiesConstants.DEFAULT_ANALYTICS_VERSION) | ||
.txt(ServicePropertiesConstants.DEFAULT_ANALYTICS_VERSION) | ||
.up(); | ||
@@ -124,18 +154,18 @@ } | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(metrics.Enabled) | ||
.up(); | ||
.txt(metrics.Enabled) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.ENABLED_ELEMENT) | ||
.txt(false) | ||
.txt(false) | ||
.up(); | ||
} | ||
if(metrics.Enabled) { | ||
if (metrics.Enabled) { | ||
if (typeof metrics.IncludeAPIs !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.INCLUDE_APIS_ELEMENT) | ||
.txt(metrics.IncludeAPIs) | ||
.up(); | ||
} else if (metrics.Enabled === true){ | ||
.txt(metrics.IncludeAPIs) | ||
.up(); | ||
} else if (metrics.Enabled === true) { | ||
doc = doc.ele(ServicePropertiesConstants.INCLUDE_APIS_ELEMENT) | ||
.txt(false) | ||
.txt(false) | ||
.up(); | ||
@@ -147,47 +177,47 @@ } | ||
function serializeCorsRules(doc, rules){ | ||
if(typeof rules !== 'undefined' && rules !== null && _.isArray(rules)){ | ||
function serializeCorsRules(doc, rules) { | ||
if (typeof rules !== 'undefined' && rules !== null && _.isArray(rules)) { | ||
rules.forEach(function (rule) { | ||
doc = doc.ele(ServicePropertiesConstants.CORS_RULE_ELEMENT); | ||
if(typeof rule.AllowedMethods !== 'undefined' && _.isArray(rule.AllowedMethods)){ | ||
if (typeof rule.AllowedMethods !== 'undefined' && _.isArray(rule.AllowedMethods)) { | ||
doc = doc.ele(ServicePropertiesConstants.ALLOWED_METHODS_ELEMENT) | ||
.txt(rule.AllowedMethods.join(',')) | ||
.up(); | ||
.txt(rule.AllowedMethods.join(',')) | ||
.up(); | ||
} | ||
if(typeof rule.AllowedOrigins !== 'undefined' && _.isArray(rule.AllowedOrigins)){ | ||
if (typeof rule.AllowedOrigins !== 'undefined' && _.isArray(rule.AllowedOrigins)) { | ||
doc = doc.ele(ServicePropertiesConstants.ALLOWED_ORIGINS_ELEMENT) | ||
.txt(rule.AllowedOrigins.join(',')) | ||
.up(); | ||
.txt(rule.AllowedOrigins.join(',')) | ||
.up(); | ||
} | ||
if(typeof rule.AllowedHeaders !== 'undefined' && _.isArray(rule.AllowedHeaders)){ | ||
if (typeof rule.AllowedHeaders !== 'undefined' && _.isArray(rule.AllowedHeaders)) { | ||
doc = doc.ele(ServicePropertiesConstants.ALLOWED_HEADERS_ELEMENT) | ||
.txt(rule.AllowedHeaders.join(',')) | ||
.up(); | ||
.txt(rule.AllowedHeaders.join(',')) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.ALLOWED_HEADERS_ELEMENT) | ||
.txt('') | ||
.up(); | ||
.txt('') | ||
.up(); | ||
} | ||
if(typeof rule.ExposedHeaders !== 'undefined' && _.isArray(rule.ExposedHeaders)){ | ||
if (typeof rule.ExposedHeaders !== 'undefined' && _.isArray(rule.ExposedHeaders)) { | ||
doc = doc.ele(ServicePropertiesConstants.EXPOSED_HEADERS_ELEMENT) | ||
.txt(rule.ExposedHeaders.join(',')) | ||
.up(); | ||
.txt(rule.ExposedHeaders.join(',')) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.EXPOSED_HEADERS_ELEMENT) | ||
.txt('') | ||
.up(); | ||
.txt('') | ||
.up(); | ||
} | ||
if(typeof rule.MaxAgeInSeconds !== 'undefined'){ | ||
if (typeof rule.MaxAgeInSeconds !== 'undefined') { | ||
doc = doc.ele(ServicePropertiesConstants.MAX_AGE_IN_SECONDS_ELEMENT) | ||
.txt(rule.MaxAgeInSeconds) | ||
.up(); | ||
.txt(rule.MaxAgeInSeconds) | ||
.up(); | ||
} else { | ||
doc = doc.ele(ServicePropertiesConstants.MAX_AGE_IN_SECONDS_ELEMENT) | ||
.txt('0') | ||
.up(); | ||
.txt('0') | ||
.up(); | ||
} | ||
@@ -230,24 +260,30 @@ | ||
doc = doc.ele(ServicePropertiesConstants.DEFAULT_SERVICE_VERSION_ELEMENT) | ||
.txt(servicePropertiesJs.DefaultServiceVersion) | ||
.up(); | ||
.txt(servicePropertiesJs.DefaultServiceVersion) | ||
.up(); | ||
} | ||
if (servicePropertiesJs.DeleteRetentionPolicy) { | ||
doc = doc.ele(ServicePropertiesConstants.DEFAULT_DELETE_RETENTION_POLICY_ELEMENT); | ||
serializeDeleteRetentionPolicy(doc, servicePropertiesJs.DeleteRetentionPolicy); | ||
doc = doc.up(); | ||
} | ||
return doc.doc().toString(); | ||
}; | ||
function parseRetentionPolicy(policyXml){ | ||
var policy = {}; | ||
function parseRetentionPolicy(policyXml) { | ||
var policy = {}; | ||
if (typeof policyXml.Enabled !== 'undefined') { | ||
policy.Enabled = policyXml.Enabled === 'true'; | ||
} | ||
if (typeof policyXml.Enabled !== 'undefined') { | ||
policy.Enabled = policyXml.Enabled === 'true'; | ||
} | ||
if (typeof policyXml.Days !== 'undefined') { | ||
policy.Days = parseInt(policyXml.Days, 10); | ||
} | ||
if (typeof policyXml.Days !== 'undefined') { | ||
policy.Days = parseInt(policyXml.Days, 10); | ||
} | ||
return policy; | ||
return policy; | ||
} | ||
function parseLogging(loggingXml){ | ||
function parseLogging(loggingXml) { | ||
var logging = {}; | ||
@@ -278,3 +314,3 @@ | ||
function parseMetrics(metricsXml){ | ||
function parseMetrics(metricsXml) { | ||
var metrics = {}; | ||
@@ -301,3 +337,3 @@ | ||
function parseCors(corsXml){ | ||
function parseCors(corsXml) { | ||
var cors = {}; | ||
@@ -308,3 +344,3 @@ | ||
if (!_.isArray(rulesXml)) { | ||
rulesXml = [ rulesXml ]; | ||
rulesXml = [rulesXml]; | ||
} | ||
@@ -316,4 +352,4 @@ | ||
if(typeof ruleXml.AllowedMethods !== 'undefined'){ | ||
if(ruleXml.AllowedMethods !== ''){ | ||
if (typeof ruleXml.AllowedMethods !== 'undefined') { | ||
if (ruleXml.AllowedMethods !== '') { | ||
rule.AllowedMethods = ruleXml.AllowedMethods.split(','); | ||
@@ -326,4 +362,4 @@ } | ||
if(typeof ruleXml.AllowedOrigins !== 'undefined'){ | ||
if(ruleXml.AllowedOrigins !== ''){ | ||
if (typeof ruleXml.AllowedOrigins !== 'undefined') { | ||
if (ruleXml.AllowedOrigins !== '') { | ||
rule.AllowedOrigins = ruleXml.AllowedOrigins.split(','); | ||
@@ -336,4 +372,4 @@ } | ||
if(typeof ruleXml.AllowedHeaders !== 'undefined'){ | ||
if(ruleXml.AllowedHeaders !== ''){ | ||
if (typeof ruleXml.AllowedHeaders !== 'undefined') { | ||
if (ruleXml.AllowedHeaders !== '') { | ||
rule.AllowedHeaders = ruleXml.AllowedHeaders.split(','); | ||
@@ -346,4 +382,4 @@ } | ||
if(typeof ruleXml.ExposedHeaders !== 'undefined'){ | ||
if(ruleXml.ExposedHeaders !== ''){ | ||
if (typeof ruleXml.ExposedHeaders !== 'undefined') { | ||
if (ruleXml.ExposedHeaders !== '') { | ||
rule.ExposedHeaders = ruleXml.ExposedHeaders.split(','); | ||
@@ -356,3 +392,3 @@ } | ||
if(typeof ruleXml.MaxAgeInSeconds !== 'undefined'){ | ||
if (typeof ruleXml.MaxAgeInSeconds !== 'undefined') { | ||
rule.MaxAgeInSeconds = parseInt(ruleXml.MaxAgeInSeconds, 10); | ||
@@ -368,2 +404,16 @@ } | ||
function parseDeleteRetentionPolicy(deleteRetentionPolicyXml) { | ||
var deleteRetentionPolicy = {}; | ||
if (typeof deleteRetentionPolicyXml.Enabled !== 'undefined') { | ||
deleteRetentionPolicy.Enabled = deleteRetentionPolicyXml.Enabled === 'true'; | ||
} | ||
if (typeof deleteRetentionPolicyXml.Days !== 'undefined') { | ||
deleteRetentionPolicy.Days = deleteRetentionPolicyXml.Days; | ||
} | ||
return deleteRetentionPolicy; | ||
} | ||
exports.parse = function (servicePropertiesXml) { | ||
@@ -373,3 +423,3 @@ var serviceProperties = {}; | ||
if (typeof servicePropertiesXml.Logging !== 'undefined') { | ||
serviceProperties.Logging = parseLogging(servicePropertiesXml.Logging); | ||
serviceProperties.Logging = parseLogging(servicePropertiesXml.Logging); | ||
} | ||
@@ -393,3 +443,7 @@ | ||
if (typeof servicePropertiesXml.DeleteRetentionPolicy !== 'undefined') { | ||
serviceProperties.DeleteRetentionPolicy = parseDeleteRetentionPolicy(servicePropertiesXml.DeleteRetentionPolicy); | ||
} | ||
return serviceProperties; | ||
}; |
@@ -40,3 +40,3 @@ // | ||
*/ | ||
USER_AGENT_PRODUCT_VERSION: '2.7.0', | ||
USER_AGENT_PRODUCT_VERSION: '2.8.0', | ||
@@ -466,3 +466,11 @@ /** | ||
*/ | ||
DEFAULT_SERVICE_VERSION_ELEMENT: 'DefaultServiceVersion' | ||
DEFAULT_SERVICE_VERSION_ELEMENT: 'DefaultServiceVersion', | ||
/** | ||
* XML element for DeleteRetentionPolicy. | ||
* | ||
* @const | ||
* @type {string} | ||
*/ | ||
DEFAULT_DELETE_RETENTION_POLICY_ELEMENT: 'DeleteRetentionPolicy' | ||
}, | ||
@@ -1678,3 +1686,3 @@ | ||
*/ | ||
TARGET_STORAGE_VERSION: '2017-04-17', | ||
TARGET_STORAGE_VERSION: '2017-07-29', | ||
@@ -1681,0 +1689,0 @@ /** |
@@ -442,3 +442,2 @@ // | ||
callback(error); | ||
return; | ||
}); | ||
@@ -448,16 +447,12 @@ | ||
if (error) { | ||
if (fs.existsSync(localFileName)) { | ||
// make sure writeStream is closed / destroyed to avoid locking issues | ||
if (writeStream.close) { | ||
writeStream.close(); | ||
writeStream.end(function () { | ||
// If the download failed from the beginning, remove the file. | ||
if (fs.existsSync(localFileName) && writeStream.bytesWritten === 0) { | ||
fs.unlinkSync(localFileName); | ||
} | ||
// If the download failed from the beginning, remove the file. | ||
fs.unlink(localFileName, function () { | ||
callback(error, responseBlob, response); | ||
}); | ||
return; | ||
} | ||
callback(error, responseBlob, response); | ||
}); | ||
} else { | ||
callback(error, responseBlob, response); | ||
} | ||
callback(error, responseBlob, response); | ||
}); | ||
@@ -464,0 +459,0 @@ |
@@ -50,3 +50,4 @@ // | ||
UNCOMMITTED_BLOBS: 'uncommittedblobs', | ||
COPY: 'copy' | ||
COPY: 'copy', | ||
DELETED: 'deleted' | ||
}, | ||
@@ -53,0 +54,0 @@ |
@@ -96,3 +96,2 @@ // | ||
// convert isIncrementalCopy to boolean type | ||
if (blobResult.isIncrementalCopy !== undefined) { | ||
@@ -107,2 +106,10 @@ blobResult.isIncrementalCopy = (blobResult.isIncrementalCopy === 'true'); | ||
if (blobResult.deleted !== undefined) { | ||
blobResult.deleted = (blobResult.deleted == 'true'); | ||
} | ||
if (blobResult.remainingRetentionDays !== undefined) { | ||
blobResult.remainingRetentionDays = parseInt(blobResult.remainingRetentionDays); | ||
} | ||
return blobResult; | ||
@@ -109,0 +116,0 @@ }; |
@@ -90,3 +90,2 @@ // | ||
callback(error); | ||
return; | ||
}); | ||
@@ -96,16 +95,12 @@ | ||
if (error) { | ||
// make sure writeStream is closed / destroyed to avoid locking issues | ||
if (writeStream.close) { | ||
writeStream.close(); | ||
} | ||
if (fs.existsSync(localFileName)) { | ||
writeStream.end(function () { | ||
// If the download failed from the beginning, remove the file. | ||
fs.unlink(localFileName, function () { | ||
callback(error, responseFile, response); | ||
return; | ||
}); | ||
} | ||
if (fs.existsSync(localFileName) && writeStream.bytesWritten === 0) { | ||
fs.unlinkSync(localFileName); | ||
} | ||
callback(error, responseFile, response); | ||
}); | ||
} else { | ||
callback(error, responseFile, response); | ||
} | ||
callback(error, responseFile, response); | ||
}); | ||
@@ -112,0 +107,0 @@ |
{ | ||
"name": "azure-storage", | ||
"author": "Microsoft Corporation", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "Microsoft Azure Storage Client Library for Node.js", | ||
@@ -32,3 +32,3 @@ "typings": "typings/azure-storage/azure-storage.d.ts", | ||
"validator": "~3.35.0", | ||
"xml2js": "0.2.7", | ||
"xml2js": "0.2.8", | ||
"xmlbuilder": "0.4.3" | ||
@@ -35,0 +35,0 @@ }, |
@@ -8,3 +8,3 @@ # Microsoft Azure Storage SDK for Node.js | ||
This project provides a Node.js package and a browser compatible [JavaScript Client Library](#azure-storage-javascript-client-library-for-browsers) that make it easy to consume and manage Microsoft Azure Storage Services. | ||
This project provides a Node.js package and a browser compatible [JavaScript Client Library](#azure-storage-javascript-client-library-for-browsers) that makes it easy to consume and manage Microsoft Azure Storage Services. | ||
@@ -11,0 +11,0 @@ > If you are looking for the Node.js SDK for other Azure services, visit [https://github.com/Azure/azure-sdk-for-node](https://github.com/Azure/azure-sdk-for-node). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2596663
36792
+ Addedsax@0.5.8(transitive)
+ Addedxml2js@0.2.8(transitive)
- Removedsax@0.5.2(transitive)
- Removedxml2js@0.2.7(transitive)
Updatedxml2js@0.2.8