@azure/storage-blob 12.9.1-alpha.20220418.2 → 12.10.0-alpha.20220502.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 +4 -4
- package/dist/index.js +70 -69
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.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/policies/StorageRetryPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/Batch.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +2 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-common/src/BufferScheduler.js.map +1 -1
- package/dist-esm/storage-internal-avro/src/AvroParser.js +38 -40
- package/dist-esm/storage-internal-avro/src/AvroParser.js.map +1 -1
- package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js +4 -4
- package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js.map +1 -1
- package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js +7 -5
- package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js.map +1 -1
- package/dist-esm/storage-internal-avro/src/AvroReader.js +8 -6
- package/dist-esm/storage-internal-avro/src/AvroReader.js.map +1 -1
- package/dist-esm/storage-internal-avro/src/utils/utils.common.js +2 -1
- package/dist-esm/storage-internal-avro/src/utils/utils.common.js.map +1 -1
- package/package.json +2 -2
- package/types/3.1/storage-blob.d.ts +0 -26
- package/types/latest/storage-blob.d.ts +0 -27
package/CHANGELOG.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
-
## 12.
|
3
|
+
## 12.10.0-beta.1 (2022-04-19)
|
4
4
|
|
5
5
|
### Features Added
|
6
6
|
|
7
|
-
|
7
|
+
- Added support for service version 2021-06-08.
|
8
|
+
- Added pageable output of PageBlobClient.listPageRanges() and PageBlobClient.listPageRangesDiff().
|
9
|
+
- Added ability to copy source blob tags for BlobClient.syncCopyFromURL().
|
8
10
|
|
9
11
|
### Bugs Fixed
|
10
12
|
|
11
13
|
- Fix incorrect browser mapping path for BufferScheduler.js
|
12
14
|
- Add `react-native` mapping to ESM entrypoint
|
13
15
|
|
14
|
-
### Other Changes
|
15
|
-
|
16
16
|
## 12.9.0 (2022-03-11)
|
17
17
|
|
18
18
|
### Features Added
|
package/dist/index.js
CHANGED
@@ -8497,7 +8497,7 @@ const timeoutInSeconds = {
|
|
8497
8497
|
const version = {
|
8498
8498
|
parameterPath: "version",
|
8499
8499
|
mapper: {
|
8500
|
-
defaultValue: "2021-
|
8500
|
+
defaultValue: "2021-06-08",
|
8501
8501
|
isConstant: true,
|
8502
8502
|
serializedName: "x-ms-version",
|
8503
8503
|
type: {
|
@@ -13325,8 +13325,8 @@ const logger = logger$1.createClientLogger("storage-blob");
|
|
13325
13325
|
|
13326
13326
|
// Copyright (c) Microsoft Corporation.
|
13327
13327
|
// Licensed under the MIT license.
|
13328
|
-
const SDK_VERSION = "12.
|
13329
|
-
const SERVICE_VERSION = "2021-
|
13328
|
+
const SDK_VERSION = "12.10.0-beta.1";
|
13329
|
+
const SERVICE_VERSION = "2021-06-08";
|
13330
13330
|
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
13331
13331
|
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
13332
13332
|
const BLOCK_BLOB_MAX_BLOCKS = 50000;
|
@@ -15309,7 +15309,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
15309
15309
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
15310
15310
|
*/
|
15311
15311
|
const packageName = "azure-storage-blob";
|
15312
|
-
const packageVersion = "12.
|
15312
|
+
const packageVersion = "12.10.0-beta.1";
|
15313
15313
|
class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
15314
15314
|
/**
|
15315
15315
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -15335,7 +15335,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
15335
15335
|
// Parameter assignments
|
15336
15336
|
this.url = url;
|
15337
15337
|
// Assigning values to Constant parameters
|
15338
|
-
this.version = options.version || "2021-
|
15338
|
+
this.version = options.version || "2021-06-08";
|
15339
15339
|
}
|
15340
15340
|
}
|
15341
15341
|
|
@@ -17417,22 +17417,6 @@ const AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]);
|
|
17417
17417
|
const AVRO_CODEC_KEY = "avro.codec";
|
17418
17418
|
const AVRO_SCHEMA_KEY = "avro.schema";
|
17419
17419
|
|
17420
|
-
// Copyright (c) Microsoft Corporation.
|
17421
|
-
// Licensed under the MIT license.
|
17422
|
-
function arraysEqual(a, b) {
|
17423
|
-
if (a === b)
|
17424
|
-
return true;
|
17425
|
-
if (a == null || b == null)
|
17426
|
-
return false;
|
17427
|
-
if (a.length != b.length)
|
17428
|
-
return false;
|
17429
|
-
for (let i = 0; i < a.length; ++i) {
|
17430
|
-
if (a[i] !== b[i])
|
17431
|
-
return false;
|
17432
|
-
}
|
17433
|
-
return true;
|
17434
|
-
}
|
17435
|
-
|
17436
17420
|
// Copyright (c) Microsoft Corporation.
|
17437
17421
|
// Licensed under the MIT license.
|
17438
17422
|
class AvroParser {
|
@@ -17445,7 +17429,7 @@ class AvroParser {
|
|
17445
17429
|
*/
|
17446
17430
|
static async readFixedBytes(stream, length, options = {}) {
|
17447
17431
|
const bytes = await stream.read(length, { abortSignal: options.abortSignal });
|
17448
|
-
if (bytes.length
|
17432
|
+
if (bytes.length !== length) {
|
17449
17433
|
throw new Error("Hit stream end.");
|
17450
17434
|
}
|
17451
17435
|
return bytes;
|
@@ -17475,6 +17459,7 @@ class AvroParser {
|
|
17475
17459
|
} while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers
|
17476
17460
|
if (haveMoreByte) {
|
17477
17461
|
// Switch to float arithmetic
|
17462
|
+
// eslint-disable-next-line no-self-assign
|
17478
17463
|
zigZagEncoded = zigZagEncoded;
|
17479
17464
|
significanceInFloat = 268435456; // 2 ** 28.
|
17480
17465
|
do {
|
@@ -17501,10 +17486,10 @@ class AvroParser {
|
|
17501
17486
|
}
|
17502
17487
|
static async readBoolean(stream, options = {}) {
|
17503
17488
|
const b = await AvroParser.readByte(stream, options);
|
17504
|
-
if (b
|
17489
|
+
if (b === 1) {
|
17505
17490
|
return true;
|
17506
17491
|
}
|
17507
|
-
else if (b
|
17492
|
+
else if (b === 0) {
|
17508
17493
|
return false;
|
17509
17494
|
}
|
17510
17495
|
else {
|
@@ -17526,16 +17511,10 @@ class AvroParser {
|
|
17526
17511
|
if (size < 0) {
|
17527
17512
|
throw new Error("Bytes size was negative.");
|
17528
17513
|
}
|
17529
|
-
return
|
17514
|
+
return stream.read(size, { abortSignal: options.abortSignal });
|
17530
17515
|
}
|
17531
17516
|
static async readString(stream, options = {}) {
|
17532
17517
|
const u8arr = await AvroParser.readBytes(stream, options);
|
17533
|
-
// polyfill TextDecoder to be backward compatible with older
|
17534
|
-
// nodejs that doesn't expose TextDecoder as a global variable
|
17535
|
-
if (typeof TextDecoder === "undefined" && typeof require !== "undefined") {
|
17536
|
-
global.TextDecoder = require("util").TextDecoder;
|
17537
|
-
}
|
17538
|
-
// FUTURE: need TextDecoder polyfill for IE
|
17539
17518
|
const utf8decoder = new TextDecoder();
|
17540
17519
|
return utf8decoder.decode(u8arr);
|
17541
17520
|
}
|
@@ -17546,8 +17525,8 @@ class AvroParser {
|
|
17546
17525
|
return { key, value };
|
17547
17526
|
}
|
17548
17527
|
static async readMap(stream, readItemMethod, options = {}) {
|
17549
|
-
const readPairMethod =
|
17550
|
-
return
|
17528
|
+
const readPairMethod = (s, opts = {}) => {
|
17529
|
+
return AvroParser.readMapPair(s, readItemMethod, opts);
|
17551
17530
|
};
|
17552
17531
|
const pairs = await AvroParser.readArray(stream, readPairMethod, options);
|
17553
17532
|
const dict = {};
|
@@ -17558,7 +17537,7 @@ class AvroParser {
|
|
17558
17537
|
}
|
17559
17538
|
static async readArray(stream, readItemMethod, options = {}) {
|
17560
17539
|
const items = [];
|
17561
|
-
for (let count = await AvroParser.readLong(stream, options); count
|
17540
|
+
for (let count = await AvroParser.readLong(stream, options); count !== 0; count = await AvroParser.readLong(stream, options)) {
|
17562
17541
|
if (count < 0) {
|
17563
17542
|
// Ignore block sizes
|
17564
17543
|
await AvroParser.readLong(stream, options);
|
@@ -17581,6 +17560,17 @@ var AvroComplex;
|
|
17581
17560
|
AvroComplex["UNION"] = "union";
|
17582
17561
|
AvroComplex["FIXED"] = "fixed";
|
17583
17562
|
})(AvroComplex || (AvroComplex = {}));
|
17563
|
+
var AvroPrimitive;
|
17564
|
+
(function (AvroPrimitive) {
|
17565
|
+
AvroPrimitive["NULL"] = "null";
|
17566
|
+
AvroPrimitive["BOOLEAN"] = "boolean";
|
17567
|
+
AvroPrimitive["INT"] = "int";
|
17568
|
+
AvroPrimitive["LONG"] = "long";
|
17569
|
+
AvroPrimitive["FLOAT"] = "float";
|
17570
|
+
AvroPrimitive["DOUBLE"] = "double";
|
17571
|
+
AvroPrimitive["BYTES"] = "bytes";
|
17572
|
+
AvroPrimitive["STRING"] = "string";
|
17573
|
+
})(AvroPrimitive || (AvroPrimitive = {}));
|
17584
17574
|
class AvroType {
|
17585
17575
|
/**
|
17586
17576
|
* Determines the AvroType from the Avro Schema.
|
@@ -17620,7 +17610,9 @@ class AvroType {
|
|
17620
17610
|
try {
|
17621
17611
|
return AvroType.fromStringSchema(type);
|
17622
17612
|
}
|
17623
|
-
catch (err) {
|
17613
|
+
catch (err) {
|
17614
|
+
// eslint-disable-line no-empty
|
17615
|
+
}
|
17624
17616
|
switch (type) {
|
17625
17617
|
case AvroComplex.RECORD:
|
17626
17618
|
if (schema.aliases) {
|
@@ -17629,6 +17621,7 @@ class AvroType {
|
|
17629
17621
|
if (!schema.name) {
|
17630
17622
|
throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`);
|
17631
17623
|
}
|
17624
|
+
// eslint-disable-next-line no-case-declarations
|
17632
17625
|
const fields = {};
|
17633
17626
|
if (!schema.fields) {
|
17634
17627
|
throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`);
|
@@ -17657,40 +17650,29 @@ class AvroType {
|
|
17657
17650
|
}
|
17658
17651
|
}
|
17659
17652
|
}
|
17660
|
-
var AvroPrimitive;
|
17661
|
-
(function (AvroPrimitive) {
|
17662
|
-
AvroPrimitive["NULL"] = "null";
|
17663
|
-
AvroPrimitive["BOOLEAN"] = "boolean";
|
17664
|
-
AvroPrimitive["INT"] = "int";
|
17665
|
-
AvroPrimitive["LONG"] = "long";
|
17666
|
-
AvroPrimitive["FLOAT"] = "float";
|
17667
|
-
AvroPrimitive["DOUBLE"] = "double";
|
17668
|
-
AvroPrimitive["BYTES"] = "bytes";
|
17669
|
-
AvroPrimitive["STRING"] = "string";
|
17670
|
-
})(AvroPrimitive || (AvroPrimitive = {}));
|
17671
17653
|
class AvroPrimitiveType extends AvroType {
|
17672
17654
|
constructor(primitive) {
|
17673
17655
|
super();
|
17674
17656
|
this._primitive = primitive;
|
17675
17657
|
}
|
17676
|
-
|
17658
|
+
read(stream, options = {}) {
|
17677
17659
|
switch (this._primitive) {
|
17678
17660
|
case AvroPrimitive.NULL:
|
17679
|
-
return
|
17661
|
+
return AvroParser.readNull();
|
17680
17662
|
case AvroPrimitive.BOOLEAN:
|
17681
|
-
return
|
17663
|
+
return AvroParser.readBoolean(stream, options);
|
17682
17664
|
case AvroPrimitive.INT:
|
17683
|
-
return
|
17665
|
+
return AvroParser.readInt(stream, options);
|
17684
17666
|
case AvroPrimitive.LONG:
|
17685
|
-
return
|
17667
|
+
return AvroParser.readLong(stream, options);
|
17686
17668
|
case AvroPrimitive.FLOAT:
|
17687
|
-
return
|
17669
|
+
return AvroParser.readFloat(stream, options);
|
17688
17670
|
case AvroPrimitive.DOUBLE:
|
17689
|
-
return
|
17671
|
+
return AvroParser.readDouble(stream, options);
|
17690
17672
|
case AvroPrimitive.BYTES:
|
17691
|
-
return
|
17673
|
+
return AvroParser.readBytes(stream, options);
|
17692
17674
|
case AvroPrimitive.STRING:
|
17693
|
-
return
|
17675
|
+
return AvroParser.readString(stream, options);
|
17694
17676
|
default:
|
17695
17677
|
throw new Error("Unknown Avro Primitive");
|
17696
17678
|
}
|
@@ -17713,7 +17695,7 @@ class AvroUnionType extends AvroType {
|
|
17713
17695
|
}
|
17714
17696
|
async read(stream, options = {}) {
|
17715
17697
|
const typeIndex = await AvroParser.readInt(stream, options);
|
17716
|
-
return
|
17698
|
+
return this._types[typeIndex].read(stream, options);
|
17717
17699
|
}
|
17718
17700
|
}
|
17719
17701
|
class AvroMapType extends AvroType {
|
@@ -17721,11 +17703,11 @@ class AvroMapType extends AvroType {
|
|
17721
17703
|
super();
|
17722
17704
|
this._itemType = itemType;
|
17723
17705
|
}
|
17724
|
-
|
17725
|
-
const readItemMethod =
|
17726
|
-
return
|
17706
|
+
read(stream, options = {}) {
|
17707
|
+
const readItemMethod = (s, opts) => {
|
17708
|
+
return this._itemType.read(s, opts);
|
17727
17709
|
};
|
17728
|
-
return
|
17710
|
+
return AvroParser.readMap(stream, readItemMethod, options);
|
17729
17711
|
}
|
17730
17712
|
}
|
17731
17713
|
class AvroRecordType extends AvroType {
|
@@ -17738,7 +17720,7 @@ class AvroRecordType extends AvroType {
|
|
17738
17720
|
const record = {};
|
17739
17721
|
record["$schema"] = this._name;
|
17740
17722
|
for (const key in this._fields) {
|
17741
|
-
if (
|
17723
|
+
if (Object.prototype.hasOwnProperty.call(this._fields, key)) {
|
17742
17724
|
record[key] = await this._fields[key].read(stream, options);
|
17743
17725
|
}
|
17744
17726
|
}
|
@@ -17746,6 +17728,23 @@ class AvroRecordType extends AvroType {
|
|
17746
17728
|
}
|
17747
17729
|
}
|
17748
17730
|
|
17731
|
+
// Copyright (c) Microsoft Corporation.
|
17732
|
+
// Licensed under the MIT license.
|
17733
|
+
function arraysEqual(a, b) {
|
17734
|
+
if (a === b)
|
17735
|
+
return true;
|
17736
|
+
// eslint-disable-next-line eqeqeq
|
17737
|
+
if (a == null || b == null)
|
17738
|
+
return false;
|
17739
|
+
if (a.length !== b.length)
|
17740
|
+
return false;
|
17741
|
+
for (let i = 0; i < a.length; ++i) {
|
17742
|
+
if (a[i] !== b[i])
|
17743
|
+
return false;
|
17744
|
+
}
|
17745
|
+
return true;
|
17746
|
+
}
|
17747
|
+
|
17749
17748
|
// Copyright (c) Microsoft Corporation.
|
17750
17749
|
class AvroReader {
|
17751
17750
|
constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) {
|
@@ -17776,7 +17775,7 @@ class AvroReader {
|
|
17776
17775
|
});
|
17777
17776
|
// Validate codec
|
17778
17777
|
const codec = this._metadata[AVRO_CODEC_KEY];
|
17779
|
-
if (!(codec
|
17778
|
+
if (!(codec === undefined || codec === null || codec === "null")) {
|
17780
17779
|
throw new Error("Codecs are not supported");
|
17781
17780
|
}
|
17782
17781
|
// The 16-byte, randomly-generated sync marker for this file.
|
@@ -17786,7 +17785,7 @@ class AvroReader {
|
|
17786
17785
|
// Parse the schema
|
17787
17786
|
const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
|
17788
17787
|
this._itemType = AvroType.fromSchema(schema);
|
17789
|
-
if (this._blockOffset
|
17788
|
+
if (this._blockOffset === 0) {
|
17790
17789
|
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
|
17791
17790
|
}
|
17792
17791
|
this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
|
@@ -17816,7 +17815,7 @@ class AvroReader {
|
|
17816
17815
|
}));
|
17817
17816
|
this._itemsRemainingInBlock--;
|
17818
17817
|
this._objectIndex++;
|
17819
|
-
if (this._itemsRemainingInBlock
|
17818
|
+
if (this._itemsRemainingInBlock === 0) {
|
17820
17819
|
const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
|
17821
17820
|
abortSignal: options.abortSignal,
|
17822
17821
|
}));
|
@@ -17891,6 +17890,7 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17891
17890
|
else {
|
17892
17891
|
// register callback to wait for enough data to read
|
17893
17892
|
return new Promise((resolve, reject) => {
|
17893
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
17894
17894
|
const cleanUp = () => {
|
17895
17895
|
this._readable.removeListener("readable", readableCallback);
|
17896
17896
|
this._readable.removeListener("error", rejectCallback);
|
@@ -17901,12 +17901,12 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17901
17901
|
}
|
17902
17902
|
};
|
17903
17903
|
const readableCallback = () => {
|
17904
|
-
const
|
17905
|
-
if (
|
17906
|
-
this._position +=
|
17904
|
+
const callbackChunk = this._readable.read(size);
|
17905
|
+
if (callbackChunk) {
|
17906
|
+
this._position += callbackChunk.length;
|
17907
17907
|
cleanUp();
|
17908
|
-
//
|
17909
|
-
resolve(this.toUint8Array(
|
17908
|
+
// callbackChunk.length maybe less than desired size if the stream ends.
|
17909
|
+
resolve(this.toUint8Array(callbackChunk));
|
17910
17910
|
}
|
17911
17911
|
};
|
17912
17912
|
const rejectCallback = () => {
|
@@ -17924,6 +17924,7 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17924
17924
|
if (options.abortSignal) {
|
17925
17925
|
options.abortSignal.addEventListener("abort", abortHandler);
|
17926
17926
|
}
|
17927
|
+
/* eslint-enable @typescript-eslint/no-use-before-define */
|
17927
17928
|
});
|
17928
17929
|
}
|
17929
17930
|
}
|