@azure/storage-file-share 12.25.0-alpha.20240823.1 → 12.25.0-alpha.20240827.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/dist/index.js +47 -47
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/BatchResponse.js +1 -1
  4. package/dist-esm/storage-blob/src/BatchResponse.js.map +1 -1
  5. package/dist-esm/storage-blob/src/BatchResponseParser.js +1 -1
  6. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
  7. package/dist-esm/storage-blob/src/BatchUtils.js +1 -1
  8. package/dist-esm/storage-blob/src/BatchUtils.js.map +1 -1
  9. package/dist-esm/storage-blob/src/BlobBatch.js +1 -1
  10. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
  11. package/dist-esm/storage-blob/src/BlobBatchClient.js +1 -1
  12. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  13. package/dist-esm/storage-blob/src/BlobDownloadResponse.js +1 -1
  14. package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +1 -1
  15. package/dist-esm/storage-blob/src/BlobLeaseClient.js +1 -1
  16. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
  17. package/dist-esm/storage-blob/src/BlobQueryResponse.js +1 -1
  18. package/dist-esm/storage-blob/src/BlobQueryResponse.js.map +1 -1
  19. package/dist-esm/storage-blob/src/BlobServiceClient.js +1 -1
  20. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  21. package/dist-esm/storage-blob/src/Clients.js +1 -1
  22. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  23. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  24. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js +1 -1
  25. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -1
  26. package/dist-esm/storage-blob/src/Pipeline.js +1 -1
  27. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  28. package/dist-esm/storage-blob/src/Range.js +1 -1
  29. package/dist-esm/storage-blob/src/Range.js.map +1 -1
  30. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js +1 -1
  31. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +1 -1
  32. package/dist-esm/storage-blob/src/StorageClient.js +1 -1
  33. package/dist-esm/storage-blob/src/StorageClient.js.map +1 -1
  34. package/dist-esm/storage-blob/src/StorageContextClient.js +1 -1
  35. package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -1
  36. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js +1 -1
  37. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -1
  38. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js +1 -1
  39. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js.map +1 -1
  40. package/dist-esm/storage-blob/src/credentials/Credential.js +1 -1
  41. package/dist-esm/storage-blob/src/credentials/Credential.js.map +1 -1
  42. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js +1 -1
  43. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js.map +1 -1
  44. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js +1 -1
  45. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js.map +1 -1
  46. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js +1 -1
  47. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js.map +1 -1
  48. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js +1 -1
  49. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js.map +1 -1
  50. package/dist-esm/storage-blob/src/generatedModels.js +1 -1
  51. package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
  52. package/dist-esm/storage-blob/src/index.js +1 -1
  53. package/dist-esm/storage-blob/src/index.js.map +1 -1
  54. package/dist-esm/storage-blob/src/log.js +1 -1
  55. package/dist-esm/storage-blob/src/log.js.map +1 -1
  56. package/dist-esm/storage-blob/src/models.js +1 -1
  57. package/dist-esm/storage-blob/src/models.js.map +1 -1
  58. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js +1 -1
  59. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -1
  60. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js +1 -1
  61. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +1 -1
  62. package/dist-esm/storage-blob/src/policies/RequestPolicy.js +1 -1
  63. package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +1 -1
  64. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +1 -1
  65. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
  66. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +1 -1
  67. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +1 -1
  68. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js +1 -1
  69. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js.map +1 -1
  70. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js +1 -1
  71. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js.map +1 -1
  72. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
  73. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  74. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +1 -1
  75. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
  76. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +1 -1
  77. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  78. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +1 -1
  79. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +1 -1
  80. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +1 -1
  81. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  82. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +1 -1
  83. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  84. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +1 -1
  85. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
  86. package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js +1 -1
  87. package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js.map +1 -1
  88. package/dist-esm/storage-blob/src/sas/AccountSASServices.js +1 -1
  89. package/dist-esm/storage-blob/src/sas/AccountSASServices.js.map +1 -1
  90. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +1 -1
  91. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
  92. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +1 -1
  93. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +1 -1
  94. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +1 -1
  95. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
  96. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +1 -1
  97. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
  98. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +1 -1
  99. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
  100. package/dist-esm/storage-blob/src/sas/SasIPRange.js +1 -1
  101. package/dist-esm/storage-blob/src/sas/SasIPRange.js.map +1 -1
  102. package/dist-esm/storage-blob/src/utils/Batch.js +1 -1
  103. package/dist-esm/storage-blob/src/utils/Batch.js.map +1 -1
  104. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +1 -1
  105. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
  106. package/dist-esm/storage-blob/src/utils/Mutex.js +1 -1
  107. package/dist-esm/storage-blob/src/utils/Mutex.js.map +1 -1
  108. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +1 -1
  109. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
  110. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js +1 -1
  111. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js.map +1 -1
  112. package/dist-esm/storage-blob/src/utils/cache.js +1 -1
  113. package/dist-esm/storage-blob/src/utils/cache.js.map +1 -1
  114. package/dist-esm/storage-blob/src/utils/constants.js +1 -1
  115. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  116. package/dist-esm/storage-blob/src/utils/tracing.js +1 -1
  117. package/dist-esm/storage-blob/src/utils/tracing.js.map +1 -1
  118. package/dist-esm/storage-blob/src/utils/utils.common.js +1 -1
  119. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  120. package/dist-esm/storage-blob/src/utils/utils.node.js +1 -1
  121. package/dist-esm/storage-blob/src/utils/utils.node.js.map +1 -1
  122. package/dist-esm/storage-file-share/src/AccountSASPermissions.js +1 -1
  123. package/dist-esm/storage-file-share/src/AccountSASPermissions.js.map +1 -1
  124. package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js +1 -1
  125. package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js.map +1 -1
  126. package/dist-esm/storage-file-share/src/AccountSASServices.js +1 -1
  127. package/dist-esm/storage-file-share/src/AccountSASServices.js.map +1 -1
  128. package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js +1 -1
  129. package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js.map +1 -1
  130. package/dist-esm/storage-file-share/src/Clients.js +1 -1
  131. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  132. package/dist-esm/storage-file-share/src/FileDownloadResponse.browser.js +1 -1
  133. package/dist-esm/storage-file-share/src/FileDownloadResponse.browser.js.map +1 -1
  134. package/dist-esm/storage-file-share/src/FileDownloadResponse.js +1 -1
  135. package/dist-esm/storage-file-share/src/FileDownloadResponse.js.map +1 -1
  136. package/dist-esm/storage-file-share/src/FileSASPermissions.js +1 -1
  137. package/dist-esm/storage-file-share/src/FileSASPermissions.js.map +1 -1
  138. package/dist-esm/storage-file-share/src/FileSASSignatureValues.js +1 -1
  139. package/dist-esm/storage-file-share/src/FileSASSignatureValues.js.map +1 -1
  140. package/dist-esm/storage-file-share/src/FileSystemAttributes.js +1 -1
  141. package/dist-esm/storage-file-share/src/FileSystemAttributes.js.map +1 -1
  142. package/dist-esm/storage-file-share/src/Pipeline.js +1 -1
  143. package/dist-esm/storage-file-share/src/Pipeline.js.map +1 -1
  144. package/dist-esm/storage-file-share/src/Range.js +1 -1
  145. package/dist-esm/storage-file-share/src/Range.js.map +1 -1
  146. package/dist-esm/storage-file-share/src/SASQueryParameters.js +1 -1
  147. package/dist-esm/storage-file-share/src/SASQueryParameters.js.map +1 -1
  148. package/dist-esm/storage-file-share/src/SasIPRange.js +1 -1
  149. package/dist-esm/storage-file-share/src/SasIPRange.js.map +1 -1
  150. package/dist-esm/storage-file-share/src/ShareClientInternal.js +1 -1
  151. package/dist-esm/storage-file-share/src/ShareClientInternal.js.map +1 -1
  152. package/dist-esm/storage-file-share/src/ShareSASPermissions.js +1 -1
  153. package/dist-esm/storage-file-share/src/ShareSASPermissions.js.map +1 -1
  154. package/dist-esm/storage-file-share/src/ShareServiceClient.js +1 -1
  155. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
  156. package/dist-esm/storage-file-share/src/StorageClient.js +1 -1
  157. package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
  158. package/dist-esm/storage-file-share/src/StorageContextClient.js +1 -1
  159. package/dist-esm/storage-file-share/src/StorageContextClient.js.map +1 -1
  160. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js +1 -1
  161. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js.map +1 -1
  162. package/dist-esm/storage-file-share/src/generatedModels.js +1 -1
  163. package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
  164. package/dist-esm/storage-file-share/src/index.browser.js +1 -1
  165. package/dist-esm/storage-file-share/src/index.browser.js.map +1 -1
  166. package/dist-esm/storage-file-share/src/index.js +1 -1
  167. package/dist-esm/storage-file-share/src/index.js.map +1 -1
  168. package/dist-esm/storage-file-share/src/log.js +1 -1
  169. package/dist-esm/storage-file-share/src/log.js.map +1 -1
  170. package/dist-esm/storage-file-share/src/models.js +1 -1
  171. package/dist-esm/storage-file-share/src/models.js.map +1 -1
  172. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js +1 -1
  173. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js.map +1 -1
  174. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js +1 -1
  175. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js.map +1 -1
  176. package/dist-esm/storage-file-share/src/utils/Batch.js +1 -1
  177. package/dist-esm/storage-file-share/src/utils/Batch.js.map +1 -1
  178. package/dist-esm/storage-file-share/src/utils/BufferScheduler.js +1 -1
  179. package/dist-esm/storage-file-share/src/utils/BufferScheduler.js.map +1 -1
  180. package/dist-esm/storage-file-share/src/utils/RetriableReadableStream.js +1 -1
  181. package/dist-esm/storage-file-share/src/utils/RetriableReadableStream.js.map +1 -1
  182. package/dist-esm/storage-file-share/src/utils/constants.js +1 -1
  183. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  184. package/dist-esm/storage-file-share/src/utils/tracing.js +1 -1
  185. package/dist-esm/storage-file-share/src/utils/tracing.js.map +1 -1
  186. package/dist-esm/storage-file-share/src/utils/utils.browser.js +1 -1
  187. package/dist-esm/storage-file-share/src/utils/utils.browser.js.map +1 -1
  188. package/dist-esm/storage-file-share/src/utils/utils.common.js +1 -1
  189. package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -1
  190. package/dist-esm/storage-file-share/src/utils/utils.node.js +1 -1
  191. package/dist-esm/storage-file-share/src/utils/utils.node.js.map +1 -1
  192. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"utils.node.js","sourceRoot":"","sources":["../../../../src/utils/utils.node.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B,EAC7B,MAAc,EACd,MAAc,EACd,GAAW,EACX,QAAyB;IAEzB,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,qBAAqB;IAClC,MAAM,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,wCAAwC;IAEpE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,UAAU,CACxB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,EACxE,eAAe,CAChB,CAAC;QACF,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YACzB,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;gBACjB,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YAED,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,E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CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as fs from \"fs\";\nimport * as util from \"util\";\nimport { REQUEST_TIMEOUT } from \"./constants\";\n\n/**\n * Reads a readable stream into buffer. Fill the buffer from offset to end.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param offset - From which position in the buffer to be filled, inclusive\n * @param end - To which position in the buffer to be filled, exclusive\n * @param encoding - Encoding of the Readable stream\n */\nexport async function streamToBuffer(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n offset: number,\n end: number,\n encoding?: BufferEncoding,\n): Promise<void> {\n let pos = 0; // Position in stream\n const count = end - offset; // Total amount of data needed in stream\n\n return new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(\n () => reject(new Error(`The operation cannot be completed in timeout.`)),\n REQUEST_TIMEOUT,\n );\n stream.on(\"readable\", () => {\n if (pos >= count) {\n clearTimeout(timeout);\n resolve();\n return;\n }\n\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n // How much data needed in this chunk\n const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;\n\n buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);\n pos += chunkLength;\n });\n\n stream.on(\"end\", () => {\n clearTimeout(timeout);\n if (pos < count) {\n reject(\n new Error(\n `Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`,\n ),\n );\n }\n resolve();\n });\n\n stream.on(\"error\", (msg) => {\n clearTimeout(timeout);\n reject(msg);\n });\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.\n *\n * @param rs - The read stream.\n * @param file - Destination file path.\n */\nexport async function readStreamToLocalFile(\n rs: NodeJS.ReadableStream,\n file: string,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const ws = fs.createWriteStream(file);\n\n rs.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"close\", resolve);\n\n rs.pipe(ws);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Promisified version of fs.stat().\n */\nexport const fsStat = util.promisify(fs.stat);\n\nexport const fsCreateReadStream = fs.createReadStream;\n"]}
