@azure/storage-file-share 12.8.0-beta.1 → 12.8.1-alpha.20211025.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 (40) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/index.js +57 -31
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/Clients.js +30 -10
  5. package/dist-esm/src/Clients.js.map +1 -1
  6. package/dist-esm/src/Range.js.map +1 -1
  7. package/dist-esm/src/SASQueryParameters.js +1 -1
  8. package/dist-esm/src/SASQueryParameters.js.map +1 -1
  9. package/dist-esm/src/ShareClientInternal.js +1 -1
  10. package/dist-esm/src/ShareClientInternal.js.map +1 -1
  11. package/dist-esm/src/ShareSASPermissions.js.map +1 -1
  12. package/dist-esm/src/ShareServiceClient.js +8 -2
  13. package/dist-esm/src/ShareServiceClient.js.map +1 -1
  14. package/dist-esm/src/credentials/Credential.js +1 -5
  15. package/dist-esm/src/credentials/Credential.js.map +1 -1
  16. package/dist-esm/src/generated/src/storageClientContext.js +1 -1
  17. package/dist-esm/src/generated/src/storageClientContext.js.map +1 -1
  18. package/dist-esm/src/generatedModels.js.map +1 -1
  19. package/dist-esm/src/models.js.map +1 -1
  20. package/dist-esm/src/policies/AnonymousCredentialPolicy.js +2 -0
  21. package/dist-esm/src/policies/AnonymousCredentialPolicy.js.map +1 -1
  22. package/dist-esm/src/policies/StorageBrowserPolicy.js +2 -0
  23. package/dist-esm/src/policies/StorageBrowserPolicy.js.map +1 -1
  24. package/dist-esm/src/policies/StorageRetryPolicy.js +1 -1
  25. package/dist-esm/src/policies/StorageRetryPolicy.js.map +1 -1
  26. package/dist-esm/src/policies/StorageSharedKeyCredentialPolicy.js +1 -1
  27. package/dist-esm/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  28. package/dist-esm/src/utils/RetriableReadableStream.js +2 -3
  29. package/dist-esm/src/utils/RetriableReadableStream.js.map +1 -1
  30. package/dist-esm/src/utils/constants.js +1 -1
  31. package/dist-esm/src/utils/constants.js.map +1 -1
  32. package/dist-esm/src/utils/tracing.js +1 -0
  33. package/dist-esm/src/utils/tracing.js.map +1 -1
  34. package/dist-esm/src/utils/utils.browser.js +12 -4
  35. package/dist-esm/src/utils/utils.browser.js.map +1 -1
  36. package/dist-esm/src/utils/utils.common.js +5 -30
  37. package/dist-esm/src/utils/utils.common.js.map +1 -1
  38. package/package.json +12 -13
  39. package/typings/3.1/storage-file-share.d.ts +16 -15
  40. package/typings/latest/storage-file-share.d.ts +28 -16
@@ -28,7 +28,10 @@ import { generateFileSASQueryParameters } from "./FileSASSignatureValues";
28
28
  * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
29
29
  */
