@azure/storage-blob 12.23.0-alpha.20240112.1 → 12.23.0-alpha.20240116.1

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