@azure/storage-blob 12.8.0-beta.1 → 12.8.0

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 (54) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/index.js +112 -63
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/storage-blob/src/BatchResponseParser.js +3 -3
  5. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
  6. package/dist-esm/storage-blob/src/BatchUtils.browser.js +1 -1
  7. package/dist-esm/storage-blob/src/BatchUtils.browser.js.map +1 -1
  8. package/dist-esm/storage-blob/src/BlobBatch.js +3 -2
  9. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
  10. package/dist-esm/storage-blob/src/BlobBatchClient.js +15 -6
  11. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  12. package/dist-esm/storage-blob/src/BlobServiceClient.js +11 -4
  13. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  14. package/dist-esm/storage-blob/src/Clients.js +23 -11
  15. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  16. package/dist-esm/storage-blob/src/ContainerClient.js +8 -5
  17. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  18. package/dist-esm/storage-blob/src/Pipeline.js +14 -0
  19. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  20. package/dist-esm/storage-blob/src/Range.js.map +1 -1
  21. package/dist-esm/storage-blob/src/StorageClient.js.map +1 -1
  22. package/dist-esm/storage-blob/src/credentials/Credential.js +1 -5
  23. package/dist-esm/storage-blob/src/credentials/Credential.js.map +1 -1
  24. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +1 -1
  25. package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
  26. package/dist-esm/storage-blob/src/models.js +1 -1
  27. package/dist-esm/storage-blob/src/models.js.map +1 -1
  28. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js +2 -0
  29. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -1
  30. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +2 -0
  31. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
  32. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
  33. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  34. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +1 -1
  35. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  36. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
  37. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
  38. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +1 -1
  39. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
  40. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +16 -12
  41. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
  42. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +2 -3
  43. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
  44. package/dist-esm/storage-blob/src/utils/constants.js +1 -1
  45. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  46. package/dist-esm/storage-blob/src/utils/tracing.js +1 -0
  47. package/dist-esm/storage-blob/src/utils/tracing.js.map +1 -1
  48. package/dist-esm/storage-blob/src/utils/utils.browser.js +15 -5
  49. package/dist-esm/storage-blob/src/utils/utils.browser.js.map +1 -1
  50. package/dist-esm/storage-blob/src/utils/utils.common.js +8 -10
  51. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  52. package/package.json +7 -8
  53. package/typings/3.1/storage-blob.d.ts +45 -19
  54. package/typings/latest/storage-blob.d.ts +47 -19
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Release History
2
2
 
3
- ## 12.8.0-beta.1 (2021-07-26)
3
+ ## 12.8.0 (2021-09-10)
4
+
5
+ ### Features Added
6
+
7
+ - Includes all features released in 12.8.0-beta.1.
8
+
9
+ ## 12.8.0-beta.1 (2021-07-28)
4
10
 
5
11
  ### Features Added
6
12
 
@@ -13,7 +19,12 @@
13
19
  - Added support for OAuth copy sources for synchronous copy operations.
14
20
  - Added support for Parquet as an input format in `BlockBlobClient.query()`.
15
21
  - With the dropping of support for Node.js versions that are no longer in LTS, the dependency on `@types/node` has been updated to version 12. Read our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
22
+
23
+ ## 12.7.0 (2021-08-02)
24
+
25
+ - Support for Node.js 8 and IE 11 has been dropped. Please see our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
16
26
  - Changed TS compilation target to ES2017 in order to produce smaller bundles and use more native platform features
27
+ - Updated our internal core package dependencies to their latest versions in order to add support for Opentelemetry 1.0.0 which is compatible with the latest versions of our other client libraries.
17
28
 
18
29
  ## 12.6.0 (2021-06-09)
19
30
 
package/dist/index.js CHANGED
@@ -13150,7 +13150,7 @@ const logger = logger$1.createClientLogger("storage-blob");
13150
13150
 
13151
13151
  // Copyright (c) Microsoft Corporation.
13152
13152
  // Licensed under the MIT license.