30
30
  export class ShareClient extends StorageClient {
31
- constructor(urlOrConnectionString, credentialOrPipelineOrShareName, options) {
31
+ constructor(urlOrConnectionString, credentialOrPipelineOrShareName,
32
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
33
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
34
+ options) {
32
35
  let pipeline;
33
36
  let url;
34
37
  if (credentialOrPipelineOrShareName instanceof Pipeline) {
@@ -156,6 +159,8 @@ export class ShareClient extends StorageClient {
156
159
  * @param directoryName - A directory name
157
160
  * @returns The ShareDirectoryClient object for the given directory name.
158
161
  */
162
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
163
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
159
164
  getDirectoryClient(directoryName) {
160
165
  return new ShareDirectoryClient(appendToURLPath(this.url, encodeURIComponent(directoryName)), this.pipeline);
161
166
  }
@@ -165,6 +170,8 @@ export class ShareClient extends StorageClient {
165
170
  *
166
171
  * @readonly A new ShareDirectoryClient object for the root directory.
167
172
  */
173
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
174
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
168
175
  get rootDirectoryClient() {
169
176
  return this.getDirectoryClient("");
170
177
  }
@@ -993,6 +1000,8 @@ export class ShareDirectoryClient extends StorageClient {
993
1000
  * console.log("Updated file successfully!")
994
1001
  * ```
995
1002
  */
1003
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
1004
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
996
1005
  getFileClient(fileName) {
997
1006
  return new ShareFileClient(appendToURLPath(this.url, encodeURIComponent(fileName)), this.pipeline);
998
1007
  }
@@ -1585,8 +1594,12 @@ export class ShareDirectoryClient extends StorageClient {
1585
1594
  do {
1586
1595
  const response = await this.forceCloseHandlesSegment(marker, updatedOptions);
1587
1596
  marker = response.marker;
1588
- response.closedHandlesCount && (handlesClosed += response.closedHandlesCount);
1589
- response.closeFailureCount && (numberOfHandlesFailedToClose += response.closeFailureCount);
1597
+ if (response.closedHandlesCount) {
1598
+ handlesClosed += response.closedHandlesCount;
1599
+ }
1600
+ if (response.closeFailureCount) {
1601
+ numberOfHandlesFailedToClose += response.closeFailureCount;
1602
+ }
1590
1603
  } while (marker);
1591
1604
  return { closedHandlesCount: handlesClosed, closeFailureCount: numberOfHandlesFailedToClose };
1592
1605
  }
@@ -1639,7 +1652,10 @@ export class ShareDirectoryClient extends StorageClient {
1639
1652
  * A ShareFileClient represents a URL to an Azure Storage file.
1640
1653
  */
1641
1654
  export class ShareFileClient extends StorageClient {
1642
- constructor(url, credentialOrPipeline, options) {
1655
+ constructor(url, credentialOrPipeline,
1656
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
1657
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
1658
+ options) {
1643
1659
  let pipeline;
1644
1660
  if (credentialOrPipeline instanceof Pipeline) {
1645
1661
  pipeline = credentialOrPipeline;
@@ -1824,7 +1840,7 @@ export class ShareFileClient extends StorageClient {
1824
1840
  throw new RangeError(`File download response doesn't contain valid content length header`);
1825
1841
  }
1826
1842
  return new FileDownloadResponse(res, async (start) => {
1827
- const updatedOptions = {
1843
+ const updatedDownloadOptions = {
1828
1844
  range: rangeToString({
1829
1845
  count: offset + res.contentLength - start,
1830
1846
  offset: start
@@ -1833,10 +1849,10 @@ export class ShareFileClient extends StorageClient {
1833
1849
  // Debug purpose only
1834
1850
  // console.log(
1835
1851
  // `Read from internal stream, range: ${
1836
- // updatedOptions.range
1837
- // }, options: ${JSON.stringify(updatedOptions)}`
1852
+ // chunkDownloadOptions.range
1853
+ // }, options: ${JSON.stringify(chunkDownloadOptions)}`
1838
1854
  // );
1839
- const downloadRes = await this.context.download(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, updatedOptions), convertTracingToRequestOptionsBase(updatedOptions)));
1855
+ const downloadRes = await this.context.download(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, updatedDownloadOptions), convertTracingToRequestOptionsBase(updatedDownloadOptions)));
1840
1856
  if (!(downloadRes.etag === res.etag)) {
1841
1857
  throw new Error("File has been modified concurrently");
1842
1858
  }
@@ -2896,8 +2912,12 @@ export class ShareFileClient extends StorageClient {
2896
2912
  do {
2897
2913
  const response = await this.forceCloseHandlesSegment(marker, { tracingOptions: updatedOptions.tracingOptions });
2898
2914
  marker = response.marker;
2899
- response.closedHandlesCount && (handlesClosed += response.closedHandlesCount);
2900
- response.closeFailureCount && (numberOfHandlesFailedToClose += response.closeFailureCount);
2915
+ if (response.closedHandlesCount) {
2916
+ handlesClosed += response.closedHandlesCount;
2917
+ }
2918
+ if (response.closeFailureCount) {
2919
+ numberOfHandlesFailedToClose += response.closeFailureCount;
2920
+ }
2901
2921
  } while (marker);
2902
2922
  return {
2903
2923
  closedHandlesCount: handlesClosed,