@azure/storage-blob 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.
Files changed (33) hide show
  1. package/dist/index.js +513 -700
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/BlobBatchClient.js +1 -3
  4. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  5. package/dist-esm/storage-blob/src/BlobLeaseClient.js +30 -35
  6. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/BlobServiceClient.js +81 -80
  8. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  9. package/dist-esm/storage-blob/src/Clients.js +193 -302
  10. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  11. package/dist-esm/storage-blob/src/ContainerClient.js +132 -165
  12. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  13. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js +3 -10
  14. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -1
  15. package/dist-esm/storage-blob/src/Pipeline.js +10 -19
  16. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  17. package/dist-esm/storage-blob/src/StorageContextClient.js +1 -1
  18. package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -1
  19. package/dist-esm/storage-blob/src/generated/src/storageClient.js +3 -7
  20. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  21. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
  22. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  23. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +12 -10
  24. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
  25. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +3 -6
  26. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  27. package/dist-esm/storage-blob/src/utils/utils.common.js +11 -24
  28. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  29. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js +2 -1
  30. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js.map +1 -1
  31. package/dist-esm/storage-internal-avro/src/AvroReader.js +34 -32
  32. package/dist-esm/storage-internal-avro/src/AvroReader.js.map +1 -1
  33. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var coreRestPipeline = require('@azure/core-rest-pipeline');
6
+ var tslib = require('tslib');
6
7
  var coreAuth = require('@azure/core-auth');
7
8
  var coreUtil = require('@azure/core-util');
8
9
  var coreHttpCompat = require('@azure/core-http-compat');
@@ -13,7 +14,6 @@ var abortController = require('@azure/abort-controller');
13
14
  var crypto = require('crypto');
14
15
  var coreTracing = require('@azure/core-tracing');
15
16
  var stream = require('stream');
16
- require('@azure/core-paging');
17
17
  var coreLro = require('@azure/core-lro');
18
18
  var events = require('events');
19
19
  var fs = require('fs');
@@ -538,8 +538,9 @@ function setURLParameter(url, name, value) {
538
538
  * @param name -
539
539
  */
540
540
  function getURLParameter(url, name) {
541
+ var _a;
541
542
  const urlParsed = new URL(url);
542
- return urlParsed.searchParams.get(name) ?? undefined;
543
+ return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : undefined;
543
544
  }
544
545
  /**
545
546
  * Set URL host.
@@ -938,39 +939,25 @@ function BlobNameToString(name) {
938
939
  }
939
940
  }
940
941
  function ConvertInternalResponseOfListBlobFlat(internalResponse) {
941
- return {
942
- ...internalResponse,
943
- segment: {
942
+ return Object.assign(Object.assign({}, internalResponse), { segment: {
944
943
  blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
945
- const blobItem = {
946
- ...blobItemInteral,
947
- name: BlobNameToString(blobItemInteral.name),
948
- };
944
+ const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
949
945
  return blobItem;
950
946
  }),
951
- },
952
- };
947
+ } });
953
948
  }
954
949
  function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
955
- return {
956
- ...internalResponse,
957
- segment: {
958
- blobPrefixes: internalResponse.segment.blobPrefixes?.map((blobPrefixInternal) => {
959
- const blobPrefix = {
960
- ...blobPrefixInternal,
961
- name: BlobNameToString(blobPrefixInternal.name),
962
- };
950
+ var _a;
951
+ return Object.assign(Object.assign({}, internalResponse), { segment: {
952
+ blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
953
+ const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });
963
954
  return blobPrefix;
964
955
  }),
965
956
  blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
966
- const blobItem = {
967
- ...blobItemInteral,
968
- name: BlobNameToString(blobItemInteral.name),
969
- };
957
+ const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
970
958
  return blobItem;
971
959
  }),
972
- },
973
- };
960
+ } });
974
961
  }
975
962
  function* ExtractPageRangeInfoItems(getPageRangesSegment) {
976
963
  let pageRange = [];
@@ -1201,7 +1188,7 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1201
1188
  return true;
1202
1189
  }
1203
1190
  }
1204
- if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) {
1191
+ if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) {
1205
1192
  logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1206
1193
  return true;
1207
1194
  }
@@ -1600,13 +1587,15 @@ const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was abor
1600
1587
  * Retry policy with exponential retry and linear retry implemented.
1601
1588
  */
1602
1589
  function storageRetryPolicy(options = {}) {
1603
- const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType;
1604
- const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries;
1605
- const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs;
1606
- const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
1607
- const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost;
1608
- const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
1590
+ var _a, _b, _c, _d, _e, _f;
1591
+ const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType;
1592
+ const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries;
1593
+ const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs;
1594
+ const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
1595
+ const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost;
1596
+ const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
1609
1597
  function shouldRetry({ isPrimaryRetry, attempt, response, error, }) {
1598
+ var _a, _b;
1610
1599
  if (attempt >= maxTries) {
1611
1600
  logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
1612
1601
  return false;
@@ -1620,8 +1609,8 @@ function storageRetryPolicy(options = {}) {
1620
1609
  return true;
1621
1610
  }
1622
1611
  }
1623
- if (error?.code === "PARSE_ERROR" &&
1624
- error?.message.startsWith(`Error "Error: Unclosed root tag`)) {
1612
+ if ((error === null || error === void 0 ? void 0 : error.code) === "PARSE_ERROR" &&
1613
+ (error === null || error === void 0 ? void 0 : error.message.startsWith(`Error "Error: Unclosed root tag`))) {
1625
1614
  logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1626
1615
  return true;
1627
1616
  }
@@ -1630,7 +1619,7 @@ function storageRetryPolicy(options = {}) {
1630
1619
  // the resource was not found. This may be due to replication delay. So, in this
1631
1620
  // case, we'll never try the secondary again for this operation.
1632
1621
  if (response || error) {
1633
- const statusCode = response?.status ?? error?.statusCode ?? 0;
1622
+ const statusCode = (_b = (_a = response === null || response === void 0 ? void 0 : response.status) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.statusCode) !== null && _b !== void 0 ? _b : 0;
1634
1623
  if (!isPrimaryRetry && statusCode === 404) {
1635
1624
  logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
1636
1625
  return true;
@@ -1707,7 +1696,7 @@ function storageRetryPolicy(options = {}) {
1707
1696
  if (response) {
1708
1697
  return response;
1709
1698
  }
1710
- throw error ?? new coreRestPipeline.RestError("RetryPolicy failed without known error.");
1699
+ throw error !== null && error !== void 0 ? error : new coreRestPipeline.RestError("RetryPolicy failed without known error.");
1711
1700
  },
1712
1701
  };
1713
1702
  }
@@ -1989,7 +1978,8 @@ function processDownlevelPipeline(pipeline) {
1989
1978
  return undefined;
1990
1979
  }
1991
1980
  function getCoreClientOptions(pipeline) {
1992
- const { httpClient: v1Client, ...restOptions } = pipeline.options;
1981
+ var _a;
1982
+ const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]);
1993
1983
  let httpClient = pipeline._coreHttpClient;
1994
1984
  if (!httpClient) {
1995
1985
  httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient();
@@ -2001,17 +1991,13 @@ function getCoreClientOptions(pipeline) {
2001
1991
  const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
2002
1992
  ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
2003
1993
  : `${packageDetails}`;
2004
- corePipeline = coreClient.createClientPipeline({
2005
- ...restOptions,
2006
- loggingOptions: {
1994
+ corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: {
2007
1995
  additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,
2008
1996
  additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,
2009
1997
  logger: logger.info,
2010
- },
2011
- userAgentOptions: {
1998
+ }, userAgentOptions: {
2012
1999
  userAgentPrefix,
2013
- },
2014
- serializationOptions: {
2000
+ }, serializationOptions: {
2015
2001
  stringifyXML: coreXml.stringifyXML,
2016
2002
  serializerOptions: {
2017
2003
  xml: {
@@ -2020,8 +2006,7 @@ function getCoreClientOptions(pipeline) {
2020
2006
  xmlCharKey: "#",
2021
2007
  },
2022
2008
  },
2023
- },
2024
- deserializationOptions: {
2009
+ }, deserializationOptions: {
2025
2010
  parseXML: coreXml.parseXML,
2026
2011
  serializerOptions: {
2027
2012
  xml: {
@@ -2030,8 +2015,7 @@ function getCoreClientOptions(pipeline) {
2030
2015
  xmlCharKey: "#",
2031
2016
  },
2032
2017
  },
2033
- },
2034
- });
2018
+ } }));
2035
2019
  corePipeline.removePolicy({ phase: "Retry" });
2036
2020
  corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName });
2037
2021
  corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
@@ -2044,7 +2028,7 @@ function getCoreClientOptions(pipeline) {
2044
2028
  if (coreAuth.isTokenCredential(credential)) {
2045
2029
  corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
2046
2030
  credential,
2047
- scopes: restOptions.audience ?? StorageOAuthScopes,
2031
+ scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes,
2048
2032
  challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge },
2049
2033
  }), { phase: "Sign" });
2050
2034
  }
@@ -2056,12 +2040,7 @@ function getCoreClientOptions(pipeline) {
2056
2040
  }
2057
2041
  pipeline._corePipeline = corePipeline;
2058
2042
  }
2059
- return {
2060
- ...restOptions,
2061
- allowInsecureConnection: true,
2062
- httpClient,
2063
- pipeline: corePipeline,
2064
- };
2043
+ return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline });
2065
2044
  }