1
+ {"version":3,"file":"utils.node.js","sourceRoot":"","sources":["../../../../src/utils/utils.node.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B,EAC7B,MAAc,EACd,MAAc,EACd,GAAW,EACX,QAAyB;IAEzB,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,qBAAqB;IAClC,MAAM,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,wCAAwC;IAEpE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAA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AC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,EAAyB,EACzB,IAAY;IAEZ,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEtC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as fs from \"fs\";\nimport * as util from \"util\";\nimport { REQUEST_TIMEOUT } from \"./constants\";\n\n/**\n * Reads a readable stream into buffer. Fill the buffer from offset to end.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param offset - From which position in the buffer to be filled, inclusive\n * @param end - To which position in the buffer to be filled, exclusive\n * @param encoding - Encoding of the Readable stream\n */\nexport async function streamToBuffer(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n offset: number,\n end: number,\n encoding?: BufferEncoding,\n): Promise<void> {\n let pos = 0; // Position in stream\n const count = end - offset; // Total amount of data needed in stream\n\n return new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(\n () => reject(new Error(`The operation cannot be completed in timeout.`)),\n REQUEST_TIMEOUT,\n );\n stream.on(\"readable\", () => {\n if (pos >= count) {\n clearTimeout(timeout);\n resolve();\n return;\n }\n\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n // How much data needed in this chunk\n const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;\n\n buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);\n pos += chunkLength;\n });\n\n stream.on(\"end\", () => {\n clearTimeout(timeout);\n if (pos < count) {\n reject(\n new Error(\n `Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`,\n ),\n );\n }\n resolve();\n });\n\n stream.on(\"error\", (msg) => {\n clearTimeout(timeout);\n reject(msg);\n });\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.\n *\n * @param rs - The read stream.\n * @param file - Destination file path.\n */\nexport async function readStreamToLocalFile(\n rs: NodeJS.ReadableStream,\n file: string,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const ws = fs.createWriteStream(file);\n\n rs.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"close\", resolve);\n\n rs.pipe(ws);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Promisified version of fs.stat().\n */\nexport const fsStat = util.promisify(fs.stat);\n\nexport const fsCreateReadStream = fs.createReadStream;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azure/storage-file-share",
3
3
  "sdk-type": "client",
4
- "version": "12.25.0-alpha.20240823.1",
4
+ "version": "12.25.0-alpha.20240827.1",
5
5
  "description": "Microsoft Azure Storage SDK for JavaScript - File",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist-esm/storage-file-share/src/index.js",
@@ -146,7 +146,7 @@
146
146
  "cross-env": "^7.0.2",
147
147
  "dotenv": "^16.0.0",
148
148
  "es6-promise": "^4.2.5",
149
- "eslint": "^8.0.0",
149
+ "eslint": "^9.9.0",
150
150
  "inherits": "^2.0.3",
151
151
  "karma": "^6.2.0",
152
152
  "karma-chrome-launcher": "^3.0.0",