@azure/storage-blob 12.2.1-alpha.20200909.1 → 12.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -1
- package/README.md +4 -2
- package/dist/index.js +35 -14
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobDownloadResponse.js +1 -1
- package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +3 -3
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-common/src/BuffersStream.js +29 -8
- package/dist-esm/storage-common/src/BuffersStream.js.map +1 -1
- package/dist-esm/storage-common/src/PooledBuffer.js +1 -1
- package/dist-esm/storage-common/src/PooledBuffer.js.map +1 -1
- package/package.json +5 -5
@@ -22,9 +22,18 @@ var BuffersStream = /** @class */ (function (_super) {
|
|
22
22
|
var _this = _super.call(this, options) || this;
|
23
23
|
_this.buffers = buffers;
|
24
24
|
_this.byteLength = byteLength;
|
25
|
-
_this.
|
25
|
+
_this.byteOffsetInCurrentBuffer = 0;
|
26
26
|
_this.bufferIndex = 0;
|
27
27
|
_this.pushedBytesLength = 0;
|
28
|
+
// check byteLength is no larger than buffers[] total length
|
29
|
+
var buffersLength = 0;
|
30
|
+
for (var _i = 0, _a = _this.buffers; _i < _a.length; _i++) {
|
31
|
+
var buf = _a[_i];
|
32
|
+
buffersLength += buf.byteLength;
|
33
|
+
}
|
34
|
+
if (buffersLength < _this.byteLength) {
|
35
|
+
throw new Error("Data size shouldn't be larger than the total length of buffers.");
|
36
|
+
}
|
28
37
|
return _this;
|
29
38
|
}
|
30
39
|
/**
|
@@ -43,19 +52,31 @@ var BuffersStream = /** @class */ (function (_super) {
|
|
43
52
|
var outBuffers = [];
|
44
53
|
var i = 0;
|
45
54
|
while (i < size && this.pushedBytesLength < this.byteLength) {
|
46
|
-
|
55
|
+
// The last buffer may be longer than the data it contains.
|
56
|
+
var remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength;
|
57
|
+
var remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer;
|
58
|
+
var remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers);
|
47
59
|
if (remaining > size - i) {
|
48
|
-
|
49
|
-
|
60
|
+
// chunkSize = size - i
|
61
|
+
var end = this.byteOffsetInCurrentBuffer + size - i;
|
62
|
+
outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));
|
50
63
|
this.pushedBytesLength += size - i;
|
51
|
-
this.
|
64
|
+
this.byteOffsetInCurrentBuffer = end;
|
52
65
|
i = size;
|
53
66
|
break;
|
54
67
|
}
|
55
68
|
else {
|
56
|
-
|
57
|
-
this.
|
58
|
-
this.bufferIndex
|
69
|
+
// chunkSize = remaining
|
70
|
+
var end = this.byteOffsetInCurrentBuffer + remaining;
|
71
|
+
outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));
|
72
|
+
if (remaining === remainingCapacityInThisBuffer) {
|
73
|
+
// this.buffers[this.bufferIndex] used up, shift to next one
|
74
|
+
this.byteOffsetInCurrentBuffer = 0;
|
75
|
+
this.bufferIndex++;
|
76
|
+
}
|
77
|
+
else {
|
78
|
+
this.byteOffsetInCurrentBuffer = end;
|
79
|
+
}
|
59
80
|
this.pushedBytesLength += remaining;
|
60
81
|
i += remaining;
|
61
82
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BuffersStream.js","sourceRoot":"","sources":["../../../../storage-common/src/BuffersStream.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,kCAAkC;;AAElC,OAAO,EAAE,QAAQ,EAAmB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C,CAAC;oBACnC,IAAI,CAAC,WAAW,EAAE,CAAC;iBACpB;qBAAM;oBACL,IAAI,CAAC,yBAAyB,GAAG,GAAG,CAAC;iBACtC;gBACD,IAAI,CAAC,iBAAiB,IAAI,SAAS,CAAC;gBACpC,CAAC,IAAI,SAAS,CAAC;aAChB;SACF;QAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;SACtC;aAAM,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AA7GD,CAAmC,QAAQ,GA6G1C","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Readable, ReadableOptions } from \"stream\";\n\n/**\n * Options to configure the BuffersStream.\n */\nexport interface BuffersStreamOptions extends ReadableOptions {}\n\n/**\n * This class generates a readable stream from the data in an array of buffers.\n *\n * @export\n * @class BuffersStream\n */\nexport class BuffersStream extends Readable {\n /**\n * The offset of data to be read in the current buffer.\n *\n * @private\n * @type {number}\n * @memberof BuffersStream\n */\n private byteOffsetInCurrentBuffer: number;\n\n /**\n * The index of buffer to be read in the array of buffers.\n *\n * @private\n * @type {number}\n * @memberof BuffersStream\n */\n private bufferIndex: number;\n\n /**\n * The total length of data already read.\n *\n * @private\n * @type {number}\n * @memberof BuffersStream\n */\n private pushedBytesLength: number;\n\n /**\n * Creates an instance of BuffersStream that will emit the data\n * contained in the array of buffers.\n *\n * @param {Buffer[]} buffers Array of buffers containing the data\n * @param {number} byteLength The total length of data contained in the buffers\n * @memberof BuffersStream\n */\n constructor(\n private buffers: Buffer[],\n private byteLength: number,\n options?: BuffersStreamOptions\n ) {\n super(options);\n this.byteOffsetInCurrentBuffer = 0;\n this.bufferIndex = 0;\n this.pushedBytesLength = 0;\n\n // check byteLength is no larger than buffers[] total length\n let buffersLength = 0;\n for (const buf of this.buffers) {\n buffersLength += buf.byteLength;\n }\n if (buffersLength < this.byteLength) {\n throw new Error(\"Data size shouldn't be larger than the total length of buffers.\");\n }\n }\n\n /**\n * Internal _read() that will be called when the stream wants to pull more data in.\n *\n * @param {number} size Optional. The size of data to be read\n * @memberof BuffersStream\n */\n public _read(size?: number) {\n if (this.pushedBytesLength >= this.byteLength) {\n this.push(null);\n }\n\n if (!size) {\n size = this.readableHighWaterMark;\n }\n\n const outBuffers: Buffer[] = [];\n let i = 0;\n while (i < size && this.pushedBytesLength < this.byteLength) {\n // The last buffer may be longer than the data it contains.\n const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength;\n const remainingCapacityInThisBuffer =\n this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer;\n const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers);\n if (remaining > size - i) {\n // chunkSize = size - i\n const end = this.byteOffsetInCurrentBuffer + size - i;\n outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));\n this.pushedBytesLength += size - i;\n this.byteOffsetInCurrentBuffer = end;\n i = size;\n break;\n } else {\n // chunkSize = remaining\n const end = this.byteOffsetInCurrentBuffer + remaining;\n outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));\n if (remaining === remainingCapacityInThisBuffer) {\n // this.buffers[this.bufferIndex] used up, shift to next one\n this.byteOffsetInCurrentBuffer = 0;\n this.bufferIndex++;\n } else {\n this.byteOffsetInCurrentBuffer = end;\n }\n this.pushedBytesLength += remaining;\n i += remaining;\n }\n }\n\n if (outBuffers.length > 1) {\n this.push(Buffer.concat(outBuffers));\n } else if (outBuffers.length === 1) {\n this.push(outBuffers[0]);\n }\n }\n}\n"]}
|
@@ -29,7 +29,7 @@ var PooledBuffer = /** @class */ (function () {
|
|
29
29
|
*/
|
30
30
|
this.buffers = [];
|
31
31
|
this.capacity = capacity;
|
32
|
-
this._size =
|
32
|
+
this._size = 0;
|
33
33
|
// allocate
|
34
34
|
var bufferNum = Math.ceil(capacity / maxBufferLength);
|
35
35
|
for (var i = 0; i < bufferNum; i++) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PooledBuffer.js","sourceRoot":"","sources":["../../../../storage-common/src/PooledBuffer.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;GAEG;AACH,6DAA6D;AAC7D,IAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC;AAE/D;;;;;;;;;;GAUG;AACH;IA0DE,sBAAY,QAAgB,EAAE,OAAkB,EAAE,WAAoB;QAzDtE;;;;;;;WAOG;QACK,YAAO,GAAa,EAAE,CAAC;QAkD7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,
|
1
|
+
{"version":3,"file":"PooledBuffer.js","sourceRoot":"","sources":["../../../../storage-common/src/PooledBuffer.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;GAEG;AACH,6DAA6D;AAC7D,IAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC;AAE/D;;;;;;;;;;GAUG;AACH;IA0DE,sBAAY,QAAgB,EAAE,OAAkB,EAAE,WAAoB;QAzDtE;;;;;;;WAOG;QACK,YAAO,GAAa,EAAE,CAAC;QAkD7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QAEf,WAAW;QACX,IAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,Q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AAI,SAAS,CAAC;YAC1B,IAAI,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE;gBAClC,CAAC,EAAE,CAAC;gBACJ,YAAY,GAAG,CAAC,CAAC;aAClB;YACD,IAAI,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE;gBAClC,CAAC,EAAE,CAAC;gBACJ,YAAY,GAAG,CAAC,CAAC;aAClB;SACF;QAED,mCAAmC;QACnC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACrB,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACtB,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAC7C;IACH,CAAC;IAED;;;;;OAKG;IACI,wCAAiB,GAAxB;QACE,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IACH,mBAAC;AAAD,CAAC,AAlID,IAkIC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { BuffersStream } from \"./BuffersStream\";\nimport { Readable } from \"stream\";\n\n/**\n * maxBufferLength is max size of each buffer in the pooled buffers.\n */\n// Can't use import as Typescript doesn't recognize \"buffer\".\nconst maxBufferLength = require(\"buffer\").constants.MAX_LENGTH;\n\n/**\n * This class provides a buffer container which conceptually has no hard size limit.\n * It accepts a capacity, an array of input buffers and the total length of input data.\n * It will allocate an internal \"buffer\" of the capacity and fill the data in the input buffers\n * into the internal \"buffer\" serially with respect to the total length.\n * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream\n * assembled from all the data in the internal \"buffer\".\n *\n * @export\n * @class BufferScheduler\n */\nexport class PooledBuffer {\n /**\n * Internal buffers used to keep the data.\n * Each buffer has a length of the maxBufferLength except last one.\n *\n * @private\n * @type {Buffer[]}\n * @memberof PooledBuffer\n */\n private buffers: Buffer[] = [];\n\n /**\n * The total size of internal buffers.\n *\n * @private\n * @type {number}\n * @memberof PooledBuffer\n */\n private readonly capacity: number;\n\n /**\n * The total size of data contained in internal buffers.\n *\n * @private\n * @type {number}\n * @memberof PooledBuffer\n */\n private _size: number;\n\n /**\n * The size of the data contained in the pooled buffers.\n */\n public get size(): number {\n return this._size;\n }\n\n /**\n * Creates an instance of PooledBuffer with given capacity.\n * Internal buffers are allocated but contains no data.\n * Users may call the {@link PooledBuffer.fill} method to fill this\n * pooled buffer with data.\n *\n * @param {number} capacity Total capacity of the internal buffers\n * @memberof PooledBuffer\n */\n constructor(capacity: number);\n\n /**\n * Creates an instance of PooledBuffer with given capacity.\n * Internal buffers are allocated and filled with data in the input buffers serially\n * with respect to the total length.\n *\n * @param {number} capacity Total capacity of the internal buffers\n * @param {Buffer[]} buffers Input buffers containing the data to be filled in the pooled buffer\n * @param {number} totalLength Total length of the data to be filled in.\n * @memberof PooledBuffer\n */\n constructor(capacity: number, buffers: Buffer[], totalLength: number);\n constructor(capacity: number, buffers?: Buffer[], totalLength?: number) {\n this.capacity = capacity;\n this._size = 0;\n\n // allocate\n const bufferNum = Math.ceil(capacity / maxBufferLength);\n for (let i = 0; i < bufferNum; i++) {\n let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength;\n if (len === 0) {\n len = maxBufferLength;\n }\n this.buffers.push(Buffer.allocUnsafe(len));\n }\n\n if (buffers) {\n this.fill(buffers, totalLength!);\n }\n }\n\n /**\n * Fill the internal buffers with data in the input buffers serially\n * with respect to the total length and the total capacity of the internal buffers.\n * Data copied will be shift out of the input buffers.\n *\n * @param {Buffer[]} buffers Input buffers containing the data to be filled in the pooled buffer\n * @param {number} totalLength Total length of the data to be filled in.\n *\n * @returns {void}\n * @memberof PooledBuffer\n */\n public fill(buffers: Buffer[], totalLength: number) {\n this._size = Math.min(this.capacity, totalLength);\n\n let i = 0,\n j = 0,\n targetOffset = 0,\n sourceOffset = 0,\n totalCopiedNum = 0;\n while (totalCopiedNum < this._size) {\n const source = buffers[i];\n const target = this.buffers[j];\n const copiedNum = source.copy(target, targetOffset, sourceOffset);\n\n totalCopiedNum += copiedNum;\n sourceOffset += copiedNum;\n targetOffset += copiedNum;\n if (sourceOffset === source.length) {\n i++;\n sourceOffset = 0;\n }\n if (targetOffset === target.length) {\n j++;\n targetOffset = 0;\n }\n }\n\n // clear copied from source buffers\n buffers.splice(0, i);\n if (buffers.length > 0) {\n buffers[0] = buffers[0].slice(sourceOffset);\n }\n }\n\n /**\n * Get the readable stream assembled from all the data in the internal buffers.\n *\n * @returns {Readable}\n * @memberof PooledBuffer\n */\n public getReadableStream(): Readable {\n return new BuffersStream(this.buffers, this.size);\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/storage-blob",
|
3
3
|
"sdk-type": "client",
|
4
|
-
"version": "12.2.1
|
4
|
+
"version": "12.2.1",
|
5
5
|
"description": "Microsoft Azure Storage SDK for JavaScript - Blob",
|
6
6
|
"main": "./dist/index.js",
|
7
7
|
"module": "./dist-esm/storage-blob/src/index.js",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
},
|
33
33
|
"scripts": {
|
34
34
|
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
35
|
-
"build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.2.
|
35
|
+
"build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.2.1 --use=@microsoft.azure/autorest.typescript@5.0.1",
|
36
36
|
"build:es6": "tsc -p tsconfig.json",
|
37
37
|
"build:nodebrowser": "rollup -c 2>&1",
|
38
38
|
"build:samples": "npm run clean && npm run build:es6 && cross-env ONLY_NODE=true rollup -c 2>&1 && npm run build:prep-samples",
|
@@ -121,16 +121,16 @@
|
|
121
121
|
"@azure/core-http": "^1.1.6",
|
122
122
|
"@azure/core-lro": "^1.0.2",
|
123
123
|
"@azure/core-paging": "^1.1.1",
|
124
|
-
"@azure/core-tracing": "
|
124
|
+
"@azure/core-tracing": "1.0.0-preview.9",
|
125
125
|
"@azure/logger": "^1.0.0",
|
126
126
|
"@opentelemetry/api": "^0.10.2",
|
127
127
|
"events": "^3.0.0",
|
128
128
|
"tslib": "^2.0.0"
|
129
129
|
},
|
130
130
|
"devDependencies": {
|
131
|
-
"@azure/dev-tool": "^1.0.0
|
131
|
+
"@azure/dev-tool": "^1.0.0",
|
132
132
|
"@azure/identity": "^1.1.0",
|
133
|
-
"@azure/test-utils-recorder": "^1.0.0
|
133
|
+
"@azure/test-utils-recorder": "^1.0.0",
|
134
134
|
"@microsoft/api-extractor": "7.7.11",
|
135
135
|
"@rollup/plugin-multi-entry": "^3.0.0",
|
136
136
|
"@rollup/plugin-replace": "^2.2.0",
|