2066
2045
  function getCredentialFromPipeline(pipeline) {
2067
2046
  // see if we squirreled one away on the type itself
@@ -15202,6 +15181,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
15202
15181
  * @param options The parameter options
15203
15182
  */
15204
15183
  constructor(url, options) {
15184
+ var _a, _b;
15205
15185
  if (url === undefined) {
15206
15186
  throw new Error("'url' cannot be null");
15207
15187
  }
@@ -15216,14 +15196,9 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
15216
15196
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
15217
15197
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
15218
15198
  : `${packageDetails}`;
15219
- const optionsWithDefaults = {
15220
- ...defaults,
15221
- ...options,
15222
- userAgentOptions: {
15199
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
15223
15200
  userAgentPrefix
15224
- },
15225
- endpoint: options.endpoint ?? options.baseUri ?? "{url}"
15226
- };
15201
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" });
15227
15202
  super(optionsWithDefaults);
15228
15203
  // Parameter assignments
15229
15204
  this.url = url;
@@ -15245,7 +15220,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
15245
15220
  */
15246
15221
  class StorageContextClient extends StorageClient$1 {
15247
15222
  async sendOperationRequest(operationArguments, operationSpec) {
15248
- const operationSpecToSend = { ...operationSpec };
15223
+ const operationSpecToSend = Object.assign({}, operationSpec);
15249
15224
  if (operationSpecToSend.path === "/{containerName}" ||
15250
15225
  operationSpecToSend.path === "/{containerName}/{blob}") {
15251
15226
  operationSpecToSend.path = "";
@@ -16586,20 +16561,19 @@ class BlobLeaseClient {
16586
16561
  * @returns Response data for acquire lease operation.
16587
16562
  */
16588
16563
  async acquireLease(duration, options = {}) {
16564
+ var _a, _b, _c, _d, _e;
16589
16565
  if (this._isContainer &&
16590
- ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
16591
- (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
16592
- options.conditions?.tagConditions)) {
16566
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
16567
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
16568
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
16593
16569
  throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
16594
16570
  }
16595
16571
  return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => {
16572
+ var _a;
16596
16573
  return assertResponse(await this._containerOrBlobOperation.acquireLease({
16597
16574
  abortSignal: options.abortSignal,
16598
16575
  duration,
16599
- modifiedAccessConditions: {
16600
- ...options.conditions,
16601
- ifTags: options.conditions?.tagConditions,
16602
- },
16576
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
16603
16577
  proposedLeaseId: this._leaseId,
16604
16578
  tracingOptions: updatedOptions.tracingOptions,
16605
16579
  }));
@@ -16616,19 +16590,18 @@ class BlobLeaseClient {
16616
16590
  * @returns Response data for change lease operation.
16617
16591
  */
16618
16592
  async changeLease(proposedLeaseId, options = {}) {
16593
+ var _a, _b, _c, _d, _e;
16619
16594
  if (this._isContainer &&
16620
- ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
16621
- (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
16622
- options.conditions?.tagConditions)) {
16595
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
16596
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
16597
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
16623
16598
  throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
16624
16599
  }
16625
16600
  return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => {
16601
+ var _a;
16626
16602
  const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {
16627
16603
  abortSignal: options.abortSignal,
16628
- modifiedAccessConditions: {
16629
- ...options.conditions,
16630
- ifTags: options.conditions?.tagConditions,
16631
- },
16604
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
16632
16605
  tracingOptions: updatedOptions.tracingOptions,
16633
16606
  }));
16634
16607
  this._leaseId = proposedLeaseId;
@@ -16646,19 +16619,18 @@ class BlobLeaseClient {
16646
16619
  * @returns Response data for release lease operation.
16647
16620
  */
16648
16621
  async releaseLease(options = {}) {
16622
+ var _a, _b, _c, _d, _e;
16649
16623
  if (this._isContainer &&
16650
- ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
16651
- (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
16652
- options.conditions?.tagConditions)) {
16624
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
16625
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
16626
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
16653
16627
  throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
16654
16628
  }
16655
16629
  return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => {
16630
+ var _a;
16656
16631
  return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, {
16657
16632
  abortSignal: options.abortSignal,
16658
- modifiedAccessConditions: {
16659
- ...options.conditions,
16660
- ifTags: options.conditions?.tagConditions,
16661
- },
16633
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
16662
16634
  tracingOptions: updatedOptions.tracingOptions,
16663
16635
  }));
16664
16636
  });
@@ -16673,19 +16645,18 @@ class BlobLeaseClient {
16673
16645
  * @returns Response data for renew lease operation.
16674
16646
  */
16675
16647
  async renewLease(options = {}) {
16648
+ var _a, _b, _c, _d, _e;
16676
16649
  if (this._isContainer &&
16677
- ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
16678
- (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
16679
- options.conditions?.tagConditions)) {
16650
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
16651
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
16652
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
16680
16653
  throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
16681
16654
  }
16682
16655
  return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => {
16656
+ var _a;
16683
16657
  return this._containerOrBlobOperation.renewLease(this._leaseId, {
16684
16658
  abortSignal: options.abortSignal,
16685
- modifiedAccessConditions: {
16686
- ...options.conditions,
16687
- ifTags: options.conditions?.tagConditions,
16688
- },
16659
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
16689
16660
  tracingOptions: updatedOptions.tracingOptions,
16690
16661
  });
16691
16662
  });
@@ -16702,20 +16673,19 @@ class BlobLeaseClient {
16702
16673
  * @returns Response data for break lease operation.
16703
16674
  */
16704
16675
  async breakLease(breakPeriod, options = {}) {
16676
+ var _a, _b, _c, _d, _e;
16705
16677
  if (this._isContainer &&
16706
- ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||
16707
- (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||
16708
- options.conditions?.tagConditions)) {
16678
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
16679
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
16680
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
16709
16681
  throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");
16710
16682
  }
16711
16683
  return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => {
16684
+ var _a;
16712
16685
  const operationOptions = {
16713
16686
  abortSignal: options.abortSignal,
16714
16687
  breakPeriod,
16715
- modifiedAccessConditions: {
16716
- ...options.conditions,
16717
- ifTags: options.conditions?.tagConditions,
16718
- },
16688
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
16719
16689
  tracingOptions: updatedOptions.tracingOptions,
16720
16690
  };
16721
16691
  return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions));
@@ -17639,8 +17609,6 @@ function arraysEqual(a, b) {
17639
17609
 
17640
17610
  // Copyright (c) Microsoft Corporation.
17641
17611
  // Licensed under the MIT license.
17642
- // TODO: Do a review of non-interfaces
17643
- /* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */
17644
17612
  class AvroReader {
17645
17613
  get blockOffset() {
17646
17614
  return this._blockOffset;
@@ -17699,41 +17667,43 @@ class AvroReader {
17699
17667
  hasNext() {
17700
17668
  return !this._initialized || this._itemsRemainingInBlock > 0;
17701
17669
  }
17702
- async *parseObjects(options = {}) {
17703
- if (!this._initialized) {
17704
- await this.initialize(options);
17705
- }
17706
- while (this.hasNext()) {
17707
- const result = await this._itemType.read(this._dataStream, {
17708
- abortSignal: options.abortSignal,
17709
- });
17710
- this._itemsRemainingInBlock--;
17711
- this._objectIndex++;
17712
- if (this._itemsRemainingInBlock === 0) {
17713
- const marker = await AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
17670
+ parseObjects(options = {}) {
17671
+ return tslib.__asyncGenerator(this, arguments, function* parseObjects_1() {
17672
+ if (!this._initialized) {
17673
+ yield tslib.__await(this.initialize(options));
17674
+ }
17675
+ while (this.hasNext()) {
17676
+ const result = yield tslib.__await(this._itemType.read(this._dataStream, {
17714
17677
  abortSignal: options.abortSignal,
17715
- });
17716
- this._blockOffset = this._initialBlockOffset + this._dataStream.position;
17717
- this._objectIndex = 0;
17718
- if (!arraysEqual(this._syncMarker, marker)) {
17719
- throw new Error("Stream is not a valid Avro file.");
17720
- }
17721
- try {
17722
- this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
17678
+ }));
17679
+ this._itemsRemainingInBlock--;
17680
+ this._objectIndex++;
17681
+ if (this._itemsRemainingInBlock === 0) {
17682
+ const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
17723
17683
  abortSignal: options.abortSignal,
17724
- });
17725
- }
17726
- catch (err) {
17727
- // We hit the end of the stream.
17728
- this._itemsRemainingInBlock = 0;
17729
- }
17730
- if (this._itemsRemainingInBlock > 0) {
17731
- // Ignore block size
17732
- await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
17684
+ }));
17685
+ this._blockOffset = this._initialBlockOffset + this._dataStream.position;
17686
+ this._objectIndex = 0;
17687
+ if (!arraysEqual(this._syncMarker, marker)) {
17688
+ throw new Error("Stream is not a valid Avro file.");
17689
+ }
17690
+ try {
17691
+ this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, {
17692
+ abortSignal: options.abortSignal,
17693
+ }));
17694
+ }
17695
+ catch (err) {
17696
+ // We hit the end of the stream.
17697
+ this._itemsRemainingInBlock = 0;
17698
+ }
17699
+ if (this._itemsRemainingInBlock > 0) {
17700
+ // Ignore block size
17701
+ yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }));
17702
+ }
17733
17703
  }
17704
+ yield yield tslib.__await(result);
17734
17705
  }
17735
- yield result;
17736
- }
17706
+ });
17737
17707
  }
17738
17708
  }
17739
17709
 
@@ -17761,7 +17731,8 @@ class AvroReadableFromStream extends AvroReadable {
17761
17731
  return this._position;
17762
17732
  }
17763
17733
  async read(size, options = {}) {
17764
- if (options.abortSignal?.aborted) {
17734
+ var _a;
17735
+ if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
17765
17736
  throw ABORT_ERROR;
17766
17737
  }
17767
17738
  if (size < 0) {
@@ -18421,18 +18392,11 @@ function rangeResponseFromModel(response) {
18421
18392
  offset: x.start,
18422
18393
  count: x.end - x.start,
18423
18394
  }));
18424
- return {
18425
- ...response,
18426
- pageRange,
18427
- clearRange,
18428
- _response: {
18429
- ...response._response,
18430
- parsedBody: {
18395
+ return Object.assign(Object.assign({}, response), { pageRange,
18396
+ clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: {
18431
18397
  pageRange,
18432
18398
  clearRange,
18433
- },
18434
- },
18435
- };
18399
+ } }) });
18436
18400
  }
18437
18401
 
18438
18402
  // Copyright (c) Microsoft Corporation.
@@ -18450,12 +18414,9 @@ class BlobBeginCopyFromUrlPoller extends coreLro.Poller {
18450
18414
  if (resumeFrom) {
18451
18415
  state = JSON.parse(resumeFrom).state;
18452
18416
  }
18453
- const operation = makeBlobBeginCopyFromURLPollOperation({
18454
- ...state,
18455
- blobClient,
18417
+ const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { blobClient,
18456
18418
  copySource,
18457
- startCopyFromURLOptions,
18458
- });
18419
+ startCopyFromURLOptions }));
18459
18420
  super(operation);
