@azure/storage-blob
Advanced tools
Comparing version 10.1.0-preview to 10.2.0-preview
# Breaking Changes | ||
2018.11 10.2.0-preview | ||
* Updated names of exported interfaces `IHTTPPipelineLogger` & `IHTTPClient` to `IHttpPipelineLogger` & `IHttpClient`. | ||
* For `setMetadata()` and `setHTTPHeaders()`, `metadata` and `blobHTTPHeaders` are moved from `options` into top level parameter list. | ||
2018.09 10.1.0-preview | ||
@@ -4,0 +9,0 @@ |
# Changelog | ||
2018.11 10.2.0-preview | ||
* [Breaking] Updated names of exported interfaces `IHTTPPipelineLogger` & `IHTTPClient` to `IHttpPipelineLogger` & `IHttpClient`. | ||
* [Breaking] For `setMetadata()` and `setHTTPHeaders()`, `metadata` and `blobHTTPHeaders` are moved from `options` into top level parameter list. | ||
* Fixed bugs and typos in samples. | ||
* Fixed a bug during generateAccountSASQueryParameters() that generated signature is not valid. | ||
* Fixed a bug during generateBlobSASQueryParameters() that cache-control, content-type, content-disposition, content-encoding and content-language are not supported. | ||
* Fixed a bug in SAS generation that start and expiry time format is not correct. | ||
* Removed `File` from `uploadBrowserDataToBlockBlob` parameter type list, because `File` extends `Blob` which is already in the list. | ||
* Fixed typos in `IRange` comments. | ||
* Removed useless `marker` field from option of `ServiceURL.listContainersSegment` method. | ||
* Fixed a bug that `timeout` parameter should use second as unit instead of millisecond. | ||
* Added stream retry when `BlobURL.download` response stream unexcepted ends. | ||
2018.09 10.1.0-preview | ||
@@ -4,0 +18,0 @@ |
import * as tslib_1 from "tslib"; | ||
import { isNode } from "ms-rest-js"; | ||
import { BlobDownloadResponse } from "./BlobDownloadResponse"; | ||
import { Blob } from "./generated/operations"; | ||
import { rangeToString } from "./IRange"; | ||
import { StorageURL } from "./StorageURL"; | ||
import { URLConstants } from "./utils/constants"; | ||
import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, URLConstants } from "./utils/constants"; | ||
import { appendToURLPath, setURLParameter } from "./utils/utils.common"; | ||
@@ -91,2 +93,3 @@ /** | ||
var res; | ||
var _this = this; | ||
return tslib_1.__generator(this, function (_a) { | ||
@@ -96,2 +99,4 @@ switch (_a.label) { | ||
options.blobAccessConditions = options.blobAccessConditions || {}; | ||
options.blobAccessConditions.modifiedAccessConditions = | ||
options.blobAccessConditions.modifiedAccessConditions || {}; | ||
return [4 /*yield*/, this.blobContext.download({ | ||
@@ -101,3 +106,3 @@ abortSignal: aborter, | ||
modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions, | ||
onDownloadProgress: options.progress, | ||
onDownloadProgress: isNode ? undefined : options.progress, | ||
range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), | ||
@@ -109,13 +114,61 @@ rangeGetContentMD5: options.rangeGetContentMD5, | ||
res = _a.sent(); | ||
// Default axios based HTTP client cannot abort download stream, manually pause/abort it | ||
// Currently, no error will be triggered when network error or abort during reading from response stream | ||
// TODO: Now need to manually validate the date length when stream ends, add download retry in the future | ||
if (res.readableStreamBody) { | ||
aborter.addEventListener("abort", function () { | ||
if (res.readableStreamBody) { | ||
res.readableStreamBody.pause(); | ||
} | ||
}); | ||
// Return browser response immediately | ||
if (!isNode) { | ||
return [2 /*return*/, res]; | ||
} | ||
return [2 /*return*/, res]; | ||
// We support retrying when download stream unexpected ends in Node.js runtime | ||
// Following code shouldn't be bundled into browser build, however some | ||
// bundlers may try to bundle following code and "FileReadResponse.ts". | ||
// In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts" | ||
// The config is in package.json "browser" field | ||
if (options.maxRetryRequests === undefined || | ||
options.maxRetryRequests < 0) { | ||
// TODO: Default value or make it a required parameter? | ||
options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; | ||
} | ||
if (res.contentLength === undefined) { | ||
throw new RangeError("File download response doesn't contain valid content length header"); | ||
} | ||
if (!res.eTag) { | ||
throw new RangeError("File download response doesn't contain valid etag header"); | ||
} | ||
return [2 /*return*/, new BlobDownloadResponse(aborter, res, function (start) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var updatedOptions; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
updatedOptions = { | ||
leaseAccessConditions: options.blobAccessConditions | ||
.leaseAccessConditions, | ||
modifiedAccessConditions: { | ||
ifMatch: options.blobAccessConditions.modifiedAccessConditions.ifMatch || | ||
res.eTag, | ||
ifModifiedSince: options.blobAccessConditions | ||
.modifiedAccessConditions.ifModifiedSince, | ||
ifNoneMatch: options.blobAccessConditions.modifiedAccessConditions | ||
.ifNoneMatch, | ||
ifUnmodifiedSince: options.blobAccessConditions | ||
.modifiedAccessConditions.ifUnmodifiedSince | ||
}, | ||
range: rangeToString({ | ||
count: offset + res.contentLength - start, | ||
offset: start | ||
}), | ||
snapshot: options.snapshot | ||
}; | ||
return [4 /*yield*/, this.blobContext.download(tslib_1.__assign({ abortSignal: aborter }, updatedOptions))]; | ||
case 1: | ||
// Debug purpose only | ||
// console.log( | ||
// `Read from internal stream, range: ${ | ||
// updatedOptions.range | ||
// }, options: ${JSON.stringify(updatedOptions)}` | ||
// ); | ||
return [2 /*return*/, (_a.sent()).readableStreamBody]; | ||
} | ||
}); | ||
}); }, offset, res.contentLength, { | ||
maxRetryRequests: options.maxRetryRequests, | ||
progress: options.progress | ||
})]; | ||
} | ||
@@ -199,3 +252,3 @@ }); | ||
* | ||
* If no option provided, or no value provided for the blob HTTP headers in the options, | ||
* If no value provided, or no value provided for the specificed blob HTTP headers, | ||
* these blob HTTP headers without a value will be cleared. | ||
@@ -206,2 +259,5 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Models.BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for | ||
* the specificed blob HTTP headers, these blob HTTP | ||
* headers without a value will be cleared. | ||
* @param {IBlobSetHTTPHeadersOptions} [options] | ||
@@ -211,3 +267,3 @@ * @returns {Promise<Models.BlobSetHTTPHeadersResponse>} | ||
*/ | ||
BlobURL.prototype.setHTTPHeaders = function (aborter, options) { | ||
BlobURL.prototype.setHTTPHeaders = function (aborter, blobHTTPHeaders, options) { | ||
if (options === void 0) { options = {}; } | ||
@@ -219,3 +275,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
abortSignal: aborter, | ||
blobHTTPHeaders: options.blobHTTPHeaders, | ||
blobHTTPHeaders: blobHTTPHeaders, | ||
leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, | ||
@@ -230,3 +286,3 @@ modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the blob | ||
* If no option provided, or no metadata defined in the parameter, the blob | ||
* metadata will be removed. | ||
@@ -237,2 +293,4 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IBlobSetMetadataOptions} [options] | ||
@@ -242,3 +300,3 @@ * @returns {Promise<Models.BlobSetMetadataResponse>} | ||
*/ | ||
BlobURL.prototype.setMetadata = function (aborter, options) { | ||
BlobURL.prototype.setMetadata = function (aborter, metadata, options) { | ||
if (options === void 0) { options = {}; } | ||
@@ -251,3 +309,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, | ||
metadata: options.metadata, | ||
metadata: metadata, | ||
modifiedAccessConditions: options.blobAccessConditions.modifiedAccessConditions | ||
@@ -254,0 +312,0 @@ })]; |
@@ -136,4 +136,5 @@ import * as tslib_1 from "tslib"; | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the container | ||
* If no option provided, or no metadata defined in the parameter, the container | ||
* metadata will be removed. | ||
* | ||
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata | ||
@@ -143,2 +144,4 @@ * | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IContainerSetMetadataOptions} [options] | ||
@@ -148,3 +151,3 @@ * @returns {Promise<Models.ContainerSetMetadataResponse>} | ||
*/ | ||
ContainerURL.prototype.setMetadata = function (aborter, options) { | ||
ContainerURL.prototype.setMetadata = function (aborter, metadata, options) { | ||
if (options === void 0) { options = {}; } | ||
@@ -176,3 +179,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
leaseAccessConditions: options.containerAccessConditions.leaseAccessConditions, | ||
metadata: options.metadata, | ||
metadata: metadata, | ||
modifiedAccessConditions: options.containerAccessConditions.modifiedAccessConditions | ||
@@ -179,0 +182,0 @@ })]; |
import * as tslib_1 from "tslib"; | ||
import { generateUuid } from "ms-rest-js"; | ||
import { Batch } from "./utils/Batch"; | ||
import { BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES, BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "./utils/constants"; | ||
import { BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES } from "./utils/constants"; | ||
import { generateBlockID } from "./utils/utils.common"; | ||
@@ -18,3 +18,3 @@ /** | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Blob | File | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {BlockBlobURL} blockBlobURL | ||
@@ -74,4 +74,4 @@ * @param {IUploadToBlockBlobOptions} [options] | ||
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); | ||
if (options.blockSize < BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -78,0 +78,0 @@ } |
@@ -6,3 +6,3 @@ import * as tslib_1 from "tslib"; | ||
import { BufferScheduler } from "./utils/BufferScheduler"; | ||
import { BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES, BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "./utils/constants"; | ||
import { BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES } from "./utils/constants"; | ||
import { generateBlockID } from "./utils/utils.common"; | ||
@@ -79,3 +79,3 @@ import { streamToBuffer } from "./utils/utils.node"; | ||
if (options.blockSize === 0) { | ||
if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { | ||
if (size > BLOCK_BLOB_MAX_BLOCKS * BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { | ||
throw new RangeError(size + " is too larger to upload to a block blob."); | ||
@@ -85,4 +85,4 @@ } | ||
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); | ||
if (options.blockSize < BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -178,3 +178,3 @@ } | ||
if (options.blockSize === 0) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -213,3 +213,4 @@ if (offset < 0) { | ||
return [4 /*yield*/, blobURL.download(aborter, off, chunkEnd - off + 1, { | ||
blobAccessConditions: options.blobAccessConditions | ||
blobAccessConditions: options.blobAccessConditions, | ||
maxRetryRequests: options.maxRetryRequestsPerBlock | ||
})]; | ||
@@ -216,0 +217,0 @@ case 1: |
@@ -33,5 +33,5 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; | ||
accountSASSignatureValues.startTime | ||
? truncatedISO8061Date(accountSASSignatureValues.startTime) | ||
? truncatedISO8061Date(accountSASSignatureValues.startTime, false) | ||
: "", | ||
truncatedISO8061Date(accountSASSignatureValues.expiryTime), | ||
truncatedISO8061Date(accountSASSignatureValues.expiryTime, false), | ||
accountSASSignatureValues.ipRange | ||
@@ -47,4 +47,4 @@ ? ipRangeToString(accountSASSignatureValues.ipRange) | ||
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign); | ||
return new SASQueryParameters(version, parsedPermissions, signature, parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startTime, accountSASSignatureValues.expiryTime, accountSASSignatureValues.ipRange); | ||
return new SASQueryParameters(version, signature, parsedPermissions, parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startTime, accountSASSignatureValues.expiryTime, accountSASSignatureValues.ipRange); | ||
} | ||
//# sourceMappingURL=IAccountSASSignatureValues.js.map |
@@ -48,6 +48,6 @@ import { BlobSASPermissions } from "./BlobSASPermissions"; | ||
blobSASSignatureValues.startTime | ||
? truncatedISO8061Date(blobSASSignatureValues.startTime) | ||
? truncatedISO8061Date(blobSASSignatureValues.startTime, false) | ||
: "", | ||
blobSASSignatureValues.expiryTime | ||
? truncatedISO8061Date(blobSASSignatureValues.expiryTime) | ||
? truncatedISO8061Date(blobSASSignatureValues.expiryTime, false) | ||
: "", | ||
@@ -76,3 +76,3 @@ getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), | ||
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign); | ||
return new SASQueryParameters(version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startTime, blobSASSignatureValues.expiryTime, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource); | ||
return new SASQueryParameters(version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startTime, blobSASSignatureValues.expiryTime, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType); | ||
} | ||
@@ -79,0 +79,0 @@ function getCanonicalName(accountName, containerName, blobName) { |
@@ -7,2 +7,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerURL"; | ||
@@ -9,0 +10,0 @@ export * from "./credentials/AnonymousCredential"; |
@@ -13,2 +13,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerSASPermissions"; | ||
@@ -15,0 +16,0 @@ export * from "./ContainerURL"; |
@@ -7,16 +7,16 @@ /** | ||
* @export | ||
* @param {IRange} ipRange | ||
* @param {IRange} iRange | ||
* @returns {string} | ||
*/ | ||
export function rangeToString(ipRange) { | ||
if (ipRange.offset < 0) { | ||
throw new RangeError("IPRange.offset cannot be smaller than 0."); | ||
export function rangeToString(iRange) { | ||
if (iRange.offset < 0) { | ||
throw new RangeError("IRange.offset cannot be smaller than 0."); | ||
} | ||
if (ipRange.count && ipRange.count <= 0) { | ||
throw new RangeError("IPRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); | ||
if (iRange.count && iRange.count <= 0) { | ||
throw new RangeError("IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end."); | ||
} | ||
return ipRange.count | ||
? "bytes=" + ipRange.offset + "-" + (ipRange.offset + ipRange.count - 1) | ||
: "bytes=" + ipRange.offset + "-"; | ||
return iRange.count | ||
? "bytes=" + iRange.offset + "-" + (iRange.offset + iRange.count - 1) | ||
: "bytes=" + iRange.offset + "-"; | ||
} | ||
//# sourceMappingURL=IRange.js.map |
@@ -1,5 +0,5 @@ | ||
import { BaseRequestPolicy, HttpHeaders, HttpPipelineLogLevel, WebResource } from "ms-rest-js"; | ||
import { BaseRequestPolicy, HttpHeaders, HttpPipelineLogLevel, RequestPolicyOptions, WebResource } from "ms-rest-js"; | ||
// Export following interfaces and types for customers who want to implement their | ||
// own RequestPolicy or HTTPClient | ||
export { HttpHeaders, HttpPipelineLogLevel, WebResource, BaseRequestPolicy }; | ||
export { HttpHeaders, HttpPipelineLogLevel, WebResource, BaseRequestPolicy, RequestPolicyOptions }; | ||
/** | ||
@@ -17,3 +17,3 @@ * A Pipeline class containing HTTP request policies. | ||
/** | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHTTPClient interface. | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. | ||
* | ||
@@ -20,0 +20,0 @@ * @param {RequestPolicyFactory[]} factories |
import * as tslib_1 from "tslib"; | ||
import { BaseRequestPolicy, delay, HttpPipelineLogLevel } from "ms-rest-js"; | ||
import { BaseRequestPolicy, delay, HttpPipelineLogLevel, } from "ms-rest-js"; | ||
import { URLConstants } from "../utils/constants"; | ||
@@ -134,3 +134,3 @@ import { setURLHost, setURLParameter } from "../utils/utils.common"; | ||
// Set the server-side timeout query parameter "timeout=[seconds]" | ||
newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, this.retryOptions.tryTimeoutInMs.toString()); | ||
newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString()); | ||
_a.label = 1; | ||
@@ -137,0 +137,0 @@ case 1: |
@@ -143,7 +143,10 @@ import * as tslib_1 from "tslib"; | ||
var queries = getURLQueries(request.url); | ||
if (getURLQueries(request.url)) { | ||
var lowercaseQueries = {}; | ||
if (queries) { | ||
var queryKeys = []; | ||
for (var key in queries) { | ||
if (queries.hasOwnProperty(key)) { | ||
queryKeys.push(key); | ||
var lowercaseKey = key.toLowerCase(); | ||
lowercaseQueries[lowercaseKey] = queries[key]; | ||
queryKeys.push(lowercaseKey); | ||
} | ||
@@ -154,3 +157,3 @@ } | ||
var key = queryKeys_1[_i]; | ||
canonicalizedResourceString += "\n" + key + ":" + decodeURIComponent(queries[key]); | ||
canonicalizedResourceString += "\n" + key + ":" + decodeURIComponent(lowercaseQueries[key]); | ||
} | ||
@@ -157,0 +160,0 @@ } |
@@ -47,5 +47,10 @@ import { ipRangeToString } from "./IIPRange"; | ||
* @param {string} [resource] Representing the storage container or blob (only for Service SAS) | ||
* @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) | ||
* @param {string} [contentDisposition] Representing the content-disposition header (only for Blob/File Service SAS) | ||
* @param {string} [contentEncoding] Representing the content-encoding header (only for Blob/File Service SAS) | ||
* @param {string} [contentLanguage] Representing the content-language header (only for Blob/File Service SAS) | ||
* @param {string} [contentType] Representing the content-type header (only for Blob/File Service SAS) | ||
* @memberof SASQueryParameters | ||
*/ | ||
function SASQueryParameters(version, signature, permissions, services, resourceTypes, protocol, startTime, expiryTime, ipRange, identifier, resource) { | ||
function SASQueryParameters(version, signature, permissions, services, resourceTypes, protocol, startTime, expiryTime, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType) { | ||
this.version = version; | ||
@@ -62,2 +67,7 @@ this.services = services; | ||
this.signature = signature; | ||
this.cacheControl = cacheControl; | ||
this.contentDisposition = contentDisposition; | ||
this.contentEncoding = contentEncoding; | ||
this.contentLanguage = contentLanguage; | ||
this.contentType = contentType; | ||
} | ||
@@ -102,3 +112,8 @@ Object.defineProperty(SASQueryParameters.prototype, "ipRange", { | ||
"sp", | ||
"sig" | ||
"sig", | ||
"rscc", | ||
"rscd", | ||
"rsce", | ||
"rscl", | ||
"rsct" | ||
]; | ||
@@ -122,6 +137,10 @@ var queries = []; | ||
case "st": | ||
this.tryAppendQueryParameter(queries, param, this.startTime ? truncatedISO8061Date(this.startTime) : undefined); | ||
this.tryAppendQueryParameter(queries, param, this.startTime | ||
? truncatedISO8061Date(this.startTime, false) | ||
: undefined); | ||
break; | ||
case "se": | ||
this.tryAppendQueryParameter(queries, param, this.expiryTime ? truncatedISO8061Date(this.expiryTime) : undefined); | ||
this.tryAppendQueryParameter(queries, param, this.expiryTime | ||
? truncatedISO8061Date(this.expiryTime, false) | ||
: undefined); | ||
break; | ||
@@ -143,2 +162,17 @@ case "sip": | ||
break; | ||
case "rscc": | ||
this.tryAppendQueryParameter(queries, param, this.cacheControl); | ||
break; | ||
case "rscd": | ||
this.tryAppendQueryParameter(queries, param, this.contentDisposition); | ||
break; | ||
case "rsce": | ||
this.tryAppendQueryParameter(queries, param, this.contentEncoding); | ||
break; | ||
case "rscl": | ||
this.tryAppendQueryParameter(queries, param, this.contentLanguage); | ||
break; | ||
case "rsct": | ||
this.tryAppendQueryParameter(queries, param, this.contentType); | ||
break; | ||
} | ||
@@ -145,0 +179,0 @@ } |
@@ -125,3 +125,9 @@ import * as tslib_1 from "tslib"; | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {string} [marker] | ||
* @param {string} [marker] A string value that identifies the portion of | ||
* the list of containers to be returned with the next listing operation. The | ||
* operation returns the NextMarker value within the response body if the | ||
* listing operation did not return all containers remaining to be listed | ||
* with the current page. The NextMarker value can be used as the value for | ||
* the marker parameter in a subsequent call to request the next page of list | ||
* items. The marker value is opaque to the client. | ||
* @param {IServiceListContainersSegmentOptions} [options] | ||
@@ -128,0 +134,0 @@ * @returns {Promise<Models.ServiceListContainersSegmentResponse>} |
@@ -1,2 +0,2 @@ | ||
export var SDK_VERSION = "10.1.0-preview"; | ||
export var SDK_VERSION = "10.2.0-preview"; | ||
export var SERVICE_VERSION = "2018-03-28"; | ||
@@ -6,3 +6,4 @@ export var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB | ||
export var BLOCK_BLOB_MAX_BLOCKS = 50000; | ||
export var BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB | ||
export var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB | ||
export var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; | ||
export var URLConstants = { | ||
@@ -9,0 +10,0 @@ Parameters: { |
@@ -111,8 +111,14 @@ import { isNode, URLBuilder } from "ms-rest-js"; | ||
* @export | ||
* @param {Date} date Input date | ||
* @returns {string} Date string in ISO8061 format, with no milliseconds component | ||
* @param {Date} date | ||
* @param {boolean} [withMilliseconds=true] If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned; | ||
* If false, YYYY-MM-DDThh:mm:ssZ will be returned. | ||
* @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component | ||
*/ | ||
export function truncatedISO8061Date(date) { | ||
export function truncatedISO8061Date(date, withMilliseconds) { | ||
if (withMilliseconds === void 0) { withMilliseconds = true; } | ||
// Date.toISOString() will return like "2018-10-29T06:34:36.139Z" | ||
var dateString = date.toISOString(); | ||
return dateString.substring(0, dateString.length - 1) + "0000" + "Z"; | ||
return withMilliseconds | ||
? dateString.substring(0, dateString.length - 1) + "0000" + "Z" | ||
: dateString.substring(0, dateString.length - 5) + "Z"; | ||
} | ||
@@ -119,0 +125,0 @@ /** |
@@ -1,5 +0,6 @@ | ||
import { TransferProgressEvent } from "ms-rest-js"; | ||
import { isNode, TransferProgressEvent } from "ms-rest-js"; | ||
import * as Models from "../lib/generated/models"; | ||
import { Aborter } from "./Aborter"; | ||
import { BlobDownloadResponse } from "./BlobDownloadResponse"; | ||
import { ContainerURL } from "./ContainerURL"; | ||
@@ -11,3 +12,6 @@ import { Blob } from "./generated/operations"; | ||
import { StorageURL } from "./StorageURL"; | ||
import { URLConstants } from "./utils/constants"; | ||
import { | ||
DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, | ||
URLConstants | ||
} from "./utils/constants"; | ||
import { appendToURLPath, setURLParameter } from "./utils/utils.common"; | ||
@@ -20,2 +24,19 @@ | ||
progress?: (progress: TransferProgressEvent) => void; | ||
/** | ||
* Optional. ONLY AVAILABLE IN NODE.JS. | ||
* | ||
* How many retries will perform when original body download stream unexpected ends. | ||
* Above kind of ends will not trigger retry policy defined in a pipeline, | ||
* because they doesn't emit network errors. | ||
* | ||
* With this option, every additional retry means an additional FileURL.download() request will be made | ||
* from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached. | ||
* | ||
* Default value is 5, please set a larger value when loading large files in poor network. | ||
* | ||
* @type {number} | ||
* @memberof IBlobDownloadOptions | ||
*/ | ||
maxRetryRequests?: number; | ||
} | ||
@@ -34,7 +55,5 @@ | ||
blobAccessConditions?: IBlobAccessConditions; | ||
blobHTTPHeaders?: Models.BlobHTTPHeaders; | ||
} | ||
export interface IBlobSetMetadataOptions { | ||
metadata?: IMetadata; | ||
blobAccessConditions?: IBlobAccessConditions; | ||
@@ -190,2 +209,4 @@ } | ||
options.blobAccessConditions = options.blobAccessConditions || {}; | ||
options.blobAccessConditions.modifiedAccessConditions = | ||
options.blobAccessConditions.modifiedAccessConditions || {}; | ||
@@ -197,3 +218,3 @@ const res = await this.blobContext.download({ | ||
options.blobAccessConditions.modifiedAccessConditions, | ||
onDownloadProgress: options.progress, | ||
onDownloadProgress: isNode ? undefined : options.progress, | ||
range: | ||
@@ -205,14 +226,76 @@ offset === 0 && !count ? undefined : rangeToString({ offset, count }), | ||
// Default axios based HTTP client cannot abort download stream, manually pause/abort it | ||
// Currently, no error will be triggered when network error or abort during reading from response stream | ||
// TODO: Now need to manually validate the date length when stream ends, add download retry in the future | ||
if (res.readableStreamBody) { | ||
aborter.addEventListener("abort", () => { | ||
if (res.readableStreamBody) { | ||
res.readableStreamBody.pause(); | ||
} | ||
}); | ||
// Return browser response immediately | ||
if (!isNode) { | ||
return res; | ||
} | ||
return res; | ||
// We support retrying when download stream unexpected ends in Node.js runtime | ||
// Following code shouldn't be bundled into browser build, however some | ||
// bundlers may try to bundle following code and "FileReadResponse.ts". | ||
// In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts" | ||
// The config is in package.json "browser" field | ||
if ( | ||
options.maxRetryRequests === undefined || | ||
options.maxRetryRequests < 0 | ||
) { | ||
// TODO: Default value or make it a required parameter? | ||
options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; | ||
} | ||
if (res.contentLength === undefined) { | ||
throw new RangeError( | ||
`File download response doesn't contain valid content length header` | ||
); | ||
} | ||
if (!res.eTag) { | ||
throw new RangeError( | ||
`File download response doesn't contain valid etag header` | ||
); | ||
} | ||
return new BlobDownloadResponse( | ||
aborter, | ||
res, | ||
async (start: number): Promise<NodeJS.ReadableStream> => { | ||
const updatedOptions: Models.BlobDownloadOptionalParams = { | ||
leaseAccessConditions: options.blobAccessConditions! | ||
.leaseAccessConditions, | ||
modifiedAccessConditions: { | ||
ifMatch: | ||
options.blobAccessConditions!.modifiedAccessConditions!.ifMatch || | ||
res.eTag, | ||
ifModifiedSince: options.blobAccessConditions! | ||
.modifiedAccessConditions!.ifModifiedSince, | ||
ifNoneMatch: options.blobAccessConditions!.modifiedAccessConditions! | ||
.ifNoneMatch, | ||
ifUnmodifiedSince: options.blobAccessConditions! | ||
.modifiedAccessConditions!.ifUnmodifiedSince | ||
}, | ||
range: rangeToString({ | ||
count: offset + res.contentLength! - start, | ||
offset: start | ||
}), | ||
snapshot: options.snapshot | ||
}; | ||
// Debug purpose only | ||
// console.log( | ||
// `Read from internal stream, range: ${ | ||
// updatedOptions.range | ||
// }, options: ${JSON.stringify(updatedOptions)}` | ||
// ); | ||
return (await this.blobContext.download({ | ||
abortSignal: aborter, | ||
...updatedOptions | ||
})).readableStreamBody!; | ||
}, | ||
offset, | ||
res.contentLength!, | ||
{ | ||
maxRetryRequests: options.maxRetryRequests, | ||
progress: options.progress | ||
} | ||
); | ||
} | ||
@@ -293,3 +376,3 @@ | ||
* | ||
* If no option provided, or no value provided for the blob HTTP headers in the options, | ||
* If no value provided, or no value provided for the specificed blob HTTP headers, | ||
* these blob HTTP headers without a value will be cleared. | ||
@@ -300,2 +383,5 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Models.BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for | ||
* the specificed blob HTTP headers, these blob HTTP | ||
* headers without a value will be cleared. | ||
* @param {IBlobSetHTTPHeadersOptions} [options] | ||
@@ -307,2 +393,3 @@ * @returns {Promise<Models.BlobSetHTTPHeadersResponse>} | ||
aborter: Aborter, | ||
blobHTTPHeaders?: Models.BlobHTTPHeaders, | ||
options: IBlobSetHTTPHeadersOptions = {} | ||
@@ -313,3 +400,3 @@ ): Promise<Models.BlobSetHTTPHeadersResponse> { | ||
abortSignal: aborter, | ||
blobHTTPHeaders: options.blobHTTPHeaders, | ||
blobHTTPHeaders, | ||
leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, | ||
@@ -324,3 +411,3 @@ modifiedAccessConditions: | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the blob | ||
* If no option provided, or no metadata defined in the parameter, the blob | ||
* metadata will be removed. | ||
@@ -331,2 +418,4 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IBlobSetMetadataOptions} [options] | ||
@@ -338,2 +427,3 @@ * @returns {Promise<Models.BlobSetMetadataResponse>} | ||
aborter: Aborter, | ||
metadata?: IMetadata, | ||
options: IBlobSetMetadataOptions = {} | ||
@@ -345,3 +435,3 @@ ): Promise<Models.BlobSetMetadataResponse> { | ||
leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions, | ||
metadata: options.metadata, | ||
metadata, | ||
modifiedAccessConditions: | ||
@@ -348,0 +438,0 @@ options.blobAccessConditions.modifiedAccessConditions |
@@ -26,3 +26,2 @@ import { HttpResponse } from "ms-rest-js"; | ||
export interface IContainerSetMetadataOptions { | ||
metadata?: IMetadata; | ||
containerAccessConditions?: IContainerAccessConditions; | ||
@@ -153,3 +152,3 @@ } | ||
/** | ||
* containersContext provided by protocol layer. | ||
* containerContext provided by protocol layer. | ||
* | ||
@@ -290,4 +289,5 @@ * @private | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the container | ||
* If no option provided, or no metadata defined in the parameter, the container | ||
* metadata will be removed. | ||
* | ||
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata | ||
@@ -297,2 +297,4 @@ * | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IContainerSetMetadataOptions} [options] | ||
@@ -304,2 +306,3 @@ * @returns {Promise<Models.ContainerSetMetadataResponse>} | ||
aborter: Aborter, | ||
metadata?: IMetadata, | ||
options: IContainerSetMetadataOptions = {} | ||
@@ -339,3 +342,3 @@ ): Promise<Models.ContainerSetMetadataResponse> { | ||
options.containerAccessConditions.leaseAccessConditions, | ||
metadata: options.metadata, | ||
metadata, | ||
modifiedAccessConditions: | ||
@@ -342,0 +345,0 @@ options.containerAccessConditions.modifiedAccessConditions |
@@ -11,6 +11,6 @@ import { generateUuid } from "ms-rest-js"; | ||
import { | ||
BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES, | ||
BLOCK_BLOB_MAX_BLOCKS, | ||
BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, | ||
BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES | ||
BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, | ||
DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES | ||
} from "./utils/constants"; | ||
@@ -31,3 +31,3 @@ import { generateBlockID } from "./utils/utils.common"; | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Blob | File | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {BlockBlobURL} blockBlobURL | ||
@@ -39,3 +39,3 @@ * @param {IUploadToBlockBlobOptions} [options] | ||
aborter: Aborter, | ||
browserData: Blob | File | ArrayBuffer | ArrayBufferView, | ||
browserData: Blob | ArrayBuffer | ArrayBufferView, | ||
blockBlobURL: BlockBlobURL, | ||
@@ -98,4 +98,4 @@ options?: IUploadToBlockBlobOptions | ||
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); | ||
if (options.blockSize < BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -102,0 +102,0 @@ } |
@@ -94,2 +94,20 @@ import { HttpResponse, TransferProgressEvent } from "ms-rest-js"; | ||
/** | ||
* Optional. ONLY AVAILABLE IN NODE.JS. | ||
* | ||
* How many retries will perform when original block download stream unexpected ends. | ||
* Above kind of ends will not trigger retry policy defined in a pipeline, | ||
* because they doesn't emit network errors. | ||
* | ||
* With this option, every additional retry means an additional FileURL.download() request will be made | ||
* from the broken point, until the requested block has been successfully downloaded or | ||
* maxRetryRequestsPerBlock is reached. | ||
* | ||
* Default value is 5, please set a larger value when in poor network. | ||
* | ||
* @type {number} | ||
* @memberof IDownloadFromAzureFileOptions | ||
*/ | ||
maxRetryRequestsPerBlock?: number; | ||
/** | ||
* Progress updater. | ||
@@ -96,0 +114,0 @@ * |
@@ -18,6 +18,6 @@ import * as fs from "fs"; | ||
import { | ||
BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES, | ||
BLOCK_BLOB_MAX_BLOCKS, | ||
BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, | ||
BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES | ||
BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, | ||
DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES | ||
} from "./utils/constants"; | ||
@@ -105,3 +105,3 @@ import { generateBlockID } from "./utils/utils.common"; | ||
if (options.blockSize === 0) { | ||
if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { | ||
if (size > BLOCK_BLOB_MAX_BLOCKS * BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { | ||
throw new RangeError(`${size} is too larger to upload to a block blob.`); | ||
@@ -111,4 +111,4 @@ } | ||
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); | ||
if (options.blockSize < BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -203,3 +203,3 @@ } | ||
if (options.blockSize === 0) { | ||
options.blockSize = BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES; | ||
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; | ||
} | ||
@@ -247,3 +247,4 @@ | ||
{ | ||
blobAccessConditions: options.blobAccessConditions | ||
blobAccessConditions: options.blobAccessConditions, | ||
maxRetryRequests: options.maxRetryRequestsPerBlock | ||
} | ||
@@ -250,0 +251,0 @@ ); |
@@ -133,5 +133,5 @@ import { AccountSASPermissions } from "./AccountSASPermissions"; | ||
accountSASSignatureValues.startTime | ||
? truncatedISO8061Date(accountSASSignatureValues.startTime) | ||
? truncatedISO8061Date(accountSASSignatureValues.startTime, false) | ||
: "", | ||
truncatedISO8061Date(accountSASSignatureValues.expiryTime), | ||
truncatedISO8061Date(accountSASSignatureValues.expiryTime, false), | ||
accountSASSignatureValues.ipRange | ||
@@ -151,4 +151,4 @@ ? ipRangeToString(accountSASSignatureValues.ipRange) | ||
version, | ||
signature, | ||
parsedPermissions, | ||
signature, | ||
parsedServices, | ||
@@ -155,0 +155,0 @@ parsedResourceTypes, |
@@ -191,6 +191,6 @@ import { BlobSASPermissions } from "./BlobSASPermissions"; | ||
blobSASSignatureValues.startTime | ||
? truncatedISO8061Date(blobSASSignatureValues.startTime) | ||
? truncatedISO8061Date(blobSASSignatureValues.startTime, false) | ||
: "", | ||
blobSASSignatureValues.expiryTime | ||
? truncatedISO8061Date(blobSASSignatureValues.expiryTime) | ||
? truncatedISO8061Date(blobSASSignatureValues.expiryTime, false) | ||
: "", | ||
@@ -236,3 +236,8 @@ getCanonicalName( | ||
blobSASSignatureValues.identifier, | ||
resource | ||
resource, | ||
blobSASSignatureValues.cacheControl, | ||
blobSASSignatureValues.contentDisposition, | ||
blobSASSignatureValues.contentEncoding, | ||
blobSASSignatureValues.contentLanguage, | ||
blobSASSignatureValues.contentType | ||
); | ||
@@ -239,0 +244,0 @@ } |
@@ -9,2 +9,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerURL"; | ||
@@ -11,0 +12,0 @@ export * from "./credentials/AnonymousCredential"; |
@@ -15,2 +15,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerSASPermissions"; | ||
@@ -17,0 +18,0 @@ export * from "./ContainerURL"; |
@@ -14,3 +14,3 @@ // tslint:disable:max-line-length | ||
* @type {string} | ||
* @memberof IPRange | ||
* @memberof IRange | ||
*/ | ||
@@ -23,3 +23,3 @@ offset: number; | ||
* @type {string} | ||
* @memberof IPRange | ||
* @memberof IRange | ||
*/ | ||
@@ -35,17 +35,17 @@ count?: number; | ||
* @export | ||
* @param {IRange} ipRange | ||
* @param {IRange} iRange | ||
* @returns {string} | ||
*/ | ||
export function rangeToString(ipRange: IRange): string { | ||
if (ipRange.offset < 0) { | ||
throw new RangeError(`IPRange.offset cannot be smaller than 0.`); | ||
export function rangeToString(iRange: IRange): string { | ||
if (iRange.offset < 0) { | ||
throw new RangeError(`IRange.offset cannot be smaller than 0.`); | ||
} | ||
if (ipRange.count && ipRange.count <= 0) { | ||
if (iRange.count && iRange.count <= 0) { | ||
throw new RangeError( | ||
`IPRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` | ||
`IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.` | ||
); | ||
} | ||
return ipRange.count | ||
? `bytes=${ipRange.offset}-${ipRange.offset + ipRange.count - 1}` | ||
: `bytes=${ipRange.offset}-`; | ||
return iRange.count | ||
? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` | ||
: `bytes=${iRange.offset}-`; | ||
} |
import { | ||
BaseRequestPolicy, | ||
HttpClient as IHTTPClient, | ||
HttpClient as IHttpClient, | ||
HttpHeaders, | ||
HttpOperationResponse, | ||
HttpPipelineLogger as IHTTPPipelineLogger, | ||
HttpPipelineLogger as IHttpPipelineLogger, | ||
HttpPipelineLogLevel, | ||
RequestPolicy, | ||
RequestPolicyFactory, | ||
RequestPolicyOptions, | ||
ServiceClientOptions, | ||
@@ -16,4 +18,4 @@ WebResource | ||
export { | ||
IHTTPClient, | ||
IHTTPPipelineLogger, | ||
IHttpClient, | ||
IHttpPipelineLogger, | ||
HttpHeaders, | ||
@@ -23,3 +25,6 @@ HttpPipelineLogLevel, | ||
WebResource, | ||
BaseRequestPolicy | ||
BaseRequestPolicy, | ||
RequestPolicyFactory, | ||
RequestPolicy, | ||
RequestPolicyOptions | ||
}; | ||
@@ -34,4 +39,4 @@ | ||
export interface IPipelineOptions { | ||
logger?: IHTTPPipelineLogger; | ||
HTTPClient?: IHTTPClient; | ||
logger?: IHttpPipelineLogger; | ||
HTTPClient?: IHttpClient; | ||
} | ||
@@ -54,3 +59,3 @@ | ||
/** | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHTTPClient interface. | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. | ||
* | ||
@@ -57,0 +62,0 @@ * @param {RequestPolicyFactory[]} factories |
@@ -10,3 +10,3 @@ import { | ||
RestError, | ||
WebResource | ||
WebResource, | ||
} from "ms-rest-js"; | ||
@@ -188,3 +188,3 @@ | ||
URLConstants.Parameters.TIMEOUT, | ||
this.retryOptions.tryTimeoutInMs!.toString() | ||
Math.floor(this.retryOptions.tryTimeoutInMs! / 1000).toString() | ||
); | ||
@@ -191,0 +191,0 @@ |
@@ -185,7 +185,10 @@ import { RequestPolicy, RequestPolicyOptions, WebResource } from "ms-rest-js"; | ||
const queries = getURLQueries(request.url); | ||
if (getURLQueries(request.url)) { | ||
const lowercaseQueries: { [key: string]: string } = {}; | ||
if (queries) { | ||
const queryKeys: string[] = []; | ||
for (const key in queries) { | ||
if (queries.hasOwnProperty(key)) { | ||
queryKeys.push(key); | ||
const lowercaseKey = key.toLowerCase(); | ||
lowercaseQueries[lowercaseKey] = queries[key]; | ||
queryKeys.push(lowercaseKey); | ||
} | ||
@@ -197,3 +200,3 @@ } | ||
canonicalizedResourceString += `\n${key}:${decodeURIComponent( | ||
queries[key] | ||
lowercaseQueries[key] | ||
)}`; | ||
@@ -200,0 +203,0 @@ } |
@@ -122,2 +122,42 @@ import { IIPRange, ipRangeToString } from "./IIPRange"; | ||
/** | ||
* Value for cache-control header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
public readonly cacheControl?: string; | ||
/** | ||
* Value for content-disposition header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
public readonly contentDisposition?: string; | ||
/** | ||
* Value for content-encoding header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
public readonly contentEncoding?: string; | ||
/** | ||
* Value for content-length header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
public readonly contentLanguage?: string; | ||
/** | ||
* Value for content-type header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
public readonly contentType?: string; | ||
/** | ||
* Inner value of getter ipRange. | ||
@@ -162,2 +202,7 @@ * | ||
* @param {string} [resource] Representing the storage container or blob (only for Service SAS) | ||
* @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) | ||
* @param {string} [contentDisposition] Representing the content-disposition header (only for Blob/File Service SAS) | ||
* @param {string} [contentEncoding] Representing the content-encoding header (only for Blob/File Service SAS) | ||
* @param {string} [contentLanguage] Representing the content-language header (only for Blob/File Service SAS) | ||
* @param {string} [contentType] Representing the content-type header (only for Blob/File Service SAS) | ||
* @memberof SASQueryParameters | ||
@@ -176,3 +221,8 @@ */ | ||
identifier?: string, | ||
resource?: string | ||
resource?: string, | ||
cacheControl?: string, | ||
contentDisposition?: string, | ||
contentEncoding?: string, | ||
contentLanguage?: string, | ||
contentType?: string | ||
) { | ||
@@ -190,2 +240,7 @@ this.version = version; | ||
this.signature = signature; | ||
this.cacheControl = cacheControl; | ||
this.contentDisposition = contentDisposition; | ||
this.contentEncoding = contentEncoding; | ||
this.contentLanguage = contentLanguage; | ||
this.contentType = contentType; | ||
} | ||
@@ -211,3 +266,8 @@ | ||
"sp", | ||
"sig" | ||
"sig", | ||
"rscc", | ||
"rscd", | ||
"rsce", | ||
"rscl", | ||
"rsct" | ||
]; | ||
@@ -234,3 +294,5 @@ const queries: string[] = []; | ||
param, | ||
this.startTime ? truncatedISO8061Date(this.startTime) : undefined | ||
this.startTime | ||
? truncatedISO8061Date(this.startTime, false) | ||
: undefined | ||
); | ||
@@ -242,3 +304,5 @@ break; | ||
param, | ||
this.expiryTime ? truncatedISO8061Date(this.expiryTime) : undefined | ||
this.expiryTime | ||
? truncatedISO8061Date(this.expiryTime, false) | ||
: undefined | ||
); | ||
@@ -265,2 +329,17 @@ break; | ||
break; | ||
case "rscc": | ||
this.tryAppendQueryParameter(queries, param, this.cacheControl); | ||
break; | ||
case "rscd": | ||
this.tryAppendQueryParameter(queries, param, this.contentDisposition); | ||
break; | ||
case "rsce": | ||
this.tryAppendQueryParameter(queries, param, this.contentEncoding); | ||
break; | ||
case "rscl": | ||
this.tryAppendQueryParameter(queries, param, this.contentLanguage); | ||
break; | ||
case "rsct": | ||
this.tryAppendQueryParameter(queries, param, this.contentType); | ||
break; | ||
} | ||
@@ -267,0 +346,0 @@ } |
@@ -15,12 +15,2 @@ import * as Models from "../lib/generated/models"; | ||
/** | ||
* @member {string} [marker] A string value that identifies the portion of | ||
* the list of containers to be returned with the next listing operation. The | ||
* operation returns the NextMarker value within the response body if the | ||
* listing operation did not return all containers remaining to be listed | ||
* with the current page. The NextMarker value can be used as the value for | ||
* the marker parameter in a subsequent call to request the next page of list | ||
* items. The marker value is opaque to the client. | ||
*/ | ||
marker?: string; | ||
/** | ||
* @member {number} [maxresults] Specifies the maximum number of containers | ||
@@ -170,3 +160,9 @@ * to return. If the request does not specify maxresults, or specifies a | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {string} [marker] | ||
* @param {string} [marker] A string value that identifies the portion of | ||
* the list of containers to be returned with the next listing operation. The | ||
* operation returns the NextMarker value within the response body if the | ||
* listing operation did not return all containers remaining to be listed | ||
* with the current page. The NextMarker value can be used as the value for | ||
* the marker parameter in a subsequent call to request the next page of list | ||
* items. The marker value is opaque to the client. | ||
* @param {IServiceListContainersSegmentOptions} [options] | ||
@@ -173,0 +169,0 @@ * @returns {Promise<Models.ServiceListContainersSegmentResponse>} |
@@ -7,3 +7,3 @@ import { deserializationPolicy, RequestPolicyFactory } from "ms-rest-js"; | ||
import { LoggingPolicyFactory } from "./LoggingPolicyFactory"; | ||
import { IHTTPClient, IHTTPPipelineLogger, Pipeline } from "./Pipeline"; | ||
import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; | ||
import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory"; | ||
@@ -35,4 +35,4 @@ import { | ||
logger?: IHTTPPipelineLogger; | ||
httpClient?: IHTTPClient; | ||
logger?: IHttpPipelineLogger; | ||
httpClient?: IHttpClient; | ||
} | ||
@@ -39,0 +39,0 @@ |
@@ -1,2 +0,2 @@ | ||
export const SDK_VERSION: string = "10.1.0-preview"; | ||
export const SDK_VERSION: string = "10.2.0-preview"; | ||
export const SERVICE_VERSION: string = "2018-03-28"; | ||
@@ -7,3 +7,4 @@ | ||
export const BLOCK_BLOB_MAX_BLOCKS: number = 50000; | ||
export const BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES: number = 4 * 1024 * 1024; // 4MB | ||
export const DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES: number = 4 * 1024 * 1024; // 4MB | ||
export const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS: number = 5; | ||
@@ -10,0 +11,0 @@ export const URLConstants = { |
@@ -132,8 +132,17 @@ import { isNode, URLBuilder } from "ms-rest-js"; | ||
* @export | ||
* @param {Date} date Input date | ||
* @returns {string} Date string in ISO8061 format, with no milliseconds component | ||
* @param {Date} date | ||
* @param {boolean} [withMilliseconds=true] If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned; | ||
* If false, YYYY-MM-DDThh:mm:ssZ will be returned. | ||
* @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component | ||
*/ | ||
export function truncatedISO8061Date(date: Date): string { | ||
export function truncatedISO8061Date( | ||
date: Date, | ||
withMilliseconds: boolean = true | ||
): string { | ||
// Date.toISOString() will return like "2018-10-29T06:34:36.139Z" | ||
const dateString = date.toISOString(); | ||
return dateString.substring(0, dateString.length - 1) + "0000" + "Z"; | ||
return withMilliseconds | ||
? dateString.substring(0, dateString.length - 1) + "0000" + "Z" | ||
: dateString.substring(0, dateString.length - 5) + "Z"; | ||
} | ||
@@ -140,0 +149,0 @@ |
{ | ||
"name": "@azure/storage-blob", | ||
"version": "10.1.0-preview", | ||
"version": "10.2.0-preview", | ||
"description": "Microsoft Azure Storage SDK for JavaScript - Blob", | ||
@@ -11,2 +11,3 @@ "main": "./dist/index.js", | ||
"./dist-esm/test/utils/index.js": "./dist-esm/test/utils/index.browser.js", | ||
"./dist-esm/lib/BlobDownloadResponse.js": "./dist-esm/lib/BlobDownloadResponse.browser.js", | ||
"os": false, | ||
@@ -26,5 +27,6 @@ "process": false | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.3", | ||
"assert": "^1.4.1", | ||
"es6-promise": "^4.2.4", | ||
"gulp": "^3.9.1", | ||
"gulp": "^4.0.0", | ||
"gulp-zip": "^4.2.0", | ||
@@ -49,9 +51,10 @@ "karma": "^3.0.0", | ||
"rollup-plugin-visualizer": "^0.9.0", | ||
"typescript": "^3.0.1" | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.6" | ||
}, | ||
"scripts": { | ||
"test": "npm run test:node && npm run test:browser", | ||
"test:node": "npm run build:test && mocha --no-timeouts dist-test/index.js", | ||
"test:browser": "npm run build:test && karma start --single-run", | ||
"build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip", | ||
"test:node": "mocha --no-timeouts dist-test/index.js", | ||
"test:browser": "karma start --single-run", | ||
"build": "npm run build:es6 && npm run build:nodebrowser && npm run build:browserzip && npm run build:test", | ||
"build:test": "rollup -c rollup.test.config.js", | ||
@@ -62,3 +65,2 @@ "build:nodebrowser": "rollup -c", | ||
"build:browserzip": "gulp zip", | ||
"prepare": "npm run build", | ||
"clean": "rimraf dist dist-esm dist-test typings temp browser/*.js* browser/*.zip statistics.html" | ||
@@ -65,0 +67,0 @@ }, |
# Azure Storage SDK V10 for JavaScript - Blob | ||
[![npm version](https://badge.fury.io/js/%40azure%2Fstorage-blob.svg)](https://badge.fury.io/js/%40azure%2Fstorage-blob) | ||
* [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-blob.svg)](https://badge.fury.io/js/%40azure%2Fstorage-blob) | ||
* [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-blob/index?view=azure-node-preview) | ||
@@ -42,3 +43,3 @@ ## Introduction | ||
There are differences between Node.js and browsers runtime. When getting start with this SDK, pay attention to APIs or classes marked with *"ONLY AVAILABLE IN NODE.JS RUNTIME"* or *"ONLY AVAILABLE IN BROWSERS"*. | ||
There are differences between Node.js and browsers runtime. When getting start with this SDK, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_. | ||
@@ -108,6 +109,6 @@ ##### Following features, interfaces, classes or functions are only available in Node.js | ||
* Allowed origins: * | ||
* Allowed origins: \* | ||
* Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT | ||
* Allowed headers: * | ||
* Exposed headers: * | ||
* Allowed headers: \* | ||
* Exposed headers: \* | ||
* Maximum age (seconds): 86400 | ||
@@ -148,3 +149,3 @@ | ||
const tokenCredential = new TokenCredential("token"); | ||
tokenCredential.token = "renewedToken"; | ||
tokenCredential.token = "renewedToken"; // Renew the token by updating token field of token credential | ||
@@ -154,3 +155,3 @@ // Use AnonymousCredential when url already includes a SAS signature | ||
// Use sharedKeyCredential, tokenCredential or tokenCredential to create a pipeline | ||
// Use sharedKeyCredential, tokenCredential or anonymousCredential to create a pipeline | ||
const pipeline = StorageURL.newPipeline(sharedKeyCredential); | ||
@@ -172,3 +173,3 @@ | ||
marker = listContainersResponse.marker; | ||
marker = listContainersResponse.nextMarker; | ||
for (const container of listContainersResponse.containerItems) { | ||
@@ -205,2 +206,3 @@ console.log(`Container: ${container.name}`); | ||
// List blobs | ||
marker = undefined; | ||
do { | ||
@@ -212,3 +214,3 @@ const listBlobsResponse = await containerURL.listBlobFlatSegment( | ||
marker = listBlobsResponse.marker; | ||
marker = listBlobsResponse.nextMarker; | ||
for (const blob of listBlobsResponse.segment.blobItems) { | ||
@@ -225,3 +227,3 @@ console.log(`Blob: ${blob.name}`); | ||
"Downloaded blob content", | ||
downloadBlockBlobResponse.readableStreamBody.read(content.length).toString() | ||
await streamToString(downloadBlockBlobResponse.readableStreamBody) | ||
); | ||
@@ -235,2 +237,16 @@ | ||
// A helper method used to read a Node.js readable stream into string | ||
async function streamToString(readableStream) { | ||
return new Promise((resolve, reject) => { | ||
const chunks = []; | ||
readableStream.on("data", data => { | ||
chunks.push(data.toString()); | ||
}); | ||
readableStream.on("end", () => { | ||
resolve(chunks.join("")); | ||
}); | ||
readableStream.on("error", reject); | ||
}); | ||
} | ||
// An async method returns a Promise object, which is compatible with then().catch() coding style. | ||
@@ -237,0 +253,0 @@ main() |
@@ -13,2 +13,18 @@ import { TransferProgressEvent } from "ms-rest-js"; | ||
progress?: (progress: TransferProgressEvent) => void; | ||
/** | ||
* Optional. ONLY AVAILABLE IN NODE.JS. | ||
* | ||
* How many retries will perform when original body download stream unexpected ends. | ||
* Above kind of ends will not trigger retry policy defined in a pipeline, | ||
* because they doesn't emit network errors. | ||
* | ||
* With this option, every additional retry means an additional FileURL.download() request will be made | ||
* from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached. | ||
* | ||
* Default value is 5, please set a larger value when loading large files in poor network. | ||
* | ||
* @type {number} | ||
* @memberof IBlobDownloadOptions | ||
*/ | ||
maxRetryRequests?: number; | ||
} | ||
@@ -24,6 +40,4 @@ export interface IBlobGetPropertiesOptions { | ||
blobAccessConditions?: IBlobAccessConditions; | ||
blobHTTPHeaders?: Models.BlobHTTPHeaders; | ||
} | ||
export interface IBlobSetMetadataOptions { | ||
metadata?: IMetadata; | ||
blobAccessConditions?: IBlobAccessConditions; | ||
@@ -180,3 +194,3 @@ } | ||
* | ||
* If no option provided, or no value provided for the blob HTTP headers in the options, | ||
* If no value provided, or no value provided for the specificed blob HTTP headers, | ||
* these blob HTTP headers without a value will be cleared. | ||
@@ -187,2 +201,5 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Models.BlobHTTPHeaders} [blobHTTPHeaders] If no value provided, or no value provided for | ||
* the specificed blob HTTP headers, these blob HTTP | ||
* headers without a value will be cleared. | ||
* @param {IBlobSetHTTPHeadersOptions} [options] | ||
@@ -192,7 +209,7 @@ * @returns {Promise<Models.BlobSetHTTPHeadersResponse>} | ||
*/ | ||
setHTTPHeaders(aborter: Aborter, options?: IBlobSetHTTPHeadersOptions): Promise<Models.BlobSetHTTPHeadersResponse>; | ||
setHTTPHeaders(aborter: Aborter, blobHTTPHeaders?: Models.BlobHTTPHeaders, options?: IBlobSetHTTPHeadersOptions): Promise<Models.BlobSetHTTPHeadersResponse>; | ||
/** | ||
* Sets user-defined metadata for the specified blob as one or more name-value pairs. | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the blob | ||
* If no option provided, or no metadata defined in the parameter, the blob | ||
* metadata will be removed. | ||
@@ -203,2 +220,4 @@ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IBlobSetMetadataOptions} [options] | ||
@@ -208,3 +227,3 @@ * @returns {Promise<Models.BlobSetMetadataResponse>} | ||
*/ | ||
setMetadata(aborter: Aborter, options?: IBlobSetMetadataOptions): Promise<Models.BlobSetMetadataResponse>; | ||
setMetadata(aborter: Aborter, metadata?: IMetadata, options?: IBlobSetMetadataOptions): Promise<Models.BlobSetMetadataResponse>; | ||
/** | ||
@@ -211,0 +230,0 @@ * Establishes and manages a lock on a blob for write and delete operations. |
@@ -19,3 +19,2 @@ import { HttpResponse } from "ms-rest-js"; | ||
export interface IContainerSetMetadataOptions { | ||
metadata?: IMetadata; | ||
containerAccessConditions?: IContainerAccessConditions; | ||
@@ -126,3 +125,3 @@ } | ||
/** | ||
* containersContext provided by protocol layer. | ||
* containerContext provided by protocol layer. | ||
* | ||
@@ -193,4 +192,5 @@ * @private | ||
* | ||
* If no option provided, or no metadata defined in the option parameter, the container | ||
* If no option provided, or no metadata defined in the parameter, the container | ||
* metadata will be removed. | ||
* | ||
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata | ||
@@ -200,2 +200,4 @@ * | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {IMetadata} [metadata] Replace existing metadata with this value. | ||
* If no value provided the existing metadata will be removed. | ||
* @param {IContainerSetMetadataOptions} [options] | ||
@@ -205,3 +207,3 @@ * @returns {Promise<Models.ContainerSetMetadataResponse>} | ||
*/ | ||
setMetadata(aborter: Aborter, options?: IContainerSetMetadataOptions): Promise<Models.ContainerSetMetadataResponse>; | ||
setMetadata(aborter: Aborter, metadata?: IMetadata, options?: IContainerSetMetadataOptions): Promise<Models.ContainerSetMetadataResponse>; | ||
/** | ||
@@ -208,0 +210,0 @@ * Gets the permissions for the specified container. The permissions indicate |
@@ -16,3 +16,3 @@ import { Aborter } from "./Aborter"; | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {Blob | File | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView | ||
* @param {BlockBlobURL} blockBlobURL | ||
@@ -22,3 +22,3 @@ * @param {IUploadToBlockBlobOptions} [options] | ||
*/ | ||
export declare function uploadBrowserDataToBlockBlob(aborter: Aborter, browserData: Blob | File | ArrayBuffer | ArrayBufferView, blockBlobURL: BlockBlobURL, options?: IUploadToBlockBlobOptions): Promise<BlobUploadCommonResponse>; | ||
export declare function uploadBrowserDataToBlockBlob(aborter: Aborter, browserData: Blob | ArrayBuffer | ArrayBufferView, blockBlobURL: BlockBlobURL, options?: IUploadToBlockBlobOptions): Promise<BlobUploadCommonResponse>; | ||
//# sourceMappingURL=highlevel.browser.d.ts.map |
@@ -86,2 +86,19 @@ import { HttpResponse, TransferProgressEvent } from "ms-rest-js"; | ||
/** | ||
* Optional. ONLY AVAILABLE IN NODE.JS. | ||
* | ||
* How many retries will perform when original block download stream unexpected ends. | ||
* Above kind of ends will not trigger retry policy defined in a pipeline, | ||
* because they doesn't emit network errors. | ||
* | ||
* With this option, every additional retry means an additional FileURL.download() request will be made | ||
* from the broken point, until the requested block has been successfully downloaded or | ||
* maxRetryRequestsPerBlock is reached. | ||
* | ||
* Default value is 5, please set a larger value when in poor network. | ||
* | ||
* @type {number} | ||
* @memberof IDownloadFromAzureFileOptions | ||
*/ | ||
maxRetryRequestsPerBlock?: number; | ||
/** | ||
* Progress updater. | ||
@@ -88,0 +105,0 @@ * |
@@ -7,2 +7,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerURL"; | ||
@@ -9,0 +10,0 @@ export * from "./credentials/AnonymousCredential"; |
@@ -13,2 +13,3 @@ import { RestError } from "ms-rest-js"; | ||
export * from "./BlockBlobURL"; | ||
export * from "./BrowserPolicyFactory"; | ||
export * from "./ContainerSASPermissions"; | ||
@@ -15,0 +16,0 @@ export * from "./ContainerURL"; |
@@ -13,3 +13,3 @@ /** | ||
* @type {string} | ||
* @memberof IPRange | ||
* @memberof IRange | ||
*/ | ||
@@ -22,3 +22,3 @@ offset: number; | ||
* @type {string} | ||
* @memberof IPRange | ||
* @memberof IRange | ||
*/ | ||
@@ -33,6 +33,6 @@ count?: number; | ||
* @export | ||
* @param {IRange} ipRange | ||
* @param {IRange} iRange | ||
* @returns {string} | ||
*/ | ||
export declare function rangeToString(ipRange: IRange): string; | ||
export declare function rangeToString(iRange: IRange): string; | ||
//# sourceMappingURL=IRange.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { BaseRequestPolicy, HttpClient as IHTTPClient, HttpHeaders, HttpOperationResponse, HttpPipelineLogger as IHTTPPipelineLogger, HttpPipelineLogLevel, RequestPolicyFactory, ServiceClientOptions, WebResource } from "ms-rest-js"; | ||
export { IHTTPClient, IHTTPPipelineLogger, HttpHeaders, HttpPipelineLogLevel, HttpOperationResponse, WebResource, BaseRequestPolicy }; | ||
import { BaseRequestPolicy, HttpClient as IHttpClient, HttpHeaders, HttpOperationResponse, HttpPipelineLogger as IHttpPipelineLogger, HttpPipelineLogLevel, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, ServiceClientOptions, WebResource } from "ms-rest-js"; | ||
export { IHttpClient, IHttpPipelineLogger, HttpHeaders, HttpPipelineLogLevel, HttpOperationResponse, WebResource, BaseRequestPolicy, RequestPolicyFactory, RequestPolicy, RequestPolicyOptions }; | ||
/** | ||
@@ -10,4 +10,4 @@ * Option interface for Pipeline constructor. | ||
export interface IPipelineOptions { | ||
logger?: IHTTPPipelineLogger; | ||
HTTPClient?: IHTTPClient; | ||
logger?: IHttpPipelineLogger; | ||
HTTPClient?: IHttpClient; | ||
} | ||
@@ -28,3 +28,3 @@ /** | ||
/** | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHTTPClient interface. | ||
* Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. | ||
* | ||
@@ -31,0 +31,0 @@ * @param {RequestPolicyFactory[]} factories |
@@ -108,2 +108,37 @@ import { IIPRange } from "./IIPRange"; | ||
/** | ||
* Value for cache-control header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
readonly cacheControl?: string; | ||
/** | ||
* Value for content-disposition header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
readonly contentDisposition?: string; | ||
/** | ||
* Value for content-encoding header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
readonly contentEncoding?: string; | ||
/** | ||
* Value for content-length header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
readonly contentLanguage?: string; | ||
/** | ||
* Value for content-type header in Blob/File Service SAS. | ||
* | ||
* @type {string} | ||
* @memberof SASQueryParameters | ||
*/ | ||
readonly contentType?: string; | ||
/** | ||
* Inner value of getter ipRange. | ||
@@ -138,5 +173,10 @@ * | ||
* @param {string} [resource] Representing the storage container or blob (only for Service SAS) | ||
* @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS) | ||
* @param {string} [contentDisposition] Representing the content-disposition header (only for Blob/File Service SAS) | ||
* @param {string} [contentEncoding] Representing the content-encoding header (only for Blob/File Service SAS) | ||
* @param {string} [contentLanguage] Representing the content-language header (only for Blob/File Service SAS) | ||
* @param {string} [contentType] Representing the content-type header (only for Blob/File Service SAS) | ||
* @memberof SASQueryParameters | ||
*/ | ||
constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, ipRange?: IIPRange, identifier?: string, resource?: string); | ||
constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startTime?: Date, expiryTime?: Date, ipRange?: IIPRange, identifier?: string, resource?: string, cacheControl?: string, contentDisposition?: string, contentEncoding?: string, contentLanguage?: string, contentType?: string); | ||
/** | ||
@@ -143,0 +183,0 @@ * Encodes all SAS query parameters into a string that can be appended to a URL. |
@@ -13,12 +13,2 @@ import * as Models from "../lib/generated/models"; | ||
/** | ||
* @member {string} [marker] A string value that identifies the portion of | ||
* the list of containers to be returned with the next listing operation. The | ||
* operation returns the NextMarker value within the response body if the | ||
* listing operation did not return all containers remaining to be listed | ||
* with the current page. The NextMarker value can be used as the value for | ||
* the marker parameter in a subsequent call to request the next page of list | ||
* items. The marker value is opaque to the client. | ||
*/ | ||
marker?: string; | ||
/** | ||
* @member {number} [maxresults] Specifies the maximum number of containers | ||
@@ -130,3 +120,9 @@ * to return. If the request does not specify maxresults, or specifies a | ||
* goto documents of Aborter for more examples about request cancellation | ||
* @param {string} [marker] | ||
* @param {string} [marker] A string value that identifies the portion of | ||
* the list of containers to be returned with the next listing operation. The | ||
* operation returns the NextMarker value within the response body if the | ||
* listing operation did not return all containers remaining to be listed | ||
* with the current page. The NextMarker value can be used as the value for | ||
* the marker parameter in a subsequent call to request the next page of list | ||
* items. The marker value is opaque to the client. | ||
* @param {IServiceListContainersSegmentOptions} [options] | ||
@@ -133,0 +129,0 @@ * @returns {Promise<Models.ServiceListContainersSegmentResponse>} |
import { deserializationPolicy } from "ms-rest-js"; | ||
import { Credential } from "./credentials/Credential"; | ||
import { StorageClientContext } from "./generated/storageClientContext"; | ||
import { IHTTPClient, IHTTPPipelineLogger, Pipeline } from "./Pipeline"; | ||
import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline"; | ||
import { IRetryOptions } from "./RetryPolicyFactory"; | ||
@@ -23,4 +23,4 @@ import { ITelemetryOptions } from "./TelemetryPolicyFactory"; | ||
retryOptions?: IRetryOptions; | ||
logger?: IHTTPPipelineLogger; | ||
httpClient?: IHTTPClient; | ||
logger?: IHttpPipelineLogger; | ||
httpClient?: IHttpClient; | ||
} | ||
@@ -27,0 +27,0 @@ /** |
@@ -6,3 +6,4 @@ export declare const SDK_VERSION: string; | ||
export declare const BLOCK_BLOB_MAX_BLOCKS: number; | ||
export declare const BLOB_DEFAULT_DOWNLOAD_BLOCK_BYTES: number; | ||
export declare const DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES: number; | ||
export declare const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS: number; | ||
export declare const URLConstants: { | ||
@@ -9,0 +10,0 @@ Parameters: { |
@@ -62,6 +62,8 @@ /** | ||
* @export | ||
* @param {Date} date Input date | ||
* @returns {string} Date string in ISO8061 format, with no milliseconds component | ||
* @param {Date} date | ||
* @param {boolean} [withMilliseconds=true] If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned; | ||
* If false, YYYY-MM-DDThh:mm:ssZ will be returned. | ||
* @returns {string} Date string in ISO8061 format, with or without 7 milliseconds component | ||
*/ | ||
export declare function truncatedISO8061Date(date: Date): string; | ||
export declare function truncatedISO8061Date(date: Date, withMilliseconds?: boolean): string; | ||
/** | ||
@@ -68,0 +70,0 @@ * Base64 encode. |
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2181641
288
50213
275
0
26