@azure/storage-file-share 12.15.0-beta.1 → 12.20.0-alpha.20230608.4

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 (324) hide show
  1. package/dist/index.js +5967 -6568
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/BatchResponse.js +4 -0
  4. package/dist-esm/storage-blob/src/BatchResponse.js.map +1 -0
  5. package/dist-esm/storage-blob/src/BatchResponseParser.js +137 -0
  6. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -0
  7. package/dist-esm/storage-blob/src/BatchUtils.browser.js +11 -0
  8. package/dist-esm/storage-blob/src/BatchUtils.browser.js.map +1 -0
  9. package/dist-esm/storage-blob/src/BatchUtils.js +15 -0
  10. package/dist-esm/storage-blob/src/BatchUtils.js.map +1 -0
  11. package/dist-esm/storage-blob/src/BlobBatch.js +267 -0
  12. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -0
  13. package/dist-esm/storage-blob/src/BlobBatchClient.js +140 -0
  14. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -0
  15. package/dist-esm/storage-blob/src/BlobDownloadResponse.browser.js +7 -0
  16. package/dist-esm/storage-blob/src/BlobDownloadResponse.browser.js.map +1 -0
  17. package/dist-esm/storage-blob/src/BlobDownloadResponse.js +455 -0
  18. package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +1 -0
  19. package/dist-esm/storage-blob/src/BlobLeaseClient.js +192 -0
  20. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -0
  21. package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js +362 -0
  22. package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js.map +1 -0
  23. package/dist-esm/storage-blob/src/BlobQueryResponse.js +367 -0
  24. package/dist-esm/storage-blob/src/BlobQueryResponse.js.map +1 -0
  25. package/dist-esm/storage-blob/src/BlobServiceClient.js +702 -0
  26. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -0
  27. package/dist-esm/storage-blob/src/Clients.js +2527 -0
  28. package/dist-esm/storage-blob/src/Clients.js.map +1 -0
  29. package/dist-esm/storage-blob/src/ContainerClient.js +1161 -0
  30. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -0
  31. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js +24 -0
  32. package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -0
  33. package/dist-esm/storage-blob/src/Pipeline.js +259 -0
  34. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -0
  35. package/dist-esm/storage-blob/src/Range.js +21 -0
  36. package/dist-esm/storage-blob/src/Range.js.map +1 -0
  37. package/dist-esm/{src → storage-blob/src}/StorageBrowserPolicyFactory.js +1 -1
  38. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +1 -0
  39. package/dist-esm/storage-blob/src/StorageClient.js +29 -0
  40. package/dist-esm/storage-blob/src/StorageClient.js.map +1 -0
  41. package/dist-esm/storage-blob/src/StorageContextClient.js +17 -0
  42. package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -0
  43. package/dist-esm/{src → storage-blob/src}/StorageRetryPolicyFactory.js +2 -1
  44. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -0
  45. package/dist-esm/{src → storage-blob/src}/credentials/AnonymousCredential.js +1 -1
  46. package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js.map +1 -0
  47. package/dist-esm/storage-blob/src/credentials/Credential.js.map +1 -0
  48. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.browser.js.map +1 -0
  49. package/dist-esm/{src → storage-blob/src}/credentials/StorageSharedKeyCredential.js +1 -1
  50. package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js.map +1 -0
  51. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js +5 -0
  52. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.browser.js.map +1 -0
  53. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js +31 -0
  54. package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js.map +1 -0
  55. package/dist-esm/{src → storage-blob/src}/generated/src/index.js +1 -1
  56. package/dist-esm/storage-blob/src/generated/src/index.js.map +1 -0
  57. package/dist-esm/storage-blob/src/generated/src/models/index.js +256 -0
  58. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -0
  59. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +8196 -0
  60. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -0
  61. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1610 -0
  62. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -0
  63. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +221 -0
  64. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js.map +1 -0
  65. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +997 -0
  66. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -0
  67. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +365 -0
  68. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +1 -0
  69. package/dist-esm/storage-blob/src/generated/src/operations/container.js +705 -0
  70. package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -0
  71. package/dist-esm/storage-blob/src/generated/src/operations/index.js +14 -0
  72. package/dist-esm/storage-blob/src/generated/src/operations/index.js.map +1 -0
  73. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +456 -0
  74. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js.map +1 -0
  75. package/dist-esm/storage-blob/src/generated/src/operations/service.js +315 -0
  76. package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +1 -0
  77. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js +9 -0
  78. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js.map +1 -0
  79. package/dist-esm/{src/generated/src/models/index.js → storage-blob/src/generated/src/operationsInterfaces/blob.js} +1 -1
  80. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js.map +1 -0
  81. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js +9 -0
  82. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js.map +1 -0
  83. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js +9 -0
  84. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js.map +1 -0
  85. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js +14 -0
  86. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js.map +1 -0
  87. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js +9 -0
  88. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js.map +1 -0
  89. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js +9 -0
  90. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js.map +1 -0
  91. package/dist-esm/storage-blob/src/generated/src/storageClient.js +49 -0
  92. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -0
  93. package/dist-esm/storage-blob/src/generatedModels.js +4 -0
  94. package/dist-esm/storage-blob/src/generatedModels.js.map +1 -0
  95. package/dist-esm/storage-blob/src/index.browser.js +23 -0
  96. package/dist-esm/storage-blob/src/index.browser.js.map +1 -0
  97. package/dist-esm/storage-blob/src/index.js +33 -0
  98. package/dist-esm/storage-blob/src/index.js.map +1 -0
  99. package/dist-esm/storage-blob/src/log.js +8 -0
  100. package/dist-esm/storage-blob/src/log.js.map +1 -0
  101. package/dist-esm/storage-blob/src/models.js +108 -0
  102. package/dist-esm/storage-blob/src/models.js.map +1 -0
  103. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -0
  104. package/dist-esm/{src → storage-blob/src}/policies/CredentialPolicy.js +1 -1
  105. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +1 -0
  106. package/dist-esm/storage-blob/src/policies/RequestPolicy.js +40 -0
  107. package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +1 -0
  108. package/dist-esm/{src → storage-blob/src}/policies/StorageBrowserPolicy.js +2 -1
  109. package/dist-esm/{src → storage-blob/src}/policies/StorageBrowserPolicy.js.map +1 -1
  110. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +31 -0
  111. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +1 -0
  112. package/dist-esm/{src → storage-blob/src}/policies/StorageRetryPolicy.js +15 -6
  113. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -0
  114. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +165 -0
  115. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -0
  116. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -0
  117. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +18 -0
  118. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +1 -0
  119. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +131 -0
  120. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -0
  121. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +130 -0
  122. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -0
  123. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +227 -0
  124. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -0
  125. package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js.map +1 -0
  126. package/dist-esm/storage-blob/src/sas/AccountSASServices.js.map +1 -0
  127. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +93 -0
  128. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -0
  129. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js +195 -0
  130. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +1 -0
  131. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +555 -0
  132. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -0
  133. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +221 -0
  134. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -0
  135. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +234 -0
  136. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -0
  137. package/dist-esm/storage-blob/src/sas/SasIPRange.js +13 -0
  138. package/dist-esm/storage-blob/src/sas/SasIPRange.js.map +1 -0
  139. package/dist-esm/storage-blob/src/utils/Batch.js.map +1 -0
  140. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +111 -0
  141. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -0
  142. package/dist-esm/storage-blob/src/utils/Mutex.js +66 -0
  143. package/dist-esm/storage-blob/src/utils/Mutex.js.map +1 -0
  144. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +119 -0
  145. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -0
  146. package/dist-esm/storage-blob/src/utils/cache.js +11 -0
  147. package/dist-esm/storage-blob/src/utils/cache.js.map +1 -0
  148. package/dist-esm/storage-blob/src/utils/constants.js +223 -0
  149. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -0
  150. package/dist-esm/storage-blob/src/utils/tracing.js +14 -0
  151. package/dist-esm/storage-blob/src/utils/tracing.js.map +1 -0
  152. package/dist-esm/storage-blob/src/utils/utils.browser.js +48 -0
  153. package/dist-esm/storage-blob/src/utils/utils.browser.js.map +1 -0
  154. package/dist-esm/storage-blob/src/utils/utils.common.js +754 -0
  155. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -0
  156. package/dist-esm/storage-blob/src/utils/utils.node.js +132 -0
  157. package/dist-esm/storage-blob/src/utils/utils.node.js.map +1 -0
  158. package/dist-esm/storage-file-share/src/AccountSASPermissions.js.map +1 -0
  159. package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js +72 -0
  160. package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js.map +1 -0
  161. package/dist-esm/storage-file-share/src/AccountSASServices.js +80 -0
  162. package/dist-esm/storage-file-share/src/AccountSASServices.js.map +1 -0
  163. package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js.map +1 -0
  164. package/dist-esm/{src → storage-file-share/src}/Clients.js +476 -1253
  165. package/dist-esm/storage-file-share/src/Clients.js.map +1 -0
  166. package/dist-esm/storage-file-share/src/FileDownloadResponse.browser.js.map +1 -0
  167. package/dist-esm/{src → storage-file-share/src}/FileDownloadResponse.js +15 -14
  168. package/dist-esm/storage-file-share/src/FileDownloadResponse.js.map +1 -0
  169. package/dist-esm/storage-file-share/src/FileSASPermissions.js.map +1 -0
  170. package/dist-esm/storage-file-share/src/FileSASSignatureValues.js.map +1 -0
  171. package/dist-esm/storage-file-share/src/FileSystemAttributes.js.map +1 -0
  172. package/dist-esm/storage-file-share/src/Range.js.map +1 -0
  173. package/dist-esm/{src → storage-file-share/src}/SASQueryParameters.js +14 -14
  174. package/dist-esm/storage-file-share/src/SASQueryParameters.js.map +1 -0
  175. package/dist-esm/storage-file-share/src/SasIPRange.js.map +1 -0
  176. package/dist-esm/{src → storage-file-share/src}/ShareClientInternal.js +1 -2
  177. package/dist-esm/storage-file-share/src/ShareClientInternal.js.map +1 -0
  178. package/dist-esm/storage-file-share/src/ShareSASPermissions.js.map +1 -0
  179. package/dist-esm/{src → storage-file-share/src}/ShareServiceClient.js +58 -121
  180. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -0
  181. package/dist-esm/{src → storage-file-share/src}/StorageClient.js +8 -14
  182. package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -0
  183. package/dist-esm/storage-file-share/src/StorageContextClient.js +18 -0
  184. package/dist-esm/storage-file-share/src/StorageContextClient.js.map +1 -0
  185. package/dist-esm/storage-file-share/src/generated/src/index.js +11 -0
  186. package/dist-esm/storage-file-share/src/generated/src/index.js.map +1 -0
  187. package/dist-esm/storage-file-share/src/generated/src/models/index.js +144 -0
  188. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -0
  189. package/dist-esm/{src → storage-file-share/src}/generated/src/models/mappers.js +16 -64
  190. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -0
  191. package/dist-esm/{src → storage-file-share/src}/generated/src/models/parameters.js +17 -37
  192. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -0
  193. package/dist-esm/{src → storage-file-share/src}/generated/src/operations/directory.js +17 -73
  194. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js.map +1 -0
  195. package/dist-esm/{src → storage-file-share/src}/generated/src/operations/file.js +33 -142
  196. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -0
  197. package/dist-esm/storage-file-share/src/generated/src/operations/index.js.map +1 -0
  198. package/dist-esm/{src → storage-file-share/src}/generated/src/operations/service.js +7 -17
  199. package/dist-esm/storage-file-share/src/generated/src/operations/service.js.map +1 -0
  200. package/dist-esm/{src → storage-file-share/src}/generated/src/operations/share.js +26 -85
  201. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +1 -0
  202. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/directory.js +9 -0
  203. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/directory.js.map +1 -0
  204. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/file.js +9 -0
  205. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/file.js.map +1 -0
  206. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/index.js +12 -0
  207. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/index.js.map +1 -0
  208. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/service.js +9 -0
  209. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/service.js.map +1 -0
  210. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/share.js +9 -0
  211. package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/share.js.map +1 -0
  212. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +48 -0
  213. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -0
  214. package/dist-esm/storage-file-share/src/generatedModels.js +4 -0
  215. package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -0
  216. package/dist-esm/storage-file-share/src/index.browser.js +18 -0
  217. package/dist-esm/storage-file-share/src/index.browser.js.map +1 -0
  218. package/dist-esm/storage-file-share/src/index.js +28 -0
  219. package/dist-esm/storage-file-share/src/index.js.map +1 -0
  220. package/dist-esm/storage-file-share/src/log.js.map +1 -0
  221. package/dist-esm/storage-file-share/src/models.js.map +1 -0
  222. package/dist-esm/storage-file-share/src/utils/Batch.js +122 -0
  223. package/dist-esm/storage-file-share/src/utils/Batch.js.map +1 -0
  224. package/dist-esm/storage-file-share/src/utils/BufferScheduler.js.map +1 -0
  225. package/dist-esm/{src → storage-file-share/src}/utils/RetriableReadableStream.js +51 -48
  226. package/dist-esm/storage-file-share/src/utils/RetriableReadableStream.js.map +1 -0
  227. package/dist-esm/{src → storage-file-share/src}/utils/constants.js +2 -6
  228. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -0
  229. package/dist-esm/storage-file-share/src/utils/tracing.js +14 -0
  230. package/dist-esm/storage-file-share/src/utils/tracing.js.map +1 -0
  231. package/dist-esm/storage-file-share/src/utils/utils.browser.js.map +1 -0
  232. package/dist-esm/{src → storage-file-share/src}/utils/utils.common.js +77 -94
  233. package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -0
  234. package/dist-esm/storage-file-share/src/utils/utils.node.js.map +1 -0
  235. package/package.json +36 -31
  236. package/types/3.1/storage-file-share.d.ts +1454 -532
  237. package/types/latest/storage-file-share.d.ts +1571 -544
  238. package/dist-esm/src/AccountSASPermissions.js.map +0 -1
  239. package/dist-esm/src/AccountSASResourceTypes.js.map +0 -1
  240. package/dist-esm/src/AccountSASServices.js.map +0 -1
  241. package/dist-esm/src/AccountSASSignatureValues.js.map +0 -1
  242. package/dist-esm/src/Clients.js.map +0 -1
  243. package/dist-esm/src/FileDownloadResponse.browser.js.map +0 -1
  244. package/dist-esm/src/FileDownloadResponse.js.map +0 -1
  245. package/dist-esm/src/FileSASPermissions.js.map +0 -1
  246. package/dist-esm/src/FileSASSignatureValues.js.map +0 -1
  247. package/dist-esm/src/FileSystemAttributes.js.map +0 -1
  248. package/dist-esm/src/Pipeline.js +0 -88
  249. package/dist-esm/src/Pipeline.js.map +0 -1
  250. package/dist-esm/src/Range.js.map +0 -1
  251. package/dist-esm/src/SASQueryParameters.js.map +0 -1
  252. package/dist-esm/src/SasIPRange.js.map +0 -1
  253. package/dist-esm/src/ShareClientInternal.js.map +0 -1
  254. package/dist-esm/src/ShareSASPermissions.js.map +0 -1
  255. package/dist-esm/src/ShareServiceClient.js.map +0 -1
  256. package/dist-esm/src/StorageBrowserPolicyFactory.js.map +0 -1
  257. package/dist-esm/src/StorageClient.js.map +0 -1
  258. package/dist-esm/src/StorageRetryPolicyFactory.js.map +0 -1
  259. package/dist-esm/src/TelemetryPolicyFactory.js +0 -50
  260. package/dist-esm/src/TelemetryPolicyFactory.js.map +0 -1
  261. package/dist-esm/src/credentials/AnonymousCredential.js.map +0 -1
  262. package/dist-esm/src/credentials/Credential.js.map +0 -1
  263. package/dist-esm/src/credentials/StorageSharedKeyCredential.browser.js.map +0 -1
  264. package/dist-esm/src/credentials/StorageSharedKeyCredential.js.map +0 -1
  265. package/dist-esm/src/generated/src/index.js.map +0 -1
  266. package/dist-esm/src/generated/src/models/index.js.map +0 -1
  267. package/dist-esm/src/generated/src/models/mappers.js.map +0 -1
  268. package/dist-esm/src/generated/src/models/parameters.js.map +0 -1
  269. package/dist-esm/src/generated/src/operations/directory.js.map +0 -1
  270. package/dist-esm/src/generated/src/operations/file.js.map +0 -1
  271. package/dist-esm/src/generated/src/operations/index.js.map +0 -1
  272. package/dist-esm/src/generated/src/operations/service.js.map +0 -1
  273. package/dist-esm/src/generated/src/operations/share.js.map +0 -1
  274. package/dist-esm/src/generated/src/storageClient.js +0 -25
  275. package/dist-esm/src/generated/src/storageClient.js.map +0 -1
  276. package/dist-esm/src/generated/src/storageClientContext.js +0 -40
  277. package/dist-esm/src/generated/src/storageClientContext.js.map +0 -1
  278. package/dist-esm/src/generatedModels.js +0 -8
  279. package/dist-esm/src/generatedModels.js.map +0 -1
  280. package/dist-esm/src/index.browser.js +0 -17
  281. package/dist-esm/src/index.browser.js.map +0 -1
  282. package/dist-esm/src/index.js +0 -27
  283. package/dist-esm/src/index.js.map +0 -1
  284. package/dist-esm/src/log.js.map +0 -1
  285. package/dist-esm/src/models.js.map +0 -1
  286. package/dist-esm/src/policies/AnonymousCredentialPolicy.js.map +0 -1
  287. package/dist-esm/src/policies/CredentialPolicy.js.map +0 -1
  288. package/dist-esm/src/policies/StorageRetryPolicy.js.map +0 -1
  289. package/dist-esm/src/policies/StorageSharedKeyCredentialPolicy.js.map +0 -1
  290. package/dist-esm/src/policies/TelemetryPolicy.js +0 -36
  291. package/dist-esm/src/policies/TelemetryPolicy.js.map +0 -1
  292. package/dist-esm/src/utils/Batch.js.map +0 -1
  293. package/dist-esm/src/utils/BufferScheduler.js.map +0 -1
  294. package/dist-esm/src/utils/RetriableReadableStream.js.map +0 -1
  295. package/dist-esm/src/utils/cache.js +0 -8
  296. package/dist-esm/src/utils/cache.js.map +0 -1
  297. package/dist-esm/src/utils/constants.js.map +0 -1
  298. package/dist-esm/src/utils/tracing.js +0 -27
  299. package/dist-esm/src/utils/tracing.js.map +0 -1
  300. package/dist-esm/src/utils/utils.browser.js.map +0 -1
  301. package/dist-esm/src/utils/utils.common.js.map +0 -1
  302. package/dist-esm/src/utils/utils.node.js.map +0 -1
  303. /package/dist-esm/{src → storage-blob/src}/credentials/Credential.js +0 -0
  304. /package/dist-esm/{src → storage-blob/src}/credentials/StorageSharedKeyCredential.browser.js +0 -0
  305. /package/dist-esm/{src → storage-blob/src}/policies/AnonymousCredentialPolicy.js +0 -0
  306. /package/dist-esm/{src → storage-blob/src}/policies/StorageSharedKeyCredentialPolicy.js +0 -0
  307. /package/dist-esm/{src → storage-blob/src/sas}/AccountSASResourceTypes.js +0 -0
  308. /package/dist-esm/{src → storage-blob/src/sas}/AccountSASServices.js +0 -0
  309. /package/dist-esm/{src → storage-blob/src}/utils/Batch.js +0 -0
  310. /package/dist-esm/{src → storage-file-share/src}/AccountSASPermissions.js +0 -0
  311. /package/dist-esm/{src → storage-file-share/src}/AccountSASSignatureValues.js +0 -0
  312. /package/dist-esm/{src → storage-file-share/src}/FileDownloadResponse.browser.js +0 -0
  313. /package/dist-esm/{src → storage-file-share/src}/FileSASPermissions.js +0 -0
  314. /package/dist-esm/{src → storage-file-share/src}/FileSASSignatureValues.js +0 -0
  315. /package/dist-esm/{src → storage-file-share/src}/FileSystemAttributes.js +0 -0
  316. /package/dist-esm/{src → storage-file-share/src}/Range.js +0 -0
  317. /package/dist-esm/{src → storage-file-share/src}/SasIPRange.js +0 -0
  318. /package/dist-esm/{src → storage-file-share/src}/ShareSASPermissions.js +0 -0
  319. /package/dist-esm/{src → storage-file-share/src}/generated/src/operations/index.js +0 -0
  320. /package/dist-esm/{src → storage-file-share/src}/log.js +0 -0
  321. /package/dist-esm/{src → storage-file-share/src}/models.js +0 -0
  322. /package/dist-esm/{src → storage-file-share/src}/utils/BufferScheduler.js +0 -0
  323. /package/dist-esm/{src → storage-file-share/src}/utils/utils.browser.js +0 -0
  324. /package/dist-esm/{src → storage-file-share/src}/utils/utils.node.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlobDownloadResponse.js","sourceRoot":"","sources":["../../../../storage-blob/src/BlobDownloadResponse.ts"],"names":[],"mapp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,kBAAmB,EACzC,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { isNode } from \"@azure/core-util\";\nimport { BlobImmutabilityPolicyMode } from \"./generatedModels\";\n\nimport {\n BlobDownloadHeaders,\n BlobType,\n CopyStatusType,\n LeaseDurationType,\n LeaseStateType,\n LeaseStatusType,\n} from \"./generatedModels\";\nimport { BlobDownloadResponseParsed, Metadata, ObjectReplicationPolicy } from \"./models\";\nimport {\n ReadableStreamGetter,\n RetriableReadableStream,\n RetriableReadableStreamOptions,\n} from \"./utils/RetriableReadableStream\";\nimport { ResponseWithHeaders } from \"./utils/utils.common\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will\n * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot\n * trigger retries defined in pipeline retry policy.)\n *\n * The {@link readableStreamBody} stream will retry underlayer, you can just use it as a normal Node.js\n * Readable stream.\n */\nexport class BlobDownloadResponse implements BlobDownloadResponseParsed {\n /**\n * Indicates that the service supports\n * requests for partial file content.\n *\n * @readonly\n */\n public get acceptRanges(): string | undefined {\n return this.originalResponse.acceptRanges;\n }\n\n /**\n * Returns if it was previously specified\n * for the file.\n *\n * @readonly\n */\n public get cacheControl(): string | undefined {\n return this.originalResponse.cacheControl;\n }\n\n /**\n * Returns the value that was specified\n * for the 'x-ms-content-disposition' header and specifies how to process the\n * response.\n *\n * @readonly\n */\n public get contentDisposition(): string | undefined {\n return this.originalResponse.contentDisposition;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Encoding request header.\n *\n * @readonly\n */\n public get contentEncoding(): string | undefined {\n return this.originalResponse.contentEncoding;\n }\n\n /**\n * Returns the value that was specified\n * for the Content-Language request header.\n *\n * @readonly\n */\n public get contentLanguage(): string | undefined {\n return this.originalResponse.contentLanguage;\n }\n\n /**\n * The current sequence number for a\n * page blob. This header is not returned for block blobs or append blobs.\n *\n * @readonly\n */\n public get blobSequenceNumber(): number | undefined {\n return this.originalResponse.blobSequenceNumber;\n }\n\n /**\n * The blob's type. Possible values include:\n * 'BlockBlob', 'PageBlob', 'AppendBlob'.\n *\n * @readonly\n */\n public get blobType(): BlobType | undefined {\n return this.originalResponse.blobType;\n }\n\n /**\n * The number of bytes present in the\n * response body.\n *\n * @readonly\n */\n public get contentLength(): number | undefined {\n return this.originalResponse.contentLength;\n }\n\n /**\n * If the file has an MD5 hash and the\n * request is to read the full file, this response header is returned so that\n * the client can check for message content integrity. If the request is to\n * read a specified range and the 'x-ms-range-get-content-md5' is set to\n * true, then the request returns an MD5 hash for the range, as long as the\n * range size is less than or equal to 4 MB. If neither of these sets of\n * conditions is true, then no value is returned for the 'Content-MD5'\n * header.\n *\n * @readonly\n */\n public get contentMD5(): Uint8Array | undefined {\n return this.originalResponse.contentMD5;\n }\n\n /**\n * Indicates the range of bytes returned if\n * the client requested a subset of the file by setting the Range request\n * header.\n *\n * @readonly\n */\n public get contentRange(): string | undefined {\n return this.originalResponse.contentRange;\n }\n\n /**\n * The content type specified for the file.\n * The default content type is 'application/octet-stream'\n *\n * @readonly\n */\n public get contentType(): string | undefined {\n return this.originalResponse.contentType;\n }\n\n /**\n * Conclusion time of the last attempted\n * Copy File operation where this file was the destination file. This value\n * can specify the time of a completed, aborted, or failed copy attempt.\n *\n * @readonly\n */\n public get copyCompletedOn(): Date | undefined {\n return this.originalResponse.copyCompletedOn;\n }\n\n /**\n * String identifier for the last attempted Copy\n * File operation where this file was the destination file.\n *\n * @readonly\n */\n public get copyId(): string | undefined {\n return this.originalResponse.copyId;\n }\n\n /**\n * Contains the number of bytes copied and\n * the total bytes in the source in the last attempted Copy File operation\n * where this file was the destination file. Can show between 0 and\n * Content-Length bytes copied.\n *\n * @readonly\n */\n public get copyProgress(): string | undefined {\n return this.originalResponse.copyProgress;\n }\n\n /**\n * URL up to 2KB in length that specifies the\n * source file used in the last attempted Copy File operation where this file\n * was the destination file.\n *\n * @readonly\n */\n public get copySource(): string | undefined {\n return this.originalResponse.copySource;\n }\n\n /**\n * State of the copy operation\n * identified by 'x-ms-copy-id'. Possible values include: 'pending',\n * 'success', 'aborted', 'failed'\n *\n * @readonly\n */\n public get copyStatus(): CopyStatusType | undefined {\n return this.originalResponse.copyStatus;\n }\n\n /**\n * Only appears when\n * x-ms-copy-status is failed or pending. Describes cause of fatal or\n * non-fatal copy operation failure.\n *\n * @readonly\n */\n public get copyStatusDescription(): string | undefined {\n return this.originalResponse.copyStatusDescription;\n }\n\n /**\n * When a blob is leased,\n * specifies whether the lease is of infinite or fixed duration. Possible\n * values include: 'infinite', 'fixed'.\n *\n * @readonly\n */\n public get leaseDuration(): LeaseDurationType | undefined {\n return this.originalResponse.leaseDuration;\n }\n\n /**\n * Lease state of the blob. Possible\n * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.\n *\n * @readonly\n */\n public get leaseState(): LeaseStateType | undefined {\n return this.originalResponse.leaseState;\n }\n\n /**\n * The current lease status of the\n * blob. Possible values include: 'locked', 'unlocked'.\n *\n * @readonly\n */\n public get leaseStatus(): LeaseStatusType | undefined {\n return this.originalResponse.leaseStatus;\n }\n\n /**\n * A UTC date/time value generated by the service that\n * indicates the time at which the response was initiated.\n *\n * @readonly\n */\n public get date(): Date | undefined {\n return this.originalResponse.date;\n }\n\n /**\n * The number of committed blocks\n * present in the blob. This header is returned only for append blobs.\n *\n * @readonly\n */\n public get blobCommittedBlockCount(): number | undefined {\n return this.originalResponse.blobCommittedBlockCount;\n }\n\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally, in quotes.\n *\n * @readonly\n */\n public get etag(): string | undefined {\n return this.originalResponse.etag;\n }\n\n /**\n * The number of tags associated with the blob\n *\n * @readonly\n */\n public get tagCount(): number | undefined {\n return this.originalResponse.tagCount;\n }\n\n /**\n * The error code.\n *\n * @readonly\n */\n public get errorCode(): string | undefined {\n return this.originalResponse.errorCode;\n }\n\n /**\n * The value of this header is set to\n * true if the file data and application metadata are completely encrypted\n * using the specified algorithm. Otherwise, the value is set to false (when\n * the file is unencrypted, or if only parts of the file/application metadata\n * are encrypted).\n *\n * @readonly\n */\n public get isServerEncrypted(): boolean | undefined {\n return this.originalResponse.isServerEncrypted;\n }\n\n /**\n * If the blob has a MD5 hash, and if\n * request contains range header (Range or x-ms-range), this response header\n * is returned with the value of the whole blob's MD5 value. This value may\n * or may not be equal to the value returned in Content-MD5 header, with the\n * latter calculated from the requested range.\n *\n * @readonly\n */\n public get blobContentMD5(): Uint8Array | undefined {\n return this.originalResponse.blobContentMD5;\n }\n\n /**\n * Returns the date and time the file was last\n * modified. Any operation that modifies the file or its properties updates\n * the last modified time.\n *\n * @readonly\n */\n public get lastModified(): Date | undefined {\n return this.originalResponse.lastModified;\n }\n\n /**\n * Returns the UTC date and time generated by the service that indicates the time at which the blob was\n * last read or written to.\n *\n * @readonly\n */\n public get lastAccessed(): Date | undefined {\n return this.originalResponse.lastAccessed;\n }\n\n /**\n * A name-value pair\n * to associate with a file storage object.\n *\n * @readonly\n */\n public get metadata(): Metadata | undefined {\n return this.originalResponse.metadata;\n }\n\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n *\n * @readonly\n */\n public get requestId(): string | undefined {\n return this.originalResponse.requestId;\n }\n\n /**\n * If a client request id header is sent in the request, this header will be present in the\n * response with the same value.\n *\n * @readonly\n */\n public get clientRequestId(): string | undefined {\n return this.originalResponse.clientRequestId;\n }\n\n /**\n * Indicates the version of the Blob service used\n * to execute the request.\n *\n * @readonly\n */\n public get version(): string | undefined {\n return this.originalResponse.version;\n }\n\n /**\n * Indicates the versionId of the downloaded blob version.\n *\n * @readonly\n */\n public get versionId(): string | undefined {\n return this.originalResponse.versionId;\n }\n\n /**\n * Indicates whether version of this blob is a current version.\n *\n * @readonly\n */\n public get isCurrentVersion(): boolean | undefined {\n return this.originalResponse.isCurrentVersion;\n }\n\n /**\n * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned\n * when the blob was encrypted with a customer-provided key.\n *\n * @readonly\n */\n public get encryptionKeySha256(): string | undefined {\n return this.originalResponse.encryptionKeySha256;\n }\n\n /**\n * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to\n * true, then the request returns a crc64 for the range, as long as the range size is less than\n * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is\n * specified in the same request, it will fail with 400(Bad Request)\n */\n public get contentCrc64(): Uint8Array | undefined {\n return this.originalResponse.contentCrc64;\n }\n\n /**\n * Object Replication Policy Id of the destination blob.\n *\n * @readonly\n */\n public get objectReplicationDestinationPolicyId(): string | undefined {\n return this.originalResponse.objectReplicationDestinationPolicyId;\n }\n\n /**\n * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob.\n *\n * @readonly\n */\n public get objectReplicationSourceProperties(): ObjectReplicationPolicy[] | undefined {\n return this.originalResponse.objectReplicationSourceProperties;\n }\n\n /**\n * If this blob has been sealed.\n *\n * @readonly\n */\n public get isSealed(): boolean | undefined {\n return this.originalResponse.isSealed;\n }\n\n /**\n * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire.\n *\n * @readonly\n */\n public get immutabilityPolicyExpiresOn(): Date | undefined {\n return this.originalResponse.immutabilityPolicyExpiresOn;\n }\n\n /**\n * Indicates immutability policy mode.\n *\n * @readonly\n */\n public get immutabilityPolicyMode(): BlobImmutabilityPolicyMode | undefined {\n return this.originalResponse.immutabilityPolicyMode;\n }\n\n /**\n * Indicates if a legal hold is present on the blob.\n *\n * @readonly\n */\n public get legalHold(): boolean | undefined {\n return this.originalResponse.legalHold;\n }\n\n /**\n * The response body as a browser Blob.\n * Always undefined in node.js.\n *\n * @readonly\n */\n public get contentAsBlob(): Promise<Blob> | undefined {\n return this.originalResponse.blobBody;\n }\n\n /**\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n *\n * It will automatically retry when internal read stream unexpected ends.\n *\n * @readonly\n */\n public get readableStreamBody(): NodeJS.ReadableStream | undefined {\n return isNode ? this.blobDownloadStream : undefined;\n }\n\n /**\n * The HTTP response.\n */\n public get _response(): ResponseWithHeaders<BlobDownloadHeaders>[\"_response\"] {\n return this.originalResponse._response;\n }\n\n private originalResponse: BlobDownloadResponseParsed;\n private blobDownloadStream?: RetriableReadableStream;\n\n /**\n * Creates an instance of BlobDownloadResponse.\n *\n * @param originalResponse -\n * @param getter -\n * @param offset -\n * @param count -\n * @param options -\n */\n public constructor(\n originalResponse: BlobDownloadResponseParsed,\n getter: ReadableStreamGetter,\n offset: number,\n count: number,\n options: RetriableReadableStreamOptions = {}\n ) {\n this.originalResponse = originalResponse;\n this.blobDownloadStream = new RetriableReadableStream(\n this.originalResponse.readableStreamBody!,\n getter,\n offset,\n count,\n options\n );\n }\n}\n"]}
