diff --git a/blob/ChangeLog.md b/blob/ChangeLog.md index 7f7a6cc..3bd9193 100644 --- a/blob/ChangeLog.md +++ b/blob/ChangeLog.md @@ -1,5 +1,8 @@ # Changelog +* Improved comments for `BlockBlobURL.upload()`. +* Exported `HttpRequestBody` type for who wants to implement a customized HTTP client. + 2018.12 10.3.0 * [Breaking] Updated convenience layer methods enum type parameters into typescript union types, this will help reducing bundle footprint. diff --git a/blob/README.md b/blob/README.md index 9e01f62..2a88be9 100644 --- a/blob/README.md +++ b/blob/README.md @@ -255,7 +255,7 @@ main() ## More Code Samples * [Blob Storage Examples](https://github.com/azure/azure-storage-js/tree/master/blob/samples) -* [Blob Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/blob/test/) +* [Blob Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/blob/tests/) ## License diff --git a/blob/lib/BlockBlobURL.ts b/blob/lib/BlockBlobURL.ts index a648260..3d40cd9 100644 --- a/blob/lib/BlockBlobURL.ts +++ b/blob/lib/BlockBlobURL.ts @@ -158,8 +158,10 @@ export class BlockBlobURL extends BlobURL { * * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(), * goto documents of Aborter for more examples about request cancellation - * @param {HttpRequestBody} body - * @param {number} contentLength + * @param {HttpRequestBody} body Blob, string, ArrayBuffer, ArrayBufferView or a function + * which returns a new Readable stream whose offset is from data source beginning. + * @param {number} contentLength Length of body in bytes. Use Buffer.byteLength() to calculate body length for a + * string including non non-Base64/Hex-encoded characters. * @param {IBlockBlobUploadOptions} [options] * @returns {Promise} * @memberof BlockBlobURL diff --git a/blob/lib/Pipeline.ts b/blob/lib/Pipeline.ts index ee400f3..4d5262d 100644 --- a/blob/lib/Pipeline.ts +++ b/blob/lib/Pipeline.ts @@ -5,6 +5,7 @@ import { HttpOperationResponse, HttpPipelineLogger as IHttpPipelineLogger, HttpPipelineLogLevel, + HttpRequestBody, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, @@ -19,6 +20,7 @@ export { IHttpPipelineLogger, HttpHeaders, HttpPipelineLogLevel, + HttpRequestBody, HttpOperationResponse, WebResource, BaseRequestPolicy, diff --git a/blob/tests/bloburl.test.ts b/blob/tests/bloburl.test.ts index 661a6c8..904fe59 100644 --- a/blob/tests/bloburl.test.ts +++ b/blob/tests/bloburl.test.ts @@ -145,7 +145,8 @@ describe("BlobURL", () => { assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await sleep(16 * 1000); + await sleep(20 * 1000); + const result2 = await blobURL.getProperties(Aborter.none); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "expired"); @@ -187,14 +188,14 @@ describe("BlobURL", () => { assert.equal(result.leaseState, "leased"); assert.equal(result.leaseStatus, "locked"); - await blobURL.breakLease(Aborter.none, 3); + await blobURL.breakLease(Aborter.none, 5); const result2 = await blobURL.getProperties(Aborter.none); assert.ok(!result2.leaseDuration); assert.equal(result2.leaseState, "breaking"); assert.equal(result2.leaseStatus, "locked"); - await sleep(3 * 1000); + await sleep(5 * 1000); const result3 = await blobURL.getProperties(Aborter.none); assert.ok(!result3.leaseDuration); diff --git a/blob/tests/node/pagebloburl.test.ts b/blob/tests/node/pagebloburl.test.ts index 2c8ff88..2627716 100644 --- a/blob/tests/node/pagebloburl.test.ts +++ b/blob/tests/node/pagebloburl.test.ts @@ -44,6 +44,9 @@ describe("PageBlobURL", () => { ); await containerURL.setAccessPolicy(Aborter.none, "container"); + + await sleep(5 * 1000); + let copySource = pageBlobURL.withSnapshot(snapshotResult.snapshot!).url; let copyResponse = await destPageBlobURL.startCopyIncremental( Aborter.none,