18460
18421
  if (typeof onProgress === "function") {
18461
18422
  this.onProgress(onProgress);
@@ -18559,7 +18520,7 @@ const toString = function toString() {
18559
18520
  */
18560
18521
  function makeBlobBeginCopyFromURLPollOperation(state) {
18561
18522
  return {
18562
- state: { ...state },
18523
+ state: Object.assign({}, state),
18563
18524
  cancel,
18564
18525
  toString,
18565
18526
  update,
@@ -19432,13 +19393,11 @@ class BlobClient extends StorageClient {
19432
19393
  options.conditions = options.conditions || {};
19433
19394
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
19434
19395
  return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => {
19396
+ var _a;
19435
19397
  const res = assertResponse(await this.blobContext.download({
19436
19398
  abortSignal: options.abortSignal,
19437
19399
  leaseAccessConditions: options.conditions,
19438
- modifiedAccessConditions: {
19439
- ...options.conditions,
19440
- ifTags: options.conditions?.tagConditions,
19441
- },
19400
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19442
19401
  requestOptions: {
19443
19402
  onDownloadProgress: coreUtil.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
19444
19403
  },
@@ -19449,12 +19408,7 @@ class BlobClient extends StorageClient {
19449
19408
  cpkInfo: options.customerProvidedKey,
19450
19409
  tracingOptions: updatedOptions.tracingOptions,
19451
19410
  }));
19452
- const wrappedRes = {
19453
- ...res,
19454
- _response: res._response,
19455
- objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
19456
- objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
19457
- };
19411
+ const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
19458
19412
  // Return browser response immediately
19459
19413
  if (!coreUtil.isNode) {
19460
19414
  return wrappedRes;
@@ -19475,6 +19429,7 @@ class BlobClient extends StorageClient {
19475
19429
  throw new RangeError(`File download response doesn't contain valid etag header`);
19476
19430
  }
19477
19431
  return new BlobDownloadResponse(wrappedRes, async (start) => {
19432
+ var _a;
19478
19433
  const updatedDownloadOptions = {
19479
19434
  leaseAccessConditions: options.conditions,
19480
19435
  modifiedAccessConditions: {
@@ -19482,7 +19437,7 @@ class BlobClient extends StorageClient {
19482
19437
  ifModifiedSince: options.conditions.ifModifiedSince,
19483
19438
  ifNoneMatch: options.conditions.ifNoneMatch,
19484
19439
  ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
19485
- ifTags: options.conditions?.tagConditions,
19440
+ ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions,
19486
19441
  },
19487
19442
  range: rangeToString({
19488
19443
  count: offset + res.contentLength - start,
@@ -19499,10 +19454,7 @@ class BlobClient extends StorageClient {
19499
19454
  // updatedOptions.range
19500
19455
  // }, options: ${JSON.stringify(updatedOptions)}`
19501
19456
  // );
19502
- return (await this.blobContext.download({
19503
- abortSignal: options.abortSignal,
19504
- ...updatedDownloadOptions,
19505
- })).readableStreamBody;
19457
+ return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;
19506
19458
  }, offset, res.contentLength, {
19507
19459
  maxRetryRequests: options.maxRetryRequests,
19508
19460
  onProgress: options.onProgress,
@@ -19561,22 +19513,15 @@ class BlobClient extends StorageClient {
19561
19513
  options.conditions = options.conditions || {};
19562
19514
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
19563
19515
  return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => {
19516
+ var _a;
19564
19517
  const res = assertResponse(await this.blobContext.getProperties({
19565
19518
  abortSignal: options.abortSignal,
19566
19519
  leaseAccessConditions: options.conditions,
19567
- modifiedAccessConditions: {
19568
- ...options.conditions,
19569
- ifTags: options.conditions?.tagConditions,
19570
- },
19520
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19571
19521
  cpkInfo: options.customerProvidedKey,
19572
19522
  tracingOptions: updatedOptions.tracingOptions,
19573
19523
  }));
19574
- return {
19575
- ...res,
19576
- _response: res._response,
19577
- objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
19578
- objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
19579
- };
19524
+ return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
19580
19525
  });
19581
19526
  }
19582
19527
  /**
@@ -19591,14 +19536,12 @@ class BlobClient extends StorageClient {
19591
19536
  async delete(options = {}) {
19592
19537
  options.conditions = options.conditions || {};
19593
19538
  return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => {
19539
+ var _a;
19594
19540
  return assertResponse(await this.blobContext.delete({
19595
19541
  abortSignal: options.abortSignal,
19596
19542
  deleteSnapshots: options.deleteSnapshots,
19597
19543
  leaseAccessConditions: options.conditions,
19598
- modifiedAccessConditions: {
19599
- ...options.conditions,
19600
- ifTags: options.conditions?.tagConditions,
19601
- },
19544
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19602
19545
  tracingOptions: updatedOptions.tracingOptions,
19603
19546
  }));
19604
19547
  });
@@ -19614,21 +19557,14 @@ class BlobClient extends StorageClient {
19614
19557
  */
19615
19558
  async deleteIfExists(options = {}) {
19616
19559
  return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => {
19560
+ var _a, _b;
19617
19561
  try {
19618
19562
  const res = assertResponse(await this.delete(updatedOptions));
19619
- return {
19620
- succeeded: true,
19621
- ...res,
19622
- _response: res._response, // _response is made non-enumerable
19623
- };
19563
+ return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
19624
19564
  }
19625
19565
  catch (e) {
19626
- if (e.details?.errorCode === "BlobNotFound") {
19627
- return {
19628
- succeeded: false,
19629
- ...e.response?.parsedHeaders,
19630
- _response: e.response,
19631
- };
19566
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") {
19567
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
19632
19568
  }
19633
19569
  throw e;
19634
19570
  }
@@ -19669,14 +19605,12 @@ class BlobClient extends StorageClient {
19669
19605
  options.conditions = options.conditions || {};
19670
19606
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
19671
19607
  return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => {
19608
+ var _a;
19672
19609
  return assertResponse(await this.blobContext.setHttpHeaders({
19673
19610
  abortSignal: options.abortSignal,
19674
19611
  blobHttpHeaders: blobHTTPHeaders,
19675
19612
  leaseAccessConditions: options.conditions,
19676
- modifiedAccessConditions: {
19677
- ...options.conditions,
19678
- ifTags: options.conditions?.tagConditions,
19679
- },
19613
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19680
19614
  // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger.
19681
19615
  tracingOptions: updatedOptions.tracingOptions,
19682
19616
  }));
@@ -19697,14 +19631,12 @@ class BlobClient extends StorageClient {
19697
19631
  options.conditions = options.conditions || {};
19698
19632
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
19699
19633
  return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => {
19634
+ var _a;
19700
19635
  return assertResponse(await this.blobContext.setMetadata({
19701
19636
  abortSignal: options.abortSignal,
19702
19637
  leaseAccessConditions: options.conditions,
19703
19638
  metadata,
19704
- modifiedAccessConditions: {
19705
- ...options.conditions,
19706
- ifTags: options.conditions?.tagConditions,
19707
- },
19639
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19708
19640
  cpkInfo: options.customerProvidedKey,
19709
19641
  encryptionScope: options.encryptionScope,
19710
19642
  tracingOptions: updatedOptions.tracingOptions,
@@ -19722,13 +19654,11 @@ class BlobClient extends StorageClient {
19722
19654
  */
19723
19655
  async setTags(tags, options = {}) {
19724
19656
  return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => {
19657
+ var _a;
19725
19658
  return assertResponse(await this.blobContext.setTags({
19726
19659
  abortSignal: options.abortSignal,
19727
19660
  leaseAccessConditions: options.conditions,
19728
- modifiedAccessConditions: {
19729
- ...options.conditions,
19730
- ifTags: options.conditions?.tagConditions,
19731
- },
19661
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19732
19662
  tracingOptions: updatedOptions.tracingOptions,
19733
19663
  tags: toBlobTags(tags),
19734
19664
  }));
@@ -19741,20 +19671,14 @@ class BlobClient extends StorageClient {
19741
19671
  */
19742
19672
  async getTags(options = {}) {
19743
19673
  return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => {
19674
+ var _a;
19744
19675
  const response = assertResponse(await this.blobContext.getTags({
19745
19676
  abortSignal: options.abortSignal,
19746
19677
  leaseAccessConditions: options.conditions,
19747
- modifiedAccessConditions: {
19748
- ...options.conditions,
19749
- ifTags: options.conditions?.tagConditions,
19750
- },
19678
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19751
19679
  tracingOptions: updatedOptions.tracingOptions,
19752
19680
  }));
19753
- const wrappedResponse = {
19754
- ...response,
19755
- _response: response._response,
19756
- tags: toTags({ blobTagSet: response.blobTagSet }) || {},
19757
- };
19681
+ const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} });
19758
19682
  return wrappedResponse;
19759
19683
  });
19760
19684
  }
@@ -19777,14 +19701,12 @@ class BlobClient extends StorageClient {
19777
19701
  options.conditions = options.conditions || {};
19778
19702
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
19779
19703
  return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => {
19704
+ var _a;
19780
19705
  return assertResponse(await this.blobContext.createSnapshot({
19781
19706
  abortSignal: options.abortSignal,
19782
19707
  leaseAccessConditions: options.conditions,
19783
19708
  metadata: options.metadata,
19784
- modifiedAccessConditions: {
19785
- ...options.conditions,
19786
- ifTags: options.conditions?.tagConditions,
19787
- },
19709
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19788
19710
  cpkInfo: options.customerProvidedKey,
19789
19711
  encryptionScope: options.encryptionScope,
19790
19712
  tracingOptions: updatedOptions.tracingOptions,
@@ -19911,26 +19833,24 @@ class BlobClient extends StorageClient {
19911
19833
  options.conditions = options.conditions || {};
19912
19834
  options.sourceConditions = options.sourceConditions || {};
19913
19835
  return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => {
19836
+ var _a, _b, _c, _d, _e, _f, _g;
19914
19837
  return assertResponse(await this.blobContext.copyFromURL(copySource, {
19915
19838
  abortSignal: options.abortSignal,
19916
19839
  metadata: options.metadata,
19917
19840
  leaseAccessConditions: options.conditions,
19918
- modifiedAccessConditions: {
19919
- ...options.conditions,
19920
- ifTags: options.conditions?.tagConditions,
19921
- },
19841
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19922
19842
  sourceModifiedAccessConditions: {
19923
- sourceIfMatch: options.sourceConditions?.ifMatch,
19924
- sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
19925
- sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
19926
- sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
19843
+ sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
19844
+ sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
19845
+ sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
19846
+ sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
19927
19847
  },
19928
19848
  sourceContentMD5: options.sourceContentMD5,
19929
19849
  copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
19930
19850
  tier: toAccessTier(options.tier),
19931
19851
  blobTagsString: toBlobTagsString(options.tags),
19932
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
19933
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
19852
+ immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn,
19853
+ immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode,
19934
19854
  legalHold: options.legalHold,
19935
19855
  encryptionScope: options.encryptionScope,
19936
19856
  copySourceTags: options.copySourceTags,
@@ -19951,19 +19871,18 @@ class BlobClient extends StorageClient {
19951
19871
  */
19952
19872
  async setAccessTier(tier, options = {}) {
19953
19873
  return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => {
19874
+ var _a;
19954
19875
  return assertResponse(await this.blobContext.setTier(toAccessTier(tier), {
19955
19876
  abortSignal: options.abortSignal,
19956
19877
  leaseAccessConditions: options.conditions,
19957
- modifiedAccessConditions: {
19958
- ...options.conditions,
19959
- ifTags: options.conditions?.tagConditions,
19960
- },
19878
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
19961
19879
  rehydratePriority: options.rehydratePriority,
19962
19880
  tracingOptions: updatedOptions.tracingOptions,
19963
19881
  }));
19964
19882
  });
19965
19883
  }
19966
19884
  async downloadToBuffer(param1, param2, param3, param4 = {}) {
19885
+ var _a;
19967
19886
  let buffer;
19968
19887
  let offset = 0;
19969
19888
  let count = 0;
@@ -19978,7 +19897,7 @@ class BlobClient extends StorageClient {
19978
19897
  count = typeof param2 === "number" ? param2 : 0;
19979
19898
  options = param3 || {};
19980
19899
  }
19981
- let blockSize = options.blockSize ?? 0;
19900
+ let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0;
19982
19901
  if (blockSize < 0) {
19983
19902
  throw new RangeError("blockSize option must be >= 0");
19984
19903
  }
@@ -19997,10 +19916,7 @@ class BlobClient extends StorageClient {
19997
19916
  return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => {
19998
19917
  // Customer doesn't specify length, get it
19999
19918
  if (!count) {
20000
- const response = await this.getProperties({
20001
- ...options,
20002
- tracingOptions: updatedOptions.tracingOptions,
20003
- });
19919
+ const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
20004
19920
  count = response.contentLength - offset;
20005
19921
  if (count < 0) {
20006
19922
  throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`);
@@ -20067,10 +19983,7 @@ class BlobClient extends StorageClient {
20067
19983
  */
20068
19984
  async downloadToFile(filePath, offset = 0, count, options = {}) {
20069
19985
  return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => {
20070
- const response = await this.download(offset, count, {
20071
- ...options,
20072
- tracingOptions: updatedOptions.tracingOptions,
20073
- });
19986
+ const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
20074
19987
  if (response.readableStreamBody) {
20075
19988
  await readStreamToLocalFile(response.readableStreamBody, filePath);
20076
19989
  }
@@ -20143,16 +20056,14 @@ class BlobClient extends StorageClient {
20143
20056
  */
20144
20057
  async startCopyFromURL(copySource, options = {}) {
20145
20058
  return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => {
20059
+ var _a, _b, _c;
20146
20060
  options.conditions = options.conditions || {};
20147
20061
  options.sourceConditions = options.sourceConditions || {};
20148
20062
  return assertResponse(await this.blobContext.startCopyFromURL(copySource, {
20149
20063
  abortSignal: options.abortSignal,
20150
20064
  leaseAccessConditions: options.conditions,
20151
20065
  metadata: options.metadata,
20152
- modifiedAccessConditions: {
20153
- ...options.conditions,
20154
- ifTags: options.conditions?.tagConditions,
20155
- },
20066
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20156
20067
  sourceModifiedAccessConditions: {
20157
20068
  sourceIfMatch: options.sourceConditions.ifMatch,
20158
20069
  sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
@@ -20160,8 +20071,8 @@ class BlobClient extends StorageClient {
20160
20071
  sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
20161
20072
  sourceIfTags: options.sourceConditions.tagConditions,
20162
20073
  },
20163
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
20164
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
20074
+ immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
20075
+ immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
20165
20076
  legalHold: options.legalHold,
20166
20077
  rehydratePriority: options.rehydratePriority,
20167
20078
  tier: toAccessTier(options.tier),
@@ -20187,13 +20098,7 @@ class BlobClient extends StorageClient {
20187
20098
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
20188
20099
  throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
20189
20100
  }
20190
- const sas = generateBlobSASQueryParameters({
20191
- containerName: this._containerName,
20192
- blobName: this._name,
20193
- snapshotTime: this._snapshot,
20194
- versionId: this._versionId,
20195
- ...options,
20196
- }, this.credential).toString();
20101
+ const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString();
20197
20102
  resolve(appendToURLQuery(this.url, sas));
20198
20103
  });
20199
20104
  }
@@ -20336,19 +20241,17 @@ class AppendBlobClient extends BlobClient {
20336
20241
  options.conditions = options.conditions || {};
20337
20242
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20338
20243
  return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => {
20244
+ var _a, _b, _c;
20339
20245
  return assertResponse(await this.appendBlobContext.create(0, {
20340
20246
  abortSignal: options.abortSignal,
20341
20247
  blobHttpHeaders: options.blobHTTPHeaders,
20342
20248
  leaseAccessConditions: options.conditions,
20343
20249
  metadata: options.metadata,
20344
- modifiedAccessConditions: {
20345
- ...options.conditions,
20346
- ifTags: options.conditions?.tagConditions,
20347
- },
20250
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20348
20251
  cpkInfo: options.customerProvidedKey,
20349
20252
  encryptionScope: options.encryptionScope,
20350
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
20351
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
20253
+ immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
20254
+ immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
20352
20255
  legalHold: options.legalHold,
20353
20256
  blobTagsString: toBlobTagsString(options.tags),
20354
20257
  tracingOptions: updatedOptions.tracingOptions,
@@ -20365,24 +20268,14 @@ class AppendBlobClient extends BlobClient {
20365
20268
  async createIfNotExists(options = {}) {
20366
20269
  const conditions = { ifNoneMatch: ETagAny };
20367
20270
  return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => {
20271
+ var _a, _b;
20368
20272
  try {
20369
- const res = assertResponse(await this.create({
20370
- ...updatedOptions,
20371
- conditions,
20372
- }));
20373
- return {
20374
- succeeded: true,
20375
- ...res,
20376
- _response: res._response, // _response is made non-enumerable
20377
- };
20273
+ const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions })));
20274
+ return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
20378
20275
  }
20379
20276
  catch (e) {
20380
- if (e.details?.errorCode === "BlobAlreadyExists") {
20381
- return {
20382
- succeeded: false,
20383
- ...e.response?.parsedHeaders,
20384
- _response: e.response,
20385
- };
20277
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
20278
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
20386
20279
  }
20387
20280
  throw e;
20388
20281
  }
@@ -20396,14 +20289,12 @@ class AppendBlobClient extends BlobClient {
20396
20289
  async seal(options = {}) {
20397
20290
  options.conditions = options.conditions || {};
20398
20291
  return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => {
20292
+ var _a;
20399
20293
  return assertResponse(await this.appendBlobContext.seal({
20400
20294
  abortSignal: options.abortSignal,
20401
20295
  appendPositionAccessConditions: options.conditions,
20402
20296
  leaseAccessConditions: options.conditions,
20403
- modifiedAccessConditions: {
20404
- ...options.conditions,
20405
- ifTags: options.conditions?.tagConditions,
20406
- },
20297
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20407
20298
  tracingOptions: updatedOptions.tracingOptions,
20408
20299
  }));
20409
20300
  });
@@ -20436,14 +20327,12 @@ class AppendBlobClient extends BlobClient {
20436
20327
  options.conditions = options.conditions || {};
20437
20328
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20438
20329
  return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => {
20330
+ var _a;
20439
20331
  return assertResponse(await this.appendBlobContext.appendBlock(contentLength, body, {
20440
20332
  abortSignal: options.abortSignal,
20441
20333
  appendPositionAccessConditions: options.conditions,
20442
20334
  leaseAccessConditions: options.conditions,
20443
- modifiedAccessConditions: {
20444
- ...options.conditions,
20445
- ifTags: options.conditions?.tagConditions,
20446
- },
20335
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20447
20336
  requestOptions: {
20448
20337
  onUploadProgress: options.onProgress,
20449
20338
  },
@@ -20474,6 +20363,7 @@ class AppendBlobClient extends BlobClient {
20474
20363
  options.sourceConditions = options.sourceConditions || {};
20475
20364
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20476
20365
  return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => {
20366
+ var _a, _b, _c, _d, _e;
20477
20367
  return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, {
20478
20368
  abortSignal: options.abortSignal,
20479
20369
  sourceRange: rangeToString({ offset: sourceOffset, count }),
@@ -20481,15 +20371,12 @@ class AppendBlobClient extends BlobClient {
20481
20371
  sourceContentCrc64: options.sourceContentCrc64,
20482
20372
  leaseAccessConditions: options.conditions,
20483
20373
  appendPositionAccessConditions: options.conditions,
20484
- modifiedAccessConditions: {
20485
- ...options.conditions,
20486
- ifTags: options.conditions?.tagConditions,
20487
- },
20374
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20488
20375
  sourceModifiedAccessConditions: {
20489
- sourceIfMatch: options.sourceConditions?.ifMatch,
20490
- sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
20491
- sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
20492
- sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
20376
+ sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
20377
+ sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
20378
+ sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
20379
+ sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
20493
20380
  },
20494
20381
  copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
20495
20382
  cpkInfo: options.customerProvidedKey,
@@ -20621,6 +20508,7 @@ class BlockBlobClient extends BlobClient {
20621
20508
  throw new Error("This operation currently is only supported in Node.js.");
20622
20509
  }
20623
20510
  return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => {
20511
+ var _a;
20624
20512
  const response = assertResponse(await this._blobContext.query({
20625
20513
  abortSignal: options.abortSignal,
20626
20514
  queryRequest: {
@@ -20630,10 +20518,7 @@ class BlockBlobClient extends BlobClient {
20630
20518
  outputSerialization: toQuerySerialization(options.outputTextConfiguration),
20631
20519
  },
20632
20520
  leaseAccessConditions: options.conditions,
20633
- modifiedAccessConditions: {
20634
- ...options.conditions,
20635
- ifTags: options.conditions?.tagConditions,
20636
- },
20521
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20637
20522
  cpkInfo: options.customerProvidedKey,
20638
20523
  tracingOptions: updatedOptions.tracingOptions,
20639
20524
  }));
@@ -20675,22 +20560,20 @@ class BlockBlobClient extends BlobClient {
20675
20560
  options.conditions = options.conditions || {};
20676
20561
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20677
20562
  return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => {
20563
+ var _a, _b, _c;
20678
20564
  return assertResponse(await this.blockBlobContext.upload(contentLength, body, {
20679
20565
  abortSignal: options.abortSignal,
20680
20566
  blobHttpHeaders: options.blobHTTPHeaders,
20681
20567
  leaseAccessConditions: options.conditions,
20682
20568
  metadata: options.metadata,
20683
- modifiedAccessConditions: {
20684
- ...options.conditions,
20685
- ifTags: options.conditions?.tagConditions,
20686
- },
20569
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20687
20570
  requestOptions: {
20688
20571
  onUploadProgress: options.onProgress,
20689
20572
  },
20690
20573
  cpkInfo: options.customerProvidedKey,
20691
20574
  encryptionScope: options.encryptionScope,
20692
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
20693
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
20575
+ immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
20576
+ immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
20694
20577
  legalHold: options.legalHold,
20695
20578
  tier: toAccessTier(options.tier),
20696
20579
  blobTagsString: toBlobTagsString(options.tags),
@@ -20720,28 +20603,14 @@ class BlockBlobClient extends BlobClient {
20720
20603
  options.conditions = options.conditions || {};
20721
20604
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20722
20605
  return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => {
20723
- return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, {
20724
- ...options,
20725
- blobHttpHeaders: options.blobHTTPHeaders,
20726
- leaseAccessConditions: options.conditions,
20727
- modifiedAccessConditions: {
20728
- ...options.conditions,
20729
- ifTags: options.conditions?.tagConditions,
20730
- },
20731
- sourceModifiedAccessConditions: {
20732
- sourceIfMatch: options.sourceConditions?.ifMatch,
20733
- sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
20734
- sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
20735
- sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
20736
- sourceIfTags: options.sourceConditions?.tagConditions,
20737
- },
20738
- cpkInfo: options.customerProvidedKey,
20739
- copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
20740
- tier: toAccessTier(options.tier),
20741
- blobTagsString: toBlobTagsString(options.tags),
20742
- copySourceTags: options.copySourceTags,
20743
- tracingOptions: updatedOptions.tracingOptions,
20744
- }));
20606
+ var _a, _b, _c, _d, _e, _f;
20607
+ 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: {
20608
+ sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
20609
+ sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
20610
+ sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
20611
+ sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
20612
+ sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions,
20613
+ }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions })));
20745
20614
  });
20746
20615
  }
20747
20616
  /**
@@ -20825,19 +20694,17 @@ class BlockBlobClient extends BlobClient {
20825
20694
  options.conditions = options.conditions || {};
20826
20695
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
20827
20696
  return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => {
20697
+ var _a, _b, _c;
20828
20698
  return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks }, {
20829
20699
  abortSignal: options.abortSignal,
20830
20700
  blobHttpHeaders: options.blobHTTPHeaders,
20831
20701
  leaseAccessConditions: options.conditions,
20832
20702
  metadata: options.metadata,
20833
- modifiedAccessConditions: {
20834
- ...options.conditions,
20835
- ifTags: options.conditions?.tagConditions,
20836
- },
20703
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20837
20704
  cpkInfo: options.customerProvidedKey,
20838
20705
  encryptionScope: options.encryptionScope,
20839
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
20840
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
20706
+ immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
20707
+ immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
20841
20708
  legalHold: options.legalHold,
20842
20709
  tier: toAccessTier(options.tier),
20843
20710
  blobTagsString: toBlobTagsString(options.tags),
@@ -20857,13 +20724,11 @@ class BlockBlobClient extends BlobClient {
20857
20724
  */
20858
20725
  async getBlockList(listType, options = {}) {
20859
20726
  return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => {
20727
+ var _a;
20860
20728
  const res = assertResponse(await this.blockBlobContext.getBlockList(listType, {
20861
20729
  abortSignal: options.abortSignal,
20862
20730
  leaseAccessConditions: options.conditions,
20863
- modifiedAccessConditions: {
20864
- ...options.conditions,
20865
- ifTags: options.conditions?.tagConditions,
20866
- },
20731
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
20867
20732
  tracingOptions: updatedOptions.tracingOptions,
20868
20733
  }));
20869
20734
  if (!res.committedBlocks) {
@@ -20954,11 +20819,12 @@ class BlockBlobClient extends BlobClient {
20954
20819
  * @returns Response data for the Blob Upload operation.
20955
20820
  */
20956
20821
  async uploadSeekableInternal(bodyFactory, size, options = {}) {
20957
- let blockSize = options.blockSize ?? 0;
20822
+ var _a, _b;
20823
+ let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0;
20958
20824
  if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
20959
20825
  throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);
20960
20826
  }
20961
- const maxSingleShotSize = options.maxSingleShotSize ?? BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
20827
+ const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
20962
20828
  if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
20963
20829
  throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);
20964
20830
  }
@@ -21041,10 +20907,7 @@ class BlockBlobClient extends BlobClient {
21041
20907
  end: count ? offset + count - 1 : Infinity,
21042
20908
  start: offset,
21043
20909
  });
21044
- }, size, {
21045
- ...options,
21046
- tracingOptions: updatedOptions.tracingOptions,
21047
- });
20910
+ }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }));
21048
20911
  });
21049
20912
  }
21050
20913
  /**
@@ -21096,10 +20959,7 @@ class BlockBlobClient extends BlobClient {
21096
20959
  // Outgoing queue shouldn't be empty.
21097
20960
  Math.ceil((maxConcurrency / 4) * 3));
21098
20961
  await scheduler.do();
21099
- return assertResponse(await this.commitBlockList(blockList, {
21100
- ...options,
21101
- tracingOptions: updatedOptions.tracingOptions,
21102
- }));
20962
+ return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })));
21103
20963
  });
21104
20964
  }
21105
20965
  }
@@ -21198,20 +21058,18 @@ class PageBlobClient extends BlobClient {
21198
21058
  options.conditions = options.conditions || {};
21199
21059
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
21200
21060
  return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => {
21061
+ var _a, _b, _c;
21201
21062
  return assertResponse(await this.pageBlobContext.create(0, size, {
21202
21063
  abortSignal: options.abortSignal,
21203
21064
  blobHttpHeaders: options.blobHTTPHeaders,
21204
21065
  blobSequenceNumber: options.blobSequenceNumber,
21205
21066
  leaseAccessConditions: options.conditions,
21206
21067
  metadata: options.metadata,
21207
- modifiedAccessConditions: {
21208
- ...options.conditions,
21209
- ifTags: options.conditions?.tagConditions,
21210
- },
21068
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21211
21069
  cpkInfo: options.customerProvidedKey,
21212
21070
  encryptionScope: options.encryptionScope,
21213
- immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
21214
- immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
21071
+ immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn,
21072
+ immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode,
21215
21073
  legalHold: options.legalHold,
21216
21074
  tier: toAccessTier(options.tier),
21217
21075
  blobTagsString: toBlobTagsString(options.tags),
@@ -21230,26 +21088,15 @@ class PageBlobClient extends BlobClient {
21230
21088
  */
21231
21089
  async createIfNotExists(size, options = {}) {
21232
21090
  return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => {
21091
+ var _a, _b;
21233
21092
  try {
21234
21093
  const conditions = { ifNoneMatch: ETagAny };
21235
- const res = assertResponse(await this.create(size, {
21236
- ...options,
21237
- conditions,
21238
- tracingOptions: updatedOptions.tracingOptions,
21239
- }));
21240
- return {
21241
- succeeded: true,
21242
- ...res,
21243
- _response: res._response, // _response is made non-enumerable
21244
- };
21094
+ const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions })));
21095
+ return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
21245
21096
  }
21246
21097
  catch (e) {
21247
- if (e.details?.errorCode === "BlobAlreadyExists") {
21248
- return {
21249
- succeeded: false,
21250
- ...e.response?.parsedHeaders,
21251
- _response: e.response,
21252
- };
21098
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
21099
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
21253
21100
  }
21254
21101
  throw e;
21255
21102
  }
@@ -21269,13 +21116,11 @@ class PageBlobClient extends BlobClient {
21269
21116
  options.conditions = options.conditions || {};
21270
21117
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
21271
21118
  return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => {
21119
+ var _a;
21272
21120
  return assertResponse(await this.pageBlobContext.uploadPages(count, body, {
21273
21121
  abortSignal: options.abortSignal,
21274
21122
  leaseAccessConditions: options.conditions,
21275
- modifiedAccessConditions: {
21276
- ...options.conditions,
21277
- ifTags: options.conditions?.tagConditions,
21278
- },
21123
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21279
21124
  requestOptions: {
21280
21125
  onUploadProgress: options.onProgress,
21281
21126
  },
@@ -21305,21 +21150,19 @@ class PageBlobClient extends BlobClient {
21305
21150
  options.sourceConditions = options.sourceConditions || {};
21306
21151
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
21307
21152
  return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => {
21153
+ var _a, _b, _c, _d, _e;
21308
21154
  return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), {
21309
21155
  abortSignal: options.abortSignal,
21310
21156
  sourceContentMD5: options.sourceContentMD5,
21311
21157
  sourceContentCrc64: options.sourceContentCrc64,
21312
21158
  leaseAccessConditions: options.conditions,
21313
21159
  sequenceNumberAccessConditions: options.conditions,
21314
- modifiedAccessConditions: {
21315
- ...options.conditions,
21316
- ifTags: options.conditions?.tagConditions,
21317
- },
21160
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21318
21161
  sourceModifiedAccessConditions: {
21319
- sourceIfMatch: options.sourceConditions?.ifMatch,
21320
- sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
21321
- sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
21322
- sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
21162
+ sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
21163
+ sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince,
21164
+ sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch,
21165
+ sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
21323
21166
  },
21324
21167
  cpkInfo: options.customerProvidedKey,
21325
21168
  encryptionScope: options.encryptionScope,
@@ -21340,13 +21183,11 @@ class PageBlobClient extends BlobClient {
21340
21183
  async clearPages(offset = 0, count, options = {}) {
21341
21184
  options.conditions = options.conditions || {};
21342
21185
  return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => {
21186
+ var _a;
21343
21187
  return assertResponse(await this.pageBlobContext.clearPages(0, {
21344
21188
  abortSignal: options.abortSignal,
21345
21189
  leaseAccessConditions: options.conditions,
21346
- modifiedAccessConditions: {
21347
- ...options.conditions,
21348
- ifTags: options.conditions?.tagConditions,
21349
- },
21190
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21350
21191
  range: rangeToString({ offset, count }),
21351
21192
  sequenceNumberAccessConditions: options.conditions,
21352
21193
  cpkInfo: options.customerProvidedKey,
@@ -21367,13 +21208,11 @@ class PageBlobClient extends BlobClient {
21367
21208
  async getPageRanges(offset = 0, count, options = {}) {
21368
21209
  options.conditions = options.conditions || {};
21369
21210
  return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => {
21211
+ var _a;
21370
21212
  const response = assertResponse(await this.pageBlobContext.getPageRanges({
21371
21213
  abortSignal: options.abortSignal,
21372
21214
  leaseAccessConditions: options.conditions,
21373
- modifiedAccessConditions: {
21374
- ...options.conditions,
21375
- ifTags: options.conditions?.tagConditions,
21376
- },
21215
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21377
21216
  range: rangeToString({ offset, count }),
21378
21217
  tracingOptions: updatedOptions.tracingOptions,
21379
21218
  }));
@@ -21394,13 +21233,11 @@ class PageBlobClient extends BlobClient {
21394
21233
  */
21395
21234
  async listPageRangesSegment(offset = 0, count, marker, options = {}) {
21396
21235
  return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => {
21236
+ var _a;
21397
21237
  return assertResponse(await this.pageBlobContext.getPageRanges({
21398
21238
  abortSignal: options.abortSignal,
21399
21239
  leaseAccessConditions: options.conditions,
21400
- modifiedAccessConditions: {
21401
- ...options.conditions,
21402
- ifTags: options.conditions?.tagConditions,
21403
- },
21240
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21404
21241
  range: rangeToString({ offset, count }),
21405
21242
  marker: marker,
21406
21243
  maxPageSize: options.maxPageSize,
@@ -21422,15 +21259,17 @@ class PageBlobClient extends BlobClient {
21422
21259
  * items. The marker value is opaque to the client.
21423
21260
  * @param options - Options to List Page Ranges operation.
21424
21261
  */
21425
- async *listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
21426
- let getPageRangeItemSegmentsResponse;
21427
- if (!!marker || marker === undefined) {
21428
- do {
21429
- getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker, options);
21430
- marker = getPageRangeItemSegmentsResponse.continuationToken;
21431
- yield await getPageRangeItemSegmentsResponse;
21432
- } while (marker);
21433
- }
21262
+ listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
21263
+ return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() {
21264
+ let getPageRangeItemSegmentsResponse;
21265
+ if (!!marker || marker === undefined) {
21266
+ do {
21267
+ getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker, options));
21268
+ marker = getPageRangeItemSegmentsResponse.continuationToken;
21269
+ yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));
21270
+ } while (marker);
21271
+ }
21272
+ });
21434
21273
  }
21435
21274
  /**
21436
21275
  * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
@@ -21439,11 +21278,26 @@ class PageBlobClient extends BlobClient {
21439
21278
  * @param count - Number of bytes to get.
21440
21279
  * @param options - Options to List Page Ranges operation.
21441
21280
  */
21442
- async *listPageRangeItems(offset = 0, count, options = {}) {
21443
- let marker;
21444
- for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker, options)) {
21445
- yield* ExtractPageRangeInfoItems(getPageRangesSegment);
21446
- }
21281
+ listPageRangeItems(offset = 0, count, options = {}) {
21282
+ return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1() {
21283
+ var _a, e_1, _b, _c;
21284
+ let marker;
21285
+ try {
21286
+ for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
21287
+ _c = _f.value;
21288
+ _d = false;
21289
+ const getPageRangesSegment = _c;
21290
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
21291
+ }
21292
+ }
21293
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
21294
+ finally {
21295
+ try {
21296
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
21297
+ }
21298
+ finally { if (e_1) throw e_1.error; }
21299
+ }
21300
+ });
21447
21301
  }
21448
21302
  /**
21449
21303
  * Returns an async iterable iterator to list of page ranges for a page blob.
@@ -21537,10 +21391,7 @@ class PageBlobClient extends BlobClient {
21537
21391
  * Return an AsyncIterableIterator that works a page at a time
21538
21392
  */
21539
21393
  byPage: (settings = {}) => {
21540
- return this.listPageRangeItemSegments(offset, count, settings.continuationToken, {
21541
- maxPageSize: settings.maxPageSize,
21542
- ...options,
21543
- });
21394
+ return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
21544
21395
  },
21545
21396
  };
21546
21397
  }
@@ -21557,13 +21408,11 @@ class PageBlobClient extends BlobClient {
21557
21408
  async getPageRangesDiff(offset, count, prevSnapshot, options = {}) {
21558
21409
  options.conditions = options.conditions || {};
21559
21410
  return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => {
21411
+ var _a;
21560
21412
  const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({
21561
21413
  abortSignal: options.abortSignal,
21562
21414
  leaseAccessConditions: options.conditions,
21563
- modifiedAccessConditions: {
21564
- ...options.conditions,
21565
- ifTags: options.conditions?.tagConditions,
21566
- },
21415
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21567
21416
  prevsnapshot: prevSnapshot,
21568
21417
  range: rangeToString({ offset, count }),
21569
21418
  tracingOptions: updatedOptions.tracingOptions,
@@ -21587,20 +21436,18 @@ class PageBlobClient extends BlobClient {
21587
21436
  */
21588
21437
  async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) {
21589
21438
  return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => {
21439
+ var _a;
21590
21440
  return assertResponse(await this.pageBlobContext.getPageRangesDiff({
21591
- abortSignal: options?.abortSignal,
21592
- leaseAccessConditions: options?.conditions,
21593
- modifiedAccessConditions: {
21594
- ...options?.conditions,
21595
- ifTags: options?.conditions?.tagConditions,
21596
- },
21441
+ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
21442
+ leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions,
21443
+ 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 }),
21597
21444
  prevsnapshot: prevSnapshotOrUrl,
21598
21445
  range: rangeToString({
21599
21446
  offset: offset,
21600
21447
  count: count,
21601
21448
  }),
21602
21449
  marker: marker,
21603
- maxPageSize: options?.maxPageSize,
21450
+ maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize,
21604
21451
  tracingOptions: updatedOptions.tracingOptions,
21605
21452
  }));
21606
21453
  });
@@ -21621,15 +21468,17 @@ class PageBlobClient extends BlobClient {
21621
21468
  * items. The marker value is opaque to the client.
21622
21469
  * @param options - Options to the Page Blob Get Page Ranges Diff operation.
21623
21470
  */
21624
- async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
21625
- let getPageRangeItemSegmentsResponse;
21626
- if (!!marker || marker === undefined) {
21627
- do {
21628
- getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options);
21629
- marker = getPageRangeItemSegmentsResponse.continuationToken;
21630
- yield await getPageRangeItemSegmentsResponse;
21631
- } while (marker);
21632
- }
21471
+ listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
21472
+ return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() {
21473
+ let getPageRangeItemSegmentsResponse;
21474
+ if (!!marker || marker === undefined) {
21475
+ do {
21476
+ getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options));
21477
+ marker = getPageRangeItemSegmentsResponse.continuationToken;
21478
+ yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));
21479
+ } while (marker);
21480
+ }
21481
+ });
21633
21482
  }
21634
21483
  /**
21635
21484
  * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
@@ -21639,11 +21488,26 @@ class PageBlobClient extends BlobClient {
21639
21488
  * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
21640
21489
  * @param options - Options to the Page Blob Get Page Ranges Diff operation.
21641
21490
  */
21642
- async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
21643
- let marker;
21644
- for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)) {
21645
- yield* ExtractPageRangeInfoItems(getPageRangesSegment);
21646
- }
21491
+ listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
21492
+ return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() {
21493
+ var _a, e_2, _b, _c;
21494
+ let marker;
21495
+ try {
21496
+ for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
21497
+ _c = _f.value;
21498
+ _d = false;
21499
+ const getPageRangesSegment = _c;
21500
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));
21501
+ }
21502
+ }
21503
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
21504
+ finally {
21505
+ try {
21506
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
21507
+ }
21508
+ finally { if (e_2) throw e_2.error; }
21509
+ }
21510
+ });
21647
21511
  }
21648
21512
  /**
21649
21513
  * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
@@ -21720,9 +21584,7 @@ class PageBlobClient extends BlobClient {
21720
21584
  listPageRangesDiff(offset, count, prevSnapshot, options = {}) {
21721
21585
  options.conditions = options.conditions || {};
21722
21586
  // AsyncIterableIterator to iterate over blobs
21723
- const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, {
21724
- ...options,
21725
- });
21587
+ const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options));
21726
21588
  return {
21727
21589
  /**
21728
21590
  * The next method, part of the iteration protocol
@@ -21740,10 +21602,7 @@ class PageBlobClient extends BlobClient {
21740
21602
  * Return an AsyncIterableIterator that works a page at a time
21741
21603
  */
21742
21604
  byPage: (settings = {}) => {
21743
- return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, {
21744
- maxPageSize: settings.maxPageSize,
21745
- ...options,
21746
- });
21605
+ return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));
21747
21606
  },
21748
21607
  };
21749
21608
  }
@@ -21760,13 +21619,11 @@ class PageBlobClient extends BlobClient {
21760
21619
  async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) {
21761
21620
  options.conditions = options.conditions || {};
21762
21621
  return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => {
21622
+ var _a;
21763
21623
  const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({
21764
21624
  abortSignal: options.abortSignal,
21765
21625
  leaseAccessConditions: options.conditions,
21766
- modifiedAccessConditions: {
21767
- ...options.conditions,
21768
- ifTags: options.conditions?.tagConditions,
21769
- },
21626
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21770
21627
  prevSnapshotUrl,
21771
21628
  range: rangeToString({ offset, count }),
21772
21629
  tracingOptions: updatedOptions.tracingOptions,
@@ -21785,13 +21642,11 @@ class PageBlobClient extends BlobClient {
21785
21642
  async resize(size, options = {}) {
21786
21643
  options.conditions = options.conditions || {};
21787
21644
  return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => {
21645
+ var _a;
21788
21646
  return assertResponse(await this.pageBlobContext.resize(size, {
21789
21647
  abortSignal: options.abortSignal,
21790
21648
  leaseAccessConditions: options.conditions,
21791
- modifiedAccessConditions: {
21792
- ...options.conditions,
21793
- ifTags: options.conditions?.tagConditions,
21794
- },
21649
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21795
21650
  encryptionScope: options.encryptionScope,
21796
21651
  tracingOptions: updatedOptions.tracingOptions,
21797
21652
  }));
@@ -21809,14 +21664,12 @@ class PageBlobClient extends BlobClient {
21809
21664
  async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) {
21810
21665
  options.conditions = options.conditions || {};
21811
21666
  return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => {
21667
+ var _a;
21812
21668
  return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, {
21813
21669
  abortSignal: options.abortSignal,
21814
21670
  blobSequenceNumber: sequenceNumber,
21815
21671
  leaseAccessConditions: options.conditions,
21816
- modifiedAccessConditions: {
21817
- ...options.conditions,
21818
- ifTags: options.conditions?.tagConditions,
21819
- },
21672
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21820
21673
  tracingOptions: updatedOptions.tracingOptions,
21821
21674
  }));
21822
21675
  });
@@ -21836,12 +21689,10 @@ class PageBlobClient extends BlobClient {
21836
21689
  */
21837
21690
  async startCopyIncremental(copySource, options = {}) {
21838
21691
  return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => {
21692
+ var _a;
21839
21693
  return assertResponse(await this.pageBlobContext.copyIncremental(copySource, {
21840
21694
  abortSignal: options.abortSignal,
21841
- modifiedAccessConditions: {
21842
- ...options.conditions,
21843
- ifTags: options.conditions?.tagConditions,
21844
- },
21695
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
21845
21696
  tracingOptions: updatedOptions.tracingOptions,
21846
21697
  }));
21847
21698
  });
@@ -22422,9 +22273,7 @@ class BlobBatchClient {
22422
22273
  return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => {
22423
22274
  const batchRequestBody = batchRequest.getHttpRequestBody();
22424
22275
  // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.
22425
- const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, {
22426
- ...updatedOptions,
22427
- }));
22276
+ const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions)));
22428
22277
  // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).
22429
22278
  const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests());
22430
22279
  const responseSummary = await batchResponseParser.parseBatchResponse();
@@ -22548,21 +22397,14 @@ class ContainerClient extends StorageClient {
22548
22397
  */
22549
22398
  async createIfNotExists(options = {}) {
22550
22399
  return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => {
22400
+ var _a, _b;
22551
22401
  try {
22552
22402
  const res = await this.create(updatedOptions);
22553
- return {
22554
- succeeded: true,
22555
- ...res,
22556
- _response: res._response, // _response is made non-enumerable
22557
- };
22403
+ return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
22558
22404
  }
22559
22405
  catch (e) {
22560
- if (e.details?.errorCode === "ContainerAlreadyExists") {
22561
- return {
22562
- succeeded: false,
22563
- ...e.response?.parsedHeaders,
22564
- _response: e.response,
22565
- };
22406
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
22407
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
22566
22408
  }
22567
22409
  else {
22568
22410
  throw e;
@@ -22656,11 +22498,7 @@ class ContainerClient extends StorageClient {
22656
22498
  options.conditions = {};
22657
22499
  }
22658
22500
  return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => {
22659
- return assertResponse(await this.containerContext.getProperties({
22660
- abortSignal: options.abortSignal,
22661
- ...options.conditions,
22662
- tracingOptions: updatedOptions.tracingOptions,
22663
- }));
22501
+ return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions })));
22664
22502
  });
22665
22503
  }
22666
22504
  /**
@@ -22692,21 +22530,14 @@ class ContainerClient extends StorageClient {
22692
22530
  */
22693
22531
  async deleteIfExists(options = {}) {
22694
22532
  return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => {
22533
+ var _a, _b;
22695
22534
  try {
22696
22535
  const res = await this.delete(updatedOptions);
22697
- return {
22698
- succeeded: true,
22699
- ...res,
22700
- _response: res._response,
22701
- };
22536
+ return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
22702
22537
  }
22703
22538
  catch (e) {
22704
- if (e.details?.errorCode === "ContainerNotFound") {
22705
- return {
22706
- succeeded: false,
22707
- ...e.response?.parsedHeaders,
22708
- _response: e.response,
22709
- };
22539
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
22540
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
22710
22541
  }
22711
22542
  throw e;
22712
22543
  }
@@ -22913,30 +22744,11 @@ class ContainerClient extends StorageClient {
22913
22744
  */
22914
22745
  async listBlobFlatSegment(marker, options = {}) {
22915
22746
  return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => {
22916
- const response = assertResponse(await this.containerContext.listBlobFlatSegment({
22917
- marker,
22918
- ...options,
22919
- tracingOptions: updatedOptions.tracingOptions,
22920
- }));
22921
- const wrappedResponse = {
22922
- ...response,
22923
- _response: {
22924
- ...response._response,
22925
- parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody),
22926
- },
22927
- segment: {
22928
- ...response.segment,
22929
- blobItems: response.segment.blobItems.map((blobItemInternal) => {
22930
- const blobItem = {
22931
- ...blobItemInternal,
22932
- name: BlobNameToString(blobItemInternal.name),
22933
- tags: toTags(blobItemInternal.blobTags),
22934
- objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata),
22935
- };
22747
+ const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), { tracingOptions: updatedOptions.tracingOptions })));
22748
+ const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => {
22749
+ const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) });
22936
22750
  return blobItem;
22937
- }),
22938
- },
22939
- };
22751
+ }) }) });
22940
22752
  return wrappedResponse;
22941
22753
  });
22942
22754
  }
@@ -22953,37 +22765,15 @@ class ContainerClient extends StorageClient {
22953
22765
  */
22954
22766
  async listBlobHierarchySegment(delimiter, marker, options = {}) {
22955
22767
  return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => {
22956
- const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter, {
22957
- marker,
22958
- ...options,
22959
- tracingOptions: updatedOptions.tracingOptions,
22960
- }));
22961
- const wrappedResponse = {
22962
- ...response,
22963
- _response: {
22964
- ...response._response,
22965
- parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody),
22966
- },
22967
- segment: {
22968
- ...response.segment,
22969
- blobItems: response.segment.blobItems.map((blobItemInternal) => {
22970
- const blobItem = {
22971
- ...blobItemInternal,
22972
- name: BlobNameToString(blobItemInternal.name),
22973
- tags: toTags(blobItemInternal.blobTags),
22974
- objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata),
22975
- };
22768
+ var _a;
22769
+ const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), { tracingOptions: updatedOptions.tracingOptions })));
22770
+ const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => {
22771
+ const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) });
22976
22772
  return blobItem;
22977
- }),
22978
- blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => {
22979
- const blobPrefix = {
22980
- ...blobPrefixInternal,
22981
- name: BlobNameToString(blobPrefixInternal.name),
22982
- };
22773
+ }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
22774
+ const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });
22983
22775
  return blobPrefix;
22984
- }),
22985
- },
22986
- };
22776
+ }) }) });
22987
22777
  return wrappedResponse;
22988
22778
  });
22989
22779
  }
@@ -22999,26 +22789,43 @@ class ContainerClient extends StorageClient {
22999
22789
  * items. The marker value is opaque to the client.
23000
22790
  * @param options - Options to list blobs operation.
23001
22791
  */
23002
- async *listSegments(marker, options = {}) {
23003
- let listBlobsFlatSegmentResponse;
23004
- if (!!marker || marker === undefined) {
23005
- do {
23006
- listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options);
23007
- marker = listBlobsFlatSegmentResponse.continuationToken;
23008
- yield await listBlobsFlatSegmentResponse;
23009
- } while (marker);
23010
- }
22792
+ listSegments(marker, options = {}) {
22793
+ return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {
22794
+ let listBlobsFlatSegmentResponse;
22795
+ if (!!marker || marker === undefined) {
22796
+ do {
22797
+ listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker, options));
22798
+ marker = listBlobsFlatSegmentResponse.continuationToken;
22799
+ yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse));
22800
+ } while (marker);
22801
+ }
22802
+ });
23011
22803
  }
23012
22804
  /**
23013
22805
  * Returns an AsyncIterableIterator of {@link BlobItem} objects
23014
22806
  *
23015
22807
  * @param options - Options to list blobs operation.
23016
22808
  */
23017
- async *listItems(options = {}) {
23018
- let marker;
23019
- for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) {
23020
- yield* listBlobsFlatSegmentResponse.segment.blobItems;
23021
- }
22809
+ listItems(options = {}) {
22810
+ return tslib.__asyncGenerator(this, arguments, function* listItems_1() {
22811
+ var _a, e_1, _b, _c;
22812
+ let marker;
22813
+ try {
22814
+ for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
22815
+ _c = _f.value;
22816
+ _d = false;
22817
+ const listBlobsFlatSegmentResponse = _c;
22818
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems)));
22819
+ }
22820
+ }
22821
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
22822
+ finally {
22823
+ try {
22824
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
22825
+ }
22826
+ finally { if (e_1) throw e_1.error; }
22827
+ }
22828
+ });
23022
22829
  }
23023
22830
  /**
23024
22831
  * Returns an async iterable iterator to list all the blobs
@@ -23125,10 +22932,7 @@ class ContainerClient extends StorageClient {
23125
22932
  if (options.prefix === "") {
23126
22933
  options.prefix = undefined;
23127
22934
  }
23128
- const updatedOptions = {
23129
- ...options,
23130
- ...(include.length > 0 ? { include: include } : {}),
23131
- };
22935
+ const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
23132
22936
  // AsyncIterableIterator to iterate over blobs
23133
22937
  const iter = this.listItems(updatedOptions);
23134
22938
  return {
@@ -23148,10 +22952,7 @@ class ContainerClient extends StorageClient {
23148
22952
  * Return an AsyncIterableIterator that works a page at a time
23149
22953
  */
23150
22954
  byPage: (settings = {}) => {
23151
- return this.listSegments(settings.continuationToken, {
23152
- maxPageSize: settings.maxPageSize,
23153
- ...updatedOptions,
23154
- });
22955
+ return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
23155
22956
  },
23156
22957
  };
23157
22958
  }
@@ -23168,15 +22969,17 @@ class ContainerClient extends StorageClient {
23168
22969
  * items. The marker value is opaque to the client.
23169
22970
  * @param options - Options to list blobs operation.
23170
22971
  */
23171
- async *listHierarchySegments(delimiter, marker, options = {}) {
23172
- let listBlobsHierarchySegmentResponse;
23173
- if (!!marker || marker === undefined) {
23174
- do {
23175
- listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(delimiter, marker, options);
23176
- marker = listBlobsHierarchySegmentResponse.continuationToken;
23177
- yield await listBlobsHierarchySegmentResponse;
23178
- } while (marker);
23179
- }
22972
+ listHierarchySegments(delimiter, marker, options = {}) {
22973
+ return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1() {
22974
+ let listBlobsHierarchySegmentResponse;
22975
+ if (!!marker || marker === undefined) {
22976
+ do {
22977
+ listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter, marker, options));
22978
+ marker = listBlobsHierarchySegmentResponse.continuationToken;
22979
+ yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse));
22980
+ } while (marker);
22981
+ }
22982
+ });
23180
22983
  }
23181
22984
  /**
23182
22985
  * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects.
@@ -23184,22 +22987,34 @@ class ContainerClient extends StorageClient {
23184
22987
  * @param delimiter - The character or string used to define the virtual hierarchy
23185
22988
  * @param options - Options to list blobs operation.
23186
22989
  */
23187
- async *listItemsByHierarchy(delimiter, options = {}) {
23188
- let marker;
23189
- for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(delimiter, marker, options)) {
23190
- const segment = listBlobsHierarchySegmentResponse.segment;
23191
- if (segment.blobPrefixes) {
23192
- for (const prefix of segment.blobPrefixes) {
23193
- yield {
23194
- kind: "prefix",
23195
- ...prefix,
23196
- };
22990
+ listItemsByHierarchy(delimiter, options = {}) {
22991
+ return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1() {
22992
+ var _a, e_2, _b, _c;
22993
+ let marker;
22994
+ try {
22995
+ for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter, marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
22996
+ _c = _f.value;
22997
+ _d = false;
22998
+ const listBlobsHierarchySegmentResponse = _c;
22999
+ const segment = listBlobsHierarchySegmentResponse.segment;
23000
+ if (segment.blobPrefixes) {
23001
+ for (const prefix of segment.blobPrefixes) {
23002
+ yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix));
23003
+ }
23004
+ }
23005
+ for (const blob of segment.blobItems) {
23006
+ yield yield tslib.__await(Object.assign({ kind: "blob" }, blob));
23007
+ }
23197
23008
  }
23198
23009
  }
23199
- for (const blob of segment.blobItems) {
23200
- yield { kind: "blob", ...blob };
23010
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
23011
+ finally {
23012
+ try {
23013
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
23014
+ }
23015
+ finally { if (e_2) throw e_2.error; }
23201
23016
  }
23202
- }
23017
+ });
23203
23018
  }
23204
23019
  /**
23205
23020
  * Returns an async iterable iterator to list all the blobs by hierarchy.
@@ -23317,10 +23132,7 @@ class ContainerClient extends StorageClient {
23317
23132
  if (options.prefix === "") {
23318
23133
  options.prefix = undefined;
23319
23134
  }
23320
- const updatedOptions = {
23321
- ...options,
23322
- ...(include.length > 0 ? { include: include } : {}),
23323
- };
23135
+ const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
23324
23136
  // AsyncIterableIterator to iterate over blob prefixes and blobs
23325
23137
  const iter = this.listItemsByHierarchy(delimiter, updatedOptions);
23326
23138
  return {
@@ -23340,10 +23152,7 @@ class ContainerClient extends StorageClient {
23340
23152
  * Return an AsyncIterableIterator that works a page at a time
23341
23153
  */
23342
23154
  byPage: (settings = {}) => {
23343
- return this.listHierarchySegments(delimiter, settings.continuationToken, {
23344
- maxPageSize: settings.maxPageSize,
23345
- ...updatedOptions,
23346
- });
23155
+ return this.listHierarchySegments(delimiter, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
23347
23156
  },
23348
23157
  };
23349
23158
  }
@@ -23373,17 +23182,14 @@ class ContainerClient extends StorageClient {
23373
23182
  maxPageSize: options.maxPageSize,
23374
23183
  tracingOptions: updatedOptions.tracingOptions,
23375
23184
  }));
23376
- const wrappedResponse = {
23377
- ...response,
23378
- _response: response._response,
23379
- blobs: response.blobs.map((blob) => {
23185
+ const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
23186
+ var _a;
23380
23187
  let tagValue = "";
23381
- if (blob.tags?.blobTagSet.length === 1) {
23188
+ if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {
23382
23189
  tagValue = blob.tags.blobTagSet[0].value;
23383
23190
  }
23384
- return { ...blob, tags: toTags(blob.tags), tagValue };
23385
- }),
23386
- };
23191
+ return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
23192
+ }) });
23387
23193
  return wrappedResponse;
23388
23194
  });
23389
23195
  }
@@ -23403,16 +23209,18 @@ class ContainerClient extends StorageClient {
23403
23209
  * items. The marker value is opaque to the client.
23404
23210
  * @param options - Options to find blobs by tags.
23405
23211
  */
23406
- async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
23407
- let response;
23408
- if (!!marker || marker === undefined) {
23409
- do {
23410
- response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
23411
- response.blobs = response.blobs || [];
23412
- marker = response.continuationToken;
23413
- yield response;
23414
- } while (marker);
23415
- }
23212
+ findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
23213
+ return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {
23214
+ let response;
23215
+ if (!!marker || marker === undefined) {
23216
+ do {
23217
+ response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));
23218
+ response.blobs = response.blobs || [];
23219
+ marker = response.continuationToken;
23220
+ yield yield tslib.__await(response);
23221
+ } while (marker);
23222
+ }
23223
+ });
23416
23224
  }
23417
23225
  /**
23418
23226
  * Returns an AsyncIterableIterator for blobs.
@@ -23423,11 +23231,26 @@ class ContainerClient extends StorageClient {
23423
23231
  * however, only a subset of the OData filter syntax is supported in the Blob service.
23424
23232
  * @param options - Options to findBlobsByTagsItems.
23425
23233
  */
23426
- async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
23427
- let marker;
23428
- for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
23429
- yield* segment.blobs;
23430
- }
23234
+ findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
23235
+ return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {
23236
+ var _a, e_3, _b, _c;
23237
+ let marker;
23238
+ try {
23239
+ for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
23240
+ _c = _f.value;
23241
+ _d = false;
23242
+ const segment = _c;
23243
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));
23244
+ }
23245
+ }
23246
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
23247
+ finally {
23248
+ try {
23249
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
23250
+ }
23251
+ finally { if (e_3) throw e_3.error; }
23252
+ }
23253
+ });
23431
23254
  }
23432
23255
  /**
23433
23256
  * Returns an async iterable iterator to find all blobs with specified tag
@@ -23508,9 +23331,7 @@ class ContainerClient extends StorageClient {
23508
23331
  */
23509
23332
  findBlobsByTags(tagFilterSqlExpression, options = {}) {
23510
23333
  // AsyncIterableIterator to iterate over blobs
23511
- const listSegmentOptions = {
23512
- ...options,
23513
- };
23334
+ const listSegmentOptions = Object.assign({}, options);
23514
23335
  const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
23515
23336
  return {
23516
23337
  /**
@@ -23529,10 +23350,7 @@ class ContainerClient extends StorageClient {
23529
23350
  * Return an AsyncIterableIterator that works a page at a time
23530
23351
  */
23531
23352
  byPage: (settings = {}) => {
23532
- return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
23533
- maxPageSize: settings.maxPageSize,
23534
- ...listSegmentOptions,
23535
- });
23353
+ return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
23536
23354
  },
23537
23355
  };
23538
23356
  }
@@ -23589,10 +23407,7 @@ class ContainerClient extends StorageClient {
23589
23407
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
23590
23408
  throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
23591
23409
  }
23592
- const sas = generateBlobSASQueryParameters({
23593
- containerName: this._containerName,
23594
- ...options,
23595
- }, this.credential).toString();
23410
+ const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString();
23596
23411
  resolve(appendToURLQuery(this.url, sas));
23597
23412
  });
23598
23413
  }
@@ -24073,8 +23888,6 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
24073
23888
  return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope);
24074
23889
  }
24075
23890
 
24076
- // Copyright (c) Microsoft Corporation.
24077
- // Licensed under the MIT license.
24078
23891
  /**
24079
23892
  * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you
24080
23893
  * to manipulate blob containers.
@@ -24217,13 +24030,11 @@ class BlobServiceClient extends StorageClient {
24217
24030
  // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready.
24218
24031
  async renameContainer(sourceContainerName, destinationContainerName, options = {}) {
24219
24032
  return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => {
24033
+ var _a;
24220
24034
  const containerClient = this.getContainerClient(destinationContainerName);
24221
24035
  // Hack to access a protected member.
24222
24036
  const containerContext = containerClient["storageClientContext"].container;
24223
- const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName, {
24224
- ...updatedOptions,
24225
- sourceLeaseId: options.sourceCondition?.leaseId,
24226
- }));
24037
+ const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId })));
24227
24038
  return { containerClient, containerRenameResponse };
24228
24039
  });
24229
24040
  }
@@ -24311,13 +24122,7 @@ class BlobServiceClient extends StorageClient {
24311
24122
  */
24312
24123
  async listContainersSegment(marker, options = {}) {
24313
24124
  return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => {
24314
- return assertResponse(await this.serviceContext.listContainersSegment({
24315
- abortSignal: options.abortSignal,
24316
- marker,
24317
- ...options,
24318
- include: typeof options.include === "string" ? [options.include] : options.include,
24319
- tracingOptions: updatedOptions.tracingOptions,
24320
- }));
24125
+ return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions })));
24321
24126
  });
24322
24127
  }
24323
24128
  /**
@@ -24347,17 +24152,14 @@ class BlobServiceClient extends StorageClient {
24347
24152
  maxPageSize: options.maxPageSize,
24348
24153
  tracingOptions: updatedOptions.tracingOptions,
24349
24154
  }));
24350
- const wrappedResponse = {
24351
- ...response,
24352
- _response: response._response,
24353
- blobs: response.blobs.map((blob) => {
24155
+ const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
24156
+ var _a;
24354
24157
  let tagValue = "";
24355
- if (blob.tags?.blobTagSet.length === 1) {
24158
+ if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {
24356
24159
  tagValue = blob.tags.blobTagSet[0].value;
24357
24160
  }
24358
- return { ...blob, tags: toTags(blob.tags), tagValue };
24359
- }),
24360
- };
24161
+ return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
24162
+ }) });
24361
24163
  return wrappedResponse;
24362
24164
  });
24363
24165
  }
@@ -24377,16 +24179,18 @@ class BlobServiceClient extends StorageClient {
24377
24179
  * items. The marker value is opaque to the client.
24378
24180
  * @param options - Options to find blobs by tags.
24379
24181
  */
24380
- async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
24381
- let response;
24382
- if (!!marker || marker === undefined) {
24383
- do {
24384
- response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
24385
- response.blobs = response.blobs || [];
24386
- marker = response.continuationToken;
24387
- yield response;
24388
- } while (marker);
24389
- }
24182
+ findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
24183
+ return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {
24184
+ let response;
24185
+ if (!!marker || marker === undefined) {
24186
+ do {
24187
+ response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));
24188
+ response.blobs = response.blobs || [];
24189
+ marker = response.continuationToken;
24190
+ yield yield tslib.__await(response);
24191
+ } while (marker);
24192
+ }
24193
+ });
24390
24194
  }
24391
24195
  /**
24392
24196
  * Returns an AsyncIterableIterator for blobs.
@@ -24397,11 +24201,26 @@ class BlobServiceClient extends StorageClient {
24397
24201
  * however, only a subset of the OData filter syntax is supported in the Blob service.
24398
24202
  * @param options - Options to findBlobsByTagsItems.
24399
24203
  */
24400
- async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
24401
- let marker;
24402
- for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
24403
- yield* segment.blobs;
24404
- }
24204
+ findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
24205
+ return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {
24206
+ var _a, e_1, _b, _c;
24207
+ let marker;
24208
+ try {
24209
+ for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
24210
+ _c = _f.value;
24211
+ _d = false;
24212
+ const segment = _c;
24213
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));
24214
+ }
24215
+ }
24216
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
24217
+ finally {
24218
+ try {
24219
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
24220
+ }
24221
+ finally { if (e_1) throw e_1.error; }
24222
+ }
24223
+ });
24405
24224
  }
24406
24225
  /**
24407
24226
  * Returns an async iterable iterator to find all blobs with specified tag
@@ -24484,9 +24303,7 @@ class BlobServiceClient extends StorageClient {
24484
24303
  */
24485
24304
  findBlobsByTags(tagFilterSqlExpression, options = {}) {
24486
24305
  // AsyncIterableIterator to iterate over blobs
24487
- const listSegmentOptions = {
24488
- ...options,
24489
- };
24306
+ const listSegmentOptions = Object.assign({}, options);
24490
24307
  const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
24491
24308
  return {
24492
24309
  /**
@@ -24505,10 +24322,7 @@ class BlobServiceClient extends StorageClient {
24505
24322
  * Return an AsyncIterableIterator that works a page at a time
24506
24323
  */
24507
24324
  byPage: (settings = {}) => {
24508
- return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
24509
- maxPageSize: settings.maxPageSize,
24510
- ...listSegmentOptions,
24511
- });
24325
+ return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
24512
24326
  },
24513
24327
  };
24514
24328
  }
@@ -24524,28 +24338,45 @@ class BlobServiceClient extends StorageClient {
24524
24338
  * items. The marker value is opaque to the client.
24525
24339
  * @param options - Options to list containers operation.
24526
24340
  */
24527
- async *listSegments(marker, options = {}) {
24528
- let listContainersSegmentResponse;
24529
- if (!!marker || marker === undefined) {
24530
- do {
24531
- listContainersSegmentResponse = await this.listContainersSegment(marker, options);
24532
- listContainersSegmentResponse.containerItems =
24533
- listContainersSegmentResponse.containerItems || [];
24534
- marker = listContainersSegmentResponse.continuationToken;
24535
- yield await listContainersSegmentResponse;
24536
- } while (marker);
24537
- }
24341
+ listSegments(marker, options = {}) {
24342
+ return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {
24343
+ let listContainersSegmentResponse;
24344
+ if (!!marker || marker === undefined) {
24345
+ do {
24346
+ listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker, options));
24347
+ listContainersSegmentResponse.containerItems =
24348
+ listContainersSegmentResponse.containerItems || [];
24349
+ marker = listContainersSegmentResponse.continuationToken;
24350
+ yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse));
24351
+ } while (marker);
24352
+ }
24353
+ });
24538
24354
  }
24539
24355
  /**
24540
24356
  * Returns an AsyncIterableIterator for Container Items
24541
24357
  *
24542
24358
  * @param options - Options to list containers operation.
24543
24359
  */
24544
- async *listItems(options = {}) {
24545
- let marker;
24546
- for await (const segment of this.listSegments(marker, options)) {
24547
- yield* segment.containerItems;
24548
- }
24360
+ listItems(options = {}) {
24361
+ return tslib.__asyncGenerator(this, arguments, function* listItems_1() {
24362
+ var _a, e_2, _b, _c;
24363
+ let marker;
24364
+ try {
24365
+ for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
24366
+ _c = _f.value;
24367
+ _d = false;
24368
+ const segment = _c;
24369
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems)));
24370
+ }
24371
+ }
24372
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
24373
+ finally {
24374
+ try {
24375
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
24376
+ }
24377
+ finally { if (e_2) throw e_2.error; }
24378
+ }
24379
+ });
24549
24380
  }
24550
24381
  /**
24551
24382
  * Returns an async iterable iterator to list all the containers
@@ -24636,10 +24467,7 @@ class BlobServiceClient extends StorageClient {
24636
24467
  include.push("system");
24637
24468
  }
24638
24469
  // AsyncIterableIterator to iterate over containers
24639
- const listSegmentOptions = {
24640
- ...options,
24641
- ...(include.length > 0 ? { include } : {}),
24642
- };
24470
+ const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {}));
24643
24471
  const iter = this.listItems(listSegmentOptions);
24644
24472
  return {
24645
24473
  /**
@@ -24658,10 +24486,7 @@ class BlobServiceClient extends StorageClient {
24658
24486
  * Return an AsyncIterableIterator that works a page at a time
24659
24487
  */
24660
24488
  byPage: (settings = {}) => {
24661
- return this.listSegments(settings.continuationToken, {
24662
- maxPageSize: settings.maxPageSize,
24663
- ...listSegmentOptions,
24664
- });
24489
+ return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
24665
24490
  },
24666
24491
  };
24667
24492
  }
@@ -24694,15 +24519,7 @@ class BlobServiceClient extends StorageClient {
24694
24519
  signedVersion: response.signedVersion,
24695
24520
  value: response.value,
24696
24521
  };
24697
- const res = {
24698
- _response: response._response,
24699
- requestId: response.requestId,
24700
- clientRequestId: response.clientRequestId,
24701
- version: response.version,
24702
- date: response.date,
24703
- errorCode: response.errorCode,
24704
- ...userDelegationKey,
24705
- };
24522
+ const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);
24706
24523
  return res;
24707
24524
  });
24708
24525
  }
@@ -24738,13 +24555,9 @@ class BlobServiceClient extends StorageClient {
24738
24555
  const now = new Date();
24739
24556
  expiresOn = new Date(now.getTime() + 3600 * 1000);
24740
24557
  }
24741
- const sas = generateAccountSASQueryParameters({
24742
- permissions,
24558
+ const sas = generateAccountSASQueryParameters(Object.assign({ permissions,
24743
24559
  expiresOn,
24744
- resourceTypes,
24745
- services: AccountSASServices.parse("b").toString(),
24746
- ...options,
24747
- }, this.credential).toString();
24560
+ resourceTypes, services: AccountSASServices.parse("b").toString() }, options), this.credential).toString();
24748
24561
  return appendToURLQuery(this.url, sas);
24749
24562
  }
24750
24563
  }