@@ -0,0 +1,192 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { v4 as generateUuid } from "uuid";
4
+ import { ETagNone } from "./utils/constants";
5
+ import { tracingClient } from "./utils/tracing";
6
+ import { assertResponse } from "./utils/utils.common";
7
+ /**
8
+ * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.
9
+ */
10
+ export class BlobLeaseClient {
11
+ /**
12
+ * Gets the lease Id.
13
+ *
14
+ * @readonly
15
+ */
16
+ get leaseId() {
17
+ return this._leaseId;
18
+ }
19
+ /**
20
+ * Gets the url.
21
+ *
22
+ * @readonly
23
+ */
24
+ get url() {
25
+ return this._url;
26
+ }
27
+ /**
28
+ * Creates an instance of BlobLeaseClient.
29
+ * @param client - The client to make the lease operation requests.
30
+ * @param leaseId - Initial proposed lease id.
31
+ */
32
+ constructor(client, leaseId) {
33
+ const clientContext = client.storageClientContext;
34
+ this._url = client.url;
35
+ if (client.name === undefined) {
36
+ this._isContainer = true;
37
+ this._containerOrBlobOperation = clientContext.container;
38
+ }
39
+ else {
40
+ this._isContainer = false;
41
+ this._containerOrBlobOperation = clientContext.blob;
42
+ }
43
+ if (!leaseId) {
44
+ leaseId = generateUuid();
45
+ }
46
+ this._leaseId = leaseId;
47
+ }
48
+ /**
49
+ * Establishes and manages a lock on a container for delete operations, or on a blob
50
+ * for write and delete operations.
51
+ * The lock duration can be 15 to 60 seconds, or can be infinite.
52
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
53
+ * and
54
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
55
+ *
56
+ * @param duration - Must be between 15 to 60 seconds, or infinite (-1)
57
+ * @param options - option to configure lease management operations.
58
+ * @returns Response data for acquire lease operation.
59
+ */
60
+ async acquireLease(duration, options = {}) {
61
+ var _a, _b, _c, _d, _e;
62
+ if (this._isContainer &&
63
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
64
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
65
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
66
+ 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.");
67
+ }
68
+ return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => {
69
+ var _a;
70
+ return assertResponse(await this._containerOrBlobOperation.acquireLease({
71
+ abortSignal: options.abortSignal,
72
+ duration,
73
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
74
+ proposedLeaseId: this._leaseId,
75
+ tracingOptions: updatedOptions.tracingOptions,
76
+ }));
77
+ });
78
+ }
79
+ /**
80
+ * To change the ID of the lease.
81
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
82
+ * and
83
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
84
+ *
85
+ * @param proposedLeaseId - the proposed new lease Id.
86
+ * @param options - option to configure lease management operations.
87
+ * @returns Response data for change lease operation.
88
+ */
89
+ async changeLease(proposedLeaseId, options = {}) {
90
+ var _a, _b, _c, _d, _e;
91
+ if (this._isContainer &&
92
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
93
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
94
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
95
+ 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.");
96
+ }
97
+ return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => {
98
+ var _a;
99
+ const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {
100
+ abortSignal: options.abortSignal,
101
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
102
+ tracingOptions: updatedOptions.tracingOptions,
103
+ }));
104
+ this._leaseId = proposedLeaseId;
105
+ return response;
106
+ });
107
+ }
108
+ /**
109
+ * To free the lease if it is no longer needed so that another client may
110
+ * immediately acquire a lease against the container or the blob.
111
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
112
+ * and
113
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
114
+ *
115
+ * @param options - option to configure lease management operations.
116
+ * @returns Response data for release lease operation.
117
+ */
118
+ async releaseLease(options = {}) {
119
+ var _a, _b, _c, _d, _e;
120
+ if (this._isContainer &&
121
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
122
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
123
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
124
+ 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.");
125
+ }
126
+ return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => {
127
+ var _a;
128
+ return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, {
129
+ abortSignal: options.abortSignal,
130
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
131
+ tracingOptions: updatedOptions.tracingOptions,
132
+ }));
133
+ });
134
+ }
135
+ /**
136
+ * To renew the lease.
137
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
138
+ * and
139
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
140
+ *
141
+ * @param options - Optional option to configure lease management operations.
142
+ * @returns Response data for renew lease operation.
143
+ */
144
+ async renewLease(options = {}) {
145
+ var _a, _b, _c, _d, _e;
146
+ if (this._isContainer &&
147
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
148
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
149
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
150
+ 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.");
151
+ }
152
+ return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => {
153
+ var _a;
154
+ return this._containerOrBlobOperation.renewLease(this._leaseId, {
155
+ abortSignal: options.abortSignal,
156
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
157
+ tracingOptions: updatedOptions.tracingOptions,
158
+ });
159
+ });
160
+ }
161
+ /**
162
+ * To end the lease but ensure that another client cannot acquire a new lease
163
+ * until the current lease period has expired.
164
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
165
+ * and
166
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
167
+ *
168
+ * @param breakPeriod - Break period
169
+ * @param options - Optional options to configure lease management operations.
170
+ * @returns Response data for break lease operation.
171
+ */
172
+ async breakLease(breakPeriod, options = {}) {
173
+ var _a, _b, _c, _d, _e;
174
+ if (this._isContainer &&
175
+ ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||
176
+ (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||
177
+ ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
178
+ 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.");
179
+ }
180
+ return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => {
181
+ var _a;
182
+ const operationOptions = {
183
+ abortSignal: options.abortSignal,
184
+ breakPeriod,
185
+ modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
186
+ tracingOptions: updatedOptions.tracingOptions,
187
+ };
188
+ return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions));
189
+ });
190
+ }
191
+ }
192
+ //# sourceMappingURL=BlobLeaseClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlobLeaseClient.js","sourceRoot":"","sources":["../../../../storage-blob/src/BlobLeaseClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;AAM1C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAC;AA8EpE;;GAEG;AACH,MAAM,OAAO,eAAe;IAM1B;;;;OAIG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,YAAY,MAAoC,EAAE,OAAgB;QAChE,MAAM,aAAa,GAAI,MAAc,CAAC,oBAAoB,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAK,MAAqB,CAAC,IAAI,KAAK,SAAS,EAAE;YAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,yBAAyB,GAAG,aAAa,CAAC,SAAS,CAAC;SAC1D;aAAM;YACL,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,CAAC,yBAAyB,GAAG,aAAa,CAAC,IAAI,CAAC;SACrD;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,YAAY,EAAE,CAAC;SAC1B;QACD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,YAAY,CACvB,QAAgB,EAChB,U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AiC,EAAE;;QAEnC,IACE,IAAI,CAAC,YAAY;YACjB,CAAC,CAAC,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,OAAO,KAAI,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,OAAO,MAAK,QAAQ,CAAC;gBACxE,CAAC,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,KAAI,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,MAAK,QAAQ,CAAC;iBACjF,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,CAAA,CAAC,EACpC;YACA,MAAM,IAAI,UAAU,CAClB,yJAAyJ,CAC1J,CAAC;SACH;QAED,OAAO,aAAa,CAAC,QAAQ,CAAC,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;;YAC5F,MAAM,gBAAgB,GAAsC;gBAC1D,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,WAAW;gBACX,wBAAwB,kCACnB,OAAO,CAAC,UAAU,KACrB,MAAM,EAAE,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,GAC1C;gBACD,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC;YACF,OAAO,cAAc,CACnB,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAClE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { v4 as generateUuid } from \"uuid\";\nimport { ContainerBreakLeaseOptionalParams } from \"./generatedModels\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { Blob as StorageBlob, Container } from \"./generated/src/operationsInterfaces\";\nimport { ModifiedAccessConditions } from \"./models\";\nimport { CommonOptions } from \"./StorageClient\";\nimport { ETagNone } from \"./utils/constants\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { BlobClient } from \"./Clients\";\nimport { ContainerClient } from \"./ContainerClient\";\nimport { assertResponse, WithResponse } from \"./utils/utils.common\";\nimport {\n ContainerAcquireLeaseHeaders,\n ContainerBreakLeaseHeaders,\n ContainerReleaseLeaseHeaders,\n} from \"./generated/src\";\n\n/**\n * The details for a specific lease.\n */\nexport interface Lease {\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally. If the request version is 2011-08-18 or\n * newer, the ETag value will be in quotes.\n */\n etag?: string;\n /**\n * Returns the date and time the container was\n * last modified. Any operation that modifies the blob, including an update\n * of the blob's metadata or properties, changes the last-modified time of\n * the blob.\n */\n lastModified?: Date;\n /**\n * Uniquely identifies a container's lease\n */\n leaseId?: string;\n /**\n * Approximate time remaining in the lease\n * period, in seconds.\n */\n leaseTime?: number;\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the Blob service used\n * to execute the request. This header is returned for requests made against\n * version 2009-09-19 and above.\n */\n version?: string;\n /**\n * UTC date/time value generated by the service that\n * indicates the time at which the response was initiated\n */\n date?: Date;\n /**\n * Error code if any associated with the response that returned\n * the Lease information.\n */\n errorCode?: string;\n}\n\n/**\n * Contains the response data for operations that create, modify, or delete a lease.\n *\n * See {@link BlobLeaseClient}.\n */\nexport type LeaseOperationResponse = WithResponse<Lease, Lease>;\n\n/**\n * Configures lease operations.\n */\nexport interface LeaseOperationOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Conditions to meet when changing the lease.\n */\n conditions?: ModifiedAccessConditions;\n}\n\n/**\n * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.\n */\nexport class BlobLeaseClient {\n private _leaseId: string;\n private _url: string;\n private _containerOrBlobOperation: Container | StorageBlob;\n private _isContainer: boolean;\n\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n public get leaseId(): string {\n return this._leaseId;\n }\n\n /**\n * Gets the url.\n *\n * @readonly\n */\n public get url(): string {\n return this._url;\n }\n\n /**\n * Creates an instance of BlobLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client: ContainerClient | BlobClient, leaseId?: string) {\n const clientContext = (client as any).storageClientContext;\n this._url = client.url;\n\n if ((client as BlobClient).name === undefined) {\n this._isContainer = true;\n this._containerOrBlobOperation = clientContext.container;\n } else {\n this._isContainer = false;\n this._containerOrBlobOperation = clientContext.blob;\n }\n\n if (!leaseId) {\n leaseId = generateUuid();\n }\n this._leaseId = leaseId;\n }\n\n /**\n * Establishes and manages a lock on a container for delete operations, or on a blob\n * for write and delete operations.\n * The lock duration can be 15 to 60 seconds, or can be infinite.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param duration - Must be between 15 to 60 seconds, or infinite (-1)\n * @param options - option to configure lease management operations.\n * @returns Response data for acquire lease operation.\n */\n public async acquireLease(\n duration: number,\n options: LeaseOperationOptions = {}\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\"\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-acquireLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerAcquireLeaseHeaders, ContainerAcquireLeaseHeaders>(\n await this._containerOrBlobOperation.acquireLease({\n abortSignal: options.abortSignal,\n duration,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n proposedLeaseId: this._leaseId,\n tracingOptions: updatedOptions.tracingOptions,\n })\n );\n }\n );\n }\n\n /**\n * To change the ID of the lease.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - option to configure lease management operations.\n * @returns Response data for change lease operation.\n */\n public async changeLease(\n proposedLeaseId: string,\n options: LeaseOperationOptions = {}\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\"\n );\n }\n\n return tracingClient.withSpan(\n \"BlobLeaseClient-changeLease\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<Lease, Lease>(\n await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n })\n );\n this._leaseId = proposedLeaseId;\n return response;\n }\n );\n }\n\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease against the container or the blob.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - option to configure lease management operations.\n * @returns Response data for release lease operation.\n */\n public async releaseLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\"\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-releaseLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerReleaseLeaseHeaders, ContainerReleaseLeaseHeaders>(\n await this._containerOrBlobOperation.releaseLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n })\n );\n }\n );\n }\n\n /**\n * To renew the lease.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - Optional option to configure lease management operations.\n * @returns Response data for renew lease operation.\n */\n public async renewLease(options: LeaseOperationOptions = {}): Promise<Lease> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\"\n );\n }\n return tracingClient.withSpan(\"BlobLeaseClient-renewLease\", options, async (updatedOptions) => {\n return this._containerOrBlobOperation.renewLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n });\n });\n }\n\n /**\n * To end the lease but ensure that another client cannot acquire a new lease\n * until the current lease period has expired.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param breakPeriod - Break period\n * @param options - Optional options to configure lease management operations.\n * @returns Response data for break lease operation.\n */\n public async breakLease(\n breakPeriod: number,\n options: LeaseOperationOptions = {}\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\"\n );\n }\n\n return tracingClient.withSpan(\"BlobLeaseClient-breakLease\", options, async (updatedOptions) => {\n const operationOptions: ContainerBreakLeaseOptionalParams = {\n abortSignal: options.abortSignal,\n breakPeriod,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n };\n return assertResponse<ContainerBreakLeaseHeaders, ContainerBreakLeaseHeaders>(\n await this._containerOrBlobOperation.breakLease(operationOptions)\n );\n });\n }\n}\n"]}
@@ -0,0 +1,362 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /**
4
+ * ONLY AVAILABLE IN BROWSER RUNTIME.
5
+ *
6
+ * BlobQueryResponse implements BlobDownloadResponseModel interface, and in browser runtime it will
7
+ * parse avor data returned by blob query.
8
+ */
9
+ export class BlobQueryResponse {
10
+ /**
11
+ * Indicates that the service supports
12
+ * requests for partial file content.
13
+ *
14
+ * @readonly
15
+ */
16
+ get acceptRanges() {
17
+ return this.originalResponse.acceptRanges;
18
+ }
19
+ /**
20
+ * Returns if it was previously specified
21
+ * for the file.
22
+ *
23
+ * @readonly
24
+ */
25
+ get cacheControl() {
26
+ return this.originalResponse.cacheControl;
27
+ }
28
+ /**
29
+ * Returns the value that was specified
30
+ * for the 'x-ms-content-disposition' header and specifies how to process the
31
+ * response.
32
+ *
33
+ * @readonly
34
+ */
35
+ get contentDisposition() {
36
+ return this.originalResponse.contentDisposition;
37
+ }
38
+ /**
39
+ * Returns the value that was specified
40
+ * for the Content-Encoding request header.
41
+ *
42
+ * @readonly
43
+ */
44
+ get contentEncoding() {
45
+ return this.originalResponse.contentEncoding;
46
+ }
47
+ /**
48
+ * Returns the value that was specified
49
+ * for the Content-Language request header.
50
+ *
51
+ * @readonly
52
+ */
53
+ get contentLanguage() {
54
+ return this.originalResponse.contentLanguage;
55
+ }
56
+ /**
57
+ * The current sequence number for a
58
+ * page blob. This header is not returned for block blobs or append blobs.
59
+ *
60
+ * @readonly
61
+ */
62
+ get blobSequenceNumber() {
63
+ return this.originalResponse.blobSequenceNumber;
64
+ }
65
+ /**
66
+ * The blob's type. Possible values include:
67
+ * 'BlockBlob', 'PageBlob', 'AppendBlob'.
68
+ *
69
+ * @readonly
70
+ */
71
+ get blobType() {
72
+ return this.originalResponse.blobType;
73
+ }
74
+ /**
75
+ * The number of bytes present in the
76
+ * response body.
77
+ *
78
+ * @readonly
79
+ */
80
+ get contentLength() {
81
+ return this.originalResponse.contentLength;
82
+ }
83
+ /**
84
+ * If the file has an MD5 hash and the
85
+ * request is to read the full file, this response header is returned so that
86
+ * the client can check for message content integrity. If the request is to
87
+ * read a specified range and the 'x-ms-range-get-content-md5' is set to
88
+ * true, then the request returns an MD5 hash for the range, as long as the
89
+ * range size is less than or equal to 4 MB. If neither of these sets of
90
+ * conditions is true, then no value is returned for the 'Content-MD5'
91
+ * header.
92
+ *
93
+ * @readonly
94
+ */
95
+ get contentMD5() {
96
+ return this.originalResponse.contentMD5;
97
+ }
98
+ /**
99
+ * Indicates the range of bytes returned if
100
+ * the client requested a subset of the file by setting the Range request
101
+ * header.
102
+ *
103
+ * @readonly
104
+ */
105
+ get contentRange() {
106
+ return this.originalResponse.contentRange;
107
+ }
108
+ /**
109
+ * The content type specified for the file.
110
+ * The default content type is 'application/octet-stream'
111
+ *
112
+ * @readonly
113
+ */
114
+ get contentType() {
115
+ return this.originalResponse.contentType;
116
+ }
117
+ /**
118
+ * Conclusion time of the last attempted
119
+ * Copy File operation where this file was the destination file. This value
120
+ * can specify the time of a completed, aborted, or failed copy attempt.
121
+ *
122
+ * @readonly
123
+ */
124
+ get copyCompletedOn() {
125
+ return undefined;
126
+ }
127
+ /**
128
+ * String identifier for the last attempted Copy
129
+ * File operation where this file was the destination file.
130
+ *
131
+ * @readonly
132
+ */
133
+ get copyId() {
134
+ return this.originalResponse.copyId;
135
+ }
136
+ /**
137
+ * Contains the number of bytes copied and
138
+ * the total bytes in the source in the last attempted Copy File operation
139
+ * where this file was the destination file. Can show between 0 and
140
+ * Content-Length bytes copied.
141
+ *
142
+ * @readonly
143
+ */
144
+ get copyProgress() {
145
+ return this.originalResponse.copyProgress;
146
+ }
147
+ /**
148
+ * URL up to 2KB in length that specifies the
149
+ * source file used in the last attempted Copy File operation where this file
150
+ * was the destination file.
151
+ *
152
+ * @readonly
153
+ */
154
+ get copySource() {
155
+ return this.originalResponse.copySource;
156
+ }
157
+ /**
158
+ * State of the copy operation
159
+ * identified by 'x-ms-copy-id'. Possible values include: 'pending',
160
+ * 'success', 'aborted', 'failed'
161
+ *
162
+ * @readonly
163
+ */
164
+ get copyStatus() {
165
+ return this.originalResponse.copyStatus;
166
+ }
167
+ /**
168
+ * Only appears when
169
+ * x-ms-copy-status is failed or pending. Describes cause of fatal or
170
+ * non-fatal copy operation failure.
171
+ *
172
+ * @readonly
173
+ */
174
+ get copyStatusDescription() {
175
+ return this.originalResponse.copyStatusDescription;
176
+ }
177
+ /**
178
+ * When a blob is leased,
179
+ * specifies whether the lease is of infinite or fixed duration. Possible
180
+ * values include: 'infinite', 'fixed'.
181
+ *
182
+ * @readonly
183
+ */
184
+ get leaseDuration() {
185
+ return this.originalResponse.leaseDuration;
186
+ }
187
+ /**
188
+ * Lease state of the blob. Possible
189
+ * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.
190
+ *
191
+ * @readonly
192
+ */
193
+ get leaseState() {
194
+ return this.originalResponse.leaseState;
195
+ }
196
+ /**
197
+ * The current lease status of the
198
+ * blob. Possible values include: 'locked', 'unlocked'.
199
+ *
200
+ * @readonly
201
+ */
202
+ get leaseStatus() {
203
+ return this.originalResponse.leaseStatus;
204
+ }
205
+ /**
206
+ * A UTC date/time value generated by the service that
207
+ * indicates the time at which the response was initiated.
208
+ *
209
+ * @readonly
210
+ */
211
+ get date() {
212
+ return this.originalResponse.date;
213
+ }
214
+ /**
215
+ * The number of committed blocks
216
+ * present in the blob. This header is returned only for append blobs.
217
+ *
218
+ * @readonly
219
+ */
220
+ get blobCommittedBlockCount() {
221
+ return this.originalResponse.blobCommittedBlockCount;
222
+ }
223
+ /**
224
+ * The ETag contains a value that you can use to
225
+ * perform operations conditionally, in quotes.
226
+ *
227
+ * @readonly
228
+ */
229
+ get etag() {
230
+ return this.originalResponse.etag;
231
+ }
232
+ /**
233
+ * The error code.
234
+ *
235
+ * @readonly
236
+ */
237
+ get errorCode() {
238
+ return this.originalResponse.errorCode;
239
+ }
240
+ /**
241
+ * The value of this header is set to
242
+ * true if the file data and application metadata are completely encrypted
243
+ * using the specified algorithm. Otherwise, the value is set to false (when
244
+ * the file is unencrypted, or if only parts of the file/application metadata
245
+ * are encrypted).
246
+ *
247
+ * @readonly
248
+ */
249
+ get isServerEncrypted() {
250
+ return this.originalResponse.isServerEncrypted;
251
+ }
252
+ /**
253
+ * If the blob has a MD5 hash, and if
254
+ * request contains range header (Range or x-ms-range), this response header
255
+ * is returned with the value of the whole blob's MD5 value. This value may
256
+ * or may not be equal to the value returned in Content-MD5 header, with the
257
+ * latter calculated from the requested range.
258
+ *
259
+ * @readonly
260
+ */
261
+ get blobContentMD5() {
262
+ return this.originalResponse.blobContentMD5;
263
+ }
264
+ /**
265
+ * Returns the date and time the file was last
266
+ * modified. Any operation that modifies the file or its properties updates
267
+ * the last modified time.
268
+ *
269
+ * @readonly
270
+ */
271
+ get lastModified() {
272
+ return this.originalResponse.lastModified;
273
+ }
274
+ /**
275
+ * A name-value pair
276
+ * to associate with a file storage object.
277
+ *
278
+ * @readonly
279
+ */
280
+ get metadata() {
281
+ return this.originalResponse.metadata;
282
+ }
283
+ /**
284
+ * This header uniquely identifies the request
285
+ * that was made and can be used for troubleshooting the request.
286
+ *
287
+ * @readonly
288
+ */
289
+ get requestId() {
290
+ return this.originalResponse.requestId;
291
+ }
292
+ /**
293
+ * If a client request id header is sent in the request, this header will be present in the
294
+ * response with the same value.
295
+ *
296
+ * @readonly
297
+ */
298
+ get clientRequestId() {
299
+ return this.originalResponse.clientRequestId;
300
+ }
301
+ /**
302
+ * Indicates the version of the File service used
303
+ * to execute the request.
304
+ *
305
+ * @readonly
306
+ */
307
+ get version() {
308
+ return this.originalResponse.version;
309
+ }
310
+ /**
311
+ * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned
312
+ * when the blob was encrypted with a customer-provided key.
313
+ *
314
+ * @readonly
315
+ */
316
+ get encryptionKeySha256() {
317
+ return this.originalResponse.encryptionKeySha256;
318
+ }
319
+ /**
320
+ * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to
321
+ * true, then the request returns a crc64 for the range, as long as the range size is less than
322
+ * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is
323
+ * specified in the same request, it will fail with 400(Bad Request)
324
+ */
325
+ get contentCrc64() {
326
+ return this.originalResponse.contentCrc64;
327
+ }
328
+ /**
329
+ * The response body as a browser Blob.
330
+ * Always undefined in node.js.
331
+ *
332
+ * @readonly
333
+ */
334
+ get blobBody() {
335
+ throw Error(`Quick query in browser is not supported yet.`);
336
+ }
337
+ /**
338
+ * The response body as a node.js Readable stream.
339
+ * Always undefined in the browser.
340
+ *
341
+ * @readonly
342
+ */
343
+ get readableStreamBody() {
344
+ return undefined;
345
+ }
346
+ /**
347
+ * The HTTP response.
348
+ */
349
+ get _response() {
350
+ return this.originalResponse._response;
351
+ }
352
+ /**
353
+ * Creates an instance of BlobQueryResponse.
354
+ *
355
+ * @param originalResponse -
356
+ * @param options -
357
+ */
358
+ constructor(originalResponse, _options = {}) {
359
+ this.originalResponse = originalResponse;
360
+ }
361
+ }
362
+ //# sourceMappingURL=BlobQueryResponse.browser.js.map