@azure/storage-blob 12.28.0-beta.2 → 12.28.1-alpha.20250724.2

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 (473) hide show
  1. package/dist/browser/BatchResponseParser.js +6 -1
  2. package/dist/browser/BatchResponseParser.js.map +1 -1
  3. package/dist/browser/BlobBatch.d.ts +8 -8
  4. package/dist/browser/BlobBatch.js +11 -2
  5. package/dist/browser/BlobBatch.js.map +1 -1
  6. package/dist/browser/BlobBatchClient.d.ts +10 -10
  7. package/dist/browser/BlobBatchClient.js +6 -3
  8. package/dist/browser/BlobBatchClient.js.map +1 -1
  9. package/dist/browser/BlobLeaseClient.d.ts +10 -10
  10. package/dist/browser/BlobLeaseClient.js +49 -40
  11. package/dist/browser/BlobLeaseClient.js.map +1 -1
  12. package/dist/browser/BlobQueryResponse-browser.mjs.map +1 -1
  13. package/dist/browser/BlobQueryResponse.js +1 -0
  14. package/dist/browser/BlobServiceClient.d.ts +11 -11
  15. package/dist/browser/BlobServiceClient.js +97 -92
  16. package/dist/browser/BlobServiceClient.js.map +1 -1
  17. package/dist/browser/Clients.d.ts +36 -36
  18. package/dist/browser/Clients.js +374 -219
  19. package/dist/browser/Clients.js.map +1 -1
  20. package/dist/browser/ContainerClient.d.ts +16 -16
  21. package/dist/browser/ContainerClient.js +197 -150
  22. package/dist/browser/ContainerClient.js.map +1 -1
  23. package/dist/browser/PageBlobRangeResponse.js +10 -3
  24. package/dist/browser/PageBlobRangeResponse.js.map +1 -1
  25. package/dist/browser/Pipeline.js +27 -10
  26. package/dist/browser/Pipeline.js.map +1 -1
  27. package/dist/browser/Range.d.ts +1 -1
  28. package/dist/browser/Range.js.map +1 -1
  29. package/dist/browser/StorageClient.js +23 -0
  30. package/dist/browser/StorageClient.js.map +1 -1
  31. package/dist/browser/StorageContextClient.js +1 -1
  32. package/dist/browser/StorageContextClient.js.map +1 -1
  33. package/dist/browser/StorageRetryPolicyFactory.d.ts +2 -2
  34. package/dist/browser/StorageRetryPolicyFactory.js +1 -0
  35. package/dist/browser/StorageRetryPolicyFactory.js.map +1 -1
  36. package/dist/browser/generated/src/operations/appendBlob.js +1 -0
  37. package/dist/browser/generated/src/operations/appendBlob.js.map +1 -1
  38. package/dist/browser/generated/src/operations/blob.js +1 -0
  39. package/dist/browser/generated/src/operations/blob.js.map +1 -1
  40. package/dist/browser/generated/src/operations/blockBlob.js +1 -0
  41. package/dist/browser/generated/src/operations/blockBlob.js.map +1 -1
  42. package/dist/browser/generated/src/operations/container.js +1 -0
  43. package/dist/browser/generated/src/operations/container.js.map +1 -1
  44. package/dist/browser/generated/src/operations/pageBlob.js +1 -0
  45. package/dist/browser/generated/src/operations/pageBlob.js.map +1 -1
  46. package/dist/browser/generated/src/operations/service.js +1 -0
  47. package/dist/browser/generated/src/operations/service.js.map +1 -1
  48. package/dist/browser/generated/src/storageClient.js +16 -4
  49. package/dist/browser/generated/src/storageClient.js.map +1 -1
  50. package/dist/browser/index-browser.d.mts.map +1 -1
  51. package/dist/browser/index-browser.mjs.map +1 -1
  52. package/dist/browser/index.d.ts +0 -8
  53. package/dist/browser/index.js +0 -8
  54. package/dist/browser/internal-avro/AvroParser.js +7 -1
  55. package/dist/browser/internal-avro/AvroParser.js.map +1 -1
  56. package/dist/browser/internal-avro/AvroReadableFromBlob.js +2 -0
  57. package/dist/browser/internal-avro/AvroReadableFromBlob.js.map +1 -1
  58. package/dist/browser/internal-avro/AvroReadableFromStream.js +3 -2
  59. package/dist/browser/internal-avro/AvroReadableFromStream.js.map +1 -1
  60. package/dist/browser/internal-avro/AvroReader.js +44 -34
  61. package/dist/browser/internal-avro/AvroReader.js.map +1 -1
  62. package/dist/browser/policies/RequestPolicy.js +2 -0
  63. package/dist/browser/policies/RequestPolicy.js.map +1 -1
  64. package/dist/browser/policies/StorageRetryPolicy.js +5 -1
  65. package/dist/browser/policies/StorageRetryPolicy.js.map +1 -1
  66. package/dist/browser/policies/StorageRetryPolicyV2.js +10 -12
  67. package/dist/browser/policies/StorageRetryPolicyV2.js.map +1 -1
  68. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
  69. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js +6 -2
  70. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  71. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  72. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  73. package/dist/browser/sas/AccountSASPermissions.d.ts +1 -1
  74. package/dist/browser/sas/AccountSASPermissions.js +54 -56
  75. package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
  76. package/dist/browser/sas/AccountSASResourceTypes.d.ts +1 -1
  77. package/dist/browser/sas/AccountSASResourceTypes.js +13 -15
  78. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
  79. package/dist/browser/sas/AccountSASServices.js +16 -18
  80. package/dist/browser/sas/AccountSASServices.js.map +1 -1
  81. package/dist/browser/sas/AccountSASSignatureValues.d.ts +3 -3
  82. package/dist/browser/sas/AccountSASSignatureValues.js +1 -1
  83. package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -1
  84. package/dist/browser/sas/BlobSASPermissions.js +44 -46
  85. package/dist/browser/sas/BlobSASPermissions.js.map +1 -1
  86. package/dist/browser/sas/BlobSASSignatureValues.d.ts +1 -1
  87. package/dist/browser/sas/BlobSASSignatureValues.js +1 -1
  88. package/dist/browser/sas/BlobSASSignatureValues.js.map +1 -1
  89. package/dist/browser/sas/ContainerSASPermissions.d.ts +1 -1
  90. package/dist/browser/sas/ContainerSASPermissions.js +53 -55
  91. package/dist/browser/sas/ContainerSASPermissions.js.map +1 -1
  92. package/dist/browser/sas/SASQueryParameters.d.ts +2 -2
  93. package/dist/browser/sas/SASQueryParameters.js +117 -0
  94. package/dist/browser/sas/SASQueryParameters.js.map +1 -1
  95. package/dist/browser/utils/Batch.js +29 -21
  96. package/dist/browser/utils/Batch.js.map +1 -1
  97. package/dist/browser/utils/BlobQuickQueryStream.js +6 -1
  98. package/dist/browser/utils/BlobQuickQueryStream.js.map +1 -1
  99. package/dist/browser/utils/Mutex.js +2 -2
  100. package/dist/browser/utils/Mutex.js.map +1 -1
  101. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  102. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  103. package/dist/browser/utils/constants.d.ts.map +1 -1
  104. package/dist/browser/utils/constants.js +1 -1
  105. package/dist/browser/utils/constants.js.map +1 -1
  106. package/dist/browser/utils/utils.common.d.ts +2 -2
  107. package/dist/browser/utils/utils.common.js +27 -14
  108. package/dist/browser/utils/utils.common.js.map +1 -1
  109. package/dist/commonjs/BatchResponseParser.js +6 -1
  110. package/dist/commonjs/BatchResponseParser.js.map +1 -1
  111. package/dist/commonjs/BlobBatch.d.ts +8 -8
  112. package/dist/commonjs/BlobBatch.js +11 -2
  113. package/dist/commonjs/BlobBatch.js.map +1 -1
  114. package/dist/commonjs/BlobBatchClient.d.ts +10 -10
  115. package/dist/commonjs/BlobBatchClient.js +6 -3
  116. package/dist/commonjs/BlobBatchClient.js.map +1 -1
  117. package/dist/commonjs/BlobDownloadResponse.js +2 -0
  118. package/dist/commonjs/BlobDownloadResponse.js.map +1 -1
  119. package/dist/commonjs/BlobLeaseClient.d.ts +10 -10
  120. package/dist/commonjs/BlobLeaseClient.js +49 -40
  121. package/dist/commonjs/BlobLeaseClient.js.map +1 -1
  122. package/dist/commonjs/BlobQueryResponse.js +2 -0
  123. package/dist/commonjs/BlobQueryResponse.js.map +1 -1
  124. package/dist/commonjs/BlobServiceClient.d.ts +11 -11
  125. package/dist/commonjs/BlobServiceClient.js +97 -92
  126. package/dist/commonjs/BlobServiceClient.js.map +1 -1
  127. package/dist/commonjs/Clients.d.ts +36 -36
  128. package/dist/commonjs/Clients.js +374 -219
  129. package/dist/commonjs/Clients.js.map +1 -1
  130. package/dist/commonjs/ContainerClient.d.ts +16 -16
  131. package/dist/commonjs/ContainerClient.js +197 -150
  132. package/dist/commonjs/ContainerClient.js.map +1 -1
  133. package/dist/commonjs/PageBlobRangeResponse.js +10 -3
  134. package/dist/commonjs/PageBlobRangeResponse.js.map +1 -1
  135. package/dist/commonjs/Pipeline.js +27 -10
  136. package/dist/commonjs/Pipeline.js.map +1 -1
  137. package/dist/commonjs/Range.d.ts +1 -1
  138. package/dist/commonjs/Range.js.map +1 -1
  139. package/dist/commonjs/StorageClient.js +23 -0
  140. package/dist/commonjs/StorageClient.js.map +1 -1
  141. package/dist/commonjs/StorageContextClient.js +1 -1
  142. package/dist/commonjs/StorageContextClient.js.map +1 -1
  143. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +2 -2
  144. package/dist/commonjs/StorageRetryPolicyFactory.js +1 -0
  145. package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -1
  146. package/dist/commonjs/credentials/StorageSharedKeyCredential.js +8 -0
  147. package/dist/commonjs/credentials/StorageSharedKeyCredential.js.map +1 -1
  148. package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +1 -1
  149. package/dist/commonjs/credentials/UserDelegationKeyCredential.js +13 -1
  150. package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
  151. package/dist/commonjs/generated/src/operations/appendBlob.js +1 -0
  152. package/dist/commonjs/generated/src/operations/appendBlob.js.map +1 -1
  153. package/dist/commonjs/generated/src/operations/blob.js +1 -0
  154. package/dist/commonjs/generated/src/operations/blob.js.map +1 -1
  155. package/dist/commonjs/generated/src/operations/blockBlob.js +1 -0
  156. package/dist/commonjs/generated/src/operations/blockBlob.js.map +1 -1
  157. package/dist/commonjs/generated/src/operations/container.js +1 -0
  158. package/dist/commonjs/generated/src/operations/container.js.map +1 -1
  159. package/dist/commonjs/generated/src/operations/pageBlob.js +1 -0
  160. package/dist/commonjs/generated/src/operations/pageBlob.js.map +1 -1
  161. package/dist/commonjs/generated/src/operations/service.js +1 -0
  162. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  163. package/dist/commonjs/generated/src/storageClient.js +16 -4
  164. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  165. package/dist/commonjs/index.d.ts +1 -8
  166. package/dist/commonjs/index.d.ts.map +1 -1
  167. package/dist/commonjs/index.js +1 -8
  168. package/dist/commonjs/index.js.map +1 -1
  169. package/dist/commonjs/internal-avro/AvroParser.js +7 -1
  170. package/dist/commonjs/internal-avro/AvroParser.js.map +1 -1
  171. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js +2 -0
  172. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js.map +1 -1
  173. package/dist/commonjs/internal-avro/AvroReadableFromStream.js +3 -2
  174. package/dist/commonjs/internal-avro/AvroReadableFromStream.js.map +1 -1
  175. package/dist/commonjs/internal-avro/AvroReader.js +44 -34
  176. package/dist/commonjs/internal-avro/AvroReader.js.map +1 -1
  177. package/dist/commonjs/policies/RequestPolicy.js +2 -0
  178. package/dist/commonjs/policies/RequestPolicy.js.map +1 -1
  179. package/dist/commonjs/policies/StorageRetryPolicy.js +5 -1
  180. package/dist/commonjs/policies/StorageRetryPolicy.js.map +1 -1
  181. package/dist/commonjs/policies/StorageRetryPolicyV2.js +10 -12
  182. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +1 -1
  183. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
  184. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +6 -2
  185. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  186. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
  187. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  188. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  189. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  190. package/dist/commonjs/sas/AccountSASPermissions.d.ts +1 -1
  191. package/dist/commonjs/sas/AccountSASPermissions.js +54 -56
  192. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
  193. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +1 -1
  194. package/dist/commonjs/sas/AccountSASResourceTypes.js +13 -15
  195. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
  196. package/dist/commonjs/sas/AccountSASServices.js +16 -18
  197. package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
  198. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +3 -3
  199. package/dist/commonjs/sas/AccountSASSignatureValues.js +1 -1
  200. package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -1
  201. package/dist/commonjs/sas/BlobSASPermissions.js +44 -46
  202. package/dist/commonjs/sas/BlobSASPermissions.js.map +1 -1
  203. package/dist/commonjs/sas/BlobSASSignatureValues.d.ts +1 -1
  204. package/dist/commonjs/sas/BlobSASSignatureValues.js +1 -1
  205. package/dist/commonjs/sas/BlobSASSignatureValues.js.map +1 -1
  206. package/dist/commonjs/sas/ContainerSASPermissions.d.ts +1 -1
  207. package/dist/commonjs/sas/ContainerSASPermissions.js +53 -55
  208. package/dist/commonjs/sas/ContainerSASPermissions.js.map +1 -1
  209. package/dist/commonjs/sas/SASQueryParameters.d.ts +2 -2
  210. package/dist/commonjs/sas/SASQueryParameters.js +117 -0
  211. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
  212. package/dist/commonjs/tsdoc-metadata.json +11 -11
  213. package/dist/commonjs/utils/Batch.js +29 -21
  214. package/dist/commonjs/utils/Batch.js.map +1 -1
  215. package/dist/commonjs/utils/BlobQuickQueryStream.js +6 -1
  216. package/dist/commonjs/utils/BlobQuickQueryStream.js.map +1 -1
  217. package/dist/commonjs/utils/Mutex.js +2 -2
  218. package/dist/commonjs/utils/Mutex.js.map +1 -1
  219. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  220. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  221. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  222. package/dist/commonjs/utils/constants.js +1 -1
  223. package/dist/commonjs/utils/constants.js.map +1 -1
  224. package/dist/commonjs/utils/utils.common.d.ts +2 -2
  225. package/dist/commonjs/utils/utils.common.js +27 -14
  226. package/dist/commonjs/utils/utils.common.js.map +1 -1
  227. package/dist/commonjs/utils/utils.d.ts +1 -1
  228. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  229. package/dist/commonjs/utils/utils.js +5 -5
  230. package/dist/commonjs/utils/utils.js.map +1 -1
  231. package/dist/esm/BatchResponseParser.js +6 -1
  232. package/dist/esm/BatchResponseParser.js.map +1 -1
  233. package/dist/esm/BlobBatch.d.ts +8 -8
  234. package/dist/esm/BlobBatch.js +11 -2
  235. package/dist/esm/BlobBatch.js.map +1 -1
  236. package/dist/esm/BlobBatchClient.d.ts +10 -10
  237. package/dist/esm/BlobBatchClient.js +6 -3
  238. package/dist/esm/BlobBatchClient.js.map +1 -1
  239. package/dist/esm/BlobDownloadResponse.js +2 -0
  240. package/dist/esm/BlobDownloadResponse.js.map +1 -1
  241. package/dist/esm/BlobLeaseClient.d.ts +10 -10
  242. package/dist/esm/BlobLeaseClient.js +49 -40
  243. package/dist/esm/BlobLeaseClient.js.map +1 -1
  244. package/dist/esm/BlobQueryResponse.js +2 -0
  245. package/dist/esm/BlobQueryResponse.js.map +1 -1
  246. package/dist/esm/BlobServiceClient.d.ts +11 -11
  247. package/dist/esm/BlobServiceClient.js +97 -92
  248. package/dist/esm/BlobServiceClient.js.map +1 -1
  249. package/dist/esm/Clients.d.ts +36 -36
  250. package/dist/esm/Clients.js +374 -219
  251. package/dist/esm/Clients.js.map +1 -1
  252. package/dist/esm/ContainerClient.d.ts +16 -16
  253. package/dist/esm/ContainerClient.js +197 -150
  254. package/dist/esm/ContainerClient.js.map +1 -1
  255. package/dist/esm/PageBlobRangeResponse.js +10 -3
  256. package/dist/esm/PageBlobRangeResponse.js.map +1 -1
  257. package/dist/esm/Pipeline.js +27 -10
  258. package/dist/esm/Pipeline.js.map +1 -1
  259. package/dist/esm/Range.d.ts +1 -1
  260. package/dist/esm/Range.js.map +1 -1
  261. package/dist/esm/StorageClient.js +23 -0
  262. package/dist/esm/StorageClient.js.map +1 -1
  263. package/dist/esm/StorageContextClient.js +1 -1
  264. package/dist/esm/StorageContextClient.js.map +1 -1
  265. package/dist/esm/StorageRetryPolicyFactory.d.ts +2 -2
  266. package/dist/esm/StorageRetryPolicyFactory.js +1 -0
  267. package/dist/esm/StorageRetryPolicyFactory.js.map +1 -1
  268. package/dist/esm/credentials/StorageSharedKeyCredential.js +8 -0
  269. package/dist/esm/credentials/StorageSharedKeyCredential.js.map +1 -1
  270. package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +1 -1
  271. package/dist/esm/credentials/UserDelegationKeyCredential.js +13 -1
  272. package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
  273. package/dist/esm/generated/src/operations/appendBlob.js +1 -0
  274. package/dist/esm/generated/src/operations/appendBlob.js.map +1 -1
  275. package/dist/esm/generated/src/operations/blob.js +1 -0
  276. package/dist/esm/generated/src/operations/blob.js.map +1 -1
  277. package/dist/esm/generated/src/operations/blockBlob.js +1 -0
  278. package/dist/esm/generated/src/operations/blockBlob.js.map +1 -1
  279. package/dist/esm/generated/src/operations/container.js +1 -0
  280. package/dist/esm/generated/src/operations/container.js.map +1 -1
  281. package/dist/esm/generated/src/operations/pageBlob.js +1 -0
  282. package/dist/esm/generated/src/operations/pageBlob.js.map +1 -1
  283. package/dist/esm/generated/src/operations/service.js +1 -0
  284. package/dist/esm/generated/src/operations/service.js.map +1 -1
  285. package/dist/esm/generated/src/storageClient.js +16 -4
  286. package/dist/esm/generated/src/storageClient.js.map +1 -1
  287. package/dist/esm/index.d.ts +1 -8
  288. package/dist/esm/index.d.ts.map +1 -1
  289. package/dist/esm/index.js +1 -8
  290. package/dist/esm/index.js.map +1 -1
  291. package/dist/esm/internal-avro/AvroParser.js +7 -1
  292. package/dist/esm/internal-avro/AvroParser.js.map +1 -1
  293. package/dist/esm/internal-avro/AvroReadableFromBlob.js +2 -0
  294. package/dist/esm/internal-avro/AvroReadableFromBlob.js.map +1 -1
  295. package/dist/esm/internal-avro/AvroReadableFromStream.js +3 -2
  296. package/dist/esm/internal-avro/AvroReadableFromStream.js.map +1 -1
  297. package/dist/esm/internal-avro/AvroReader.js +44 -34
  298. package/dist/esm/internal-avro/AvroReader.js.map +1 -1
  299. package/dist/esm/policies/RequestPolicy.js +2 -0
  300. package/dist/esm/policies/RequestPolicy.js.map +1 -1
  301. package/dist/esm/policies/StorageRetryPolicy.js +5 -1
  302. package/dist/esm/policies/StorageRetryPolicy.js.map +1 -1
  303. package/dist/esm/policies/StorageRetryPolicyV2.js +10 -12
  304. package/dist/esm/policies/StorageRetryPolicyV2.js.map +1 -1
  305. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
  306. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js +6 -2
  307. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  308. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
  309. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  310. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  311. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  312. package/dist/esm/sas/AccountSASPermissions.d.ts +1 -1
  313. package/dist/esm/sas/AccountSASPermissions.js +54 -56
  314. package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
  315. package/dist/esm/sas/AccountSASResourceTypes.d.ts +1 -1
  316. package/dist/esm/sas/AccountSASResourceTypes.js +13 -15
  317. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
  318. package/dist/esm/sas/AccountSASServices.js +16 -18
  319. package/dist/esm/sas/AccountSASServices.js.map +1 -1
  320. package/dist/esm/sas/AccountSASSignatureValues.d.ts +3 -3
  321. package/dist/esm/sas/AccountSASSignatureValues.js +1 -1
  322. package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -1
  323. package/dist/esm/sas/BlobSASPermissions.js +44 -46
  324. package/dist/esm/sas/BlobSASPermissions.js.map +1 -1
  325. package/dist/esm/sas/BlobSASSignatureValues.d.ts +1 -1
  326. package/dist/esm/sas/BlobSASSignatureValues.js +1 -1
  327. package/dist/esm/sas/BlobSASSignatureValues.js.map +1 -1
  328. package/dist/esm/sas/ContainerSASPermissions.d.ts +1 -1
  329. package/dist/esm/sas/ContainerSASPermissions.js +53 -55
  330. package/dist/esm/sas/ContainerSASPermissions.js.map +1 -1
  331. package/dist/esm/sas/SASQueryParameters.d.ts +2 -2
  332. package/dist/esm/sas/SASQueryParameters.js +117 -0
  333. package/dist/esm/sas/SASQueryParameters.js.map +1 -1
  334. package/dist/esm/utils/Batch.js +29 -21
  335. package/dist/esm/utils/Batch.js.map +1 -1
  336. package/dist/esm/utils/BlobQuickQueryStream.js +6 -1
  337. package/dist/esm/utils/BlobQuickQueryStream.js.map +1 -1
  338. package/dist/esm/utils/Mutex.js +2 -2
  339. package/dist/esm/utils/Mutex.js.map +1 -1
  340. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  341. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  342. package/dist/esm/utils/constants.d.ts.map +1 -1
  343. package/dist/esm/utils/constants.js +1 -1
  344. package/dist/esm/utils/constants.js.map +1 -1
  345. package/dist/esm/utils/utils.common.d.ts +2 -2
  346. package/dist/esm/utils/utils.common.js +27 -14
  347. package/dist/esm/utils/utils.common.js.map +1 -1
  348. package/dist/esm/utils/utils.d.ts +1 -1
  349. package/dist/esm/utils/utils.d.ts.map +1 -1
  350. package/dist/esm/utils/utils.js +2 -2
  351. package/dist/esm/utils/utils.js.map +1 -1
  352. package/dist/react-native/BatchResponseParser.js +6 -1
  353. package/dist/react-native/BatchResponseParser.js.map +1 -1
  354. package/dist/react-native/BlobBatch.d.ts +8 -8
  355. package/dist/react-native/BlobBatch.js +11 -2
  356. package/dist/react-native/BlobBatch.js.map +1 -1
  357. package/dist/react-native/BlobBatchClient.d.ts +10 -10
  358. package/dist/react-native/BlobBatchClient.js +6 -3
  359. package/dist/react-native/BlobBatchClient.js.map +1 -1
  360. package/dist/react-native/BlobDownloadResponse.js +2 -0
  361. package/dist/react-native/BlobDownloadResponse.js.map +1 -1
  362. package/dist/react-native/BlobLeaseClient.d.ts +10 -10
  363. package/dist/react-native/BlobLeaseClient.js +49 -40
  364. package/dist/react-native/BlobLeaseClient.js.map +1 -1
  365. package/dist/react-native/BlobQueryResponse.js +2 -0
  366. package/dist/react-native/BlobQueryResponse.js.map +1 -1
  367. package/dist/react-native/BlobServiceClient.d.ts +11 -11
  368. package/dist/react-native/BlobServiceClient.js +97 -92
  369. package/dist/react-native/BlobServiceClient.js.map +1 -1
  370. package/dist/react-native/Clients.d.ts +36 -36
  371. package/dist/react-native/Clients.js +374 -219
  372. package/dist/react-native/Clients.js.map +1 -1
  373. package/dist/react-native/ContainerClient.d.ts +16 -16
  374. package/dist/react-native/ContainerClient.js +197 -150
  375. package/dist/react-native/ContainerClient.js.map +1 -1
  376. package/dist/react-native/PageBlobRangeResponse.js +10 -3
  377. package/dist/react-native/PageBlobRangeResponse.js.map +1 -1
  378. package/dist/react-native/Pipeline.js +27 -10
  379. package/dist/react-native/Pipeline.js.map +1 -1
  380. package/dist/react-native/Range.d.ts +1 -1
  381. package/dist/react-native/Range.js.map +1 -1
  382. package/dist/react-native/StorageClient.js +23 -0
  383. package/dist/react-native/StorageClient.js.map +1 -1
  384. package/dist/react-native/StorageContextClient.js +1 -1
  385. package/dist/react-native/StorageContextClient.js.map +1 -1
  386. package/dist/react-native/StorageRetryPolicyFactory.d.ts +2 -2
  387. package/dist/react-native/StorageRetryPolicyFactory.js +1 -0
  388. package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -1
  389. package/dist/react-native/credentials/StorageSharedKeyCredential.js +8 -0
  390. package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +1 -1
  391. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -1
  392. package/dist/react-native/credentials/UserDelegationKeyCredential.js +13 -1
  393. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
  394. package/dist/react-native/generated/src/operations/appendBlob.js +1 -0
  395. package/dist/react-native/generated/src/operations/appendBlob.js.map +1 -1
  396. package/dist/react-native/generated/src/operations/blob.js +1 -0
  397. package/dist/react-native/generated/src/operations/blob.js.map +1 -1
  398. package/dist/react-native/generated/src/operations/blockBlob.js +1 -0
  399. package/dist/react-native/generated/src/operations/blockBlob.js.map +1 -1
  400. package/dist/react-native/generated/src/operations/container.js +1 -0
  401. package/dist/react-native/generated/src/operations/container.js.map +1 -1
  402. package/dist/react-native/generated/src/operations/pageBlob.js +1 -0
  403. package/dist/react-native/generated/src/operations/pageBlob.js.map +1 -1
  404. package/dist/react-native/generated/src/operations/service.js +1 -0
  405. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  406. package/dist/react-native/generated/src/storageClient.js +16 -4
  407. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  408. package/dist/react-native/index.d.ts +1 -8
  409. package/dist/react-native/index.d.ts.map +1 -1
  410. package/dist/react-native/index.js +1 -8
  411. package/dist/react-native/index.js.map +1 -1
  412. package/dist/react-native/internal-avro/AvroParser.js +7 -1
  413. package/dist/react-native/internal-avro/AvroParser.js.map +1 -1
  414. package/dist/react-native/internal-avro/AvroReadableFromBlob.js +2 -0
  415. package/dist/react-native/internal-avro/AvroReadableFromBlob.js.map +1 -1
  416. package/dist/react-native/internal-avro/AvroReadableFromStream.js +3 -2
  417. package/dist/react-native/internal-avro/AvroReadableFromStream.js.map +1 -1
  418. package/dist/react-native/internal-avro/AvroReader.js +44 -34
  419. package/dist/react-native/internal-avro/AvroReader.js.map +1 -1
  420. package/dist/react-native/policies/RequestPolicy.js +2 -0
  421. package/dist/react-native/policies/RequestPolicy.js.map +1 -1
  422. package/dist/react-native/policies/StorageRetryPolicy.js +5 -1
  423. package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -1
  424. package/dist/react-native/policies/StorageRetryPolicyV2.js +10 -12
  425. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +1 -1
  426. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
  427. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js +6 -2
  428. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  429. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
  430. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  431. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  432. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  433. package/dist/react-native/sas/AccountSASPermissions.d.ts +1 -1
  434. package/dist/react-native/sas/AccountSASPermissions.js +54 -56
  435. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
  436. package/dist/react-native/sas/AccountSASResourceTypes.d.ts +1 -1
  437. package/dist/react-native/sas/AccountSASResourceTypes.js +13 -15
  438. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
  439. package/dist/react-native/sas/AccountSASServices.js +16 -18
  440. package/dist/react-native/sas/AccountSASServices.js.map +1 -1
  441. package/dist/react-native/sas/AccountSASSignatureValues.d.ts +3 -3
  442. package/dist/react-native/sas/AccountSASSignatureValues.js +1 -1
  443. package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -1
  444. package/dist/react-native/sas/BlobSASPermissions.js +44 -46
  445. package/dist/react-native/sas/BlobSASPermissions.js.map +1 -1
  446. package/dist/react-native/sas/BlobSASSignatureValues.d.ts +1 -1
  447. package/dist/react-native/sas/BlobSASSignatureValues.js +1 -1
  448. package/dist/react-native/sas/BlobSASSignatureValues.js.map +1 -1
  449. package/dist/react-native/sas/ContainerSASPermissions.d.ts +1 -1
  450. package/dist/react-native/sas/ContainerSASPermissions.js +53 -55
  451. package/dist/react-native/sas/ContainerSASPermissions.js.map +1 -1
  452. package/dist/react-native/sas/SASQueryParameters.d.ts +2 -2
  453. package/dist/react-native/sas/SASQueryParameters.js +117 -0
  454. package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
  455. package/dist/react-native/utils/Batch.js +29 -21
  456. package/dist/react-native/utils/Batch.js.map +1 -1
  457. package/dist/react-native/utils/BlobQuickQueryStream.js +6 -1
  458. package/dist/react-native/utils/BlobQuickQueryStream.js.map +1 -1
  459. package/dist/react-native/utils/Mutex.js +2 -2
  460. package/dist/react-native/utils/Mutex.js.map +1 -1
  461. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  462. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  463. package/dist/react-native/utils/constants.d.ts.map +1 -1
  464. package/dist/react-native/utils/constants.js +1 -1
  465. package/dist/react-native/utils/constants.js.map +1 -1
  466. package/dist/react-native/utils/utils.common.d.ts +2 -2
  467. package/dist/react-native/utils/utils.common.js +27 -14
  468. package/dist/react-native/utils/utils.common.js.map +1 -1
  469. package/dist/react-native/utils/utils.d.ts +1 -1
  470. package/dist/react-native/utils/utils.d.ts.map +1 -1
  471. package/dist/react-native/utils/utils.js +2 -2
  472. package/dist/react-native/utils/utils.js.map +1 -1
  473. package/package.json +10 -10
