@azure/storage-file-share 12.23.0-alpha.20240112.1 → 12.23.0-alpha.20240124.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/dist/index.js +270 -472
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatchClient.js +1 -3
- package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobLeaseClient.js +30 -35
- package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +81 -80
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +193 -302
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +132 -165
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/PageBlobRangeResponse.js +3 -10
- package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/Pipeline.js +10 -19
- package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageContextClient.js +1 -1
- package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClient.js +3 -7
- package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +12 -10
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
- package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +3 -6
- package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +11 -24
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-file-share/src/Clients.js +194 -367
- package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
- package/dist-esm/storage-file-share/src/ShareServiceClient.js +43 -43
- package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/StorageContextClient.js +1 -1
- package/dist-esm/storage-file-share/src/StorageContextClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js +3 -7
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/utils.common.js +10 -26
- package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -1
- package/package.json +1 -1
@@ -1,5 +1,6 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT license.
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
3
4
|
import { getDefaultProxySettings, } from "@azure/core-rest-pipeline";
|
4
5
|
import { isTokenCredential } from "@azure/core-auth";
|
5
6
|
import { isNode } from "@azure/core-util";
|
@@ -216,13 +217,11 @@ export class BlobClient extends StorageClient {
|
|
216
217
|
options.conditions = options.conditions || {};
|
217
218
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
218
219
|
return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => {
|
220
|
+
var _a;
|
219
221
|
const res = assertResponse(await this.blobContext.download({
|
220
222
|
abortSignal: options.abortSignal,
|
221
223
|
leaseAccessConditions: options.conditions,
|
222
|
-
modifiedAccessConditions: {
|
223
|
-
...options.conditions,
|
224
|
-
ifTags: options.conditions?.tagConditions,
|
225
|
-
},
|
224
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
226
225
|
requestOptions: {
|
227
226
|
onDownloadProgress: isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
|
228
227
|
},
|
@@ -233,12 +232,7 @@ export class BlobClient extends StorageClient {
|
|
233
232
|
cpkInfo: options.customerProvidedKey,
|
234
233
|
tracingOptions: updatedOptions.tracingOptions,
|
235
234
|
}));
|
236
|
-
const wrappedRes = {
|
237
|
-
...res,
|
238
|
-
_response: res._response,
|
239
|
-
objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
|
240
|
-
objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
|
241
|
-
};
|
235
|
+
const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
|
242
236
|
// Return browser response immediately
|
243
237
|
if (!isNode) {
|
244
238
|
return wrappedRes;
|
@@ -259,6 +253,7 @@ export class BlobClient extends StorageClient {
|
|
259
253
|
throw new RangeError(`File download response doesn't contain valid etag header`);
|
260
254
|
}
|
261
255
|
return new BlobDownloadResponse(wrappedRes, async (start) => {
|
256
|
+
var _a;
|
262
257
|
const updatedDownloadOptions = {
|
263
258
|
leaseAccessConditions: options.conditions,
|
264
259
|
modifiedAccessConditions: {
|
@@ -266,7 +261,7 @@ export class BlobClient extends StorageClient {
|
|
266
261
|
ifModifiedSince: options.conditions.ifModifiedSince,
|
267
262
|
ifNoneMatch: options.conditions.ifNoneMatch,
|
268
263
|
ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
|
269
|
-
ifTags: options.conditions
|
264
|
+
ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions,
|
270
265
|
},
|
271
266
|
range: rangeToString({
|
272
267
|
count: offset + res.contentLength - start,
|
@@ -283,10 +278,7 @@ export class BlobClient extends StorageClient {
|
|
283
278
|
// updatedOptions.range
|
284
279
|
// }, options: ${JSON.stringify(updatedOptions)}`
|
285
280
|
// );
|
286
|
-
return (await this.blobContext.download({
|
287
|
-
abortSignal: options.abortSignal,
|
288
|
-
...updatedDownloadOptions,
|
289
|
-
})).readableStreamBody;
|
281
|
+
return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;
|
290
282
|
}, offset, res.contentLength, {
|
291
283
|
maxRetryRequests: options.maxRetryRequests,
|
292
284
|
onProgress: options.onProgress,
|
@@ -345,22 +337,15 @@ export class BlobClient extends StorageClient {
|
|
345
337
|
options.conditions = options.conditions || {};
|
346
338
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
347
339
|
return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => {
|
340
|
+
var _a;
|
348
341
|
const res = assertResponse(await this.blobContext.getProperties({
|
349
342
|
abortSignal: options.abortSignal,
|
350
343
|
leaseAccessConditions: options.conditions,
|
351
|
-
modifiedAccessConditions: {
|
352
|
-
...options.conditions,
|
353
|
-
ifTags: options.conditions?.tagConditions,
|
354
|
-
},
|
344
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
355
345
|
cpkInfo: options.customerProvidedKey,
|
356
346
|
tracingOptions: updatedOptions.tracingOptions,
|
357
347
|
}));
|
358
|
-
return {
|
359
|
-
...res,
|
360
|
-
_response: res._response,
|
361
|
-
objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
|
362
|
-
objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
|
363
|
-
};
|
348
|
+
return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
|
364
349
|
});
|
365
350
|
}
|
366
351
|
/**
|
@@ -375,14 +360,12 @@ export class BlobClient extends StorageClient {
|
|
375
360
|
async delete(options = {}) {
|
376
361
|
options.conditions = options.conditions || {};
|
377
362
|
return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => {
|
363
|
+
var _a;
|
378
364
|
return assertResponse(await this.blobContext.delete({
|
379
365
|
abortSignal: options.abortSignal,
|
380
366
|
deleteSnapshots: options.deleteSnapshots,
|
381
367
|
leaseAccessConditions: options.conditions,
|
382
|
-
modifiedAccessConditions: {
|
383
|
-
...options.conditions,
|
384
|
-
ifTags: options.conditions?.tagConditions,
|
385
|
-
},
|
368
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
386
369
|
tracingOptions: updatedOptions.tracingOptions,
|
387
370
|
}));
|
388
371
|
});
|
@@ -398,21 +381,14 @@ export class BlobClient extends StorageClient {
|
|
398
381
|
*/
|
399
382
|
async deleteIfExists(options = {}) {
|
400
383
|
return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => {
|
384
|
+
var _a, _b;
|
401
385
|
try {
|
402
386
|
const res = assertResponse(await this.delete(updatedOptions));
|
403
|
-
return {
|
404
|
-
succeeded: true,
|
405
|
-
...res,
|
406
|
-
_response: res._response, // _response is made non-enumerable
|
407
|
-
};
|
387
|
+
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
|
408
388
|
}
|
409
389
|
catch (e) {
|
410
|
-
if (e.details
|
411
|
-
return {
|
412
|
-
succeeded: false,
|
413
|
-
...e.response?.parsedHeaders,
|
414
|
-
_response: e.response,
|
415
|
-
};
|
390
|
+
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") {
|
391
|
+
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
416
392
|
}
|
417
393
|
throw e;
|
418
394
|
}
|
@@ -453,14 +429,12 @@ export class BlobClient extends StorageClient {
|
|
453
429
|
options.conditions = options.conditions || {};
|
454
430
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
455
431
|
return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => {
|
432
|
+
var _a;
|
456
433
|
return assertResponse(await this.blobContext.setHttpHeaders({
|
457
434
|
abortSignal: options.abortSignal,
|
458
435
|
blobHttpHeaders: blobHTTPHeaders,
|
459
436
|
leaseAccessConditions: options.conditions,
|
460
|
-
modifiedAccessConditions: {
|
461
|
-
...options.conditions,
|
462
|
-
ifTags: options.conditions?.tagConditions,
|
463
|
-
},
|
437
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
464
438
|
// cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger.
|
465
439
|
tracingOptions: updatedOptions.tracingOptions,
|
466
440
|
}));
|
@@ -481,14 +455,12 @@ export class BlobClient extends StorageClient {
|
|
481
455
|
options.conditions = options.conditions || {};
|
482
456
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
483
457
|
return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => {
|
458
|
+
var _a;
|
484
459
|
return assertResponse(await this.blobContext.setMetadata({
|
485
460
|
abortSignal: options.abortSignal,
|
486
461
|
leaseAccessConditions: options.conditions,
|
487
462
|
metadata,
|
488
|
-
modifiedAccessConditions: {
|
489
|
-
...options.conditions,
|
490
|
-
ifTags: options.conditions?.tagConditions,
|
491
|
-
},
|
463
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
492
464
|
cpkInfo: options.customerProvidedKey,
|
493
465
|
encryptionScope: options.encryptionScope,
|
494
466
|
tracingOptions: updatedOptions.tracingOptions,
|
@@ -506,13 +478,11 @@ export class BlobClient extends StorageClient {
|
|
506
478
|
*/
|
507
479
|
async setTags(tags, options = {}) {
|
508
480
|
return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => {
|
481
|
+
var _a;
|
509
482
|
return assertResponse(await this.blobContext.setTags({
|
510
483
|
abortSignal: options.abortSignal,
|
511
484
|
leaseAccessConditions: options.conditions,
|
512
|
-
modifiedAccessConditions: {
|
513
|
-
...options.conditions,
|
514
|
-
ifTags: options.conditions?.tagConditions,
|
515
|
-
},
|
485
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
516
486
|
tracingOptions: updatedOptions.tracingOptions,
|
517
487
|
tags: toBlobTags(tags),
|
518
488
|
}));
|
@@ -525,20 +495,14 @@ export class BlobClient extends StorageClient {
|
|
525
495
|
*/
|
526
496
|
async getTags(options = {}) {
|
527
497
|
return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => {
|
498
|
+
var _a;
|
528
499
|
const response = assertResponse(await this.blobContext.getTags({
|
529
500
|
abortSignal: options.abortSignal,
|
530
501
|
leaseAccessConditions: options.conditions,
|
531
|
-
modifiedAccessConditions: {
|
532
|
-
...options.conditions,
|
533
|
-
ifTags: options.conditions?.tagConditions,
|
534
|
-
},
|
502
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
535
503
|
tracingOptions: updatedOptions.tracingOptions,
|
536
504
|
}));
|
537
|
-
const wrappedResponse = {
|
538
|
-
...response,
|
539
|
-
_response: response._response,
|
540
|
-
tags: toTags({ blobTagSet: response.blobTagSet }) || {},
|
541
|
-
};
|
505
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} });
|
542
506
|
return wrappedResponse;
|
543
507
|
});
|
544
508
|
}
|
@@ -561,14 +525,12 @@ export class BlobClient extends StorageClient {
|
|
561
525
|
options.conditions = options.conditions || {};
|
562
526
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
563
527
|
return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => {
|
528
|
+
var _a;
|
564
529
|
return assertResponse(await this.blobContext.createSnapshot({
|
565
530
|
abortSignal: options.abortSignal,
|
566
531
|
leaseAccessConditions: options.conditions,
|
567
532
|
metadata: options.metadata,
|
568
|
-
modifiedAccessConditions: {
|
569
|
-
...options.conditions,
|
570
|
-
ifTags: options.conditions?.tagConditions,
|
571
|
-
},
|
533
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
572
534
|
cpkInfo: options.customerProvidedKey,
|
573
535
|
encryptionScope: options.encryptionScope,
|
574
536
|
tracingOptions: updatedOptions.tracingOptions,
|
@@ -695,26 +657,24 @@ export class BlobClient extends StorageClient {
|
|
695
657
|
options.conditions = options.conditions || {};
|
696
658
|
options.sourceConditions = options.sourceConditions || {};
|
697
659
|
return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => {
|
660
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
698
661
|
return assertResponse(await this.blobContext.copyFromURL(copySource, {
|
699
662
|
abortSignal: options.abortSignal,
|
700
663
|
metadata: options.metadata,
|
701
664
|
leaseAccessConditions: options.conditions,
|
702
|
-
modifiedAccessConditions: {
|
703
|
-
...options.conditions,
|
704
|
-
ifTags: options.conditions?.tagConditions,
|
705
|
-
},
|
665
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
706
666
|
sourceModifiedAccessConditions: {
|
707
|
-
sourceIfMatch: options.sourceConditions
|
708
|
-
sourceIfModifiedSince: options.sourceConditions
|
709
|
-
sourceIfNoneMatch: options.sourceConditions
|
710
|
-
sourceIfUnmodifiedSince: options.sourceConditions
|
667
|
+
sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
|
668
|
+
sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
|
669
|
+
sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
|
670
|
+
sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
|
711
671
|
},
|
712
672
|
sourceContentMD5: options.sourceContentMD5,
|
713
673
|
copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
|
714
674
|
tier: toAccessTier(options.tier),
|
715
675
|
blobTagsString: toBlobTagsString(options.tags),
|
716
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
717
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
676
|
+
immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn,
|
677
|
+
immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode,
|
718
678
|
legalHold: options.legalHold,
|
719
679
|
encryptionScope: options.encryptionScope,
|
720
680
|
copySourceTags: options.copySourceTags,
|
@@ -735,19 +695,18 @@ export class BlobClient extends StorageClient {
|
|
735
695
|
*/
|
736
696
|
async setAccessTier(tier, options = {}) {
|
737
697
|
return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => {
|
698
|
+
var _a;
|
738
699
|
return assertResponse(await this.blobContext.setTier(toAccessTier(tier), {
|
739
700
|
abortSignal: options.abortSignal,
|
740
701
|
leaseAccessConditions: options.conditions,
|
741
|
-
modifiedAccessConditions: {
|
742
|
-
...options.conditions,
|
743
|
-
ifTags: options.conditions?.tagConditions,
|
744
|
-
},
|
702
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
745
703
|
rehydratePriority: options.rehydratePriority,
|
746
704
|
tracingOptions: updatedOptions.tracingOptions,
|
747
705
|
}));
|
748
706
|
});
|
749
707
|
}
|
750
708
|
async downloadToBuffer(param1, param2, param3, param4 = {}) {
|
709
|
+
var _a;
|
751
710
|
let buffer;
|
752
711
|
let offset = 0;
|
753
712
|
let count = 0;
|
@@ -762,7 +721,7 @@ export class BlobClient extends StorageClient {
|
|
762
721
|
count = typeof param2 === "number" ? param2 : 0;
|
763
722
|
options = param3 || {};
|
764
723
|
}
|
765
|
-
let blockSize = options.blockSize
|
724
|
+
let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0;
|
766
725
|
if (blockSize < 0) {
|
767
726
|
throw new RangeError("blockSize option must be >= 0");
|
768
727
|
}
|
@@ -781,10 +740,7 @@ export class BlobClient extends StorageClient {
|
|
781
740
|
return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => {
|
782
741
|
// Customer doesn't specify length, get it
|
783
742
|
if (!count) {
|
784
|
-
const response = await this.getProperties({
|
785
|
-
...options,
|
786
|
-
tracingOptions: updatedOptions.tracingOptions,
|
787
|
-
});
|
743
|
+
const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
|
788
744
|
count = response.contentLength - offset;
|
789
745
|
if (count < 0) {
|
790
746
|
throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`);
|
@@ -851,10 +807,7 @@ export class BlobClient extends StorageClient {
|
|
851
807
|
*/
|
852
808
|
async downloadToFile(filePath, offset = 0, count, options = {}) {
|
853
809
|
return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => {
|
854
|
-
const response = await this.download(offset, count, {
|
855
|
-
...options,
|
856
|
-
tracingOptions: updatedOptions.tracingOptions,
|
857
|
-
});
|
810
|
+
const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
|
858
811
|
if (response.readableStreamBody) {
|
859
812
|
await readStreamToLocalFile(response.readableStreamBody, filePath);
|
860
813
|
}
|
@@ -927,16 +880,14 @@ export class BlobClient extends StorageClient {
|
|
927
880
|
*/
|
928
881
|
async startCopyFromURL(copySource, options = {}) {
|
929
882
|
return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => {
|
883
|
+
var _a, _b, _c;
|
930
884
|
options.conditions = options.conditions || {};
|
931
885
|
options.sourceConditions = options.sourceConditions || {};
|
932
886
|
return assertResponse(await this.blobContext.startCopyFromURL(copySource, {
|
933
887
|
abortSignal: options.abortSignal,
|
934
888
|
leaseAccessConditions: options.conditions,
|
935
889
|
metadata: options.metadata,
|
936
|
-
modifiedAccessConditions: {
|
937
|
-
...options.conditions,
|
938
|
-
ifTags: options.conditions?.tagConditions,
|
939
|
-
},
|
890
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
940
891
|
sourceModifiedAccessConditions: {
|
941
892
|
sourceIfMatch: options.sourceConditions.ifMatch,
|
942
893
|
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
|
@@ -944,8 +895,8 @@ export class BlobClient extends StorageClient {
|
|
944
895
|
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
|
945
896
|
sourceIfTags: options.sourceConditions.tagConditions,
|
946
897
|
},
|
947
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
948
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
898
|
+
immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
|
899
|
+
immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
|
949
900
|
legalHold: options.legalHold,
|
950
901
|
rehydratePriority: options.rehydratePriority,
|
951
902
|
tier: toAccessTier(options.tier),
|
@@ -971,13 +922,7 @@ export class BlobClient extends StorageClient {
|
|
971
922
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
972
923
|
throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
973
924
|
}
|
974
|
-
const sas = generateBlobSASQueryParameters({
|
975
|
-
containerName: this._containerName,
|
976
|
-
blobName: this._name,
|
977
|
-
snapshotTime: this._snapshot,
|
978
|
-
versionId: this._versionId,
|
979
|
-
...options,
|
980
|
-
}, this.credential).toString();
|
925
|
+
const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString();
|
981
926
|
resolve(appendToURLQuery(this.url, sas));
|
982
927
|
});
|
983
928
|
}
|
@@ -1120,19 +1065,17 @@ export class AppendBlobClient extends BlobClient {
|
|
1120
1065
|
options.conditions = options.conditions || {};
|
1121
1066
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1122
1067
|
return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => {
|
1068
|
+
var _a, _b, _c;
|
1123
1069
|
return assertResponse(await this.appendBlobContext.create(0, {
|
1124
1070
|
abortSignal: options.abortSignal,
|
1125
1071
|
blobHttpHeaders: options.blobHTTPHeaders,
|
1126
1072
|
leaseAccessConditions: options.conditions,
|
1127
1073
|
metadata: options.metadata,
|
1128
|
-
modifiedAccessConditions: {
|
1129
|
-
...options.conditions,
|
1130
|
-
ifTags: options.conditions?.tagConditions,
|
1131
|
-
},
|
1074
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1132
1075
|
cpkInfo: options.customerProvidedKey,
|
1133
1076
|
encryptionScope: options.encryptionScope,
|
1134
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
1135
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
1077
|
+
immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
|
1078
|
+
immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
|
1136
1079
|
legalHold: options.legalHold,
|
1137
1080
|
blobTagsString: toBlobTagsString(options.tags),
|
1138
1081
|
tracingOptions: updatedOptions.tracingOptions,
|
@@ -1149,24 +1092,14 @@ export class AppendBlobClient extends BlobClient {
|
|
1149
1092
|
async createIfNotExists(options = {}) {
|
1150
1093
|
const conditions = { ifNoneMatch: ETagAny };
|
1151
1094
|
return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => {
|
1095
|
+
var _a, _b;
|
1152
1096
|
try {
|
1153
|
-
const res = assertResponse(await this.create({
|
1154
|
-
|
1155
|
-
conditions,
|
1156
|
-
}));
|
1157
|
-
return {
|
1158
|
-
succeeded: true,
|
1159
|
-
...res,
|
1160
|
-
_response: res._response, // _response is made non-enumerable
|
1161
|
-
};
|
1097
|
+
const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions })));
|
1098
|
+
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
|
1162
1099
|
}
|
1163
1100
|
catch (e) {
|
1164
|
-
if (e.details
|
1165
|
-
return {
|
1166
|
-
succeeded: false,
|
1167
|
-
...e.response?.parsedHeaders,
|
1168
|
-
_response: e.response,
|
1169
|
-
};
|
1101
|
+
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
|
1102
|
+
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
1170
1103
|
}
|
1171
1104
|
throw e;
|
1172
1105
|
}
|
@@ -1180,14 +1113,12 @@ export class AppendBlobClient extends BlobClient {
|
|
1180
1113
|
async seal(options = {}) {
|
1181
1114
|
options.conditions = options.conditions || {};
|
1182
1115
|
return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => {
|
1116
|
+
var _a;
|
1183
1117
|
return assertResponse(await this.appendBlobContext.seal({
|
1184
1118
|
abortSignal: options.abortSignal,
|
1185
1119
|
appendPositionAccessConditions: options.conditions,
|
1186
1120
|
leaseAccessConditions: options.conditions,
|
1187
|
-
modifiedAccessConditions: {
|
1188
|
-
...options.conditions,
|
1189
|
-
ifTags: options.conditions?.tagConditions,
|
1190
|
-
},
|
1121
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1191
1122
|
tracingOptions: updatedOptions.tracingOptions,
|
1192
1123
|
}));
|
1193
1124
|
});
|
@@ -1220,14 +1151,12 @@ export class AppendBlobClient extends BlobClient {
|
|
1220
1151
|
options.conditions = options.conditions || {};
|
1221
1152
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1222
1153
|
return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => {
|
1154
|
+
var _a;
|
1223
1155
|
return assertResponse(await this.appendBlobContext.appendBlock(contentLength, body, {
|
1224
1156
|
abortSignal: options.abortSignal,
|
1225
1157
|
appendPositionAccessConditions: options.conditions,
|
1226
1158
|
leaseAccessConditions: options.conditions,
|
1227
|
-
modifiedAccessConditions: {
|
1228
|
-
...options.conditions,
|
1229
|
-
ifTags: options.conditions?.tagConditions,
|
1230
|
-
},
|
1159
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1231
1160
|
requestOptions: {
|
1232
1161
|
onUploadProgress: options.onProgress,
|
1233
1162
|
},
|
@@ -1258,6 +1187,7 @@ export class AppendBlobClient extends BlobClient {
|
|
1258
1187
|
options.sourceConditions = options.sourceConditions || {};
|
1259
1188
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1260
1189
|
return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => {
|
1190
|
+
var _a, _b, _c, _d, _e;
|
1261
1191
|
return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, {
|
1262
1192
|
abortSignal: options.abortSignal,
|
1263
1193
|
sourceRange: rangeToString({ offset: sourceOffset, count }),
|
@@ -1265,15 +1195,12 @@ export class AppendBlobClient extends BlobClient {
|
|
1265
1195
|
sourceContentCrc64: options.sourceContentCrc64,
|
1266
1196
|
leaseAccessConditions: options.conditions,
|
1267
1197
|
appendPositionAccessConditions: options.conditions,
|
1268
|
-
modifiedAccessConditions: {
|
1269
|
-
...options.conditions,
|
1270
|
-
ifTags: options.conditions?.tagConditions,
|
1271
|
-
},
|
1198
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1272
1199
|
sourceModifiedAccessConditions: {
|
1273
|
-
sourceIfMatch: options.sourceConditions
|
1274
|
-
sourceIfModifiedSince: options.sourceConditions
|
1275
|
-
sourceIfNoneMatch: options.sourceConditions
|
1276
|
-
sourceIfUnmodifiedSince: options.sourceConditions
|
1200
|
+
sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
|
1201
|
+
sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
|
1202
|
+
sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
|
1203
|
+
sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
|
1277
1204
|
},
|
1278
1205
|
copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
|
1279
1206
|
cpkInfo: options.customerProvidedKey,
|
@@ -1405,6 +1332,7 @@ export class BlockBlobClient extends BlobClient {
|
|
1405
1332
|
throw new Error("This operation currently is only supported in Node.js.");
|
1406
1333
|
}
|
1407
1334
|
return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => {
|
1335
|
+
var _a;
|
1408
1336
|
const response = assertResponse(await this._blobContext.query({
|
1409
1337
|
abortSignal: options.abortSignal,
|
1410
1338
|
queryRequest: {
|
@@ -1414,10 +1342,7 @@ export class BlockBlobClient extends BlobClient {
|
|
1414
1342
|
outputSerialization: toQuerySerialization(options.outputTextConfiguration),
|
1415
1343
|
},
|
1416
1344
|
leaseAccessConditions: options.conditions,
|
1417
|
-
modifiedAccessConditions: {
|
1418
|
-
...options.conditions,
|
1419
|
-
ifTags: options.conditions?.tagConditions,
|
1420
|
-
},
|
1345
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1421
1346
|
cpkInfo: options.customerProvidedKey,
|
1422
1347
|
tracingOptions: updatedOptions.tracingOptions,
|
1423
1348
|
}));
|
@@ -1459,22 +1384,20 @@ export class BlockBlobClient extends BlobClient {
|
|
1459
1384
|
options.conditions = options.conditions || {};
|
1460
1385
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1461
1386
|
return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => {
|
1387
|
+
var _a, _b, _c;
|
1462
1388
|
return assertResponse(await this.blockBlobContext.upload(contentLength, body, {
|
1463
1389
|
abortSignal: options.abortSignal,
|
1464
1390
|
blobHttpHeaders: options.blobHTTPHeaders,
|
1465
1391
|
leaseAccessConditions: options.conditions,
|
1466
1392
|
metadata: options.metadata,
|
1467
|
-
modifiedAccessConditions: {
|
1468
|
-
...options.conditions,
|
1469
|
-
ifTags: options.conditions?.tagConditions,
|
1470
|
-
},
|
1393
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1471
1394
|
requestOptions: {
|
1472
1395
|
onUploadProgress: options.onProgress,
|
1473
1396
|
},
|
1474
1397
|
cpkInfo: options.customerProvidedKey,
|
1475
1398
|
encryptionScope: options.encryptionScope,
|
1476
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
1477
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
1399
|
+
immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
|
1400
|
+
immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
|
1478
1401
|
legalHold: options.legalHold,
|
1479
1402
|
tier: toAccessTier(options.tier),
|
1480
1403
|
blobTagsString: toBlobTagsString(options.tags),
|
@@ -1504,28 +1427,14 @@ export class BlockBlobClient extends BlobClient {
|
|
1504
1427
|
options.conditions = options.conditions || {};
|
1505
1428
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1506
1429
|
return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => {
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
},
|
1515
|
-
sourceModifiedAccessConditions: {
|
1516
|
-
sourceIfMatch: options.sourceConditions?.ifMatch,
|
1517
|
-
sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
|
1518
|
-
sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
|
1519
|
-
sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
|
1520
|
-
sourceIfTags: options.sourceConditions?.tagConditions,
|
1521
|
-
},
|
1522
|
-
cpkInfo: options.customerProvidedKey,
|
1523
|
-
copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
|
1524
|
-
tier: toAccessTier(options.tier),
|
1525
|
-
blobTagsString: toBlobTagsString(options.tags),
|
1526
|
-
copySourceTags: options.copySourceTags,
|
1527
|
-
tracingOptions: updatedOptions.tracingOptions,
|
1528
|
-
}));
|
1430
|
+
var _a, _b, _c, _d, _e, _f;
|
1431
|
+
return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: {
|
1432
|
+
sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
|
1433
|
+
sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
|
1434
|
+
sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
|
1435
|
+
sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
|
1436
|
+
sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions,
|
1437
|
+
}, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions })));
|
1529
1438
|
});
|
1530
1439
|
}
|
1531
1440
|
/**
|
@@ -1609,19 +1518,17 @@ export class BlockBlobClient extends BlobClient {
|
|
1609
1518
|
options.conditions = options.conditions || {};
|
1610
1519
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1611
1520
|
return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => {
|
1521
|
+
var _a, _b, _c;
|
1612
1522
|
return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks }, {
|
1613
1523
|
abortSignal: options.abortSignal,
|
1614
1524
|
blobHttpHeaders: options.blobHTTPHeaders,
|
1615
1525
|
leaseAccessConditions: options.conditions,
|
1616
1526
|
metadata: options.metadata,
|
1617
|
-
modifiedAccessConditions: {
|
1618
|
-
...options.conditions,
|
1619
|
-
ifTags: options.conditions?.tagConditions,
|
1620
|
-
},
|
1527
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1621
1528
|
cpkInfo: options.customerProvidedKey,
|
1622
1529
|
encryptionScope: options.encryptionScope,
|
1623
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
1624
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
1530
|
+
immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
|
1531
|
+
immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
|
1625
1532
|
legalHold: options.legalHold,
|
1626
1533
|
tier: toAccessTier(options.tier),
|
1627
1534
|
blobTagsString: toBlobTagsString(options.tags),
|
@@ -1641,13 +1548,11 @@ export class BlockBlobClient extends BlobClient {
|
|
1641
1548
|
*/
|
1642
1549
|
async getBlockList(listType, options = {}) {
|
1643
1550
|
return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => {
|
1551
|
+
var _a;
|
1644
1552
|
const res = assertResponse(await this.blockBlobContext.getBlockList(listType, {
|
1645
1553
|
abortSignal: options.abortSignal,
|
1646
1554
|
leaseAccessConditions: options.conditions,
|
1647
|
-
modifiedAccessConditions: {
|
1648
|
-
...options.conditions,
|
1649
|
-
ifTags: options.conditions?.tagConditions,
|
1650
|
-
},
|
1555
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1651
1556
|
tracingOptions: updatedOptions.tracingOptions,
|
1652
1557
|
}));
|
1653
1558
|
if (!res.committedBlocks) {
|
@@ -1738,11 +1643,12 @@ export class BlockBlobClient extends BlobClient {
|
|
1738
1643
|
* @returns Response data for the Blob Upload operation.
|
1739
1644
|
*/
|
1740
1645
|
async uploadSeekableInternal(bodyFactory, size, options = {}) {
|
1741
|
-
|
1646
|
+
var _a, _b;
|
1647
|
+
let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0;
|
1742
1648
|
if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
|
1743
1649
|
throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);
|
1744
1650
|
}
|
1745
|
-
const maxSingleShotSize = options.maxSingleShotSize
|
1651
|
+
const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
|
1746
1652
|
if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
|
1747
1653
|
throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);
|
1748
1654
|
}
|
@@ -1825,10 +1731,7 @@ export class BlockBlobClient extends BlobClient {
|
|
1825
1731
|
end: count ? offset + count - 1 : Infinity,
|
1826
1732
|
start: offset,
|
1827
1733
|
});
|
1828
|
-
}, size, {
|
1829
|
-
...options,
|
1830
|
-
tracingOptions: updatedOptions.tracingOptions,
|
1831
|
-
});
|
1734
|
+
}, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
|
1832
1735
|
});
|
1833
1736
|
}
|
1834
1737
|
/**
|
@@ -1880,10 +1783,7 @@ export class BlockBlobClient extends BlobClient {
|
|
1880
1783
|
// Outgoing queue shouldn't be empty.
|
1881
1784
|
Math.ceil((maxConcurrency / 4) * 3));
|
1882
1785
|
await scheduler.do();
|
1883
|
-
return assertResponse(await this.commitBlockList(blockList, {
|
1884
|
-
...options,
|
1885
|
-
tracingOptions: updatedOptions.tracingOptions,
|
1886
|
-
}));
|
1786
|
+
return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })));
|
1887
1787
|
});
|
1888
1788
|
}
|
1889
1789
|
}
|
@@ -1982,20 +1882,18 @@ export class PageBlobClient extends BlobClient {
|
|
1982
1882
|
options.conditions = options.conditions || {};
|
1983
1883
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
1984
1884
|
return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => {
|
1885
|
+
var _a, _b, _c;
|
1985
1886
|
return assertResponse(await this.pageBlobContext.create(0, size, {
|
1986
1887
|
abortSignal: options.abortSignal,
|
1987
1888
|
blobHttpHeaders: options.blobHTTPHeaders,
|
1988
1889
|
blobSequenceNumber: options.blobSequenceNumber,
|
1989
1890
|
leaseAccessConditions: options.conditions,
|
1990
1891
|
metadata: options.metadata,
|
1991
|
-
modifiedAccessConditions: {
|
1992
|
-
...options.conditions,
|
1993
|
-
ifTags: options.conditions?.tagConditions,
|
1994
|
-
},
|
1892
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
1995
1893
|
cpkInfo: options.customerProvidedKey,
|
1996
1894
|
encryptionScope: options.encryptionScope,
|
1997
|
-
immutabilityPolicyExpiry: options.immutabilityPolicy
|
1998
|
-
immutabilityPolicyMode: options.immutabilityPolicy
|
1895
|
+
immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
|
1896
|
+
immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
|
1999
1897
|
legalHold: options.legalHold,
|
2000
1898
|
tier: toAccessTier(options.tier),
|
2001
1899
|
blobTagsString: toBlobTagsString(options.tags),
|
@@ -2014,26 +1912,15 @@ export class PageBlobClient extends BlobClient {
|
|
2014
1912
|
*/
|
2015
1913
|
async createIfNotExists(size, options = {}) {
|
2016
1914
|
return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => {
|
1915
|
+
var _a, _b;
|
2017
1916
|
try {
|
2018
1917
|
const conditions = { ifNoneMatch: ETagAny };
|
2019
|
-
const res = assertResponse(await this.create(size, {
|
2020
|
-
|
2021
|
-
conditions,
|
2022
|
-
tracingOptions: updatedOptions.tracingOptions,
|
2023
|
-
}));
|
2024
|
-
return {
|
2025
|
-
succeeded: true,
|
2026
|
-
...res,
|
2027
|
-
_response: res._response, // _response is made non-enumerable
|
2028
|
-
};
|
1918
|
+
const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions })));
|
1919
|
+
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
|
2029
1920
|
}
|
2030
1921
|
catch (e) {
|
2031
|
-
if (e.details
|
2032
|
-
return {
|
2033
|
-
succeeded: false,
|
2034
|
-
...e.response?.parsedHeaders,
|
2035
|
-
_response: e.response,
|
2036
|
-
};
|
1922
|
+
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
|
1923
|
+
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
2037
1924
|
}
|
2038
1925
|
throw e;
|
2039
1926
|
}
|
@@ -2053,13 +1940,11 @@ export class PageBlobClient extends BlobClient {
|
|
2053
1940
|
options.conditions = options.conditions || {};
|
2054
1941
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
2055
1942
|
return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => {
|
1943
|
+
var _a;
|
2056
1944
|
return assertResponse(await this.pageBlobContext.uploadPages(count, body, {
|
2057
1945
|
abortSignal: options.abortSignal,
|
2058
1946
|
leaseAccessConditions: options.conditions,
|
2059
|
-
modifiedAccessConditions: {
|
2060
|
-
...options.conditions,
|
2061
|
-
ifTags: options.conditions?.tagConditions,
|
2062
|
-
},
|
1947
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2063
1948
|
requestOptions: {
|
2064
1949
|
onUploadProgress: options.onProgress,
|
2065
1950
|
},
|
@@ -2089,21 +1974,19 @@ export class PageBlobClient extends BlobClient {
|
|
2089
1974
|
options.sourceConditions = options.sourceConditions || {};
|
2090
1975
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
2091
1976
|
return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => {
|
1977
|
+
var _a, _b, _c, _d, _e;
|
2092
1978
|
return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), {
|
2093
1979
|
abortSignal: options.abortSignal,
|
2094
1980
|
sourceContentMD5: options.sourceContentMD5,
|
2095
1981
|
sourceContentCrc64: options.sourceContentCrc64,
|
2096
1982
|
leaseAccessConditions: options.conditions,
|
2097
1983
|
sequenceNumberAccessConditions: options.conditions,
|
2098
|
-
modifiedAccessConditions: {
|
2099
|
-
...options.conditions,
|
2100
|
-
ifTags: options.conditions?.tagConditions,
|
2101
|
-
},
|
1984
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2102
1985
|
sourceModifiedAccessConditions: {
|
2103
|
-
sourceIfMatch: options.sourceConditions
|
2104
|
-
sourceIfModifiedSince: options.sourceConditions
|
2105
|
-
sourceIfNoneMatch: options.sourceConditions
|
2106
|
-
sourceIfUnmodifiedSince: options.sourceConditions
|
1986
|
+
sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
|
1987
|
+
sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
|
1988
|
+
sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
|
1989
|
+
sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
|
2107
1990
|
},
|
2108
1991
|
cpkInfo: options.customerProvidedKey,
|
2109
1992
|
encryptionScope: options.encryptionScope,
|
@@ -2124,13 +2007,11 @@ export class PageBlobClient extends BlobClient {
|
|
2124
2007
|
async clearPages(offset = 0, count, options = {}) {
|
2125
2008
|
options.conditions = options.conditions || {};
|
2126
2009
|
return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => {
|
2010
|
+
var _a;
|
2127
2011
|
return assertResponse(await this.pageBlobContext.clearPages(0, {
|
2128
2012
|
abortSignal: options.abortSignal,
|
2129
2013
|
leaseAccessConditions: options.conditions,
|
2130
|
-
modifiedAccessConditions: {
|
2131
|
-
...options.conditions,
|
2132
|
-
ifTags: options.conditions?.tagConditions,
|
2133
|
-
},
|
2014
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2134
2015
|
range: rangeToString({ offset, count }),
|
2135
2016
|
sequenceNumberAccessConditions: options.conditions,
|
2136
2017
|
cpkInfo: options.customerProvidedKey,
|
@@ -2151,13 +2032,11 @@ export class PageBlobClient extends BlobClient {
|
|
2151
2032
|
async getPageRanges(offset = 0, count, options = {}) {
|
2152
2033
|
options.conditions = options.conditions || {};
|
2153
2034
|
return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => {
|
2035
|
+
var _a;
|
2154
2036
|
const response = assertResponse(await this.pageBlobContext.getPageRanges({
|
2155
2037
|
abortSignal: options.abortSignal,
|
2156
2038
|
leaseAccessConditions: options.conditions,
|
2157
|
-
modifiedAccessConditions: {
|
2158
|
-
...options.conditions,
|
2159
|
-
ifTags: options.conditions?.tagConditions,
|
2160
|
-
},
|
2039
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2161
2040
|
range: rangeToString({ offset, count }),
|
2162
2041
|
tracingOptions: updatedOptions.tracingOptions,
|
2163
2042
|
}));
|
@@ -2178,13 +2057,11 @@ export class PageBlobClient extends BlobClient {
|
|
2178
2057
|
*/
|
2179
2058
|
async listPageRangesSegment(offset = 0, count, marker, options = {}) {
|
2180
2059
|
return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => {
|
2060
|
+
var _a;
|
2181
2061
|
return assertResponse(await this.pageBlobContext.getPageRanges({
|
2182
2062
|
abortSignal: options.abortSignal,
|
2183
2063
|
leaseAccessConditions: options.conditions,
|
2184
|
-
modifiedAccessConditions: {
|
2185
|
-
...options.conditions,
|
2186
|
-
ifTags: options.conditions?.tagConditions,
|
2187
|
-
},
|
2064
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2188
2065
|
range: rangeToString({ offset, count }),
|
2189
2066
|
marker: marker,
|
2190
2067
|
maxPageSize: options.maxPageSize,
|
@@ -2206,15 +2083,17 @@ export class PageBlobClient extends BlobClient {
|
|
2206
2083
|
* items. The marker value is opaque to the client.
|
2207
2084
|
* @param options - Options to List Page Ranges operation.
|
2208
2085
|
*/
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2086
|
+
listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
|
2087
|
+
return __asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() {
|
2088
|
+
let getPageRangeItemSegmentsResponse;
|
2089
|
+
if (!!marker || marker === undefined) {
|
2090
|
+
do {
|
2091
|
+
getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesSegment(offset, count, marker, options));
|
2092
|
+
marker = getPageRangeItemSegmentsResponse.continuationToken;
|
2093
|
+
yield yield __await(yield __await(getPageRangeItemSegmentsResponse));
|
2094
|
+
} while (marker);
|
2095
|
+
}
|
2096
|
+
});
|
2218
2097
|
}
|
2219
2098
|
/**
|
2220
2099
|
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
@@ -2223,11 +2102,26 @@ export class PageBlobClient extends BlobClient {
|
|
2223
2102
|
* @param count - Number of bytes to get.
|
2224
2103
|
* @param options - Options to List Page Ranges operation.
|
2225
2104
|
*/
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2105
|
+
listPageRangeItems(offset = 0, count, options = {}) {
|
2106
|
+
return __asyncGenerator(this, arguments, function* listPageRangeItems_1() {
|
2107
|
+
var _a, e_1, _b, _c;
|
2108
|
+
let marker;
|
2109
|
+
try {
|
2110
|
+
for (var _d = true, _e = __asyncValues(this.listPageRangeItemSegments(offset, count, marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
2111
|
+
_c = _f.value;
|
2112
|
+
_d = false;
|
2113
|
+
const getPageRangesSegment = _c;
|
2114
|
+
yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
|
2115
|
+
}
|
2116
|
+
}
|
2117
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
2118
|
+
finally {
|
2119
|
+
try {
|
2120
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
2121
|
+
}
|
2122
|
+
finally { if (e_1) throw e_1.error; }
|
2123
|
+
}
|
2124
|
+
});
|
2231
2125
|
}
|
2232
2126
|
/**
|
2233
2127
|
* Returns an async iterable iterator to list of page ranges for a page blob.
|
@@ -2321,10 +2215,7 @@ export class PageBlobClient extends BlobClient {
|
|
2321
2215
|
* Return an AsyncIterableIterator that works a page at a time
|
2322
2216
|
*/
|
2323
2217
|
byPage: (settings = {}) => {
|
2324
|
-
return this.listPageRangeItemSegments(offset, count, settings.continuationToken, {
|
2325
|
-
maxPageSize: settings.maxPageSize,
|
2326
|
-
...options,
|
2327
|
-
});
|
2218
|
+
return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
|
2328
2219
|
},
|
2329
2220
|
};
|
2330
2221
|
}
|
@@ -2341,13 +2232,11 @@ export class PageBlobClient extends BlobClient {
|
|
2341
2232
|
async getPageRangesDiff(offset, count, prevSnapshot, options = {}) {
|
2342
2233
|
options.conditions = options.conditions || {};
|
2343
2234
|
return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => {
|
2235
|
+
var _a;
|
2344
2236
|
const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({
|
2345
2237
|
abortSignal: options.abortSignal,
|
2346
2238
|
leaseAccessConditions: options.conditions,
|
2347
|
-
modifiedAccessConditions: {
|
2348
|
-
...options.conditions,
|
2349
|
-
ifTags: options.conditions?.tagConditions,
|
2350
|
-
},
|
2239
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2351
2240
|
prevsnapshot: prevSnapshot,
|
2352
2241
|
range: rangeToString({ offset, count }),
|
2353
2242
|
tracingOptions: updatedOptions.tracingOptions,
|
@@ -2371,20 +2260,18 @@ export class PageBlobClient extends BlobClient {
|
|
2371
2260
|
*/
|
2372
2261
|
async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) {
|
2373
2262
|
return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => {
|
2263
|
+
var _a;
|
2374
2264
|
return assertResponse(await this.pageBlobContext.getPageRangesDiff({
|
2375
|
-
abortSignal: options
|
2376
|
-
leaseAccessConditions: options
|
2377
|
-
modifiedAccessConditions: {
|
2378
|
-
...options?.conditions,
|
2379
|
-
ifTags: options?.conditions?.tagConditions,
|
2380
|
-
},
|
2265
|
+
abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
|
2266
|
+
leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions,
|
2267
|
+
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 }),
|
2381
2268
|
prevsnapshot: prevSnapshotOrUrl,
|
2382
2269
|
range: rangeToString({
|
2383
2270
|
offset: offset,
|
2384
2271
|
count: count,
|
2385
2272
|
}),
|
2386
2273
|
marker: marker,
|
2387
|
-
maxPageSize: options
|
2274
|
+
maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize,
|
2388
2275
|
tracingOptions: updatedOptions.tracingOptions,
|
2389
2276
|
}));
|
2390
2277
|
});
|
@@ -2405,15 +2292,17 @@ export class PageBlobClient extends BlobClient {
|
|
2405
2292
|
* items. The marker value is opaque to the client.
|
2406
2293
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
2407
2294
|
*/
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2295
|
+
listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
|
2296
|
+
return __asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() {
|
2297
|
+
let getPageRangeItemSegmentsResponse;
|
2298
|
+
if (!!marker || marker === undefined) {
|
2299
|
+
do {
|
2300
|
+
getPageRangeItemSegmentsResponse = yield __await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options));
|
2301
|
+
marker = getPageRangeItemSegmentsResponse.continuationToken;
|
2302
|
+
yield yield __await(yield __await(getPageRangeItemSegmentsResponse));
|
2303
|
+
} while (marker);
|
2304
|
+
}
|
2305
|
+
});
|
2417
2306
|
}
|
2418
2307
|
/**
|
2419
2308
|
* Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
|
@@ -2423,11 +2312,26 @@ export class PageBlobClient extends BlobClient {
|
|
2423
2312
|
* @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
|
2424
2313
|
* @param options - Options to the Page Blob Get Page Ranges Diff operation.
|
2425
2314
|
*/
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2315
|
+
listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
|
2316
|
+
return __asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() {
|
2317
|
+
var _a, e_2, _b, _c;
|
2318
|
+
let marker;
|
2319
|
+
try {
|
2320
|
+
for (var _d = true, _e = __asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
2321
|
+
_c = _f.value;
|
2322
|
+
_d = false;
|
2323
|
+
const getPageRangesSegment = _c;
|
2324
|
+
yield __await(yield* __asyncDelegator(__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
|
2325
|
+
}
|
2326
|
+
}
|
2327
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
2328
|
+
finally {
|
2329
|
+
try {
|
2330
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
2331
|
+
}
|
2332
|
+
finally { if (e_2) throw e_2.error; }
|
2333
|
+
}
|
2334
|
+
});
|
2431
2335
|
}
|
2432
2336
|
/**
|
2433
2337
|
* Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
|
@@ -2504,9 +2408,7 @@ export class PageBlobClient extends BlobClient {
|
|
2504
2408
|
listPageRangesDiff(offset, count, prevSnapshot, options = {}) {
|
2505
2409
|
options.conditions = options.conditions || {};
|
2506
2410
|
// AsyncIterableIterator to iterate over blobs
|
2507
|
-
const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, {
|
2508
|
-
...options,
|
2509
|
-
});
|
2411
|
+
const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options));
|
2510
2412
|
return {
|
2511
2413
|
/**
|
2512
2414
|
* The next method, part of the iteration protocol
|
@@ -2524,10 +2426,7 @@ export class PageBlobClient extends BlobClient {
|
|
2524
2426
|
* Return an AsyncIterableIterator that works a page at a time
|
2525
2427
|
*/
|
2526
2428
|
byPage: (settings = {}) => {
|
2527
|
-
return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, {
|
2528
|
-
maxPageSize: settings.maxPageSize,
|
2529
|
-
...options,
|
2530
|
-
});
|
2429
|
+
return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
|
2531
2430
|
},
|
2532
2431
|
};
|
2533
2432
|
}
|
@@ -2544,13 +2443,11 @@ export class PageBlobClient extends BlobClient {
|
|
2544
2443
|
async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) {
|
2545
2444
|
options.conditions = options.conditions || {};
|
2546
2445
|
return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => {
|
2446
|
+
var _a;
|
2547
2447
|
const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({
|
2548
2448
|
abortSignal: options.abortSignal,
|
2549
2449
|
leaseAccessConditions: options.conditions,
|
2550
|
-
modifiedAccessConditions: {
|
2551
|
-
...options.conditions,
|
2552
|
-
ifTags: options.conditions?.tagConditions,
|
2553
|
-
},
|
2450
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2554
2451
|
prevSnapshotUrl,
|
2555
2452
|
range: rangeToString({ offset, count }),
|
2556
2453
|
tracingOptions: updatedOptions.tracingOptions,
|
@@ -2569,13 +2466,11 @@ export class PageBlobClient extends BlobClient {
|
|
2569
2466
|
async resize(size, options = {}) {
|
2570
2467
|
options.conditions = options.conditions || {};
|
2571
2468
|
return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => {
|
2469
|
+
var _a;
|
2572
2470
|
return assertResponse(await this.pageBlobContext.resize(size, {
|
2573
2471
|
abortSignal: options.abortSignal,
|
2574
2472
|
leaseAccessConditions: options.conditions,
|
2575
|
-
modifiedAccessConditions: {
|
2576
|
-
...options.conditions,
|
2577
|
-
ifTags: options.conditions?.tagConditions,
|
2578
|
-
},
|
2473
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2579
2474
|
encryptionScope: options.encryptionScope,
|
2580
2475
|
tracingOptions: updatedOptions.tracingOptions,
|
2581
2476
|
}));
|
@@ -2593,14 +2488,12 @@ export class PageBlobClient extends BlobClient {
|
|
2593
2488
|
async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) {
|
2594
2489
|
options.conditions = options.conditions || {};
|
2595
2490
|
return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => {
|
2491
|
+
var _a;
|
2596
2492
|
return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, {
|
2597
2493
|
abortSignal: options.abortSignal,
|
2598
2494
|
blobSequenceNumber: sequenceNumber,
|
2599
2495
|
leaseAccessConditions: options.conditions,
|
2600
|
-
modifiedAccessConditions: {
|
2601
|
-
...options.conditions,
|
2602
|
-
ifTags: options.conditions?.tagConditions,
|
2603
|
-
},
|
2496
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2604
2497
|
tracingOptions: updatedOptions.tracingOptions,
|
2605
2498
|
}));
|
2606
2499
|
});
|
@@ -2620,12 +2513,10 @@ export class PageBlobClient extends BlobClient {
|
|
2620
2513
|
*/
|
2621
2514
|
async startCopyIncremental(copySource, options = {}) {
|
2622
2515
|
return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => {
|
2516
|
+
var _a;
|
2623
2517
|
return assertResponse(await this.pageBlobContext.copyIncremental(copySource, {
|
2624
2518
|
abortSignal: options.abortSignal,
|
2625
|
-
modifiedAccessConditions: {
|
2626
|
-
...options.conditions,
|
2627
|
-
ifTags: options.conditions?.tagConditions,
|
2628
|
-
},
|
2519
|
+
modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
|
2629
2520
|
tracingOptions: updatedOptions.tracingOptions,
|
2630
2521
|
}));
|
2631
2522
|
});
|