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