@@ -27,7 +27,7 @@ export declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchRe
27
27
  /**
28
28
  * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.
29
29
  *
30
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch
30
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
31
31
  */
32
32
  export declare class BlobBatchClient {
33
33
  private serviceOrContainerContext;
@@ -59,9 +59,9 @@ export declare class BlobBatchClient {
59
59
  /**
60
60
  * Create multiple delete operations to mark the specified blobs or snapshots for deletion.
61
61
  * Note that in order to delete a blob, you must delete all of its snapshots.
62
- * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).
62
+ * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).
63
63
  * The operations will be authenticated and authorized with specified credential.
64
- * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).
64
+ * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
65
65
  *
66
66
  * @param urls - The urls of the blob resources to delete.
67
67
  * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
@@ -71,9 +71,9 @@ export declare class BlobBatchClient {
71
71
  /**
72
72
  * Create multiple delete operations to mark the specified blobs or snapshots for deletion.
73
73
  * Note that in order to delete a blob, you must delete all of its snapshots.
74
- * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).
74
+ * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).
75
75
  * The operation(subrequest) will be authenticated and authorized with specified credential.
76
- * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).
76
+ * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
77
77
  *
78
78
  * @param blobClients - The BlobClients for the blobs to delete.
79
79
  * @param options -
@@ -86,9 +86,9 @@ export declare class BlobBatchClient {
86
86
  * storage only). A premium page blob's tier determines the allowed size, IOPS,
87
87
  * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
88
88
  * storage type. This operation does not update the blob's ETag.
89
- * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).
89
+ * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).
90
90
  * The operation(subrequest) will be authenticated and authorized
91
- * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).
91
+ * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
92
92
  *
93
93
  * @param urls - The urls of the blob resource to delete.
94
94
  * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
@@ -103,9 +103,9 @@ export declare class BlobBatchClient {
103
103
  * storage only). A premium page blob's tier determines the allowed size, IOPS,
104
104
  * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
105
105
  * storage type. This operation does not update the blob's ETag.
106
- * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).
106
+ * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).
107
107
  * The operation(subrequest) will be authenticated and authorized
108
- * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).
108
+ * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
109
109
  *
110
110
  * @param blobClients - The BlobClients for the blobs which should have a new tier set.
111
111
  * @param tier -
@@ -171,7 +171,7 @@ export declare class BlobBatchClient {
171
171
  * console.log(batchResp.subResponsesSucceededCount);
172
172
  * ```
173
173
  *
174
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch
174
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
175
175
  *
176
176
  * @param batchRequest - A set of Delete or SetTier operations.
177
177
  * @param options -
@@ -14,9 +14,10 @@ const utils_common_js_1 = require("./utils/utils.common.js");
14
14
  /**
15
15
  * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.
16
16
  *
17
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch
17
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
18
18
  */
19
19
  class BlobBatchClient {
20
+ serviceOrContainerContext;
20
21
  constructor(url, credentialOrPipeline,
21
22
  // Legacy, no fix for eslint error without breaking. Disable it for this interface.
22
23
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
@@ -138,7 +139,7 @@ class BlobBatchClient {
138
139
  * console.log(batchResp.subResponsesSucceededCount);
139
140
  * ```
140
141
  *
141
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch
142
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
142
143
  *
143
144
  * @param batchRequest - A set of Delete or SetTier operations.
144
145
  * @param options -
@@ -150,7 +151,9 @@ class BlobBatchClient {
150
151
  return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => {
151
152
  const batchRequestBody = batchRequest.getHttpRequestBody();
152
153
  // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.
153
- const rawBatchResponse = (0, utils_common_js_1.assertResponse)(await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions)));
154
+ const rawBatchResponse = (0, utils_common_js_1.assertResponse)(await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, {
155
+ ...updatedOptions,
156
+ }));
154
157
  // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).
155
158
  const batchResponseParser = new BatchResponseParser_js_1.BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests());
156
159
  const responseSummary = await batchResponseParser.parseBatchResponse();
@@ -1 +1 @@
1
- {"version":3,"file":"BlobBatchClient.js","sourceRoot":"","sources":["../../src/BlobBatchClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AASlC,qEAA+D;AAC/D,mDAAiD;AACjD,iDAA2C;AAC3C,mDAAmD;AAInD,iFAA2E;AAE3E,uEAAiE;AAEjE,+CAAkF;AAElF,6DAAqE;AAyBrE;;;;GAIG;A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3D,2FAA2F;YAC3F,MAAM,gBAAgB,GAAoC,IAAA,gCAAc,EACtE,MAAM,IAAI,CAAC,yBAAyB,CAAC,WAAW,CAC9C,IAAA,8BAAc,EAAC,gBAAgB,CAAC,EAChC,YAAY,CAAC,uBAAuB,EAAE,EACtC,gBAAgB,oBAEX,cAAc,EAEpB,CACF,CAAC;YAEF,gHAAgH;YAChH,MAAM,mBAAmB,GAAG,IAAI,4CAAmB,CACjD,gBAAgB,EAChB,YAAY,CAAC,cAAc,EAAE,CAC9B,CAAC;YACF,MAAM,eAAe,GAAG,MAAM,mBAAmB,CAAC,kBAAkB,EAAE,CAAC;YAEvE,MAAM,GAAG,GAAiC;gBACxC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,WAAW,EAAE,gBAAgB,CAAC,WAAW;gBACzC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,eAAe,EAAE,gBAAgB,CAAC,eAAe;gBACjD,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,YAAY,EAAE,eAAe,CAAC,YAAY;gBAC1C,0BAA0B,EAAE,eAAe,CAAC,0BAA0B;gBACtE,uBAAuB,EAAE,eAAe,CAAC,uBAAuB;aACjE,CAAC;YAEF,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlUD,0CAkUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AccessTier,\n ServiceSubmitBatchHeaders,\n ServiceSubmitBatchOptionalParamsModel,\n ServiceSubmitBatchResponseModel,\n} from \"./generatedModels.js\";\nimport type { ParsedBatchResponse } from \"./BatchResponse.js\";\nimport { BatchResponseParser } from \"./BatchResponseParser.js\";\nimport { utf8ByteLength } from \"./BatchUtils.js\";\nimport { BlobBatch } from \"./BlobBatch.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Service, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from \"./Clients.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike, getCoreClientOptions } from \"./Pipeline.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse, getURLPath } from \"./utils/utils.common.js\";\n\n/**\n * Options to configure the Service - Submit Batch Optional Params.\n */\nexport interface BlobBatchSubmitBatchOptionalParams extends ServiceSubmitBatchOptionalParamsModel {}\n\n/**\n * Contains response data for blob batch operations.\n */\nexport declare type BlobBatchSubmitBatchResponse = WithResponse<\n ParsedBatchResponse & ServiceSubmitBatchHeaders,\n ServiceSubmitBatchHeaders\n>;\n\n/**\n * Contains response data for the {@link deleteBlobs} operation.\n */\nexport declare type BlobBatchDeleteBlobsResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * Contains response data for the {@link setBlobsAccessTier} operation.\n */\nexport declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch\n */\nexport class BlobBatchClient {\n private serviceOrContainerContext: Service | Container;\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: PipelineLike);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | PipelineLike,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n ) {\n let pipeline: PipelineLike;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (!credentialOrPipeline) {\n // no credential provided\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n\n const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));\n\n const path = getURLPath(url);\n if (path && path !== \"/\") {\n // Container scoped.\n this.serviceOrContainerContext = storageClientContext.container;\n } else {\n this.serviceOrContainerContext = storageClientContext.service;\n }\n }\n\n /**\n * Creates a {@link BlobBatch}.\n * A BlobBatch represents an aggregated set of operations on blobs.\n */\n public createBatch(): BlobBatch {\n return new BlobBatch();\n }\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).\n * The operations will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resources to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options -\n */\n public async deleteBlobs(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).\n * The operation(subrequest) will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs to delete.\n * @param options -\n */\n public async deleteBlobs(\n blobClients: BlobClient[],\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n public async deleteBlobs(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrOptions:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | BlobDeleteOptions\n | undefined,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as TokenCredential, options);\n } else {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as BlobDeleteOptions);\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resource to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs which should have a new tier set.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n blobClients: BlobClient[],\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n public async setBlobsAccessTier(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrTier:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | AccessTier,\n tierOrOptions?: AccessTier | BlobSetTierOptions,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as TokenCredential,\n tierOrOptions as AccessTier,\n options,\n );\n } else {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as AccessTier,\n tierOrOptions as BlobSetTierOptions,\n );\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Submit batch request which consists of multiple subrequests.\n *\n * Get `blobBatchClient` and other details before running the snippets.\n * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`\n *\n * Example usage:\n *\n * ```ts snippet:BlobBatchClientSubmitBatch\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.deleteBlob(\"<blob-url-1>\", credential);\n * await batchRequest.deleteBlob(\"<blob-url-2>\", credential, {\n * deleteSnapshots: \"include\",\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * Example using a lease:\n *\n * ```ts snippet:BlobBatchClientSubmitBatchWithLease\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n * const blobClient = containerClient.getBlobClient(\"<blob name>\");\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\");\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\", {\n * conditions: { leaseId: \"<lease-id>\" },\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch\n *\n * @param batchRequest - A set of Delete or SetTier operations.\n * @param options -\n */\n public async submitBatch(\n batchRequest: BlobBatch,\n options: BlobBatchSubmitBatchOptionalParams = {},\n ): Promise<BlobBatchSubmitBatchResponse> {\n if (!batchRequest || batchRequest.getSubRequests().size === 0) {\n throw new RangeError(\"Batch request should contain one or more sub requests.\");\n }\n\n return tracingClient.withSpan(\n \"BlobBatchClient-submitBatch\",\n options,\n async (updatedOptions) => {\n const batchRequestBody = batchRequest.getHttpRequestBody();\n\n // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.\n const rawBatchResponse: ServiceSubmitBatchResponseModel = assertResponse(\n await this.serviceOrContainerContext.submitBatch(\n utf8ByteLength(batchRequestBody),\n batchRequest.getMultiPartContentType(),\n batchRequestBody,\n {\n ...updatedOptions,\n },\n ),\n );\n\n // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).\n const batchResponseParser = new BatchResponseParser(\n rawBatchResponse,\n batchRequest.getSubRequests(),\n );\n const responseSummary = await batchResponseParser.parseBatchResponse();\n\n const res: BlobBatchSubmitBatchResponse = {\n _response: rawBatchResponse._response,\n contentType: rawBatchResponse.contentType,\n errorCode: rawBatchResponse.errorCode,\n requestId: rawBatchResponse.requestId,\n clientRequestId: rawBatchResponse.clientRequestId,\n version: rawBatchResponse.version,\n subResponses: responseSummary.subResponses,\n subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,\n subResponsesFailedCount: responseSummary.subResponsesFailedCount,\n };\n\n return res;\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"BlobBatchClient.js","sourceRoot":"","sources":["../../src/BlobBatchClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AASlC,qEAA+D;AAC/D,mDAAiD;AACjD,iDAA2C;AAC3C,mDAAmD;AAInD,iFAA2E;AAE3E,uEAAiE;AAEjE,+CAAkF;AAElF,6DAAqE;AAyBrE;;;;GAIG;AACH,MAAa,eAAe;IAClB,yBAAyB,CAAsB;IA6BvD,YACE,GAAW,EACX,oBAIgB;IAChB,mFAAmF;IACnF,gEAAgE;IAChE,OAAgC;QAEhC,IAAI,QAAsB,CAAC;QAC3B,IAAI,IAAA,4BAAc,EAAC,oBAAoB,CAAC,EAAE,CAAC;YACzC,QAAQ,GAAG,oBAAoB,CAAC;QAClC,CAAC;aAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACjC,yBAAyB;YACzB,QAAQ,GAAG,IAAA,yBAAW,EAAC,IAAI,4CAAmB,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,IAAA,yBAAW,EAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAE3F,MAAM,IAAI,G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SAAS;gBACrC,eAAe,EAAE,gBAAgB,CAAC,eAAe;gBACjD,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,YAAY,EAAE,eAAe,CAAC,YAAY;gBAC1C,0BAA0B,EAAE,eAAe,CAAC,0BAA0B;gBACtE,uBAAuB,EAAE,eAAe,CAAC,uBAAuB;aACjE,CAAC;YAEF,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlUD,0CAkUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AccessTier,\n ServiceSubmitBatchHeaders,\n ServiceSubmitBatchOptionalParamsModel,\n ServiceSubmitBatchResponseModel,\n} from \"./generatedModels.js\";\nimport type { ParsedBatchResponse } from \"./BatchResponse.js\";\nimport { BatchResponseParser } from \"./BatchResponseParser.js\";\nimport { utf8ByteLength } from \"./BatchUtils.js\";\nimport { BlobBatch } from \"./BlobBatch.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Service, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from \"./Clients.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike, getCoreClientOptions } from \"./Pipeline.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse, getURLPath } from \"./utils/utils.common.js\";\n\n/**\n * Options to configure the Service - Submit Batch Optional Params.\n */\nexport interface BlobBatchSubmitBatchOptionalParams extends ServiceSubmitBatchOptionalParamsModel {}\n\n/**\n * Contains response data for blob batch operations.\n */\nexport declare type BlobBatchSubmitBatchResponse = WithResponse<\n ParsedBatchResponse & ServiceSubmitBatchHeaders,\n ServiceSubmitBatchHeaders\n>;\n\n/**\n * Contains response data for the {@link deleteBlobs} operation.\n */\nexport declare type BlobBatchDeleteBlobsResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * Contains response data for the {@link setBlobsAccessTier} operation.\n */\nexport declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch\n */\nexport class BlobBatchClient {\n private serviceOrContainerContext: Service | Container;\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: PipelineLike);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | PipelineLike,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n ) {\n let pipeline: PipelineLike;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (!credentialOrPipeline) {\n // no credential provided\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n\n const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));\n\n const path = getURLPath(url);\n if (path && path !== \"/\") {\n // Container scoped.\n this.serviceOrContainerContext = storageClientContext.container;\n } else {\n this.serviceOrContainerContext = storageClientContext.service;\n }\n }\n\n /**\n * Creates a {@link BlobBatch}.\n * A BlobBatch represents an aggregated set of operations on blobs.\n */\n public createBatch(): BlobBatch {\n return new BlobBatch();\n }\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).\n * The operations will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resources to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options -\n */\n public async deleteBlobs(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).\n * The operation(subrequest) will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs to delete.\n * @param options -\n */\n public async deleteBlobs(\n blobClients: BlobClient[],\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n public async deleteBlobs(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrOptions:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | BlobDeleteOptions\n | undefined,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as TokenCredential, options);\n } else {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as BlobDeleteOptions);\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resource to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs which should have a new tier set.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n blobClients: BlobClient[],\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n public async setBlobsAccessTier(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrTier:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | AccessTier,\n tierOrOptions?: AccessTier | BlobSetTierOptions,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as TokenCredential,\n tierOrOptions as AccessTier,\n options,\n );\n } else {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as AccessTier,\n tierOrOptions as BlobSetTierOptions,\n );\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Submit batch request which consists of multiple subrequests.\n *\n * Get `blobBatchClient` and other details before running the snippets.\n * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`\n *\n * Example usage:\n *\n * ```ts snippet:BlobBatchClientSubmitBatch\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.deleteBlob(\"<blob-url-1>\", credential);\n * await batchRequest.deleteBlob(\"<blob-url-2>\", credential, {\n * deleteSnapshots: \"include\",\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * Example using a lease:\n *\n * ```ts snippet:BlobBatchClientSubmitBatchWithLease\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n * const blobClient = containerClient.getBlobClient(\"<blob name>\");\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\");\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\", {\n * conditions: { leaseId: \"<lease-id>\" },\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch\n *\n * @param batchRequest - A set of Delete or SetTier operations.\n * @param options -\n */\n public async submitBatch(\n batchRequest: BlobBatch,\n options: BlobBatchSubmitBatchOptionalParams = {},\n ): Promise<BlobBatchSubmitBatchResponse> {\n if (!batchRequest || batchRequest.getSubRequests().size === 0) {\n throw new RangeError(\"Batch request should contain one or more sub requests.\");\n }\n\n return tracingClient.withSpan(\n \"BlobBatchClient-submitBatch\",\n options,\n async (updatedOptions) => {\n const batchRequestBody = batchRequest.getHttpRequestBody();\n\n // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.\n const rawBatchResponse: ServiceSubmitBatchResponseModel = assertResponse(\n await this.serviceOrContainerContext.submitBatch(\n utf8ByteLength(batchRequestBody),\n batchRequest.getMultiPartContentType(),\n batchRequestBody,\n {\n ...updatedOptions,\n },\n ),\n );\n\n // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).\n const batchResponseParser = new BatchResponseParser(\n rawBatchResponse,\n batchRequest.getSubRequests(),\n );\n const responseSummary = await batchResponseParser.parseBatchResponse();\n\n const res: BlobBatchSubmitBatchResponse = {\n _response: rawBatchResponse._response,\n contentType: rawBatchResponse.contentType,\n errorCode: rawBatchResponse.errorCode,\n requestId: rawBatchResponse.requestId,\n clientRequestId: rawBatchResponse.clientRequestId,\n version: rawBatchResponse.version,\n subResponses: responseSummary.subResponses,\n subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,\n subResponsesFailedCount: responseSummary.subResponsesFailedCount,\n };\n\n return res;\n },\n );\n }\n}\n"]}
@@ -449,6 +449,8 @@ class BlobDownloadResponse {
449
449
  get _response() {
450
450
  return this.originalResponse._response;
451
451
  }
452
+ originalResponse;
453
+ blobDownloadStream;
452
454
  /**
453
455
  * Creates an instance of BlobDownloadResponse.
454
456
  *
@@ -1 +1 @@
1
- {"version":3,"file":"BlobDownloadResponse.js","sourceRoot":"","sources":["../../src/BlobDownloadResponse.ts"],"names":[],"mappings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AAC,gBAAgB,CAAC,kBAAmB,EACzC,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA7fD,oDA6fC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { isNodeLike } from \"@azure/core-util\";\nimport type { BlobImmutabilityPolicyMode } from \"./generatedModels.js\";\n\nimport type {\n BlobDownloadHeaders,\n BlobType,\n CopyStatusType,\n LeaseDurationType,\n LeaseStateType,\n LeaseStatusType,\n} from \"./generatedModels.js\";\nimport type { BlobDownloadResponseParsed, Metadata, ObjectReplicationPolicy } from \"./models.js\";\nimport type {\n ReadableStreamGetter,\n RetriableReadableStreamOptions,\n} from \"./utils/RetriableReadableStream.js\";\nimport { RetriableReadableStream } from \"./utils/RetriableReadableStream.js\";\nimport type { ResponseWithHeaders } from \"./utils/utils.common.js\";\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 * Returns the date and time the blob was created.\n *\n * @readonly\n */\n public get createdOn(): Date | undefined {\n return this.originalResponse.createdOn;\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 isNodeLike ? 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"]}
1
+ {"version":3,"file":"BlobDownloadResponse.js","sourceRoot":"","sources":["../../src/BlobDownloadResponse.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,gDAA8C;AAgB9C,mFAA6E;AAG7E;;;;;;;;;GASG;AACH,MAAa,oBAAoB;IAC/B;;;;;OAKG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACH,IAAW,eAAe;QACxB,O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ACpC,OAAO,IAAI,CAAC,gBAAgB,CAAC,2BAA2B,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,IAAW,sBAAsB;QAC/B,OAAO,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IACxC,CAAC;IAED;;;;;;;OAOG;IACH,IAAW,kBAAkB;QAC3B,OAAO,sBAAU,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC;IACzC,CAAC;IAEO,gBAAgB,CAA6B;IAC7C,kBAAkB,CAA2B;IAErD;;;;;;;;OAQG;IACH,YACE,gBAA4C,EAC5C,MAA4B,EAC5B,MAAc,EACd,KAAa,EACb,UAA0C,EAAE;QAE5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,IAAI,oDAAuB,CACnD,IAAI,CAAC,gBAAgB,CAAC,kBAAmB,EACzC,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA7fD,oDA6fC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { isNodeLike } from \"@azure/core-util\";\nimport type { BlobImmutabilityPolicyMode } from \"./generatedModels.js\";\n\nimport type {\n BlobDownloadHeaders,\n BlobType,\n CopyStatusType,\n LeaseDurationType,\n LeaseStateType,\n LeaseStatusType,\n} from \"./generatedModels.js\";\nimport type { BlobDownloadResponseParsed, Metadata, ObjectReplicationPolicy } from \"./models.js\";\nimport type {\n ReadableStreamGetter,\n RetriableReadableStreamOptions,\n} from \"./utils/RetriableReadableStream.js\";\nimport { RetriableReadableStream } from \"./utils/RetriableReadableStream.js\";\nimport type { ResponseWithHeaders } from \"./utils/utils.common.js\";\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 * Returns the date and time the blob was created.\n *\n * @readonly\n */\n public get createdOn(): Date | undefined {\n return this.originalResponse.createdOn;\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 isNodeLike ? 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"]}
@@ -102,9 +102,9 @@ export declare class BlobLeaseClient {
102
102
  * Establishes and manages a lock on a container for delete operations, or on a blob
103
103
  * for write and delete operations.
104
104
  * The lock duration can be 15 to 60 seconds, or can be infinite.
105
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
105
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
106
106
  * and
107
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
107
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
108
108
  *
109
109
  * @param duration - Must be between 15 to 60 seconds, or infinite (-1)
110
110
  * @param options - option to configure lease management operations.
@@ -113,9 +113,9 @@ export declare class BlobLeaseClient {
113
113
  acquireLease(duration: number, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>;
114
114
  /**
115
115
  * To change the ID of the lease.
116
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
116
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
117
117
  * and
118
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
118
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
119
119
  *
120
120
  * @param proposedLeaseId - the proposed new lease Id.
121
121
  * @param options - option to configure lease management operations.
@@ -125,9 +125,9 @@ export declare class BlobLeaseClient {
125
125
  /**
126
126
  * To free the lease if it is no longer needed so that another client may
127
127
  * immediately acquire a lease against the container or the blob.
128
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
128
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
129
129
  * and
130
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
130
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
131
131
  *
132
132
  * @param options - option to configure lease management operations.
133
133
  * @returns Response data for release lease operation.
@@ -135,9 +135,9 @@ export declare class BlobLeaseClient {
135
135
  releaseLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>;
136
136
  /**
137
137
  * To renew the lease.
138
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
138
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
139
139
  * and
140
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
140
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
141
141
  *
142
142
  * @param options - Optional option to configure lease management operations.
143
143
  * @returns Response data for renew lease operation.
@@ -146,9 +146,9 @@ export declare class BlobLeaseClient {
146
146
  /**
147
147
  * To end the lease but ensure that another client cannot acquire a new lease
148
148
  * until the current lease period has expired.
149
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
149
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
150
150
  * and
151
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
151
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
152
152
  *
153
153
  * @param breakPeriod - Break period
154
154
  * @param options - Optional options to configure lease management operations.
@@ -11,6 +11,10 @@ const utils_common_js_1 = require("./utils/utils.common.js");
11
11
  * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.
12
12
  */
13
13
  class BlobLeaseClient {
14
+ _leaseId;
15
+ _url;
16
+ _containerOrBlobOperation;
17
+ _isContainer;
14
18
  /**
15
19
  * Gets the lease Id.
16
20
  *
@@ -52,28 +56,29 @@ class BlobLeaseClient {
52
56
  * Establishes and manages a lock on a container for delete operations, or on a blob
53
57
  * for write and delete operations.
54
58
  * The lock duration can be 15 to 60 seconds, or can be infinite.
55
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
59
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
56
60
  * and
57
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
61
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
58
62
  *
59
63
  * @param duration - Must be between 15 to 60 seconds, or infinite (-1)
60
64
  * @param options - option to configure lease management operations.
61
65
  * @returns Response data for acquire lease operation.
62
66
  */
63
67
  async acquireLease(duration, options = {}) {
64
- var _a, _b, _c, _d, _e;
65
68
  if (this._isContainer &&
66
- ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== constants_js_1.ETagNone) ||
67
- (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== constants_js_1.ETagNone) ||
68
- ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
69
+ ((options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone) ||
70
+ (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone) ||
71
+ options.conditions?.tagConditions)) {
69
72
  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.");
70
73
  }
71
74
  return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => {
72
- var _a;
73
75
  return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.acquireLease({
74
76
  abortSignal: options.abortSignal,
75
77
  duration,
76
- modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
78
+ modifiedAccessConditions: {
79
+ ...options.conditions,
80
+ ifTags: options.conditions?.tagConditions,
81
+ },
77
82
  proposedLeaseId: this._leaseId,
78
83
  tracingOptions: updatedOptions.tracingOptions,
79
84
  }));
@@ -81,27 +86,28 @@ class BlobLeaseClient {
81
86
  }
82
87
  /**
83
88
  * To change the ID of the lease.
84
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
89
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
85
90
  * and
86
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
91
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
87
92
  *
88
93
  * @param proposedLeaseId - the proposed new lease Id.
89
94
  * @param options - option to configure lease management operations.
90
95
  * @returns Response data for change lease operation.
91
96
  */
92
97
  async changeLease(proposedLeaseId, options = {}) {
93
- var _a, _b, _c, _d, _e;
94
98
  if (this._isContainer &&
95
- ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== constants_js_1.ETagNone) ||
96
- (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== constants_js_1.ETagNone) ||
97
- ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
99
+ ((options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone) ||
100
+ (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone) ||
101
+ options.conditions?.tagConditions)) {
98
102
  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.");
99
103
  }
100
104
  return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => {
101
- var _a;
102
105
  const response = (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {
103
106
  abortSignal: options.abortSignal,
104
- modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
107
+ modifiedAccessConditions: {
108
+ ...options.conditions,
109
+ ifTags: options.conditions?.tagConditions,
110
+ },
105
111
  tracingOptions: updatedOptions.tracingOptions,
106
112
  }));
107
113
  this._leaseId = proposedLeaseId;
@@ -111,52 +117,54 @@ class BlobLeaseClient {
111
117
  /**
112
118
  * To free the lease if it is no longer needed so that another client may
113
119
  * immediately acquire a lease against the container or the blob.
114
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
120
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
115
121
  * and
116
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
122
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
117
123
  *
118
124
  * @param options - option to configure lease management operations.
119
125
  * @returns Response data for release lease operation.
120
126
  */
121
127
  async releaseLease(options = {}) {
122
- var _a, _b, _c, _d, _e;
123
128
  if (this._isContainer &&
124
- ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== constants_js_1.ETagNone) ||
125
- (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== constants_js_1.ETagNone) ||
126
- ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
129
+ ((options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone) ||
130
+ (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone) ||
131
+ options.conditions?.tagConditions)) {
127
132
  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.");
128
133
  }
129
134
  return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => {
130
- var _a;
131
135
  return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.releaseLease(this._leaseId, {
132
136
  abortSignal: options.abortSignal,
133
- modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
137
+ modifiedAccessConditions: {
138
+ ...options.conditions,
139
+ ifTags: options.conditions?.tagConditions,
140
+ },
134
141
  tracingOptions: updatedOptions.tracingOptions,
135
142
  }));
136
143
  });
137
144
  }
138
145
  /**
139
146
  * To renew the lease.
140
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
147
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
141
148
  * and
142
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
149
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
143
150
  *
144
151
  * @param options - Optional option to configure lease management operations.
145
152
  * @returns Response data for renew lease operation.
146
153
  */
147
154
  async renewLease(options = {}) {
148
- var _a, _b, _c, _d, _e;
149
155
  if (this._isContainer &&
150
- ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== constants_js_1.ETagNone) ||
151
- (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== constants_js_1.ETagNone) ||
152
- ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
156
+ ((options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone) ||
157
+ (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone) ||
158
+ options.conditions?.tagConditions)) {
153
159
  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.");
154
160
  }
155
161
  return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => {
156
- var _a;
157
162
  return this._containerOrBlobOperation.renewLease(this._leaseId, {
158
163
  abortSignal: options.abortSignal,
159
- modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
164
+ modifiedAccessConditions: {
165
+ ...options.conditions,
166
+ ifTags: options.conditions?.tagConditions,
167
+ },
160
168
  tracingOptions: updatedOptions.tracingOptions,
161
169
  });
162
170
  });
@@ -164,28 +172,29 @@ class BlobLeaseClient {
164
172
  /**
165
173
  * To end the lease but ensure that another client cannot acquire a new lease
166
174
  * until the current lease period has expired.
167
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container
175
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-container
168
176
  * and
169
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob
177
+ * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
170
178
  *
171
179
  * @param breakPeriod - Break period
172
180
  * @param options - Optional options to configure lease management operations.
173
181
  * @returns Response data for break lease operation.
174
182
  */
175
183
  async breakLease(breakPeriod, options = {}) {
176
- var _a, _b, _c, _d, _e;
177
184
  if (this._isContainer &&
178
- ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== constants_js_1.ETagNone) ||
179
- (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== constants_js_1.ETagNone) ||
180
- ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {
185
+ ((options.conditions?.ifMatch && options.conditions?.ifMatch !== constants_js_1.ETagNone) ||
186
+ (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== constants_js_1.ETagNone) ||
187
+ options.conditions?.tagConditions)) {
181
188
  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.");
182
189
  }
183
190
  return tracing_js_1.tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => {
184
- var _a;
185
191
  const operationOptions = {
186
192
  abortSignal: options.abortSignal,
187
193
  breakPeriod,
188
- modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }),
194
+ modifiedAccessConditions: {
195
+ ...options.conditions,
196
+ ifTags: options.conditions?.tagConditions,
197
+ },
189
198
  tracingOptions: updatedOptions.tracingOptions,
190
199
  };
191
200
  return (0, utils_common_js_1.assertResponse)(await this._containerOrBlobOperation.breakLease(operationOptions));