@azure/storage-blob 12.9.1-alpha.20220407.2 → 12.10.0-alpha.20220420.2
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 +5 -4
- package/dist/index.js +507 -74
- 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 +372 -6
- 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/PageBlobRangeResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js +7 -0
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +12 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js +2 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +1 -0
- package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +4 -0
- package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.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/generatedModels.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 +3 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +42 -0
- 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 +5 -2
- package/types/3.1/storage-blob.d.ts +330 -1
- package/types/latest/storage-blob.d.ts +340 -1
package/dist/index.js
CHANGED
@@ -1693,6 +1693,13 @@ const PageList = {
|
|
1693
1693
|
}
|
1694
1694
|
}
|
1695
1695
|
}
|
1696
|
+
},
|
1697
|
+
continuationToken: {
|
1698
|
+
serializedName: "NextMarker",
|
1699
|
+
xmlName: "NextMarker",
|
1700
|
+
type: {
|
1701
|
+
name: "String"
|
1702
|
+
}
|
1696
1703
|
}
|
1697
1704
|
}
|
1698
1705
|
}
|
@@ -8490,7 +8497,7 @@ const timeoutInSeconds = {
|
|
8490
8497
|
const version = {
|
8491
8498
|
parameterPath: "version",
|
8492
8499
|
mapper: {
|
8493
|
-
defaultValue: "2021-
|
8500
|
+
defaultValue: "2021-06-08",
|
8494
8501
|
isConstant: true,
|
8495
8502
|
serializedName: "x-ms-version",
|
8496
8503
|
type: {
|
@@ -9505,6 +9512,17 @@ const copySourceAuthorization = {
|
|
9505
9512
|
}
|
9506
9513
|
}
|
9507
9514
|
};
|
9515
|
+
const copySourceTags = {
|
9516
|
+
parameterPath: ["options", "copySourceTags"],
|
9517
|
+
mapper: {
|
9518
|
+
serializedName: "x-ms-copy-source-tag-option",
|
9519
|
+
xmlName: "x-ms-copy-source-tag-option",
|
9520
|
+
type: {
|
9521
|
+
name: "Enum",
|
9522
|
+
allowedValues: ["REPLACE", "COPY"]
|
9523
|
+
}
|
9524
|
+
}
|
9525
|
+
};
|
9508
9526
|
const comp15 = {
|
9509
9527
|
parameterPath: "comp",
|
9510
9528
|
mapper: {
|
@@ -11985,7 +12003,8 @@ const copyFromURLOperationSpec = {
|
|
11985
12003
|
legalHold1,
|
11986
12004
|
xMsRequiresSync,
|
11987
12005
|
sourceContentMD5,
|
11988
|
-
copySourceAuthorization
|
12006
|
+
copySourceAuthorization,
|
12007
|
+
copySourceTags
|
11989
12008
|
],
|
11990
12009
|
isXML: true,
|
11991
12010
|
serializer: xmlSerializer$3
|
@@ -12525,6 +12544,8 @@ const getPageRangesOperationSpec = {
|
|
12525
12544
|
},
|
12526
12545
|
queryParameters: [
|
12527
12546
|
timeoutInSeconds,
|
12547
|
+
marker,
|
12548
|
+
maxPageSize,
|
12528
12549
|
snapshot,
|
12529
12550
|
comp20
|
12530
12551
|
],
|
@@ -12559,6 +12580,8 @@ const getPageRangesDiffOperationSpec = {
|
|
12559
12580
|
},
|
12560
12581
|
queryParameters: [
|
12561
12582
|
timeoutInSeconds,
|
12583
|
+
marker,
|
12584
|
+
maxPageSize,
|
12562
12585
|
snapshot,
|
12563
12586
|
comp20,
|
12564
12587
|
prevsnapshot
|
@@ -13128,6 +13151,7 @@ const putBlobFromUrlOperationSpec = {
|
|
13128
13151
|
blobTagsString,
|
13129
13152
|
sourceContentMD5,
|
13130
13153
|
copySourceAuthorization,
|
13154
|
+
copySourceTags,
|
13131
13155
|
transactionalContentMD5,
|
13132
13156
|
blobType2,
|
13133
13157
|
copySourceBlobProperties
|
@@ -13301,8 +13325,8 @@ const logger = logger$1.createClientLogger("storage-blob");
|
|
13301
13325
|
|
13302
13326
|
// Copyright (c) Microsoft Corporation.
|
13303
13327
|
// Licensed under the MIT license.
|
13304
|
-
const SDK_VERSION = "12.
|
13305
|
-
const SERVICE_VERSION = "2021-
|
13328
|
+
const SDK_VERSION = "12.10.0-beta.1";
|
13329
|
+
const SERVICE_VERSION = "2021-06-08";
|
13306
13330
|
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
13307
13331
|
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
13308
13332
|
const BLOCK_BLOB_MAX_BLOCKS = 50000;
|
@@ -13495,6 +13519,7 @@ const StorageBlobLoggingAllowedQueryParameters = [
|
|
13495
13519
|
"snapshot",
|
13496
13520
|
];
|
13497
13521
|
const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
|
13522
|
+
const BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption";
|
13498
13523
|
|
13499
13524
|
// Copyright (c) Microsoft Corporation.
|
13500
13525
|
/**
|
@@ -14287,6 +14312,48 @@ function ProcessBlobPrefixes(blobPrefixesInXML) {
|
|
14287
14312
|
}
|
14288
14313
|
return blobPrefixes;
|
14289
14314
|
}
|
14315
|
+
function* ExtractPageRangeInfoItems(getPageRangesSegment) {
|
14316
|
+
let pageRange = [];
|
14317
|
+
let clearRange = [];
|
14318
|
+
if (getPageRangesSegment.pageRange)
|
14319
|
+
pageRange = getPageRangesSegment.pageRange;
|
14320
|
+
if (getPageRangesSegment.clearRange)
|
14321
|
+
clearRange = getPageRangesSegment.clearRange;
|
14322
|
+
let pageRangeIndex = 0;
|
14323
|
+
let clearRangeIndex = 0;
|
14324
|
+
while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) {
|
14325
|
+
if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) {
|
14326
|
+
yield {
|
14327
|
+
start: pageRange[pageRangeIndex].start,
|
14328
|
+
end: pageRange[pageRangeIndex].end,
|
14329
|
+
isClear: false,
|
14330
|
+
};
|
14331
|
+
++pageRangeIndex;
|
14332
|
+
}
|
14333
|
+
else {
|
14334
|
+
yield {
|
14335
|
+
start: clearRange[clearRangeIndex].start,
|
14336
|
+
end: clearRange[clearRangeIndex].end,
|
14337
|
+
isClear: true,
|
14338
|
+
};
|
14339
|
+
++clearRangeIndex;
|
14340
|
+
}
|
14341
|
+
}
|
14342
|
+
for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) {
|
14343
|
+
yield {
|
14344
|
+
start: pageRange[pageRangeIndex].start,
|
14345
|
+
end: pageRange[pageRangeIndex].end,
|
14346
|
+
isClear: false,
|
14347
|
+
};
|
14348
|
+
}
|
14349
|
+
for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) {
|
14350
|
+
yield {
|
14351
|
+
start: clearRange[clearRangeIndex].start,
|
14352
|
+
end: clearRange[clearRangeIndex].end,
|
14353
|
+
isClear: true,
|
14354
|
+
};
|
14355
|
+
}
|
14356
|
+
}
|
14290
14357
|
|
14291
14358
|
// Copyright (c) Microsoft Corporation.
|
14292
14359
|
/**
|
@@ -15242,7 +15309,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
15242
15309
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
15243
15310
|
*/
|
15244
15311
|
const packageName = "azure-storage-blob";
|
15245
|
-
const packageVersion = "12.
|
15312
|
+
const packageVersion = "12.10.0-beta.1";
|
15246
15313
|
class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
15247
15314
|
/**
|
15248
15315
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -15268,7 +15335,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
15268
15335
|
// Parameter assignments
|
15269
15336
|
this.url = url;
|
15270
15337
|
// Assigning values to Constant parameters
|
15271
|
-
this.version = options.version || "2021-
|
15338
|
+
this.version = options.version || "2021-06-08";
|
15272
15339
|
}
|
15273
15340
|
}
|
15274
15341
|
|
@@ -17350,22 +17417,6 @@ const AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]);
|
|
17350
17417
|
const AVRO_CODEC_KEY = "avro.codec";
|
17351
17418
|
const AVRO_SCHEMA_KEY = "avro.schema";
|
17352
17419
|
|
17353
|
-
// Copyright (c) Microsoft Corporation.
|
17354
|
-
// Licensed under the MIT license.
|
17355
|
-
function arraysEqual(a, b) {
|
17356
|
-
if (a === b)
|
17357
|
-
return true;
|
17358
|
-
if (a == null || b == null)
|
17359
|
-
return false;
|
17360
|
-
if (a.length != b.length)
|
17361
|
-
return false;
|
17362
|
-
for (let i = 0; i < a.length; ++i) {
|
17363
|
-
if (a[i] !== b[i])
|
17364
|
-
return false;
|
17365
|
-
}
|
17366
|
-
return true;
|
17367
|
-
}
|
17368
|
-
|
17369
17420
|
// Copyright (c) Microsoft Corporation.
|
17370
17421
|
// Licensed under the MIT license.
|
17371
17422
|
class AvroParser {
|
@@ -17378,7 +17429,7 @@ class AvroParser {
|
|
17378
17429
|
*/
|
17379
17430
|
static async readFixedBytes(stream, length, options = {}) {
|
17380
17431
|
const bytes = await stream.read(length, { abortSignal: options.abortSignal });
|
17381
|
-
if (bytes.length
|
17432
|
+
if (bytes.length !== length) {
|
17382
17433
|
throw new Error("Hit stream end.");
|
17383
17434
|
}
|
17384
17435
|
return bytes;
|
@@ -17408,6 +17459,7 @@ class AvroParser {
|
|
17408
17459
|
} while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers
|
17409
17460
|
if (haveMoreByte) {
|
17410
17461
|
// Switch to float arithmetic
|
17462
|
+
// eslint-disable-next-line no-self-assign
|
17411
17463
|
zigZagEncoded = zigZagEncoded;
|
17412
17464
|
significanceInFloat = 268435456; // 2 ** 28.
|
17413
17465
|
do {
|
@@ -17434,10 +17486,10 @@ class AvroParser {
|
|
17434
17486
|
}
|
17435
17487
|
static async readBoolean(stream, options = {}) {
|
17436
17488
|
const b = await AvroParser.readByte(stream, options);
|
17437
|
-
if (b
|
17489
|
+
if (b === 1) {
|
17438
17490
|
return true;
|
17439
17491
|
}
|
17440
|
-
else if (b
|
17492
|
+
else if (b === 0) {
|
17441
17493
|
return false;
|
17442
17494
|
}
|
17443
17495
|
else {
|
@@ -17459,16 +17511,10 @@ class AvroParser {
|
|
17459
17511
|
if (size < 0) {
|
17460
17512
|
throw new Error("Bytes size was negative.");
|
17461
17513
|
}
|
17462
|
-
return
|
17514
|
+
return stream.read(size, { abortSignal: options.abortSignal });
|
17463
17515
|
}
|
17464
17516
|
static async readString(stream, options = {}) {
|
17465
17517
|
const u8arr = await AvroParser.readBytes(stream, options);
|
17466
|
-
// polyfill TextDecoder to be backward compatible with older
|
17467
|
-
// nodejs that doesn't expose TextDecoder as a global variable
|
17468
|
-
if (typeof TextDecoder === "undefined" && typeof require !== "undefined") {
|
17469
|
-
global.TextDecoder = require("util").TextDecoder;
|
17470
|
-
}
|
17471
|
-
// FUTURE: need TextDecoder polyfill for IE
|
17472
17518
|
const utf8decoder = new TextDecoder();
|
17473
17519
|
return utf8decoder.decode(u8arr);
|
17474
17520
|
}
|
@@ -17479,8 +17525,8 @@ class AvroParser {
|
|
17479
17525
|
return { key, value };
|
17480
17526
|
}
|
17481
17527
|
static async readMap(stream, readItemMethod, options = {}) {
|
17482
|
-
const readPairMethod =
|
17483
|
-
return
|
17528
|
+
const readPairMethod = (s, opts = {}) => {
|
17529
|
+
return AvroParser.readMapPair(s, readItemMethod, opts);
|
17484
17530
|
};
|
17485
17531
|
const pairs = await AvroParser.readArray(stream, readPairMethod, options);
|
17486
17532
|
const dict = {};
|
@@ -17491,7 +17537,7 @@ class AvroParser {
|
|
17491
17537
|
}
|
17492
17538
|
static async readArray(stream, readItemMethod, options = {}) {
|
17493
17539
|
const items = [];
|
17494
|
-
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)) {
|
17495
17541
|
if (count < 0) {
|
17496
17542
|
// Ignore block sizes
|
17497
17543
|
await AvroParser.readLong(stream, options);
|
@@ -17514,6 +17560,17 @@ var AvroComplex;
|
|
17514
17560
|
AvroComplex["UNION"] = "union";
|
17515
17561
|
AvroComplex["FIXED"] = "fixed";
|
17516
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 = {}));
|
17517
17574
|
class AvroType {
|
17518
17575
|
/**
|
17519
17576
|
* Determines the AvroType from the Avro Schema.
|
@@ -17553,7 +17610,9 @@ class AvroType {
|
|
17553
17610
|
try {
|
17554
17611
|
return AvroType.fromStringSchema(type);
|
17555
17612
|
}
|
17556
|
-
catch (err) {
|
17613
|
+
catch (err) {
|
17614
|
+
// eslint-disable-line no-empty
|
17615
|
+
}
|
17557
17616
|
switch (type) {
|
17558
17617
|
case AvroComplex.RECORD:
|
17559
17618
|
if (schema.aliases) {
|
@@ -17562,6 +17621,7 @@ class AvroType {
|
|
17562
17621
|
if (!schema.name) {
|
17563
17622
|
throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`);
|
17564
17623
|
}
|
17624
|
+
// eslint-disable-next-line no-case-declarations
|
17565
17625
|
const fields = {};
|
17566
17626
|
if (!schema.fields) {
|
17567
17627
|
throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`);
|
@@ -17590,40 +17650,29 @@ class AvroType {
|
|
17590
17650
|
}
|
17591
17651
|
}
|
17592
17652
|
}
|
17593
|
-
var AvroPrimitive;
|
17594
|
-
(function (AvroPrimitive) {
|
17595
|
-
AvroPrimitive["NULL"] = "null";
|
17596
|
-
AvroPrimitive["BOOLEAN"] = "boolean";
|
17597
|
-
AvroPrimitive["INT"] = "int";
|
17598
|
-
AvroPrimitive["LONG"] = "long";
|
17599
|
-
AvroPrimitive["FLOAT"] = "float";
|
17600
|
-
AvroPrimitive["DOUBLE"] = "double";
|
17601
|
-
AvroPrimitive["BYTES"] = "bytes";
|
17602
|
-
AvroPrimitive["STRING"] = "string";
|
17603
|
-
})(AvroPrimitive || (AvroPrimitive = {}));
|
17604
17653
|
class AvroPrimitiveType extends AvroType {
|
17605
17654
|
constructor(primitive) {
|
17606
17655
|
super();
|
17607
17656
|
this._primitive = primitive;
|
17608
17657
|
}
|
17609
|
-
|
17658
|
+
read(stream, options = {}) {
|
17610
17659
|
switch (this._primitive) {
|
17611
17660
|
case AvroPrimitive.NULL:
|
17612
|
-
return
|
17661
|
+
return AvroParser.readNull();
|
17613
17662
|
case AvroPrimitive.BOOLEAN:
|
17614
|
-
return
|
17663
|
+
return AvroParser.readBoolean(stream, options);
|
17615
17664
|
case AvroPrimitive.INT:
|
17616
|
-
return
|
17665
|
+
return AvroParser.readInt(stream, options);
|
17617
17666
|
case AvroPrimitive.LONG:
|
17618
|
-
return
|
17667
|
+
return AvroParser.readLong(stream, options);
|
17619
17668
|
case AvroPrimitive.FLOAT:
|
17620
|
-
return
|
17669
|
+
return AvroParser.readFloat(stream, options);
|
17621
17670
|
case AvroPrimitive.DOUBLE:
|
17622
|
-
return
|
17671
|
+
return AvroParser.readDouble(stream, options);
|
17623
17672
|
case AvroPrimitive.BYTES:
|
17624
|
-
return
|
17673
|
+
return AvroParser.readBytes(stream, options);
|
17625
17674
|
case AvroPrimitive.STRING:
|
17626
|
-
return
|
17675
|
+
return AvroParser.readString(stream, options);
|
17627
17676
|
default:
|
17628
17677
|
throw new Error("Unknown Avro Primitive");
|
17629
17678
|
}
|
@@ -17646,7 +17695,7 @@ class AvroUnionType extends AvroType {
|
|
17646
17695
|
}
|
17647
17696
|
async read(stream, options = {}) {
|
17648
17697
|
const typeIndex = await AvroParser.readInt(stream, options);
|
17649
|
-
return
|
17698
|
+
return this._types[typeIndex].read(stream, options);
|
17650
17699
|
}
|
17651
17700
|
}
|
17652
17701
|
class AvroMapType extends AvroType {
|
@@ -17654,11 +17703,11 @@ class AvroMapType extends AvroType {
|
|
17654
17703
|
super();
|
17655
17704
|
this._itemType = itemType;
|
17656
17705
|
}
|
17657
|
-
|
17658
|
-
const readItemMethod =
|
17659
|
-
return
|
17706
|
+
read(stream, options = {}) {
|
17707
|
+
const readItemMethod = (s, opts) => {
|
17708
|
+
return this._itemType.read(s, opts);
|
17660
17709
|
};
|
17661
|
-
return
|
17710
|
+
return AvroParser.readMap(stream, readItemMethod, options);
|
17662
17711
|
}
|
17663
17712
|
}
|
17664
17713
|
class AvroRecordType extends AvroType {
|
@@ -17671,7 +17720,7 @@ class AvroRecordType extends AvroType {
|
|
17671
17720
|
const record = {};
|
17672
17721
|
record["$schema"] = this._name;
|
17673
17722
|
for (const key in this._fields) {
|
17674
|
-
if (
|
17723
|
+
if (Object.prototype.hasOwnProperty.call(this._fields, key)) {
|
17675
17724
|
record[key] = await this._fields[key].read(stream, options);
|
17676
17725
|
}
|
17677
17726
|
}
|
@@ -17679,6 +17728,23 @@ class AvroRecordType extends AvroType {
|
|
17679
17728
|
}
|
17680
17729
|
}
|
17681
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
|
+
|
17682
17748
|
// Copyright (c) Microsoft Corporation.
|
17683
17749
|
class AvroReader {
|
17684
17750
|
constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) {
|
@@ -17709,7 +17775,7 @@ class AvroReader {
|
|
17709
17775
|
});
|
17710
17776
|
// Validate codec
|
17711
17777
|
const codec = this._metadata[AVRO_CODEC_KEY];
|
17712
|
-
if (!(codec
|
17778
|
+
if (!(codec === undefined || codec === null || codec === "null")) {
|
17713
17779
|
throw new Error("Codecs are not supported");
|
17714
17780
|
}
|
17715
17781
|
// The 16-byte, randomly-generated sync marker for this file.
|
@@ -17719,7 +17785,7 @@ class AvroReader {
|
|
17719
17785
|
// Parse the schema
|
17720
17786
|
const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
|
17721
17787
|
this._itemType = AvroType.fromSchema(schema);
|
17722
|
-
if (this._blockOffset
|
17788
|
+
if (this._blockOffset === 0) {
|
17723
17789
|
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
|
17724
17790
|
}
|
17725
17791
|
this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
|
@@ -17749,7 +17815,7 @@ class AvroReader {
|
|
17749
17815
|
}));
|
17750
17816
|
this._itemsRemainingInBlock--;
|
17751
17817
|
this._objectIndex++;
|
17752
|
-
if (this._itemsRemainingInBlock
|
17818
|
+
if (this._itemsRemainingInBlock === 0) {
|
17753
17819
|
const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
|
17754
17820
|
abortSignal: options.abortSignal,
|
17755
17821
|
}));
|
@@ -17824,6 +17890,7 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17824
17890
|
else {
|
17825
17891
|
// register callback to wait for enough data to read
|
17826
17892
|
return new Promise((resolve, reject) => {
|
17893
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
17827
17894
|
const cleanUp = () => {
|
17828
17895
|
this._readable.removeListener("readable", readableCallback);
|
17829
17896
|
this._readable.removeListener("error", rejectCallback);
|
@@ -17834,12 +17901,12 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17834
17901
|
}
|
17835
17902
|
};
|
17836
17903
|
const readableCallback = () => {
|
17837
|
-
const
|
17838
|
-
if (
|
17839
|
-
this._position +=
|
17904
|
+
const callbackChunk = this._readable.read(size);
|
17905
|
+
if (callbackChunk) {
|
17906
|
+
this._position += callbackChunk.length;
|
17840
17907
|
cleanUp();
|
17841
|
-
//
|
17842
|
-
resolve(this.toUint8Array(
|
17908
|
+
// callbackChunk.length maybe less than desired size if the stream ends.
|
17909
|
+
resolve(this.toUint8Array(callbackChunk));
|
17843
17910
|
}
|
17844
17911
|
};
|
17845
17912
|
const rejectCallback = () => {
|
@@ -17857,6 +17924,7 @@ class AvroReadableFromStream extends AvroReadable {
|
|
17857
17924
|
if (options.abortSignal) {
|
17858
17925
|
options.abortSignal.addEventListener("abort", abortHandler);
|
17859
17926
|
}
|
17927
|
+
/* eslint-enable @typescript-eslint/no-use-before-define */
|
17860
17928
|
});
|
17861
17929
|
}
|
17862
17930
|
}
|
@@ -19530,7 +19598,8 @@ class BlobClient extends StorageClient {
|
|
19530
19598
|
return false;
|
19531
19599
|
}
|
19532
19600
|
else if (e.statusCode === 409 &&
|
19533
|
-
e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg
|
19601
|
+
(e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg ||
|
19602
|
+
e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) {
|
19534
19603
|
// Expected exception when checking blob existence
|
19535
19604
|
return true;
|
19536
19605
|
}
|
@@ -19943,7 +20012,7 @@ class BlobClient extends StorageClient {
|
|
19943
20012
|
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
|
19944
20013
|
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
|
19945
20014
|
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
|
19946
|
-
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
|
20015
|
+
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions)));
|
19947
20016
|
}
|
19948
20017
|
catch (e) {
|
19949
20018
|
span.setStatus({
|
@@ -20666,12 +20735,13 @@ class BlockBlobClient extends BlobClient {
|
|
20666
20735
|
if (!coreHttp.isNode) {
|
20667
20736
|
throw new Error("This operation currently is only supported in Node.js.");
|
20668
20737
|
}
|
20738
|
+
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
20669
20739
|
const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: {
|
20670
20740
|
queryType: "SQL",
|
20671
20741
|
expression: query,
|
20672
20742
|
inputSerialization: toQuerySerialization(options.inputTextConfiguration),
|
20673
20743
|
outputSerialization: toQuerySerialization(options.outputTextConfiguration),
|
20674
|
-
}, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
20744
|
+
}, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));
|
20675
20745
|
return new BlobQueryResponse(response, {
|
20676
20746
|
abortSignal: options.abortSignal,
|
20677
20747
|
onProgress: options.onProgress,
|
@@ -20767,7 +20837,7 @@ class BlockBlobClient extends BlobClient {
|
|
20767
20837
|
sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,
|
20768
20838
|
sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince,
|
20769
20839
|
sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions,
|
20770
|
-
}, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }), convertTracingToRequestOptionsBase(updatedOptions)));
|
20840
|
+
}, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags }), convertTracingToRequestOptionsBase(updatedOptions)));
|
20771
20841
|
}
|
20772
20842
|
catch (e) {
|
20773
20843
|
span.setStatus({
|
@@ -21463,6 +21533,183 @@ class PageBlobClient extends BlobClient {
|
|
21463
21533
|
span.end();
|
21464
21534
|
}
|
21465
21535
|
}
|
21536
|
+
/**
|
21537
|
+
* getPageRangesSegment returns a single segment of page ranges starting from the
|
21538
|
+
* specified Marker. Use an empty Marker to start enumeration from the beginning.
|
21539
|
+
* After getting a segment, process it, and then call getPageRangesSegment again
|
21540
|
+
* (passing the the previously-returned Marker) to get the next segment.
|
21541
|
+
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
21542
|
+
*
|
21543
|
+
* @param offset - Starting byte position of the page ranges.
|
21544
|
+
* @param count - Number of bytes to get.
|
21545
|
+
* @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
|
21546
|
+
* @param options - Options to PageBlob Get Page Ranges Segment operation.
|
21547
|
+
*/
|
21548
|
+
async listPageRangesSegment(offset = 0, count, marker, options = {}) {
|
21549
|
+
var _a;
|
21550
|
+
const { span, updatedOptions } = createSpan("PageBlobClient-getPageRangesSegment", options);
|
21551
|
+
try {
|
21552
|
+
return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }), marker: marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
|
21553
|
+
}
|
21554
|
+
catch (e) {
|
21555
|
+
span.setStatus({
|
21556
|
+
code: coreTracing.SpanStatusCode.ERROR,
|
21557
|
+
message: e.message,
|
21558
|
+
});
|
21559
|
+
throw e;
|
21560
|
+
}
|
21561
|
+
finally {
|
21562
|
+
span.end();
|
21563
|
+
}
|
21564
|
+
}
|
21565
|
+
/**
|
21566
|
+
* Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel}
|
21567
|
+
*
|
21568
|
+
* @param offset - Starting byte position of the page ranges.
|
21569
|
+
* @param count - Number of bytes to get.
|
21570
|
+
* @param marker - A string value that identifies the portion of
|
21571
|
+
* the get of page ranges to be returned with the next getting operation. The
|
21572
|
+
* operation returns the ContinuationToken value within the response body if the
|
21573
|
+
* getting operation did not return all page ranges remaining within the current page.
|
21574
|
+
* The ContinuationToken value can be used as the value for
|
21575
|
+
* the marker parameter in a subsequent call to request the next page of get
|
21576
|
+
* items. The marker value is opaque to the client.
|
21577
|
+
* @param options - Options to List Page Ranges operation.
|
21578
|
+
*/
|
21579
|
+
listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
|
21580
|
+
return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() {
|
21581
|
+
let getPageRangeItemSegmentsResponse;
|
21582
|
+
if (!!marker || marker === undefined) {
|
21583
|
+
do {
|
21584
|
+
getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker, options));
|
21585
|
+
marker = getPageRangeItemSegmentsResponse.continuationToken;
|
21586
|
+
yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));
|
21587
|
+
} while (marker);
|
21588
|
+
}
|
21589
|
+
});
|
21590
|
+
}
|
21591
|
+
/**
|
21592
|
+
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
21593
|
+
*
|
21594
|
+
* @param offset - Starting byte position of the page ranges.
|
21595
|
+
* @param count - Number of bytes to get.
|
21596
|
+
* @param options - Options to List Page Ranges operation.
|
21597
|
+
*/
|
21598
|
+
listPageRangeItems(offset = 0, count, options = {}) {
|
21599
|
+
return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1() {
|
21600
|
+
var e_1, _a;
|
21601
|
+
let marker;
|
21602
|
+
try {
|
21603
|
+
for (var _b = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
|
21604
|
+
const getPageRangesSegment = _c.value;
|
21605
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
|
21606
|
+
}
|
21607
|
+
}
|
21608
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
21609
|
+
finally {
|
21610
|
+
try {
|
21611
|
+
if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
|
21612
|
+
}
|
21613
|
+
finally { if (e_1) throw e_1.error; }
|
21614
|
+
}
|
21615
|
+
});
|
21616
|
+
}
|
21617
|
+
/**
|
21618
|
+
* Returns an async iterable iterator to list of page ranges for a page blob.
|
21619
|
+
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
21620
|
+
*
|
21621
|
+
* .byPage() returns an async iterable iterator to list of page ranges for a page blob.
|
21622
|
+
*
|
21623
|
+
* Example using `for await` syntax:
|
21624
|
+
*
|
21625
|
+
* ```js
|
21626
|
+
* // Get the pageBlobClient before you run these snippets,
|
21627
|
+
* // Can be obtained from `blobServiceClient.getContainerClient("<your-container-name>").getPageBlobClient("<your-blob-name>");`
|
21628
|
+
* let i = 1;
|
21629
|
+
* for await (const pageRange of pageBlobClient.listPageRanges()) {
|
21630
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21631
|
+
* }
|
21632
|
+
* ```
|
21633
|
+
*
|
21634
|
+
* Example using `iter.next()`:
|
21635
|
+
*
|
21636
|
+
* ```js
|
21637
|
+
* let i = 1;
|
21638
|
+
* let iter = pageBlobClient.listPageRanges();
|
21639
|
+
* let pageRangeItem = await iter.next();
|
21640
|
+
* while (!pageRangeItem.done) {
|
21641
|
+
* console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);
|
21642
|
+
* pageRangeItem = await iter.next();
|
21643
|
+
* }
|
21644
|
+
* ```
|
21645
|
+
*
|
21646
|
+
* Example using `byPage()`:
|
21647
|
+
*
|
21648
|
+
* ```js
|
21649
|
+
* // passing optional maxPageSize in the page settings
|
21650
|
+
* let i = 1;
|
21651
|
+
* for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) {
|
21652
|
+
* for (const pageRange of response) {
|
21653
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21654
|
+
* }
|
21655
|
+
* }
|
21656
|
+
* ```
|
21657
|
+
*
|
21658
|
+
* Example using paging with a marker:
|
21659
|
+
*
|
21660
|
+
* ```js
|
21661
|
+
* let i = 1;
|
21662
|
+
* let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 });
|
21663
|
+
* let response = (await iterator.next()).value;
|
21664
|
+
*
|
21665
|
+
* // Prints 2 page ranges
|
21666
|
+
* for (const pageRange of response) {
|
21667
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21668
|
+
* }
|
21669
|
+
*
|
21670
|
+
* // Gets next marker
|
21671
|
+
* let marker = response.continuationToken;
|
21672
|
+
*
|
21673
|
+
* // Passing next marker as continuationToken
|
21674
|
+
*
|
21675
|
+
* iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 });
|
21676
|
+
* response = (await iterator.next()).value;
|
21677
|
+
*
|
21678
|
+
* // Prints 10 page ranges
|
21679
|
+
* for (const blob of response) {
|
21680
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21681
|
+
* }
|
21682
|
+
* ```
|
21683
|
+
* @param offset - Starting byte position of the page ranges.
|
21684
|
+
* @param count - Number of bytes to get.
|
21685
|
+
* @param options - Options to the Page Blob Get Ranges operation.
|
21686
|
+
* @returns An asyncIterableIterator that supports paging.
|
21687
|
+
*/
|
21688
|
+
listPageRanges(offset = 0, count, options = {}) {
|
21689
|
+
options.conditions = options.conditions || {};
|
21690
|
+
// AsyncIterableIterator to iterate over blobs
|
21691
|
+
const iter = this.listPageRangeItems(offset, count, options);
|
21692
|
+
return {
|
21693
|
+
/**
|
21694
|
+
* The next method, part of the iteration protocol
|
21695
|
+
*/
|
21696
|
+
next() {
|
21697
|
+
return iter.next();
|
21698
|
+
},
|
21699
|
+
/**
|
21700
|
+
* The connection to the async iterator, part of the iteration protocol
|
21701
|
+
*/
|
21702
|
+
[Symbol.asyncIterator]() {
|
21703
|
+
return this;
|
21704
|
+
},
|
21705
|
+
/**
|
21706
|
+
* Return an AsyncIterableIterator that works a page at a time
|
21707
|
+
*/
|
21708
|
+
byPage: (settings = {}) => {
|
21709
|
+
return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
|
21710
|
+
},
|
21711
|
+
};
|
21712
|
+
}
|
21466
21713
|
/**
|
21467
21714
|
* Gets the collection of page ranges that differ between a specified snapshot and this page blob.
|
21468
21715
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
@@ -21493,6 +21740,192 @@ class PageBlobClient extends BlobClient {
|
|
21493
21740
|
span.end();
|
21494
21741
|
}
|
21495
21742
|
}
|
21743
|
+
/**
|
21744
|
+
* getPageRangesDiffSegment returns a single segment of page ranges starting from the
|
21745
|
+
* specified Marker for difference between previous snapshot and the target page blob.
|
21746
|
+
* Use an empty Marker to start enumeration from the beginning.
|
21747
|
+
* After getting a segment, process it, and then call getPageRangesDiffSegment again
|
21748
|
+
* (passing the the previously-returned Marker) to get the next segment.
|
21749
|
+
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
21750
|
+
*
|
21751
|
+
* @param offset - Starting byte position of the page ranges.
|
21752
|
+
* @param count - Number of bytes to get.
|
21753
|
+
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
21754
|
+
* @param marker - A string value that identifies the portion of the get to be returned with the next get operation.
|
21755
|
+
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
21756
|
+
*/
|
21757
|
+
async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options) {
|
21758
|
+
var _a;
|
21759
|
+
const { span, updatedOptions } = createSpan("PageBlobClient-getPageRangesDiffSegment", options);
|
21760
|
+
try {
|
21761
|
+
return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshotOrUrl, range: rangeToString({
|
21762
|
+
offset: offset,
|
21763
|
+
count: count,
|
21764
|
+
}), marker: marker, maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
|
21765
|
+
}
|
21766
|
+
catch (e) {
|
21767
|
+
span.setStatus({
|
21768
|
+
code: coreTracing.SpanStatusCode.ERROR,
|
21769
|
+
message: e.message,
|
21770
|
+
});
|
21771
|
+
throw e;
|
21772
|
+
}
|
21773
|
+
finally {
|
21774
|
+
span.end();
|
21775
|
+
}
|
21776
|
+
}
|
21777
|
+
/**
|
21778
|
+
* Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel}
|
21779
|
+
*
|
21780
|
+
*
|
21781
|
+
* @param offset - Starting byte position of the page ranges.
|
21782
|
+
* @param count - Number of bytes to get.
|
21783
|
+
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
21784
|
+
* @param marker - A string value that identifies the portion of
|
21785
|
+
* the get of page ranges to be returned with the next getting operation. The
|
21786
|
+
* operation returns the ContinuationToken value within the response body if the
|
21787
|
+
* getting operation did not return all page ranges remaining within the current page.
|
21788
|
+
* The ContinuationToken value can be used as the value for
|
21789
|
+
* the marker parameter in a subsequent call to request the next page of get
|
21790
|
+
* items. The marker value is opaque to the client.
|
21791
|
+
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
21792
|
+
*/
|
21793
|
+
listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
|
21794
|
+
return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() {
|
21795
|
+
let getPageRangeItemSegmentsResponse;
|
21796
|
+
if (!!marker || marker === undefined) {
|
21797
|
+
do {
|
21798
|
+
getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options));
|
21799
|
+
marker = getPageRangeItemSegmentsResponse.continuationToken;
|
21800
|
+
yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));
|
21801
|
+
} while (marker);
|
21802
|
+
}
|
21803
|
+
});
|
21804
|
+
}
|
21805
|
+
/**
|
21806
|
+
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
21807
|
+
*
|
21808
|
+
* @param offset - Starting byte position of the page ranges.
|
21809
|
+
* @param count - Number of bytes to get.
|
21810
|
+
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
21811
|
+
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
21812
|
+
*/
|
21813
|
+
listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
|
21814
|
+
return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() {
|
21815
|
+
var e_2, _a;
|
21816
|
+
let marker;
|
21817
|
+
try {
|
21818
|
+
for (var _b = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
|
21819
|
+
const getPageRangesSegment = _c.value;
|
21820
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
|
21821
|
+
}
|
21822
|
+
}
|
21823
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
21824
|
+
finally {
|
21825
|
+
try {
|
21826
|
+
if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
|
21827
|
+
}
|
21828
|
+
finally { if (e_2) throw e_2.error; }
|
21829
|
+
}
|
21830
|
+
});
|
21831
|
+
}
|
21832
|
+
/**
|
21833
|
+
* Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
|
21834
|
+
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|
21835
|
+
*
|
21836
|
+
* .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
|
21837
|
+
*
|
21838
|
+
* Example using `for await` syntax:
|
21839
|
+
*
|
21840
|
+
* ```js
|
21841
|
+
* // Get the pageBlobClient before you run these snippets,
|
21842
|
+
* // Can be obtained from `blobServiceClient.getContainerClient("<your-container-name>").getPageBlobClient("<your-blob-name>");`
|
21843
|
+
* let i = 1;
|
21844
|
+
* for await (const pageRange of pageBlobClient.listPageRangesDiff()) {
|
21845
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21846
|
+
* }
|
21847
|
+
* ```
|
21848
|
+
*
|
21849
|
+
* Example using `iter.next()`:
|
21850
|
+
*
|
21851
|
+
* ```js
|
21852
|
+
* let i = 1;
|
21853
|
+
* let iter = pageBlobClient.listPageRangesDiff();
|
21854
|
+
* let pageRangeItem = await iter.next();
|
21855
|
+
* while (!pageRangeItem.done) {
|
21856
|
+
* console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);
|
21857
|
+
* pageRangeItem = await iter.next();
|
21858
|
+
* }
|
21859
|
+
* ```
|
21860
|
+
*
|
21861
|
+
* Example using `byPage()`:
|
21862
|
+
*
|
21863
|
+
* ```js
|
21864
|
+
* // passing optional maxPageSize in the page settings
|
21865
|
+
* let i = 1;
|
21866
|
+
* for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) {
|
21867
|
+
* for (const pageRange of response) {
|
21868
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21869
|
+
* }
|
21870
|
+
* }
|
21871
|
+
* ```
|
21872
|
+
*
|
21873
|
+
* Example using paging with a marker:
|
21874
|
+
*
|
21875
|
+
* ```js
|
21876
|
+
* let i = 1;
|
21877
|
+
* let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 });
|
21878
|
+
* let response = (await iterator.next()).value;
|
21879
|
+
*
|
21880
|
+
* // Prints 2 page ranges
|
21881
|
+
* for (const pageRange of response) {
|
21882
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21883
|
+
* }
|
21884
|
+
*
|
21885
|
+
* // Gets next marker
|
21886
|
+
* let marker = response.continuationToken;
|
21887
|
+
*
|
21888
|
+
* // Passing next marker as continuationToken
|
21889
|
+
*
|
21890
|
+
* iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 });
|
21891
|
+
* response = (await iterator.next()).value;
|
21892
|
+
*
|
21893
|
+
* // Prints 10 page ranges
|
21894
|
+
* for (const blob of response) {
|
21895
|
+
* console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
|
21896
|
+
* }
|
21897
|
+
* ```
|
21898
|
+
* @param offset - Starting byte position of the page ranges.
|
21899
|
+
* @param count - Number of bytes to get.
|
21900
|
+
* @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
|
21901
|
+
* @param options - Options to the Page Blob Get Ranges operation.
|
21902
|
+
* @returns An asyncIterableIterator that supports paging.
|
21903
|
+
*/
|
21904
|
+
listPageRangesDiff(offset, count, prevSnapshot, options = {}) {
|
21905
|
+
options.conditions = options.conditions || {};
|
21906
|
+
// AsyncIterableIterator to iterate over blobs
|
21907
|
+
const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options));
|
21908
|
+
return {
|
21909
|
+
/**
|
21910
|
+
* The next method, part of the iteration protocol
|
21911
|
+
*/
|
21912
|
+
next() {
|
21913
|
+
return iter.next();
|
21914
|
+
},
|
21915
|
+
/**
|
21916
|
+
* The connection to the async iterator, part of the iteration protocol
|
21917
|
+
*/
|
21918
|
+
[Symbol.asyncIterator]() {
|
21919
|
+
return this;
|
21920
|
+
},
|
21921
|
+
/**
|
21922
|
+
* Return an AsyncIterableIterator that works a page at a time
|
21923
|
+
*/
|
21924
|
+
byPage: (settings = {}) => {
|
21925
|
+
return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
|
21926
|
+
},
|
21927
|
+
};
|
21928
|
+
}
|
21496
21929
|
/**
|
21497
21930
|
* Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks.
|
21498
21931
|
* @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
|