13153
- const SDK_VERSION = "12.8.0-beta.1";
13153
+ const SDK_VERSION = "12.8.0";
13154
13154
  const SERVICE_VERSION = "2020-10-02";
13155
13155
  const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
13156
13156
  const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
@@ -13592,7 +13592,7 @@ function getURLPathAndQuery(url) {
13592
13592
  }
13593
13593
  let queryString = urlParsed.getQuery() || "";
13594
13594
  queryString = queryString.trim();
13595
- if (queryString != "") {
13595
+ if (queryString !== "") {
13596
13596
  queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; // Ensure query string start with '?'
13597
13597
  }
13598
13598
  return `${pathString}${queryString}`;
@@ -13693,6 +13693,7 @@ function generateBlockID(blockIDPrefix, blockIndex) {
13693
13693
  */
13694
13694
  async function delay(timeInMs, aborter, abortError) {
13695
13695
  return new Promise((resolve, reject) => {
13696
+ /* eslint-disable-next-line prefer-const */
13696
13697
  let timeout;
13697
13698
  const abortHandler = () => {
13698
13699
  if (timeout !== undefined) {
@@ -13720,8 +13721,7 @@ async function delay(timeInMs, aborter, abortError) {
13720
13721
  * @param padString -
13721
13722
  */
13722
13723
  function padStart(currentString, targetLength, padString = " ") {
13723
- // TS doesn't know this code needs to run downlevel sometimes.
13724
- // @ts-expect-error
13724
+ // @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes
13725
13725
  if (String.prototype.padStart) {
13726
13726
  return currentString.padStart(targetLength, padString);
13727
13727
  }
@@ -13776,10 +13776,10 @@ function getAccountNameFromUrl(url) {
13776
13776
  }
13777
13777
  }
13778
13778
  function isIpEndpointStyle(parsedUrl) {
13779
- if (parsedUrl.getHost() == undefined) {
13779
+ if (parsedUrl.getHost() === undefined) {
13780
13780
  return false;
13781
13781
  }
13782
- const host = parsedUrl.getHost() + (parsedUrl.getPort() == undefined ? "" : ":" + parsedUrl.getPort());
13782
+ const host = parsedUrl.getHost() + (parsedUrl.getPort() === undefined ? "" : ":" + parsedUrl.getPort());
13783
13783
  // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
13784
13784
  // Case 2: localhost(:port), use broad regex to match port part.
13785
13785
  // Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
@@ -13797,7 +13797,7 @@ function toBlobTagsString(tags) {
13797
13797
  }
13798
13798
  const tagPairs = [];
13799
13799
  for (const key in tags) {
13800
- if (tags.hasOwnProperty(key)) {
13800
+ if (Object.prototype.hasOwnProperty.call(tags, key)) {
13801
13801
  const value = tags[key];
13802
13802
  tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
13803
13803
  }
@@ -13817,7 +13817,7 @@ function toBlobTags(tags) {
13817
13817
  blobTagSet: []
13818
13818
  };
13819
13819
  for (const key in tags) {
13820
- if (tags.hasOwnProperty(key)) {
13820
+ if (Object.prototype.hasOwnProperty.call(tags, key)) {
13821
13821
  const value = tags[key];
13822
13822
  res.blobTagSet.push({
13823
13823
  key,
@@ -13937,9 +13937,7 @@ function attachCredential(thing, credential) {
13937
13937
  return thing;
13938
13938
  }
13939
13939
  function httpAuthorizationToString(httpAuthorization) {
13940
- return httpAuthorization
13941
- ? httpAuthorization.scheme + " " + httpAuthorization.parameter
13942
- : undefined;
13940
+ return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
13943
13941
  }
13944
13942
 
13945
13943
  // Copyright (c) Microsoft Corporation.
@@ -13960,6 +13958,8 @@ class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {
13960
13958
  * @param nextPolicy -
13961
13959
  * @param options -
13962
13960
  */
13961
+ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
13962
+ /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
13963
13963
  constructor(nextPolicy, options) {
13964
13964
  super(nextPolicy, options);
13965
13965
  }
@@ -14096,7 +14096,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
14096
14096
  }
14097
14097
  }
14098
14098
  await this.delay(isPrimaryRetry, attempt, request.abortSignal);
14099
- return await this.attemptSendRequest(request, secondaryHas404, ++attempt);
14099
+ return this.attemptSendRequest(request, secondaryHas404, ++attempt);
14100
14100
  }
14101
14101
  /**
14102
14102
  * Decide whether to retry according to last HTTP response and retry counters.
@@ -14244,6 +14244,8 @@ class AnonymousCredentialPolicy extends CredentialPolicy {
14244
14244
  * @param nextPolicy -
14245
14245
  * @param options -
14246
14246
  */
14247
+ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
14248
+ /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
14247
14249
  constructor(nextPolicy, options) {
14248
14250
  super(nextPolicy, options);
14249
14251
  }
@@ -14262,11 +14264,7 @@ class Credential {
14262
14264
  * @param _nextPolicy -
14263
14265
  * @param _options -
14264
14266
  */
14265
- create(
14266
- // tslint:disable-next-line:variable-name
14267
- _nextPolicy,
14268
- // tslint:disable-next-line:variable-name
14269
- _options) {
14267
+ create(_nextPolicy, _options) {
14270
14268
  throw new Error("Method should be implemented in children classes.");
14271
14269
  }
14272
14270
  }
@@ -14372,6 +14370,20 @@ function getCachedDefaultHttpClient() {
14372
14370
  }
14373
14371
 
14374
14372
  // Copyright (c) Microsoft Corporation.
14373
+ /**
14374
+ * A helper to decide if a given argument satisfies the Pipeline contract
14375
+ * @param pipeline - An argument that may be a Pipeline
14376
+ * @returns true when the argument satisfies the Pipeline contract
14377
+ */
14378
+ function isPipelineLike(pipeline) {
14379
+ if (!pipeline || typeof pipeline !== "object") {
14380
+ return false;
14381
+ }
14382
+ const castPipeline = pipeline;
14383
+ return (Array.isArray(castPipeline.factories) &&
14384
+ typeof castPipeline.options === "object" &&
14385
+ typeof castPipeline.toServiceClientOptions === "function");
14386
+ }
14375
14387
  /**
14376
14388
  * A Pipeline class containing HTTP request policies.
14377
14389
  * You can create a default Pipeline by calling {@link newPipeline}.
@@ -14568,7 +14580,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
14568
14580
  if (queries) {
14569
14581
  const queryKeys = [];
14570
14582
  for (const key in queries) {
14571
- if (queries.hasOwnProperty(key)) {
14583
+ if (Object.prototype.hasOwnProperty.call(queries, key)) {
14572
14584
  const lowercaseKey = key.toLowerCase();
14573
14585
  lowercaseQueries[lowercaseKey] = queries[key];
14574
14586
  queryKeys.push(lowercaseKey);
@@ -14629,7 +14641,7 @@ class StorageSharedKeyCredential extends Credential {
14629
14641
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
14630
14642
  */
14631
14643
  const packageName = "azure-storage-blob";
14632
- const packageVersion = "12.7.0-beta.1";
14644
+ const packageVersion = "12.8.0";
14633
14645
  class StorageClientContext extends coreHttp.ServiceClient {
14634
14646
  /**
14635
14647
  * Initializes a new instance of the StorageClientContext class.
@@ -14714,6 +14726,7 @@ const createSpan = coreTracing.createSpanFunction({
14714
14726
  function convertTracingToRequestOptionsBase(options) {
14715
14727
  var _a, _b;
14716
14728
  return {
14729
+ // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
14717
14730
  spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions,
14718
14731
  tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext
14719
14732
  };
@@ -15154,7 +15167,7 @@ function ipRangeToString(ipRange) {
15154
15167
  /**
15155
15168
  * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly
15156
15169
  * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues}
15157
- * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should
15170
+ * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should
15158
15171
  * be taken here in case there are existing query parameters, which might affect the appropriate means of appending
15159
15172
  * these query parameters).
15160
15173
  *
@@ -16012,15 +16025,14 @@ class RetriableReadableStream extends stream.Readable {
16012
16025
  .then((newSource) => {
16013
16026
  this.source = newSource;
16014
16027
  this.setSourceEventHandlers();
16028
+ return;
16015
16029
  })
16016
16030
  .catch((error) => {
16017
16031
  this.destroy(error);
16018
16032
  });
16019
16033
  }
16020
16034
  else {
16021
- this.destroy(new Error(
16022
- // tslint:disable-next-line:max-line-length
16023
- `Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this
16035
+ this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this
16024
16036
  .offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
16025
16037
  }
16026
16038
  }
@@ -17075,21 +17087,25 @@ class BlobQuickQueryStream extends stream.Readable {
17075
17087
  }
17076
17088
  switch (schema) {
17077
17089
  case "com.microsoft.azure.storage.queryBlobContents.resultData":
17078
- const data = obj.data;
17079
- if (data instanceof Uint8Array === false) {
17080
- throw Error("Invalid data in avro result record.");
17081
- }
17082
- if (!this.push(Buffer.from(data))) {
17083
- this.avroPaused = true;
17090
+ {
17091
+ const data = obj.data;
17092
+ if (data instanceof Uint8Array === false) {
17093
+ throw Error("Invalid data in avro result record.");
17094
+ }
17095
+ if (!this.push(Buffer.from(data))) {
17096
+ this.avroPaused = true;
17097
+ }
17084
17098
  }
17085
17099
  break;
17086
17100
  case "com.microsoft.azure.storage.queryBlobContents.progress":
17087
- const bytesScanned = obj.bytesScanned;
17088
- if (typeof bytesScanned !== "number") {
17089
- throw Error("Invalid bytesScanned in avro progress record.");
17090
- }
17091
- if (this.onProgress) {
17092
- this.onProgress({ loadedBytes: bytesScanned });
17101
+ {
17102
+ const bytesScanned = obj.bytesScanned;
17103
+ if (typeof bytesScanned !== "number") {
17104
+ throw Error("Invalid bytesScanned in avro progress record.");
17105
+ }
17106
+ if (this.onProgress) {
17107
+ this.onProgress({ loadedBytes: bytesScanned });
17108
+ }
17093
17109
  }
17094
17110
  break;
17095
17111
  case "com.microsoft.azure.storage.queryBlobContents.end":
@@ -17562,7 +17578,7 @@ class BlobQueryResponse {
17562
17578
  PremiumPageBlobTier["P80"] = "P80";
17563
17579
  })(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {}));
17564
17580
  function toAccessTier(tier) {
17565
- if (tier == undefined) {
17581
+ if (tier === undefined) {
17566
17582
  return undefined;
17567
17583
  }
17568
17584
  return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).
@@ -18389,11 +18405,14 @@ const fsCreateReadStream = fs.createReadStream;
18389
18405
  * append blob, or page blob.
18390
18406
  */
18391
18407
  class BlobClient extends StorageClient {
18392
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) {
18408
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
18409
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
18410
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
18411
+ options) {
18393
18412
  options = options || {};
18394
18413
  let pipeline;
18395
18414
  let url;
18396
- if (credentialOrPipelineOrContainerName instanceof Pipeline) {
18415
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
18397
18416
  // (url: string, pipeline: Pipeline)
18398
18417
  url = urlOrConnectionString;
18399
18418
  pipeline = credentialOrPipelineOrContainerName;
@@ -18596,7 +18615,7 @@ class BlobClient extends StorageClient {
18596
18615
  }
18597
18616
  return new BlobDownloadResponse(wrappedRes, async (start) => {
18598
18617
  var _a;
18599
- const updatedOptions = {
18618
+ const updatedDownloadOptions = {
18600
18619
  leaseAccessConditions: options.conditions,
18601
18620
  modifiedAccessConditions: {
18602
18621
  ifMatch: options.conditions.ifMatch || res.etag,
@@ -18620,7 +18639,7 @@ class BlobClient extends StorageClient {
18620
18639
  // updatedOptions.range
18621
18640
  // }, options: ${JSON.stringify(updatedOptions)}`
18622
18641
  // );
18623
- return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedOptions))).readableStreamBody;
18642
+ return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;
18624
18643
  }, offset, res.contentLength, {
18625
18644
  maxRetryRequests: options.maxRetryRequests,
18626
18645
  onProgress: options.onProgress
@@ -19426,13 +19445,16 @@ class BlobClient extends StorageClient {
19426
19445
  * AppendBlobClient defines a set of operations applicable to append blobs.
19427
19446
  */
19428
19447
  class AppendBlobClient extends BlobClient {
19429
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) {
19448
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
19449
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
19450
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
19451
+ options) {
19430
19452
  // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
19431
19453
  // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
19432
19454
  let pipeline;
19433
19455
  let url;
19434
19456
  options = options || {};
19435
- if (credentialOrPipelineOrContainerName instanceof Pipeline) {
19457
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
19436
19458
  // (url: string, pipeline: Pipeline)
19437
19459
  url = urlOrConnectionString;
19438
19460
  pipeline = credentialOrPipelineOrContainerName;
@@ -19675,13 +19697,16 @@ class AppendBlobClient extends BlobClient {
19675
19697
  * BlockBlobClient defines a set of operations applicable to block blobs.
19676
19698
  */
19677
19699
  class BlockBlobClient extends BlobClient {
19678
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) {
19700
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
19701
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
19702
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
19703
+ options) {
19679
19704
  // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
19680
19705
  // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
19681
19706
  let pipeline;
19682
19707
  let url;
19683
19708
  options = options || {};
19684
- if (credentialOrPipelineOrContainerName instanceof Pipeline) {
19709
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
19685
19710
  // (url: string, pipeline: Pipeline)
19686
19711
  url = urlOrConnectionString;
19687
19712
  pipeline = credentialOrPipelineOrContainerName;
@@ -20317,13 +20342,16 @@ class BlockBlobClient extends BlobClient {
20317
20342
  * PageBlobClient defines a set of operations applicable to page blobs.
20318
20343
  */
20319
20344
  class PageBlobClient extends BlobClient {
20320
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) {
20345
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
20346
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
20347
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
20348
+ options) {
20321
20349
  // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
20322
20350
  // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
20323
20351
  let pipeline;
20324
20352
  let url;
20325
20353
  options = options || {};
20326
- if (credentialOrPipelineOrContainerName instanceof Pipeline) {
20354
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
20327
20355
  // (url: string, pipeline: Pipeline)
20328
20356
  url = urlOrConnectionString;
20329
20357
  pipeline = credentialOrPipelineOrContainerName;
@@ -20758,7 +20786,7 @@ class BatchResponseParser {
20758
20786
  async parseBatchResponse() {
20759
20787
  // When logic reach here, suppose batch request has already succeeded with 202, so we can further parse
20760
20788
  // sub request's response.
20761
- if (this.batchResponse._response.status != HTTPURLConnection.HTTP_ACCEPTED) {
20789
+ if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) {
20762
20790
  throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`);
20763
20791
  }
20764
20792
  const responseBodyAsText = await getBodyAsText(this.batchResponse);
@@ -20771,7 +20799,7 @@ class BatchResponseParser {
20771
20799
  // Note: subResponseCount == 1 is special case where sub request is invalid.
20772
20800
  // We try to prevent such cases through early validation, e.g. validate sub request count >= 1.
20773
20801
  // While in unexpected sub request invalid case, we allow sub response to be parsed and return to user.
20774
- if (subResponseCount != this.subRequests.size && subResponseCount != 1) {
20802
+ if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) {
20775
20803
  throw new Error("Invalid state: sub responses' count is not equal to sub requests' count.");
20776
20804
  }
20777
20805
  const deserializedSubResponses = new Array(subResponseCount);
@@ -20836,7 +20864,7 @@ class BatchResponseParser {
20836
20864
  // The Content-IDs are set to a valid index in the subrequests we sent. In the status code 202 path, we could expect it
20837
20865
  // to be 1-1 mapping from the [0, subRequests.size) to the Content-IDs returned. If not, we simply don't return that
20838
20866
  // unexpected subResponse in the parsed reponse and we can always look it up in the raw response for debugging purpose.
20839
- if (contentId != NOT_FOUND &&
20867
+ if (contentId !== NOT_FOUND &&
20840
20868
  Number.isInteger(contentId) &&
20841
20869
  contentId >= 0 &&
20842
20870
  contentId < this.subRequests.size &&
@@ -21131,7 +21159,7 @@ class InnerBatchRequest {
21131
21159
  }
21132
21160
  // Fast fail if url for sub request is invalid
21133
21161
  const path = getURLPath(subRequest.url);
21134
- if (!path || path == "") {
21162
+ if (!path || path === "") {
21135
21163
  throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`);
21136
21164
  }
21137
21165
  }
@@ -21174,6 +21202,8 @@ class BatchRequestAssemblePolicyFactory {
21174
21202
  }
21175
21203
  }
21176
21204
  class BatchHeaderFilterPolicy extends coreHttp.BaseRequestPolicy {
21205
+ // The base class has a protected constructor. Adding a public one to enable constructing of this class.
21206
+ /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
21177
21207
  constructor(nextPolicy, options) {
21178
21208
  super(nextPolicy, options);
21179
21209
  }
@@ -21191,7 +21221,6 @@ class BatchHeaderFilterPolicy extends coreHttp.BaseRequestPolicy {
21191
21221
  }
21192
21222
  }
21193
21223
  class BatchHeaderFilterPolicyFactory {
21194
- constructor() { }
21195
21224
  create(nextPolicy, options) {
21196
21225
  return new BatchHeaderFilterPolicy(nextPolicy, options);
21197
21226
  }
@@ -21204,9 +21233,12 @@ class BatchHeaderFilterPolicyFactory {
21204
21233
  * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch
21205
21234
  */
21206
21235
  class BlobBatchClient {
21207
- constructor(url, credentialOrPipeline, options) {
21236
+ constructor(url, credentialOrPipeline,
21237
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
21238
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
21239
+ options) {
21208
21240
  let pipeline;
21209
- if (credentialOrPipeline instanceof Pipeline) {
21241
+ if (isPipelineLike(credentialOrPipeline)) {
21210
21242
  pipeline = credentialOrPipeline;
21211
21243
  }
21212
21244
  else if (!credentialOrPipeline) {
@@ -21233,7 +21265,10 @@ class BlobBatchClient {
21233
21265
  createBatch() {
21234
21266
  return new BlobBatch();
21235
21267
  }
21236
- async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) {
21268
+ async deleteBlobs(urlsOrBlobClients, credentialOrOptions,
21269
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
21270
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
21271
+ options) {
21237
21272
  const batch = new BlobBatch();
21238
21273
  for (const urlOrBlobClient of urlsOrBlobClients) {
21239
21274
  if (typeof urlOrBlobClient === "string") {
@@ -21245,7 +21280,10 @@ class BlobBatchClient {
21245
21280
  }
21246
21281
  return this.submitBatch(batch);
21247
21282
  }
21248
- async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) {
21283
+ async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions,
21284
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
21285
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
21286
+ options) {
21249
21287
  const batch = new BlobBatch();
21250
21288
  for (const urlOrBlobClient of urlsOrBlobClients) {
21251
21289
  if (typeof urlOrBlobClient === "string") {
@@ -21293,7 +21331,7 @@ class BlobBatchClient {
21293
21331
  * @param options -
21294
21332
  */
21295
21333
  async submitBatch(batchRequest, options = {}) {
21296
- if (!batchRequest || batchRequest.getSubRequests().size == 0) {
21334
+ if (!batchRequest || batchRequest.getSubRequests().size === 0) {
21297
21335
  throw new RangeError("Batch request should contain one or more sub requests.");
21298
21336
  }
21299
21337
  const { span, updatedOptions } = createSpan("BlobBatchClient-submitBatch", options);
@@ -21334,11 +21372,14 @@ class BlobBatchClient {
21334
21372
  * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs.
21335
21373
  */
21336
21374
  class ContainerClient extends StorageClient {
21337
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) {
21375
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName,
21376
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
21377
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
21378
+ options) {
21338
21379
  let pipeline;
21339
21380
  let url;
21340
21381
  options = options || {};
21341
- if (credentialOrPipelineOrContainerName instanceof Pipeline) {
21382
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
21342
21383
  // (url: string, pipeline: Pipeline)
21343
21384
  url = urlOrConnectionString;
21344
21385
  pipeline = credentialOrPipelineOrContainerName;
@@ -22061,7 +22102,7 @@ class ContainerClient extends StorageClient {
22061
22102
  if (options.includeTags) {
22062
22103
  include.push("tags");
22063
22104
  }
22064
- if (options.includeDeletedwithVersions) {
22105
+ if (options.includeDeletedWithVersions) {
22065
22106
  include.push("deletedwithversions");
22066
22107
  }
22067
22108
  if (options.includeImmutabilityPolicy) {
@@ -22257,7 +22298,7 @@ class ContainerClient extends StorageClient {
22257
22298
  if (options.includeTags) {
22258
22299
  include.push("tags");
22259
22300
  }
22260
- if (options.includeDeletedwithVersions) {
22301
+ if (options.includeDeletedWithVersions) {
22261
22302
  include.push("deletedwithversions");
22262
22303
  }
22263
22304
  if (options.includeImmutabilityPolicy) {
@@ -22790,9 +22831,12 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
22790
22831
  * to manipulate blob containers.
22791
22832
  */
22792
22833
  class BlobServiceClient extends StorageClient {
22793
- constructor(url, credentialOrPipeline, options) {
22834
+ constructor(url, credentialOrPipeline,
22835
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
22836
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
22837
+ options) {
22794
22838
  let pipeline;
22795
- if (credentialOrPipeline instanceof Pipeline) {
22839
+ if (isPipelineLike(credentialOrPipeline)) {
22796
22840
  pipeline = credentialOrPipeline;
22797
22841
  }
22798
22842
  else if ((coreHttp.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential) ||
@@ -22819,7 +22863,10 @@ class BlobServiceClient extends StorageClient {
22819
22863
  * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
22820
22864
  * @param options - Optional. Options to configure the HTTP pipeline.
22821
22865
  */
22822
- static fromConnectionString(connectionString, options) {
22866
+ static fromConnectionString(connectionString,
22867
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
22868
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
22869
+ options) {
22823
22870
  options = options || {};
22824
22871
  const extractedCreds = extractConnectionStringParts(connectionString);
22825
22872
  if (extractedCreds.kind === "AccountConnString") {
@@ -22942,6 +22989,7 @@ class BlobServiceClient extends StorageClient {
22942
22989
  * @param destinationContainerName - The new name of the container.
22943
22990
  * @param options - Options to configure Container Rename operation.
22944
22991
  */
22992
+ /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
22945
22993
  // @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.
22946
22994
  async renameContainer(sourceContainerName, destinationContainerName, options = {}) {
22947
22995
  var _a;
@@ -23602,6 +23650,7 @@ exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
23602
23650
  exports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy;
23603
23651
  exports.generateAccountSASQueryParameters = generateAccountSASQueryParameters;
23604
23652
  exports.generateBlobSASQueryParameters = generateBlobSASQueryParameters;
23653
+ exports.isPipelineLike = isPipelineLike;
23605
23654
  exports.logger = logger;
23606
23655
  exports.newPipeline = newPipeline;
23607
23656
  //# sourceMappingURL=index.js.map