@azure/storage-blob 12.31.0 → 12.32.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/dist/browser/BatchUtils.d.ts +1 -1
  2. package/dist/browser/BatchUtils.d.ts.map +1 -0
  3. package/dist/browser/BatchUtils.js +1 -1
  4. package/dist/browser/BatchUtils.js.map +1 -0
  5. package/dist/browser/BlobDownloadResponse.d.ts +5 -2
  6. package/dist/browser/BlobDownloadResponse.d.ts.map +1 -0
  7. package/dist/browser/BlobDownloadResponse.js +9 -5
  8. package/dist/browser/BlobDownloadResponse.js.map +1 -0
  9. package/dist/browser/BlobQueryResponse.d.ts +1 -1
  10. package/dist/browser/BlobQueryResponse.d.ts.map +1 -0
  11. package/dist/browser/BlobQueryResponse.js +1 -1
  12. package/dist/browser/BlobQueryResponse.js.map +1 -0
  13. package/dist/browser/BlobServiceClient.d.ts +36 -5
  14. package/dist/browser/BlobServiceClient.d.ts.map +1 -1
  15. package/dist/browser/BlobServiceClient.js +29 -17
  16. package/dist/browser/BlobServiceClient.js.map +1 -1
  17. package/dist/browser/Clients.d.ts +68 -14
  18. package/dist/browser/Clients.d.ts.map +1 -1
  19. package/dist/browser/Clients.js +97 -28
  20. package/dist/browser/Clients.js.map +1 -1
  21. package/dist/browser/ContainerClient.d.ts +6 -4
  22. package/dist/browser/ContainerClient.d.ts.map +1 -1
  23. package/dist/browser/ContainerClient.js +8 -6
  24. package/dist/browser/ContainerClient.js.map +1 -1
  25. package/dist/browser/Pipeline.d.ts +2 -3
  26. package/dist/browser/Pipeline.d.ts.map +1 -1
  27. package/dist/browser/Pipeline.js.map +1 -1
  28. package/dist/browser/generated/src/models/index.d.ts +59 -4
  29. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  30. package/dist/browser/generated/src/models/index.js +2 -2
  31. package/dist/browser/generated/src/models/index.js.map +1 -1
  32. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  33. package/dist/browser/generated/src/models/mappers.js +65 -0
  34. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  35. package/dist/browser/generated/src/models/parameters.d.ts +7 -0
  36. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  37. package/dist/browser/generated/src/models/parameters.js +71 -1
  38. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  39. package/dist/browser/generated/src/operations/appendBlob.js +5 -0
  40. package/dist/browser/generated/src/operations/appendBlob.js.map +1 -1
  41. package/dist/browser/generated/src/operations/blob.js +3 -0
  42. package/dist/browser/generated/src/operations/blob.js.map +1 -1
  43. package/dist/browser/generated/src/operations/blockBlob.js +10 -0
  44. package/dist/browser/generated/src/operations/blockBlob.js.map +1 -1
  45. package/dist/browser/generated/src/operations/pageBlob.js +5 -0
  46. package/dist/browser/generated/src/operations/pageBlob.js.map +1 -1
  47. package/dist/browser/generated/src/storageClient.js +2 -2
  48. package/dist/browser/generated/src/storageClient.js.map +1 -1
  49. package/dist/browser/generatedModels.d.ts +4 -4
  50. package/dist/browser/generatedModels.d.ts.map +1 -1
  51. package/dist/browser/generatedModels.js.map +1 -1
  52. package/dist/browser/index.d.ts +9 -9
  53. package/dist/browser/index.d.ts.map +1 -0
  54. package/dist/browser/index.js +1 -2
  55. package/dist/browser/index.js.map +1 -0
  56. package/dist/browser/internal-avro/index.d.ts +9 -2
  57. package/dist/browser/internal-avro/index.d.ts.map +1 -0
  58. package/dist/browser/internal-avro/index.js +14 -1
  59. package/dist/browser/internal-avro/index.js.map +1 -0
  60. package/dist/browser/models.d.ts +43 -0
  61. package/dist/browser/models.d.ts.map +1 -1
  62. package/dist/browser/models.js.map +1 -1
  63. package/dist/browser/sas/BlobSASSignatureValues.d.ts +11 -1
  64. package/dist/browser/sas/BlobSASSignatureValues.d.ts.map +1 -1
  65. package/dist/browser/sas/BlobSASSignatureValues.js +133 -2
  66. package/dist/browser/sas/BlobSASSignatureValues.js.map +1 -1
  67. package/dist/browser/sas/SASQueryParameters.d.ts +23 -2
  68. package/dist/browser/sas/SASQueryParameters.d.ts.map +1 -1
  69. package/dist/browser/sas/SASQueryParameters.js +34 -2
  70. package/dist/browser/sas/SASQueryParameters.js.map +1 -1
  71. package/dist/browser/utils/RetriableReadableStream.d.ts.map +1 -1
  72. package/dist/browser/utils/RetriableReadableStream.js +1 -0
  73. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  74. package/dist/browser/utils/constants.d.ts.map +1 -1
  75. package/dist/browser/utils/constants.js +2 -2
  76. package/dist/browser/utils/constants.js.map +1 -1
  77. package/dist/browser/utils/utils.common.d.ts +16 -1
  78. package/dist/browser/utils/utils.common.d.ts.map +1 -1
  79. package/dist/browser/utils/utils.common.js +26 -0
  80. package/dist/browser/utils/utils.common.js.map +1 -1
  81. package/dist/browser/utils/utils.d.ts +12 -6
  82. package/dist/browser/utils/utils.d.ts.map +1 -0
  83. package/dist/browser/utils/utils.js +11 -11
  84. package/dist/browser/utils/utils.js.map +1 -0
  85. package/dist/commonjs/BatchResponse.js +15 -5
  86. package/dist/commonjs/BatchResponse.js.map +7 -1
  87. package/dist/commonjs/BatchResponseParser.js +127 -136
  88. package/dist/commonjs/BatchResponseParser.js.map +7 -1
  89. package/dist/commonjs/BatchUtils.js +38 -15
  90. package/dist/commonjs/BatchUtils.js.map +7 -1
  91. package/dist/commonjs/BlobBatch.js +280 -258
  92. package/dist/commonjs/BlobBatch.js.map +7 -1
  93. package/dist/commonjs/BlobBatchClient.js +188 -169
  94. package/dist/commonjs/BlobBatchClient.js.map +7 -1
  95. package/dist/commonjs/BlobDownloadResponse.d.ts +2 -1
  96. package/dist/commonjs/BlobDownloadResponse.d.ts.map +1 -1
  97. package/dist/commonjs/BlobDownloadResponse.js +487 -467
  98. package/dist/commonjs/BlobDownloadResponse.js.map +7 -1
  99. package/dist/commonjs/BlobLeaseClient.js +226 -196
  100. package/dist/commonjs/BlobLeaseClient.js.map +7 -1
  101. package/dist/commonjs/BlobQueryResponse.common.js +378 -365
  102. package/dist/commonjs/BlobQueryResponse.common.js.map +7 -1
  103. package/dist/commonjs/BlobQueryResponse.js +387 -371
  104. package/dist/commonjs/BlobQueryResponse.js.map +7 -1
  105. package/dist/commonjs/BlobServiceClient.d.ts +36 -5
  106. package/dist/commonjs/BlobServiceClient.d.ts.map +1 -1
  107. package/dist/commonjs/BlobServiceClient.js +784 -684
  108. package/dist/commonjs/BlobServiceClient.js.map +7 -1
  109. package/dist/commonjs/Clients.d.ts +68 -14
  110. package/dist/commonjs/Clients.d.ts.map +1 -1
  111. package/dist/commonjs/Clients.js +3120 -2804
  112. package/dist/commonjs/Clients.js.map +7 -1
  113. package/dist/commonjs/ContainerClient.d.ts +6 -4
  114. package/dist/commonjs/ContainerClient.d.ts.map +1 -1
  115. package/dist/commonjs/ContainerClient.js +1348 -1253
  116. package/dist/commonjs/ContainerClient.js.map +7 -1
  117. package/dist/commonjs/PageBlobRangeResponse.js +45 -31
  118. package/dist/commonjs/PageBlobRangeResponse.js.map +7 -1
  119. package/dist/commonjs/Pipeline.d.ts +2 -3
  120. package/dist/commonjs/Pipeline.d.ts.map +1 -1
  121. package/dist/commonjs/Pipeline.js +244 -244
  122. package/dist/commonjs/Pipeline.js.map +7 -1
  123. package/dist/commonjs/Range.js +35 -22
  124. package/dist/commonjs/Range.js.map +7 -1
  125. package/dist/commonjs/StorageClient.js +67 -54
  126. package/dist/commonjs/StorageClient.js.map +7 -1
  127. package/dist/commonjs/StorageContextClient.js +34 -19
  128. package/dist/commonjs/StorageContextClient.js.map +7 -1
  129. package/dist/commonjs/generated/src/index.js +32 -16
  130. package/dist/commonjs/generated/src/index.js.map +7 -1
  131. package/dist/commonjs/generated/src/models/index.d.ts +59 -4
  132. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  133. package/dist/commonjs/generated/src/models/index.js +164 -267
  134. package/dist/commonjs/generated/src/models/index.js.map +7 -1
  135. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  136. package/dist/commonjs/generated/src/models/mappers.js +8767 -8334
  137. package/dist/commonjs/generated/src/models/mappers.js.map +7 -1
  138. package/dist/commonjs/generated/src/models/parameters.d.ts +7 -0
  139. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  140. package/dist/commonjs/generated/src/models/parameters.js +2074 -1679
  141. package/dist/commonjs/generated/src/models/parameters.js.map +7 -1
  142. package/dist/commonjs/generated/src/operations/appendBlob.js +253 -214
  143. package/dist/commonjs/generated/src/operations/appendBlob.js.map +7 -1
  144. package/dist/commonjs/generated/src/operations/blob.js +1043 -961
  145. package/dist/commonjs/generated/src/operations/blob.js.map +7 -1
  146. package/dist/commonjs/generated/src/operations/blockBlob.js +406 -353
  147. package/dist/commonjs/generated/src/operations/blockBlob.js.map +7 -1
  148. package/dist/commonjs/generated/src/operations/container.js +735 -665
  149. package/dist/commonjs/generated/src/operations/container.js.map +7 -1
  150. package/dist/commonjs/generated/src/operations/index.js +31 -17
  151. package/dist/commonjs/generated/src/operations/index.js.map +7 -1
  152. package/dist/commonjs/generated/src/operations/pageBlob.js +491 -434
  153. package/dist/commonjs/generated/src/operations/pageBlob.js.map +7 -1
  154. package/dist/commonjs/generated/src/operations/service.js +352 -303
  155. package/dist/commonjs/generated/src/operations/service.js.map +7 -1
  156. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js +15 -10
  157. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js.map +7 -1
  158. package/dist/commonjs/generated/src/operationsInterfaces/blob.js +15 -10
  159. package/dist/commonjs/generated/src/operationsInterfaces/blob.js.map +7 -1
  160. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js +15 -10
  161. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js.map +7 -1
  162. package/dist/commonjs/generated/src/operationsInterfaces/container.js +15 -10
  163. package/dist/commonjs/generated/src/operationsInterfaces/container.js.map +7 -1
  164. package/dist/commonjs/generated/src/operationsInterfaces/index.js +31 -17
  165. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +7 -1
  166. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js +15 -10
  167. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js.map +7 -1
  168. package/dist/commonjs/generated/src/operationsInterfaces/service.js +15 -10
  169. package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +7 -1
  170. package/dist/commonjs/generated/src/storageClient.js +81 -63
  171. package/dist/commonjs/generated/src/storageClient.js.map +7 -1
  172. package/dist/commonjs/generatedModels.d.ts +4 -4
  173. package/dist/commonjs/generatedModels.d.ts.map +1 -1
  174. package/dist/commonjs/generatedModels.js +30 -11
  175. package/dist/commonjs/generatedModels.js.map +7 -1
  176. package/dist/commonjs/index.d.ts +14 -14
  177. package/dist/commonjs/index.d.ts.map +1 -1
  178. package/dist/commonjs/index.js +106 -52
  179. package/dist/commonjs/index.js.map +7 -1
  180. package/dist/commonjs/internal-avro/AvroConstants.js +36 -10
  181. package/dist/commonjs/internal-avro/AvroConstants.js.map +7 -1
  182. package/dist/commonjs/internal-avro/AvroParser.js +307 -297
  183. package/dist/commonjs/internal-avro/AvroParser.js.map +7 -1
  184. package/dist/commonjs/internal-avro/AvroReadable.js +26 -7
  185. package/dist/commonjs/internal-avro/AvroReadable.js.map +7 -1
  186. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js +69 -50
  187. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js.map +7 -1
  188. package/dist/commonjs/internal-avro/AvroReadableFromStream.js +96 -84
  189. package/dist/commonjs/internal-avro/AvroReadableFromStream.js.map +7 -1
  190. package/dist/commonjs/internal-avro/AvroReader.js +118 -110
  191. package/dist/commonjs/internal-avro/AvroReader.js.map +7 -1
  192. package/dist/commonjs/internal-avro/index.d.ts +1 -1
  193. package/dist/commonjs/internal-avro/index.d.ts.map +1 -1
  194. package/dist/commonjs/internal-avro/index.js +33 -12
  195. package/dist/commonjs/internal-avro/index.js.map +7 -1
  196. package/dist/commonjs/internal-avro/utils/utils.common.js +33 -17
  197. package/dist/commonjs/internal-avro/utils/utils.common.js.map +7 -1
  198. package/dist/commonjs/log.js +28 -11
  199. package/dist/commonjs/log.js.map +7 -1
  200. package/dist/commonjs/models.d.ts +43 -0
  201. package/dist/commonjs/models.d.ts.map +1 -1
  202. package/dist/commonjs/models.js +74 -115
  203. package/dist/commonjs/models.js.map +7 -1
  204. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +116 -126
  205. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js.map +7 -1
  206. package/dist/commonjs/sas/AccountSASPermissions.js +233 -226
  207. package/dist/commonjs/sas/AccountSASPermissions.js.map +7 -1
  208. package/dist/commonjs/sas/AccountSASResourceTypes.js +80 -70
  209. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +7 -1
  210. package/dist/commonjs/sas/AccountSASServices.js +88 -78
  211. package/dist/commonjs/sas/AccountSASServices.js.map +7 -1
  212. package/dist/commonjs/sas/AccountSASSignatureValues.js +119 -100
  213. package/dist/commonjs/sas/AccountSASSignatureValues.js.map +7 -1
  214. package/dist/commonjs/sas/BlobSASPermissions.js +204 -194
  215. package/dist/commonjs/sas/BlobSASPermissions.js.map +7 -1
  216. package/dist/commonjs/sas/BlobSASSignatureValues.d.ts +11 -1
  217. package/dist/commonjs/sas/BlobSASSignatureValues.d.ts.map +1 -1
  218. package/dist/commonjs/sas/BlobSASSignatureValues.js +822 -641
  219. package/dist/commonjs/sas/BlobSASSignatureValues.js.map +7 -1
  220. package/dist/commonjs/sas/ContainerSASPermissions.js +232 -220
  221. package/dist/commonjs/sas/ContainerSASPermissions.js.map +7 -1
  222. package/dist/commonjs/sas/SASQueryParameters.d.ts +23 -2
  223. package/dist/commonjs/sas/SASQueryParameters.d.ts.map +1 -1
  224. package/dist/commonjs/sas/SASQueryParameters.js +423 -361
  225. package/dist/commonjs/sas/SASQueryParameters.js.map +7 -1
  226. package/dist/commonjs/sas/SasIPRange.js +27 -14
  227. package/dist/commonjs/sas/SasIPRange.js.map +7 -1
  228. package/dist/commonjs/tsdoc-metadata.json +1 -1
  229. package/dist/commonjs/utils/Batch.js +134 -127
  230. package/dist/commonjs/utils/Batch.js.map +7 -1
  231. package/dist/commonjs/utils/BlobQuickQueryStream.js +129 -115
  232. package/dist/commonjs/utils/BlobQuickQueryStream.js.map +7 -1
  233. package/dist/commonjs/utils/Mutex.js +78 -64
  234. package/dist/commonjs/utils/Mutex.js.map +7 -1
  235. package/dist/commonjs/utils/RetriableReadableStream.d.ts.map +1 -1
  236. package/dist/commonjs/utils/RetriableReadableStream.js +128 -125
  237. package/dist/commonjs/utils/RetriableReadableStream.js.map +7 -1
  238. package/dist/commonjs/utils/SharedKeyComparator.js +437 -65
  239. package/dist/commonjs/utils/SharedKeyComparator.js.map +7 -1
  240. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  241. package/dist/commonjs/utils/constants.js +290 -223
  242. package/dist/commonjs/utils/constants.js.map +7 -1
  243. package/dist/commonjs/utils/tracing.js +32 -16
  244. package/dist/commonjs/utils/tracing.js.map +7 -1
  245. package/dist/commonjs/utils/utils.common.d.ts +16 -1
  246. package/dist/commonjs/utils/utils.common.d.ts.map +1 -1
  247. package/dist/commonjs/utils/utils.common.js +566 -740
  248. package/dist/commonjs/utils/utils.common.js.map +7 -1
  249. package/dist/commonjs/utils/utils.js +131 -128
  250. package/dist/commonjs/utils/utils.js.map +7 -1
  251. package/dist/esm/BlobDownloadResponse.d.ts +2 -1
  252. package/dist/esm/BlobDownloadResponse.d.ts.map +1 -1
  253. package/dist/esm/BlobDownloadResponse.js +8 -1
  254. package/dist/esm/BlobDownloadResponse.js.map +1 -1
  255. package/dist/esm/BlobServiceClient.d.ts +36 -5
  256. package/dist/esm/BlobServiceClient.d.ts.map +1 -1
  257. package/dist/esm/BlobServiceClient.js +29 -17
  258. package/dist/esm/BlobServiceClient.js.map +1 -1
  259. package/dist/esm/Clients.d.ts +68 -14
  260. package/dist/esm/Clients.d.ts.map +1 -1
  261. package/dist/esm/Clients.js +97 -28
  262. package/dist/esm/Clients.js.map +1 -1
  263. package/dist/esm/ContainerClient.d.ts +6 -4
  264. package/dist/esm/ContainerClient.d.ts.map +1 -1
  265. package/dist/esm/ContainerClient.js +8 -6
  266. package/dist/esm/ContainerClient.js.map +1 -1
  267. package/dist/esm/Pipeline.d.ts +2 -3
  268. package/dist/esm/Pipeline.d.ts.map +1 -1
  269. package/dist/esm/Pipeline.js.map +1 -1
  270. package/dist/esm/generated/src/models/index.d.ts +59 -4
  271. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  272. package/dist/esm/generated/src/models/index.js +2 -2
  273. package/dist/esm/generated/src/models/index.js.map +1 -1
  274. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  275. package/dist/esm/generated/src/models/mappers.js +65 -0
  276. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  277. package/dist/esm/generated/src/models/parameters.d.ts +7 -0
  278. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  279. package/dist/esm/generated/src/models/parameters.js +71 -1
  280. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  281. package/dist/esm/generated/src/operations/appendBlob.js +5 -0
  282. package/dist/esm/generated/src/operations/appendBlob.js.map +1 -1
  283. package/dist/esm/generated/src/operations/blob.js +3 -0
  284. package/dist/esm/generated/src/operations/blob.js.map +1 -1
  285. package/dist/esm/generated/src/operations/blockBlob.js +10 -0
  286. package/dist/esm/generated/src/operations/blockBlob.js.map +1 -1
  287. package/dist/esm/generated/src/operations/pageBlob.js +5 -0
  288. package/dist/esm/generated/src/operations/pageBlob.js.map +1 -1
  289. package/dist/esm/generated/src/storageClient.js +2 -2
  290. package/dist/esm/generated/src/storageClient.js.map +1 -1
  291. package/dist/esm/generatedModels.d.ts +4 -4
  292. package/dist/esm/generatedModels.d.ts.map +1 -1
  293. package/dist/esm/generatedModels.js.map +1 -1
  294. package/dist/esm/index.d.ts +14 -14
  295. package/dist/esm/index.d.ts.map +1 -1
  296. package/dist/esm/index.js +0 -1
  297. package/dist/esm/index.js.map +1 -1
  298. package/dist/esm/internal-avro/index.d.ts +1 -1
  299. package/dist/esm/internal-avro/index.d.ts.map +1 -1
  300. package/dist/esm/internal-avro/index.js.map +1 -1
  301. package/dist/esm/models.d.ts +43 -0
  302. package/dist/esm/models.d.ts.map +1 -1
  303. package/dist/esm/models.js.map +1 -1
  304. package/dist/esm/sas/BlobSASSignatureValues.d.ts +11 -1
  305. package/dist/esm/sas/BlobSASSignatureValues.d.ts.map +1 -1
  306. package/dist/esm/sas/BlobSASSignatureValues.js +133 -2
  307. package/dist/esm/sas/BlobSASSignatureValues.js.map +1 -1
  308. package/dist/esm/sas/SASQueryParameters.d.ts +23 -2
  309. package/dist/esm/sas/SASQueryParameters.d.ts.map +1 -1
  310. package/dist/esm/sas/SASQueryParameters.js +34 -2
  311. package/dist/esm/sas/SASQueryParameters.js.map +1 -1
  312. package/dist/esm/utils/RetriableReadableStream.d.ts.map +1 -1
  313. package/dist/esm/utils/RetriableReadableStream.js +1 -0
  314. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  315. package/dist/esm/utils/constants.d.ts.map +1 -1
  316. package/dist/esm/utils/constants.js +2 -2
  317. package/dist/esm/utils/constants.js.map +1 -1
  318. package/dist/esm/utils/utils.common.d.ts +16 -1
  319. package/dist/esm/utils/utils.common.d.ts.map +1 -1
  320. package/dist/esm/utils/utils.common.js +26 -0
  321. package/dist/esm/utils/utils.common.js.map +1 -1
  322. package/dist/react-native/BlobDownloadResponse.d.ts +5 -2
  323. package/dist/react-native/BlobDownloadResponse.d.ts.map +1 -0
  324. package/dist/react-native/BlobDownloadResponse.js +9 -5
  325. package/dist/react-native/BlobDownloadResponse.js.map +1 -0
  326. package/dist/react-native/BlobQueryResponse.d.ts +1 -1
  327. package/dist/react-native/BlobQueryResponse.d.ts.map +1 -0
  328. package/dist/react-native/BlobQueryResponse.js +1 -1
  329. package/dist/react-native/BlobQueryResponse.js.map +1 -0
  330. package/dist/react-native/BlobServiceClient.d.ts +36 -5
  331. package/dist/react-native/BlobServiceClient.d.ts.map +1 -1
  332. package/dist/react-native/BlobServiceClient.js +29 -17
  333. package/dist/react-native/BlobServiceClient.js.map +1 -1
  334. package/dist/react-native/Clients.d.ts +68 -14
  335. package/dist/react-native/Clients.d.ts.map +1 -1
  336. package/dist/react-native/Clients.js +97 -28
  337. package/dist/react-native/Clients.js.map +1 -1
  338. package/dist/react-native/ContainerClient.d.ts +6 -4
  339. package/dist/react-native/ContainerClient.d.ts.map +1 -1
  340. package/dist/react-native/ContainerClient.js +8 -6
  341. package/dist/react-native/ContainerClient.js.map +1 -1
  342. package/dist/react-native/Pipeline.d.ts +2 -3
  343. package/dist/react-native/Pipeline.d.ts.map +1 -1
  344. package/dist/react-native/Pipeline.js.map +1 -1
  345. package/dist/react-native/generated/src/models/index.d.ts +59 -4
  346. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  347. package/dist/react-native/generated/src/models/index.js +2 -2
  348. package/dist/react-native/generated/src/models/index.js.map +1 -1
  349. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  350. package/dist/react-native/generated/src/models/mappers.js +65 -0
  351. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  352. package/dist/react-native/generated/src/models/parameters.d.ts +7 -0
  353. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  354. package/dist/react-native/generated/src/models/parameters.js +71 -1
  355. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  356. package/dist/react-native/generated/src/operations/appendBlob.js +5 -0
  357. package/dist/react-native/generated/src/operations/appendBlob.js.map +1 -1
  358. package/dist/react-native/generated/src/operations/blob.js +3 -0
  359. package/dist/react-native/generated/src/operations/blob.js.map +1 -1
  360. package/dist/react-native/generated/src/operations/blockBlob.js +10 -0
  361. package/dist/react-native/generated/src/operations/blockBlob.js.map +1 -1
  362. package/dist/react-native/generated/src/operations/pageBlob.js +5 -0
  363. package/dist/react-native/generated/src/operations/pageBlob.js.map +1 -1
  364. package/dist/react-native/generated/src/storageClient.js +2 -2
  365. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  366. package/dist/react-native/generatedModels.d.ts +4 -4
  367. package/dist/react-native/generatedModels.d.ts.map +1 -1
  368. package/dist/react-native/generatedModels.js.map +1 -1
  369. package/dist/react-native/index.d.ts +14 -14
  370. package/dist/react-native/index.d.ts.map +1 -1
  371. package/dist/react-native/index.js +0 -1
  372. package/dist/react-native/index.js.map +1 -1
  373. package/dist/react-native/internal-avro/index.d.ts +1 -1
  374. package/dist/react-native/internal-avro/index.d.ts.map +1 -1
  375. package/dist/react-native/internal-avro/index.js.map +1 -1
  376. package/dist/react-native/models.d.ts +43 -0
  377. package/dist/react-native/models.d.ts.map +1 -1
  378. package/dist/react-native/models.js.map +1 -1
  379. package/dist/react-native/sas/BlobSASSignatureValues.d.ts +11 -1
  380. package/dist/react-native/sas/BlobSASSignatureValues.d.ts.map +1 -1
  381. package/dist/react-native/sas/BlobSASSignatureValues.js +133 -2
  382. package/dist/react-native/sas/BlobSASSignatureValues.js.map +1 -1
  383. package/dist/react-native/sas/SASQueryParameters.d.ts +23 -2
  384. package/dist/react-native/sas/SASQueryParameters.d.ts.map +1 -1
  385. package/dist/react-native/sas/SASQueryParameters.js +34 -2
  386. package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
  387. package/dist/react-native/utils/RetriableReadableStream.d.ts.map +1 -1
  388. package/dist/react-native/utils/RetriableReadableStream.js +1 -0
  389. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  390. package/dist/react-native/utils/constants.d.ts.map +1 -1
  391. package/dist/react-native/utils/constants.js +2 -2
  392. package/dist/react-native/utils/constants.js.map +1 -1
  393. package/dist/react-native/utils/utils.common.d.ts +16 -1
  394. package/dist/react-native/utils/utils.common.d.ts.map +1 -1
  395. package/dist/react-native/utils/utils.common.js +26 -0
  396. package/dist/react-native/utils/utils.common.js.map +1 -1
  397. package/dist/react-native/utils/utils.d.ts +12 -6
  398. package/dist/react-native/utils/utils.d.ts.map +1 -0
  399. package/dist/react-native/utils/utils.js +11 -11
  400. package/dist/react-native/utils/utils.js.map +1 -0
  401. package/package.json +3 -20
  402. package/dist/browser/BatchUtils-browser.d.mts.map +0 -1
  403. package/dist/browser/BatchUtils-browser.mjs.map +0 -1
  404. package/dist/browser/BlobDownloadResponse-browser.d.mts.map +0 -1
  405. package/dist/browser/BlobDownloadResponse-browser.mjs.map +0 -1
  406. package/dist/browser/BlobQueryResponse-browser.d.mts.map +0 -1
  407. package/dist/browser/BlobQueryResponse-browser.mjs.map +0 -1
  408. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
  409. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
  410. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
  411. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
  412. package/dist/browser/index-browser.d.mts.map +0 -1
  413. package/dist/browser/index-browser.mjs.map +0 -1
  414. package/dist/browser/internal-avro/index-browser.d.mts.map +0 -1
  415. package/dist/browser/internal-avro/index-browser.mjs.map +0 -1
  416. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
  417. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
  418. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
  419. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
  420. package/dist/browser/utils/utils-browser.d.mts.map +0 -1
  421. package/dist/browser/utils/utils-browser.mjs.map +0 -1
  422. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
  423. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
  424. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
  425. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
  426. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
  427. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
  428. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
  429. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
  430. package/dist/react-native/BlobDownloadResponse-react-native.d.mts.map +0 -1
  431. package/dist/react-native/BlobDownloadResponse-react-native.mjs.map +0 -1
  432. package/dist/react-native/BlobQueryResponse-react-native.d.mts.map +0 -1
  433. package/dist/react-native/BlobQueryResponse-react-native.mjs.map +0 -1
  434. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts +0 -3
  435. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts.map +0 -1
  436. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs +0 -5
  437. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs.map +0 -1
  438. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +0 -17
  439. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +0 -1
  440. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +0 -18
  441. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +0 -1
  442. package/dist/react-native/utils/utils-react-native.d.mts.map +0 -1
  443. package/dist/react-native/utils/utils-react-native.mjs.map +0 -1
@@ -1,1297 +1,1392 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContainerClient = void 0;
4
- const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
5
- const core_util_1 = require("@azure/core-util");
6
- const core_auth_1 = require("@azure/core-auth");
7
- const storage_common_1 = require("@azure/storage-common");
8
- const Pipeline_js_1 = require("./Pipeline.js");
9
- const StorageClient_js_1 = require("./StorageClient.js");
10
- const tracing_js_1 = require("./utils/tracing.js");
11
- const utils_common_js_1 = require("./utils/utils.common.js");
12
- const BlobSASSignatureValues_js_1 = require("./sas/BlobSASSignatureValues.js");
13
- const BlobLeaseClient_js_1 = require("./BlobLeaseClient.js");
14
- const Clients_js_1 = require("./Clients.js");
15
- const BlobBatchClient_js_1 = require("./BlobBatchClient.js");
16
- /**
17
- * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs.
18
- */
19
- class ContainerClient extends StorageClient_js_1.StorageClient {
20
- /**
21
- * containerContext provided by protocol layer.
22
- */
23
- containerContext;
24
- _containerName;
25
- /**
26
- * The name of the container.
27
- */
28
- get containerName() {
29
- return this._containerName;
30
- }
31
- constructor(urlOrConnectionString, credentialOrPipelineOrContainerName,
32
- // Legacy, no fix for eslint error without breaking. Disable it for this interface.
33
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
34
- options) {
35
- let pipeline;
36
- let url;
37
- options = options || {};
38
- if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) {
39
- // (url: string, pipeline: Pipeline)
40
- url = urlOrConnectionString;
41
- pipeline = credentialOrPipelineOrContainerName;
42
- }
43
- else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
44
- credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
45
- (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
46
- // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
47
- url = urlOrConnectionString;
48
- pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var ContainerClient_exports = {};
19
+ __export(ContainerClient_exports, {
20
+ ContainerClient: () => ContainerClient
21
+ });
22
+ module.exports = __toCommonJS(ContainerClient_exports);
23
+ var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
24
+ var import_core_util = require("@azure/core-util");
25
+ var import_core_auth = require("@azure/core-auth");
26
+ var import_storage_common = require("@azure/storage-common");
27
+ var import_Pipeline = require("./Pipeline.js");
28
+ var import_StorageClient = require("./StorageClient.js");
29
+ var import_tracing = require("./utils/tracing.js");
30
+ var import_utils_common = require("./utils/utils.common.js");
31
+ var import_BlobSASSignatureValues = require("./sas/BlobSASSignatureValues.js");
32
+ var import_BlobLeaseClient = require("./BlobLeaseClient.js");
33
+ var import_Clients = require("./Clients.js");
34
+ var import_BlobBatchClient = require("./BlobBatchClient.js");
35
+ class ContainerClient extends import_StorageClient.StorageClient {
36
+ /**
37
+ * containerContext provided by protocol layer.
38
+ */
39
+ containerContext;
40
+ _containerName;
41
+ blobClientConfig;
42
+ /**
43
+ * The name of the container.
44
+ */
45
+ get containerName() {
46
+ return this._containerName;
47
+ }
48
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) {
49
+ let pipeline;
50
+ let url;
51
+ options = options || {};
52
+ if ((0, import_Pipeline.isPipelineLike)(credentialOrPipelineOrContainerName)) {
53
+ url = urlOrConnectionString;
54
+ pipeline = credentialOrPipelineOrContainerName;
55
+ } else if (import_core_util.isNodeLike && credentialOrPipelineOrContainerName instanceof import_storage_common.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof import_storage_common.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrPipelineOrContainerName)) {
56
+ url = urlOrConnectionString;
57
+ pipeline = (0, import_Pipeline.newPipeline)(credentialOrPipelineOrContainerName, options);
58
+ } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") {
59
+ url = urlOrConnectionString;
60
+ pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
61
+ } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") {
62
+ const containerName = credentialOrPipelineOrContainerName;
63
+ const extractedCreds = (0, import_utils_common.extractConnectionStringParts)(urlOrConnectionString);
64
+ if (extractedCreds.kind === "AccountConnString") {
65
+ if (import_core_util.isNodeLike) {
66
+ const sharedKeyCredential = new import_storage_common.StorageSharedKeyCredential(
67
+ extractedCreds.accountName,
68
+ extractedCreds.accountKey
69
+ );
70
+ url = (0, import_utils_common.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName));
71
+ if (!options.proxyOptions) {
72
+ options.proxyOptions = (0, import_core_rest_pipeline.getDefaultProxySettings)(extractedCreds.proxyUri);
73
+ }
74
+ pipeline = (0, import_Pipeline.newPipeline)(sharedKeyCredential, options);
75
+ } else {
76
+ throw new Error("Account connection string is only supported in Node.js environment");
49
77
  }
50
- else if (!credentialOrPipelineOrContainerName &&
51
- typeof credentialOrPipelineOrContainerName !== "string") {
52
- // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
53
- // The second parameter is undefined. Use anonymous credential.
54
- url = urlOrConnectionString;
55
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
78
+ } else if (extractedCreds.kind === "SASConnString") {
79
+ url = (0, import_utils_common.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas;
80
+ pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
81
+ } else {
82
+ throw new Error(
83
+ "Connection string must be either an Account connection string or a SAS connection string"
84
+ );
85
+ }
86
+ } else {
87
+ throw new Error("Expecting non-empty strings for containerName parameter");
88
+ }
89
+ super(url, pipeline);
90
+ this._containerName = this.getContainerNameFromUrl();
91
+ this.containerContext = this.storageClientContext.container;
92
+ this.blobClientConfig = options;
93
+ }
94
+ /**
95
+ * Creates a new container under the specified account. If the container with
96
+ * the same name already exists, the operation fails.
97
+ * @see https://learn.microsoft.com/rest/api/storageservices/create-container
98
+ * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
99
+ *
100
+ * @param options - Options to Container Create operation.
101
+ *
102
+ *
103
+ * Example usage:
104
+ *
105
+ * ```ts snippet:ContainerClientCreate
106
+ * import { BlobServiceClient } from "@azure/storage-blob";
107
+ * import { DefaultAzureCredential } from "@azure/identity";
108
+ *
109
+ * const account = "<account>";
110
+ * const blobServiceClient = new BlobServiceClient(
111
+ * `https://${account}.blob.core.windows.net`,
112
+ * new DefaultAzureCredential(),
113
+ * );
114
+ *
115
+ * const containerName = "<container name>";
116
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
117
+ * const createContainerResponse = await containerClient.create();
118
+ * console.log("Container was created successfully", createContainerResponse.requestId);
119
+ * ```
120
+ */
121
+ async create(options = {}) {
122
+ return import_tracing.tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => {
123
+ return (0, import_utils_common.assertResponse)(
124
+ await this.containerContext.create(updatedOptions)
125
+ );
126
+ });
127
+ }
128
+ /**
129
+ * Creates a new container under the specified account. If the container with
130
+ * the same name already exists, it is not changed.
131
+ * @see https://learn.microsoft.com/rest/api/storageservices/create-container
132
+ * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
133
+ *
134
+ * @param options -
135
+ */
136
+ async createIfNotExists(options = {}) {
137
+ return import_tracing.tracingClient.withSpan(
138
+ "ContainerClient-createIfNotExists",
139
+ options,
140
+ async (updatedOptions) => {
141
+ try {
142
+ const res = await this.create(updatedOptions);
143
+ return {
144
+ succeeded: true,
145
+ ...res,
146
+ _response: res._response
147
+ // _response is made non-enumerable
148
+ };
149
+ } catch (e) {
150
+ if (e.details?.errorCode === "ContainerAlreadyExists") {
151
+ return {
152
+ succeeded: false,
153
+ ...e.response?.parsedHeaders,
154
+ _response: e.response
155
+ };
156
+ } else {
157
+ throw e;
158
+ }
56
159
  }
57
- else if (credentialOrPipelineOrContainerName &&
58
- typeof credentialOrPipelineOrContainerName === "string") {
59
- // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
60
- const containerName = credentialOrPipelineOrContainerName;
61
- const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
62
- if (extractedCreds.kind === "AccountConnString") {
63
- if (core_util_1.isNodeLike) {
64
- const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
65
- url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName));
66
- if (!options.proxyOptions) {
67
- options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
68
- }
69
- pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options);
70
- }
71
- else {
72
- throw new Error("Account connection string is only supported in Node.js environment");
73
- }
74
- }
75
- else if (extractedCreds.kind === "SASConnString") {
76
- url =
77
- (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) +
78
- "?" +
79
- extractedCreds.accountSas;
80
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
81
- }
82
- else {
83
- throw new Error("Connection string must be either an Account connection string or a SAS connection string");
84
- }
160
+ }
161
+ );
162
+ }
163
+ /**
164
+ * Returns true if the Azure container resource represented by this client exists; false otherwise.
165
+ *
166
+ * NOTE: use this function with care since an existing container might be deleted by other clients or
167
+ * applications. Vice versa new containers with the same name might be added by other clients or
168
+ * applications after this function completes.
169
+ *
170
+ * @param options -
171
+ */
172
+ async exists(options = {}) {
173
+ return import_tracing.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => {
174
+ try {
175
+ await this.getProperties({
176
+ abortSignal: options.abortSignal,
177
+ tracingOptions: updatedOptions.tracingOptions
178
+ });
179
+ return true;
180
+ } catch (e) {
181
+ if (e.statusCode === 404) {
182
+ return false;
85
183
  }
86
- else {
87
- throw new Error("Expecting non-empty strings for containerName parameter");
184
+ throw e;
185
+ }
186
+ });
187
+ }
188
+ /**
189
+ * Creates a {@link BlobClient}
190
+ *
191
+ * @param blobName - A blob name
192
+ * @returns A new BlobClient object for the given blob name.
193
+ */
194
+ getBlobClient(blobName) {
195
+ return new import_Clients.BlobClient(
196
+ (0, import_utils_common.appendToURLPath)(this.url, (0, import_utils_common.EscapePath)(blobName)),
197
+ this.pipeline,
198
+ this.blobClientConfig
199
+ );
200
+ }
201
+ /**
202
+ * Creates an {@link AppendBlobClient}
203
+ *
204
+ * @param blobName - An append blob name
205
+ */
206
+ getAppendBlobClient(blobName) {
207
+ return new import_Clients.AppendBlobClient(
208
+ (0, import_utils_common.appendToURLPath)(this.url, (0, import_utils_common.EscapePath)(blobName)),
209
+ this.pipeline,
210
+ this.blobClientConfig
211
+ );
212
+ }
213
+ /**
214
+ * Creates a {@link BlockBlobClient}
215
+ *
216
+ * @param blobName - A block blob name
217
+ *
218
+ *
219
+ * Example usage:
220
+ *
221
+ * ```ts snippet:ClientsUpload
222
+ * import { BlobServiceClient } from "@azure/storage-blob";
223
+ * import { DefaultAzureCredential } from "@azure/identity";
224
+ *
225
+ * const account = "<account>";
226
+ * const blobServiceClient = new BlobServiceClient(
227
+ * `https://${account}.blob.core.windows.net`,
228
+ * new DefaultAzureCredential(),
229
+ * );
230
+ *
231
+ * const containerName = "<container name>";
232
+ * const blobName = "<blob name>";
233
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
234
+ * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
235
+ *
236
+ * const content = "Hello world!";
237
+ * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
238
+ * ```
239
+ */
240
+ getBlockBlobClient(blobName) {
241
+ return new import_Clients.BlockBlobClient(
242
+ (0, import_utils_common.appendToURLPath)(this.url, (0, import_utils_common.EscapePath)(blobName)),
243
+ this.pipeline,
244
+ this.blobClientConfig
245
+ );
246
+ }
247
+ /**
248
+ * Creates a {@link PageBlobClient}
249
+ *
250
+ * @param blobName - A page blob name
251
+ */
252
+ getPageBlobClient(blobName) {
253
+ return new import_Clients.PageBlobClient(
254
+ (0, import_utils_common.appendToURLPath)(this.url, (0, import_utils_common.EscapePath)(blobName)),
255
+ this.pipeline,
256
+ this.blobClientConfig
257
+ );
258
+ }
259
+ /**
260
+ * Returns all user-defined metadata and system properties for the specified
261
+ * container. The data returned does not include the container's list of blobs.
262
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-container-properties
263
+ *
264
+ * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
265
+ * they originally contained uppercase characters. This differs from the metadata keys returned by
266
+ * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which
267
+ * will retain their original casing.
268
+ *
269
+ * @param options - Options to Container Get Properties operation.
270
+ */
271
+ async getProperties(options = {}) {
272
+ if (!options.conditions) {
273
+ options.conditions = {};
274
+ }
275
+ return import_tracing.tracingClient.withSpan(
276
+ "ContainerClient-getProperties",
277
+ options,
278
+ async (updatedOptions) => {
279
+ return (0, import_utils_common.assertResponse)(
280
+ await this.containerContext.getProperties({
281
+ abortSignal: options.abortSignal,
282
+ ...options.conditions,
283
+ tracingOptions: updatedOptions.tracingOptions
284
+ })
285
+ );
286
+ }
287
+ );
288
+ }
289
+ /**
290
+ * Marks the specified container for deletion. The container and any blobs
291
+ * contained within it are later deleted during garbage collection.
292
+ * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
293
+ *
294
+ * @param options - Options to Container Delete operation.
295
+ */
296
+ async delete(options = {}) {
297
+ if (!options.conditions) {
298
+ options.conditions = {};
299
+ }
300
+ return import_tracing.tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => {
301
+ return (0, import_utils_common.assertResponse)(
302
+ await this.containerContext.delete({
303
+ abortSignal: options.abortSignal,
304
+ leaseAccessConditions: options.conditions,
305
+ modifiedAccessConditions: options.conditions,
306
+ tracingOptions: updatedOptions.tracingOptions
307
+ })
308
+ );
309
+ });
310
+ }
311
+ /**
312
+ * Marks the specified container for deletion if it exists. The container and any blobs
313
+ * contained within it are later deleted during garbage collection.
314
+ * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
315
+ *
316
+ * @param options - Options to Container Delete operation.
317
+ */
318
+ async deleteIfExists(options = {}) {
319
+ return import_tracing.tracingClient.withSpan(
320
+ "ContainerClient-deleteIfExists",
321
+ options,
322
+ async (updatedOptions) => {
323
+ try {
324
+ const res = await this.delete(updatedOptions);
325
+ return {
326
+ succeeded: true,
327
+ ...res,
328
+ _response: res._response
329
+ };
330
+ } catch (e) {
331
+ if (e.details?.errorCode === "ContainerNotFound") {
332
+ return {
333
+ succeeded: false,
334
+ ...e.response?.parsedHeaders,
335
+ _response: e.response
336
+ };
337
+ }
338
+ throw e;
88
339
  }
89
- super(url, pipeline);
90
- this._containerName = this.getContainerNameFromUrl();
91
- this.containerContext = this.storageClientContext.container;
340
+ }
341
+ );
342
+ }
343
+ /**
344
+ * Sets one or more user-defined name-value pairs for the specified container.
345
+ *
346
+ * If no option provided, or no metadata defined in the parameter, the container
347
+ * metadata will be removed.
348
+ *
349
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata
350
+ *
351
+ * @param metadata - Replace existing metadata with this value.
352
+ * If no value provided the existing metadata will be removed.
353
+ * @param options - Options to Container Set Metadata operation.
354
+ */
355
+ async setMetadata(metadata, options = {}) {
356
+ if (!options.conditions) {
357
+ options.conditions = {};
92
358
  }
93
- /**
94
- * Creates a new container under the specified account. If the container with
95
- * the same name already exists, the operation fails.
96
- * @see https://learn.microsoft.com/rest/api/storageservices/create-container
97
- * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
98
- *
99
- * @param options - Options to Container Create operation.
100
- *
101
- *
102
- * Example usage:
103
- *
104
- * ```ts snippet:ContainerClientCreate
105
- * import { BlobServiceClient } from "@azure/storage-blob";
106
- * import { DefaultAzureCredential } from "@azure/identity";
107
- *
108
- * const account = "<account>";
109
- * const blobServiceClient = new BlobServiceClient(
110
- * `https://${account}.blob.core.windows.net`,
111
- * new DefaultAzureCredential(),
112
- * );
113
- *
114
- * const containerName = "<container name>";
115
- * const containerClient = blobServiceClient.getContainerClient(containerName);
116
- * const createContainerResponse = await containerClient.create();
117
- * console.log("Container was created successfully", createContainerResponse.requestId);
118
- * ```
119
- */
120
- async create(options = {}) {
121
- return tracing_js_1.tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => {
122
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.create(updatedOptions));
123
- });
359
+ if (options.conditions.ifUnmodifiedSince) {
360
+ throw new RangeError(
361
+ "the IfUnmodifiedSince must have their default values because they are ignored by the blob service"
362
+ );
124
363
  }
125
- /**
126
- * Creates a new container under the specified account. If the container with
127
- * the same name already exists, it is not changed.
128
- * @see https://learn.microsoft.com/rest/api/storageservices/create-container
129
- * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
130
- *
131
- * @param options -
132
- */
133
- async createIfNotExists(options = {}) {
134
- return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => {
135
- try {
136
- const res = await this.create(updatedOptions);
137
- return {
138
- succeeded: true,
139
- ...res,
140
- _response: res._response, // _response is made non-enumerable
141
- };
142
- }
143
- catch (e) {
144
- if (e.details?.errorCode === "ContainerAlreadyExists") {
145
- return {
146
- succeeded: false,
147
- ...e.response?.parsedHeaders,
148
- _response: e.response,
149
- };
150
- }
151
- else {
152
- throw e;
153
- }
154
- }
155
- });
364
+ return import_tracing.tracingClient.withSpan(
365
+ "ContainerClient-setMetadata",
366
+ options,
367
+ async (updatedOptions) => {
368
+ return (0, import_utils_common.assertResponse)(
369
+ await this.containerContext.setMetadata({
370
+ abortSignal: options.abortSignal,
371
+ leaseAccessConditions: options.conditions,
372
+ metadata,
373
+ modifiedAccessConditions: options.conditions,
374
+ tracingOptions: updatedOptions.tracingOptions
375
+ })
376
+ );
377
+ }
378
+ );
379
+ }
380
+ /**
381
+ * Gets the permissions for the specified container. The permissions indicate
382
+ * whether container data may be accessed publicly.
383
+ *
384
+ * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.
385
+ * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
386
+ *
387
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl
388
+ *
389
+ * @param options - Options to Container Get Access Policy operation.
390
+ */
391
+ async getAccessPolicy(options = {}) {
392
+ if (!options.conditions) {
393
+ options.conditions = {};
156
394
  }
157
- /**
158
- * Returns true if the Azure container resource represented by this client exists; false otherwise.
159
- *
160
- * NOTE: use this function with care since an existing container might be deleted by other clients or
161
- * applications. Vice versa new containers with the same name might be added by other clients or
162
- * applications after this function completes.
163
- *
164
- * @param options -
165
- */
166
- async exists(options = {}) {
167
- return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => {
168
- try {
169
- await this.getProperties({
170
- abortSignal: options.abortSignal,
171
- tracingOptions: updatedOptions.tracingOptions,
172
- });
173
- return true;
395
+ return import_tracing.tracingClient.withSpan(
396
+ "ContainerClient-getAccessPolicy",
397
+ options,
398
+ async (updatedOptions) => {
399
+ const response = (0, import_utils_common.assertResponse)(
400
+ await this.containerContext.getAccessPolicy({
401
+ abortSignal: options.abortSignal,
402
+ leaseAccessConditions: options.conditions,
403
+ tracingOptions: updatedOptions.tracingOptions
404
+ })
405
+ );
406
+ const res = {
407
+ _response: response._response,
408
+ blobPublicAccess: response.blobPublicAccess,
409
+ date: response.date,
410
+ etag: response.etag,
411
+ errorCode: response.errorCode,
412
+ lastModified: response.lastModified,
413
+ requestId: response.requestId,
414
+ clientRequestId: response.clientRequestId,
415
+ signedIdentifiers: [],
416
+ version: response.version
417
+ };
418
+ for (const identifier of response) {
419
+ let accessPolicy = void 0;
420
+ if (identifier.accessPolicy) {
421
+ accessPolicy = {
422
+ permissions: identifier.accessPolicy.permissions
423
+ };
424
+ if (identifier.accessPolicy.expiresOn) {
425
+ accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
174
426
  }
175
- catch (e) {
176
- if (e.statusCode === 404) {
177
- return false;
178
- }
179
- throw e;
427
+ if (identifier.accessPolicy.startsOn) {
428
+ accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);
180
429
  }
181
- });
182
- }
183
- /**
184
- * Creates a {@link BlobClient}
185
- *
186
- * @param blobName - A blob name
187
- * @returns A new BlobClient object for the given blob name.
188
- */
189
- getBlobClient(blobName) {
190
- return new Clients_js_1.BlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline);
191
- }
192
- /**
193
- * Creates an {@link AppendBlobClient}
194
- *
195
- * @param blobName - An append blob name
196
- */
197
- getAppendBlobClient(blobName) {
198
- return new Clients_js_1.AppendBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline);
430
+ }
431
+ res.signedIdentifiers.push({
432
+ accessPolicy,
433
+ id: identifier.id
434
+ });
435
+ }
436
+ return res;
437
+ }
438
+ );
439
+ }
440
+ /**
441
+ * Sets the permissions for the specified container. The permissions indicate
442
+ * whether blobs in a container may be accessed publicly.
443
+ *
444
+ * When you set permissions for a container, the existing permissions are replaced.
445
+ * If no access or containerAcl provided, the existing container ACL will be
446
+ * removed.
447
+ *
448
+ * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect.
449
+ * During this interval, a shared access signature that is associated with the stored access policy will
450
+ * fail with status code 403 (Forbidden), until the access policy becomes active.
451
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-container-acl
452
+ *
453
+ * @param access - The level of public access to data in the container.
454
+ * @param containerAcl - Array of elements each having a unique Id and details of the access policy.
455
+ * @param options - Options to Container Set Access Policy operation.
456
+ */
457
+ async setAccessPolicy(access, containerAcl, options = {}) {
458
+ options.conditions = options.conditions || {};
459
+ return import_tracing.tracingClient.withSpan(
460
+ "ContainerClient-setAccessPolicy",
461
+ options,
462
+ async (updatedOptions) => {
463
+ const acl = [];
464
+ for (const identifier of containerAcl || []) {
465
+ acl.push({
466
+ accessPolicy: {
467
+ expiresOn: identifier.accessPolicy.expiresOn ? (0, import_utils_common.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "",
468
+ permissions: identifier.accessPolicy.permissions,
469
+ startsOn: identifier.accessPolicy.startsOn ? (0, import_utils_common.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : ""
470
+ },
471
+ id: identifier.id
472
+ });
473
+ }
474
+ return (0, import_utils_common.assertResponse)(
475
+ await this.containerContext.setAccessPolicy({
476
+ abortSignal: options.abortSignal,
477
+ access,
478
+ containerAcl: acl,
479
+ leaseAccessConditions: options.conditions,
480
+ modifiedAccessConditions: options.conditions,
481
+ tracingOptions: updatedOptions.tracingOptions
482
+ })
483
+ );
484
+ }
485
+ );
486
+ }
487
+ /**
488
+ * Get a {@link BlobLeaseClient} that manages leases on the container.
489
+ *
490
+ * @param proposeLeaseId - Initial proposed lease Id.
491
+ * @returns A new BlobLeaseClient object for managing leases on the container.
492
+ */
493
+ getBlobLeaseClient(proposeLeaseId) {
494
+ return new import_BlobLeaseClient.BlobLeaseClient(this, proposeLeaseId);
495
+ }
496
+ /**
497
+ * Creates a new block blob, or updates the content of an existing block blob.
498
+ *
499
+ * Updating an existing block blob overwrites any existing metadata on the blob.
500
+ * Partial updates are not supported; the content of the existing blob is
501
+ * overwritten with the new content. To perform a partial update of a block blob's,
502
+ * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}.
503
+ *
504
+ * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile},
505
+ * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better
506
+ * performance with concurrency uploading.
507
+ *
508
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
509
+ *
510
+ * @param blobName - Name of the block blob to create or update.
511
+ * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
512
+ * which returns a new Readable stream whose offset is from data source beginning.
513
+ * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
514
+ * string including non non-Base64/Hex-encoded characters.
515
+ * @param options - Options to configure the Block Blob Upload operation.
516
+ * @returns Block Blob upload response data and the corresponding BlockBlobClient instance.
517
+ */
518
+ async uploadBlockBlob(blobName, body, contentLength, options = {}) {
519
+ return import_tracing.tracingClient.withSpan(
520
+ "ContainerClient-uploadBlockBlob",
521
+ options,
522
+ async (updatedOptions) => {
523
+ const blockBlobClient = this.getBlockBlobClient(blobName);
524
+ const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
525
+ return {
526
+ blockBlobClient,
527
+ response
528
+ };
529
+ }
530
+ );
531
+ }
532
+ /**
533
+ * Marks the specified blob or snapshot for deletion. The blob is later deleted
534
+ * during garbage collection. Note that in order to delete a blob, you must delete
535
+ * all of its snapshots. You can delete both at the same time with the Delete
536
+ * Blob operation.
537
+ * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
538
+ *
539
+ * @param blobName -
540
+ * @param options - Options to Blob Delete operation.
541
+ * @returns Block blob deletion response data.
542
+ */
543
+ async deleteBlob(blobName, options = {}) {
544
+ return import_tracing.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => {
545
+ let blobClient = this.getBlobClient(blobName);
546
+ if (options.versionId) {
547
+ blobClient = blobClient.withVersion(options.versionId);
548
+ }
549
+ return blobClient.delete(updatedOptions);
550
+ });
551
+ }
552
+ /**
553
+ * listBlobFlatSegment returns a single segment of blobs starting from the
554
+ * specified Marker. Use an empty Marker to start enumeration from the beginning.
555
+ * After getting a segment, process it, and then call listBlobsFlatSegment again
556
+ * (passing the the previously-returned Marker) to get the next segment.
557
+ * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
558
+ *
559
+ * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
560
+ * @param options - Options to Container List Blob Flat Segment operation.
561
+ */
562
+ async listBlobFlatSegment(marker, options = {}) {
563
+ return import_tracing.tracingClient.withSpan(
564
+ "ContainerClient-listBlobFlatSegment",
565
+ options,
566
+ async (updatedOptions) => {
567
+ const response = (0, import_utils_common.assertResponse)(
568
+ await this.containerContext.listBlobFlatSegment({
569
+ marker,
570
+ ...options,
571
+ tracingOptions: updatedOptions.tracingOptions
572
+ })
573
+ );
574
+ const wrappedResponse = {
575
+ ...response,
576
+ _response: {
577
+ ...response._response,
578
+ parsedBody: (0, import_utils_common.ConvertInternalResponseOfListBlobFlat)(response._response.parsedBody)
579
+ },
580
+ // _response is made non-enumerable
581
+ segment: {
582
+ ...response.segment,
583
+ blobItems: response.segment.blobItems.map((blobItemInternal) => {
584
+ const blobItem = {
585
+ ...blobItemInternal,
586
+ name: (0, import_utils_common.BlobNameToString)(blobItemInternal.name),
587
+ tags: (0, import_utils_common.toTags)(blobItemInternal.blobTags),
588
+ objectReplicationSourceProperties: (0, import_utils_common.parseObjectReplicationRecord)(
589
+ blobItemInternal.objectReplicationMetadata
590
+ )
591
+ };
592
+ return blobItem;
593
+ })
594
+ }
595
+ };
596
+ return wrappedResponse;
597
+ }
598
+ );
599
+ }
600
+ /**
601
+ * listBlobHierarchySegment returns a single segment of blobs starting from
602
+ * the specified Marker. Use an empty Marker to start enumeration from the
603
+ * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment
604
+ * again (passing the the previously-returned Marker) to get the next segment.
605
+ * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
606
+ *
607
+ * @param delimiter - The character or string used to define the virtual hierarchy
608
+ * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
609
+ * @param options - Options to Container List Blob Hierarchy Segment operation.
610
+ */
611
+ async listBlobHierarchySegment(delimiter, marker, options = {}) {
612
+ return import_tracing.tracingClient.withSpan(
613
+ "ContainerClient-listBlobHierarchySegment",
614
+ options,
615
+ async (updatedOptions) => {
616
+ const response = (0, import_utils_common.assertResponse)(
617
+ await this.containerContext.listBlobHierarchySegment(delimiter, {
618
+ marker,
619
+ ...options,
620
+ tracingOptions: updatedOptions.tracingOptions
621
+ })
622
+ );
623
+ const wrappedResponse = {
624
+ ...response,
625
+ _response: {
626
+ ...response._response,
627
+ parsedBody: (0, import_utils_common.ConvertInternalResponseOfListBlobHierarchy)(response._response.parsedBody)
628
+ },
629
+ // _response is made non-enumerable
630
+ segment: {
631
+ ...response.segment,
632
+ blobItems: response.segment.blobItems.map((blobItemInternal) => {
633
+ const blobItem = {
634
+ ...blobItemInternal,
635
+ name: (0, import_utils_common.BlobNameToString)(blobItemInternal.name),
636
+ tags: (0, import_utils_common.toTags)(blobItemInternal.blobTags),
637
+ objectReplicationSourceProperties: (0, import_utils_common.parseObjectReplicationRecord)(
638
+ blobItemInternal.objectReplicationMetadata
639
+ )
640
+ };
641
+ return blobItem;
642
+ }),
643
+ blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => {
644
+ const blobPrefix = {
645
+ ...blobPrefixInternal,
646
+ name: (0, import_utils_common.BlobNameToString)(blobPrefixInternal.name)
647
+ };
648
+ return blobPrefix;
649
+ })
650
+ }
651
+ };
652
+ return wrappedResponse;
653
+ }
654
+ );
655
+ }
656
+ /**
657
+ * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse
658
+ *
659
+ * @param marker - A string value that identifies the portion of
660
+ * the list of blobs to be returned with the next listing operation. The
661
+ * operation returns the ContinuationToken value within the response body if the
662
+ * listing operation did not return all blobs remaining to be listed
663
+ * with the current page. The ContinuationToken value can be used as the value for
664
+ * the marker parameter in a subsequent call to request the next page of list
665
+ * items. The marker value is opaque to the client.
666
+ * @param options - Options to list blobs operation.
667
+ */
668
+ async *listSegments(marker, options = {}) {
669
+ let listBlobsFlatSegmentResponse;
670
+ if (!!marker || marker === void 0) {
671
+ do {
672
+ listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options);
673
+ marker = listBlobsFlatSegmentResponse.continuationToken;
674
+ yield await listBlobsFlatSegmentResponse;
675
+ } while (marker);
199
676
  }
200
- /**
201
- * Creates a {@link BlockBlobClient}
202
- *
203
- * @param blobName - A block blob name
204
- *
205
- *
206
- * Example usage:
207
- *
208
- * ```ts snippet:ClientsUpload
209
- * import { BlobServiceClient } from "@azure/storage-blob";
210
- * import { DefaultAzureCredential } from "@azure/identity";
211
- *
212
- * const account = "<account>";
213
- * const blobServiceClient = new BlobServiceClient(
214
- * `https://${account}.blob.core.windows.net`,
215
- * new DefaultAzureCredential(),
216
- * );
217
- *
218
- * const containerName = "<container name>";
219
- * const blobName = "<blob name>";
220
- * const containerClient = blobServiceClient.getContainerClient(containerName);
221
- * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
222
- *
223
- * const content = "Hello world!";
224
- * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
225
- * ```
226
- */
227
- getBlockBlobClient(blobName) {
228
- return new Clients_js_1.BlockBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline);
677
+ }
678
+ /**
679
+ * Returns an AsyncIterableIterator of {@link BlobItem} objects
680
+ *
681
+ * @param options - Options to list blobs operation.
682
+ */
683
+ async *listItems(options = {}) {
684
+ let marker;
685
+ for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) {
686
+ yield* listBlobsFlatSegmentResponse.segment.blobItems;
229
687
  }
230
- /**
231
- * Creates a {@link PageBlobClient}
232
- *
233
- * @param blobName - A page blob name
234
- */
235
- getPageBlobClient(blobName) {
236
- return new Clients_js_1.PageBlobClient((0, utils_common_js_1.appendToURLPath)(this.url, (0, utils_common_js_1.EscapePath)(blobName)), this.pipeline);
688
+ }
689
+ /**
690
+ * Returns an async iterable iterator to list all the blobs
691
+ * under the specified account.
692
+ *
693
+ * .byPage() returns an async iterable iterator to list the blobs in pages.
694
+ *
695
+ * ```ts snippet:ReadmeSampleListBlobs_Multiple
696
+ * import { BlobServiceClient } from "@azure/storage-blob";
697
+ * import { DefaultAzureCredential } from "@azure/identity";
698
+ *
699
+ * const account = "<account>";
700
+ * const blobServiceClient = new BlobServiceClient(
701
+ * `https://${account}.blob.core.windows.net`,
702
+ * new DefaultAzureCredential(),
703
+ * );
704
+ *
705
+ * const containerName = "<container name>";
706
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
707
+ *
708
+ * // Example using `for await` syntax
709
+ * let i = 1;
710
+ * const blobs = containerClient.listBlobsFlat();
711
+ * for await (const blob of blobs) {
712
+ * console.log(`Blob ${i++}: ${blob.name}`);
713
+ * }
714
+ *
715
+ * // Example using `iter.next()` syntax
716
+ * i = 1;
717
+ * const iter = containerClient.listBlobsFlat();
718
+ * let { value, done } = await iter.next();
719
+ * while (!done) {
720
+ * console.log(`Blob ${i++}: ${value.name}`);
721
+ * ({ value, done } = await iter.next());
722
+ * }
723
+ *
724
+ * // Example using `byPage()` syntax
725
+ * i = 1;
726
+ * for await (const page of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) {
727
+ * for (const blob of page.segment.blobItems) {
728
+ * console.log(`Blob ${i++}: ${blob.name}`);
729
+ * }
730
+ * }
731
+ *
732
+ * // Example using paging with a marker
733
+ * i = 1;
734
+ * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 });
735
+ * let response = (await iterator.next()).value;
736
+ * // Prints 2 blob names
737
+ * if (response.segment.blobItems) {
738
+ * for (const blob of response.segment.blobItems) {
739
+ * console.log(`Blob ${i++}: ${blob.name}`);
740
+ * }
741
+ * }
742
+ * // Gets next marker
743
+ * let marker = response.continuationToken;
744
+ * // Passing next marker as continuationToken
745
+ * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 });
746
+ * response = (await iterator.next()).value;
747
+ * // Prints 10 blob names
748
+ * if (response.segment.blobItems) {
749
+ * for (const blob of response.segment.blobItems) {
750
+ * console.log(`Blob ${i++}: ${blob.name}`);
751
+ * }
752
+ * }
753
+ * ```
754
+ *
755
+ * @param options - Options to list blobs.
756
+ * @returns An asyncIterableIterator that supports paging.
757
+ */
758
+ listBlobsFlat(options = {}) {
759
+ const include = [];
760
+ if (options.includeCopy) {
761
+ include.push("copy");
237
762
  }
238
- /**
239
- * Returns all user-defined metadata and system properties for the specified
240
- * container. The data returned does not include the container's list of blobs.
241
- * @see https://learn.microsoft.com/rest/api/storageservices/get-container-properties
242
- *
243
- * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
244
- * they originally contained uppercase characters. This differs from the metadata keys returned by
245
- * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which
246
- * will retain their original casing.
247
- *
248
- * @param options - Options to Container Get Properties operation.
249
- */
250
- async getProperties(options = {}) {
251
- if (!options.conditions) {
252
- options.conditions = {};
253
- }
254
- return tracing_js_1.tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => {
255
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.getProperties({
256
- abortSignal: options.abortSignal,
257
- ...options.conditions,
258
- tracingOptions: updatedOptions.tracingOptions,
259
- }));
260
- });
763
+ if (options.includeDeleted) {
764
+ include.push("deleted");
261
765
  }
262
- /**
263
- * Marks the specified container for deletion. The container and any blobs
264
- * contained within it are later deleted during garbage collection.
265
- * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
266
- *
267
- * @param options - Options to Container Delete operation.
268
- */
269
- async delete(options = {}) {
270
- if (!options.conditions) {
271
- options.conditions = {};
272
- }
273
- return tracing_js_1.tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => {
274
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.delete({
275
- abortSignal: options.abortSignal,
276
- leaseAccessConditions: options.conditions,
277
- modifiedAccessConditions: options.conditions,
278
- tracingOptions: updatedOptions.tracingOptions,
279
- }));
280
- });
766
+ if (options.includeMetadata) {
767
+ include.push("metadata");
281
768
  }
282
- /**
283
- * Marks the specified container for deletion if it exists. The container and any blobs
284
- * contained within it are later deleted during garbage collection.
285
- * @see https://learn.microsoft.com/rest/api/storageservices/delete-container
286
- *
287
- * @param options - Options to Container Delete operation.
288
- */
289
- async deleteIfExists(options = {}) {
290
- return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => {
291
- try {
292
- const res = await this.delete(updatedOptions);
293
- return {
294
- succeeded: true,
295
- ...res,
296
- _response: res._response,
297
- };
298
- }
299
- catch (e) {
300
- if (e.details?.errorCode === "ContainerNotFound") {
301
- return {
302
- succeeded: false,
303
- ...e.response?.parsedHeaders,
304
- _response: e.response,
305
- };
306
- }
307
- throw e;
308
- }
309
- });
769
+ if (options.includeSnapshots) {
770
+ include.push("snapshots");
310
771
  }
311
- /**
312
- * Sets one or more user-defined name-value pairs for the specified container.
313
- *
314
- * If no option provided, or no metadata defined in the parameter, the container
315
- * metadata will be removed.
316
- *
317
- * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata
318
- *
319
- * @param metadata - Replace existing metadata with this value.
320
- * If no value provided the existing metadata will be removed.
321
- * @param options - Options to Container Set Metadata operation.
322
- */
323
- async setMetadata(metadata, options = {}) {
324
- if (!options.conditions) {
325
- options.conditions = {};
326
- }
327
- if (options.conditions.ifUnmodifiedSince) {
328
- throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service");
329
- }
330
- return tracing_js_1.tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => {
331
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.setMetadata({
332
- abortSignal: options.abortSignal,
333
- leaseAccessConditions: options.conditions,
334
- metadata,
335
- modifiedAccessConditions: options.conditions,
336
- tracingOptions: updatedOptions.tracingOptions,
337
- }));
338
- });
772
+ if (options.includeVersions) {
773
+ include.push("versions");
339
774
  }
340
- /**
341
- * Gets the permissions for the specified container. The permissions indicate
342
- * whether container data may be accessed publicly.
343
- *
344
- * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.
345
- * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
346
- *
347
- * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl
348
- *
349
- * @param options - Options to Container Get Access Policy operation.
350
- */
351
- async getAccessPolicy(options = {}) {
352
- if (!options.conditions) {
353
- options.conditions = {};
354
- }
355
- return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => {
356
- const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccessPolicy({
357
- abortSignal: options.abortSignal,
358
- leaseAccessConditions: options.conditions,
359
- tracingOptions: updatedOptions.tracingOptions,
360
- }));
361
- const res = {
362
- _response: response._response,
363
- blobPublicAccess: response.blobPublicAccess,
364
- date: response.date,
365
- etag: response.etag,
366
- errorCode: response.errorCode,
367
- lastModified: response.lastModified,
368
- requestId: response.requestId,
369
- clientRequestId: response.clientRequestId,
370
- signedIdentifiers: [],
371
- version: response.version,
372
- };
373
- for (const identifier of response) {
374
- let accessPolicy = undefined;
375
- if (identifier.accessPolicy) {
376
- accessPolicy = {
377
- permissions: identifier.accessPolicy.permissions,
378
- };
379
- if (identifier.accessPolicy.expiresOn) {
380
- accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
381
- }
382
- if (identifier.accessPolicy.startsOn) {
383
- accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);
384
- }
385
- }
386
- res.signedIdentifiers.push({
387
- accessPolicy,
388
- id: identifier.id,
389
- });
390
- }
391
- return res;
392
- });
775
+ if (options.includeUncommitedBlobs) {
776
+ include.push("uncommittedblobs");
393
777
  }
394
- /**
395
- * Sets the permissions for the specified container. The permissions indicate
396
- * whether blobs in a container may be accessed publicly.
397
- *
398
- * When you set permissions for a container, the existing permissions are replaced.
399
- * If no access or containerAcl provided, the existing container ACL will be
400
- * removed.
401
- *
402
- * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect.
403
- * During this interval, a shared access signature that is associated with the stored access policy will
404
- * fail with status code 403 (Forbidden), until the access policy becomes active.
405
- * @see https://learn.microsoft.com/rest/api/storageservices/set-container-acl
406
- *
407
- * @param access - The level of public access to data in the container.
408
- * @param containerAcl - Array of elements each having a unique Id and details of the access policy.
409
- * @param options - Options to Container Set Access Policy operation.
410
- */
411
- async setAccessPolicy(access, containerAcl, options = {}) {
412
- options.conditions = options.conditions || {};
413
- return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => {
414
- const acl = [];
415
- for (const identifier of containerAcl || []) {
416
- acl.push({
417
- accessPolicy: {
418
- expiresOn: identifier.accessPolicy.expiresOn
419
- ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn)
420
- : "",
421
- permissions: identifier.accessPolicy.permissions,
422
- startsOn: identifier.accessPolicy.startsOn
423
- ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn)
424
- : "",
425
- },
426
- id: identifier.id,
427
- });
428
- }
429
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({
430
- abortSignal: options.abortSignal,
431
- access,
432
- containerAcl: acl,
433
- leaseAccessConditions: options.conditions,
434
- modifiedAccessConditions: options.conditions,
435
- tracingOptions: updatedOptions.tracingOptions,
436
- }));
437
- });
778
+ if (options.includeTags) {
779
+ include.push("tags");
438
780
  }
439
- /**
440
- * Get a {@link BlobLeaseClient} that manages leases on the container.
441
- *
442
- * @param proposeLeaseId - Initial proposed lease Id.
443
- * @returns A new BlobLeaseClient object for managing leases on the container.
444
- */
445
- getBlobLeaseClient(proposeLeaseId) {
446
- return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId);
781
+ if (options.includeDeletedWithVersions) {
782
+ include.push("deletedwithversions");
447
783
  }
448
- /**
449
- * Creates a new block blob, or updates the content of an existing block blob.
450
- *
451
- * Updating an existing block blob overwrites any existing metadata on the blob.
452
- * Partial updates are not supported; the content of the existing blob is
453
- * overwritten with the new content. To perform a partial update of a block blob's,
454
- * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}.
455
- *
456
- * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile},
457
- * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better
458
- * performance with concurrency uploading.
459
- *
460
- * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
461
- *
462
- * @param blobName - Name of the block blob to create or update.
463
- * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
464
- * which returns a new Readable stream whose offset is from data source beginning.
465
- * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
466
- * string including non non-Base64/Hex-encoded characters.
467
- * @param options - Options to configure the Block Blob Upload operation.
468
- * @returns Block Blob upload response data and the corresponding BlockBlobClient instance.
469
- */
470
- async uploadBlockBlob(blobName, body, contentLength, options = {}) {
471
- return tracing_js_1.tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => {
472
- const blockBlobClient = this.getBlockBlobClient(blobName);
473
- const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
474
- return {
475
- blockBlobClient,
476
- response,
477
- };
478
- });
784
+ if (options.includeImmutabilityPolicy) {
785
+ include.push("immutabilitypolicy");
479
786
  }
480
- /**
481
- * Marks the specified blob or snapshot for deletion. The blob is later deleted
482
- * during garbage collection. Note that in order to delete a blob, you must delete
483
- * all of its snapshots. You can delete both at the same time with the Delete
484
- * Blob operation.
485
- * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
486
- *
487
- * @param blobName -
488
- * @param options - Options to Blob Delete operation.
489
- * @returns Block blob deletion response data.
490
- */
491
- async deleteBlob(blobName, options = {}) {
492
- return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => {
493
- let blobClient = this.getBlobClient(blobName);
494
- if (options.versionId) {
495
- blobClient = blobClient.withVersion(options.versionId);
496
- }
497
- return blobClient.delete(updatedOptions);
498
- });
787
+ if (options.includeLegalHold) {
788
+ include.push("legalhold");
499
789
  }
500
- /**
501
- * listBlobFlatSegment returns a single segment of blobs starting from the
502
- * specified Marker. Use an empty Marker to start enumeration from the beginning.
503
- * After getting a segment, process it, and then call listBlobsFlatSegment again
504
- * (passing the the previously-returned Marker) to get the next segment.
505
- * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
506
- *
507
- * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
508
- * @param options - Options to Container List Blob Flat Segment operation.
509
- */
510
- async listBlobFlatSegment(marker, options = {}) {
511
- return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => {
512
- const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobFlatSegment({
513
- marker,
514
- ...options,
515
- tracingOptions: updatedOptions.tracingOptions,
516
- }));
517
- const wrappedResponse = {
518
- ...response,
519
- _response: {
520
- ...response._response,
521
- parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobFlat)(response._response.parsedBody),
522
- }, // _response is made non-enumerable
523
- segment: {
524
- ...response.segment,
525
- blobItems: response.segment.blobItems.map((blobItemInternal) => {
526
- const blobItem = {
527
- ...blobItemInternal,
528
- name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name),
529
- tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags),
530
- objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata),
531
- };
532
- return blobItem;
533
- }),
534
- },
535
- };
536
- return wrappedResponse;
537
- });
790
+ if (options.prefix === "") {
791
+ options.prefix = void 0;
538
792
  }
539
- /**
540
- * listBlobHierarchySegment returns a single segment of blobs starting from
541
- * the specified Marker. Use an empty Marker to start enumeration from the
542
- * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment
543
- * again (passing the the previously-returned Marker) to get the next segment.
544
- * @see https://learn.microsoft.com/rest/api/storageservices/list-blobs
545
- *
546
- * @param delimiter - The character or string used to define the virtual hierarchy
547
- * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
548
- * @param options - Options to Container List Blob Hierarchy Segment operation.
549
- */
550
- async listBlobHierarchySegment(delimiter, marker, options = {}) {
551
- return tracing_js_1.tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => {
552
- const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.listBlobHierarchySegment(delimiter, {
553
- marker,
554
- ...options,
555
- tracingOptions: updatedOptions.tracingOptions,
556
- }));
557
- const wrappedResponse = {
558
- ...response,
559
- _response: {
560
- ...response._response,
561
- parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListBlobHierarchy)(response._response.parsedBody),
562
- }, // _response is made non-enumerable
563
- segment: {
564
- ...response.segment,
565
- blobItems: response.segment.blobItems.map((blobItemInternal) => {
566
- const blobItem = {
567
- ...blobItemInternal,
568
- name: (0, utils_common_js_1.BlobNameToString)(blobItemInternal.name),
569
- tags: (0, utils_common_js_1.toTags)(blobItemInternal.blobTags),
570
- objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(blobItemInternal.objectReplicationMetadata),
571
- };
572
- return blobItem;
573
- }),
574
- blobPrefixes: response.segment.blobPrefixes?.map((blobPrefixInternal) => {
575
- const blobPrefix = {
576
- ...blobPrefixInternal,
577
- name: (0, utils_common_js_1.BlobNameToString)(blobPrefixInternal.name),
578
- };
579
- return blobPrefix;
580
- }),
581
- },
582
- };
583
- return wrappedResponse;
793
+ const updatedOptions = {
794
+ ...options,
795
+ ...include.length > 0 ? { include } : {}
796
+ };
797
+ const iter = this.listItems(updatedOptions);
798
+ return {
799
+ /**
800
+ * The next method, part of the iteration protocol
801
+ */
802
+ next() {
803
+ return iter.next();
804
+ },
805
+ /**
806
+ * The connection to the async iterator, part of the iteration protocol
807
+ */
808
+ [Symbol.asyncIterator]() {
809
+ return this;
810
+ },
811
+ /**
812
+ * Return an AsyncIterableIterator that works a page at a time
813
+ */
814
+ byPage: (settings = {}) => {
815
+ return this.listSegments(settings.continuationToken, {
816
+ maxPageSize: settings.maxPageSize,
817
+ ...updatedOptions
584
818
  });
819
+ }
820
+ };
821
+ }
822
+ /**
823
+ * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse
824
+ *
825
+ * @param delimiter - The character or string used to define the virtual hierarchy
826
+ * @param marker - A string value that identifies the portion of
827
+ * the list of blobs to be returned with the next listing operation. The
828
+ * operation returns the ContinuationToken value within the response body if the
829
+ * listing operation did not return all blobs remaining to be listed
830
+ * with the current page. The ContinuationToken value can be used as the value for
831
+ * the marker parameter in a subsequent call to request the next page of list
832
+ * items. The marker value is opaque to the client.
833
+ * @param options - Options to list blobs operation.
834
+ */
835
+ async *listHierarchySegments(delimiter, marker, options = {}) {
836
+ let listBlobsHierarchySegmentResponse;
837
+ if (!!marker || marker === void 0) {
838
+ do {
839
+ listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(
840
+ delimiter,
841
+ marker,
842
+ options
843
+ );
844
+ marker = listBlobsHierarchySegmentResponse.continuationToken;
845
+ yield await listBlobsHierarchySegmentResponse;
846
+ } while (marker);
585
847
  }
586
- /**
587
- * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse
588
- *
589
- * @param marker - A string value that identifies the portion of
590
- * the list of blobs to be returned with the next listing operation. The
591
- * operation returns the ContinuationToken value within the response body if the
592
- * listing operation did not return all blobs remaining to be listed
593
- * with the current page. The ContinuationToken value can be used as the value for
594
- * the marker parameter in a subsequent call to request the next page of list
595
- * items. The marker value is opaque to the client.
596
- * @param options - Options to list blobs operation.
597
- */
598
- async *listSegments(marker, options = {}) {
599
- let listBlobsFlatSegmentResponse;
600
- if (!!marker || marker === undefined) {
601
- do {
602
- listBlobsFlatSegmentResponse = await this.listBlobFlatSegment(marker, options);
603
- marker = listBlobsFlatSegmentResponse.continuationToken;
604
- yield await listBlobsFlatSegmentResponse;
605
- } while (marker);
848
+ }
849
+ /**
850
+ * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects.
851
+ *
852
+ * @param delimiter - The character or string used to define the virtual hierarchy
853
+ * @param options - Options to list blobs operation.
854
+ */
855
+ async *listItemsByHierarchy(delimiter, options = {}) {
856
+ let marker;
857
+ for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(
858
+ delimiter,
859
+ marker,
860
+ options
861
+ )) {
862
+ const segment = listBlobsHierarchySegmentResponse.segment;
863
+ if (segment.blobPrefixes) {
864
+ for (const prefix of segment.blobPrefixes) {
865
+ yield {
866
+ kind: "prefix",
867
+ ...prefix
868
+ };
606
869
  }
870
+ }
871
+ for (const blob of segment.blobItems) {
872
+ yield { kind: "blob", ...blob };
873
+ }
607
874
  }
608
- /**
609
- * Returns an AsyncIterableIterator of {@link BlobItem} objects
610
- *
611
- * @param options - Options to list blobs operation.
612
- */
613
- async *listItems(options = {}) {
614
- let marker;
615
- for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) {
616
- yield* listBlobsFlatSegmentResponse.segment.blobItems;
617
- }
875
+ }
876
+ /**
877
+ * Returns an async iterable iterator to list all the blobs by hierarchy.
878
+ * under the specified account.
879
+ *
880
+ * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages.
881
+ *
882
+ * ```ts snippet:ReadmeSampleListBlobsByHierarchy
883
+ * import { BlobServiceClient } from "@azure/storage-blob";
884
+ * import { DefaultAzureCredential } from "@azure/identity";
885
+ *
886
+ * const account = "<account>";
887
+ * const blobServiceClient = new BlobServiceClient(
888
+ * `https://${account}.blob.core.windows.net`,
889
+ * new DefaultAzureCredential(),
890
+ * );
891
+ *
892
+ * const containerName = "<container name>";
893
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
894
+ *
895
+ * // Example using `for await` syntax
896
+ * let i = 1;
897
+ * const blobs = containerClient.listBlobsByHierarchy("/");
898
+ * for await (const blob of blobs) {
899
+ * if (blob.kind === "prefix") {
900
+ * console.log(`\tBlobPrefix: ${blob.name}`);
901
+ * } else {
902
+ * console.log(`\tBlobItem: name - ${blob.name}`);
903
+ * }
904
+ * }
905
+ *
906
+ * // Example using `iter.next()` syntax
907
+ * i = 1;
908
+ * const iter = containerClient.listBlobsByHierarchy("/");
909
+ * let { value, done } = await iter.next();
910
+ * while (!done) {
911
+ * if (value.kind === "prefix") {
912
+ * console.log(`\tBlobPrefix: ${value.name}`);
913
+ * } else {
914
+ * console.log(`\tBlobItem: name - ${value.name}`);
915
+ * }
916
+ * ({ value, done } = await iter.next());
917
+ * }
918
+ *
919
+ * // Example using `byPage()` syntax
920
+ * i = 1;
921
+ * for await (const page of containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 20 })) {
922
+ * const segment = page.segment;
923
+ * if (segment.blobPrefixes) {
924
+ * for (const prefix of segment.blobPrefixes) {
925
+ * console.log(`\tBlobPrefix: ${prefix.name}`);
926
+ * }
927
+ * }
928
+ * for (const blob of page.segment.blobItems) {
929
+ * console.log(`\tBlobItem: name - ${blob.name}`);
930
+ * }
931
+ * }
932
+ *
933
+ * // Example using paging with a marker
934
+ * i = 1;
935
+ * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 });
936
+ * let response = (await iterator.next()).value;
937
+ * // Prints 2 blob names
938
+ * if (response.blobPrefixes) {
939
+ * for (const prefix of response.blobPrefixes) {
940
+ * console.log(`\tBlobPrefix: ${prefix.name}`);
941
+ * }
942
+ * }
943
+ * if (response.segment.blobItems) {
944
+ * for (const blob of response.segment.blobItems) {
945
+ * console.log(`\tBlobItem: name - ${blob.name}`);
946
+ * }
947
+ * }
948
+ * // Gets next marker
949
+ * let marker = response.continuationToken;
950
+ * // Passing next marker as continuationToken
951
+ * iterator = containerClient
952
+ * .listBlobsByHierarchy("/")
953
+ * .byPage({ continuationToken: marker, maxPageSize: 10 });
954
+ * response = (await iterator.next()).value;
955
+ * // Prints 10 blob names
956
+ * if (response.blobPrefixes) {
957
+ * for (const prefix of response.blobPrefixes) {
958
+ * console.log(`\tBlobPrefix: ${prefix.name}`);
959
+ * }
960
+ * }
961
+ * if (response.segment.blobItems) {
962
+ * for (const blob of response.segment.blobItems) {
963
+ * console.log(`Blob ${i++}: ${blob.name}`);
964
+ * }
965
+ * }
966
+ * ```
967
+ *
968
+ * @param delimiter - The character or string used to define the virtual hierarchy
969
+ * @param options - Options to list blobs operation.
970
+ */
971
+ listBlobsByHierarchy(delimiter, options = {}) {
972
+ if (delimiter === "") {
973
+ throw new RangeError("delimiter should contain one or more characters");
618
974
  }
619
- /**
620
- * Returns an async iterable iterator to list all the blobs
621
- * under the specified account.
622
- *
623
- * .byPage() returns an async iterable iterator to list the blobs in pages.
624
- *
625
- * ```ts snippet:ReadmeSampleListBlobs_Multiple
626
- * import { BlobServiceClient } from "@azure/storage-blob";
627
- * import { DefaultAzureCredential } from "@azure/identity";
628
- *
629
- * const account = "<account>";
630
- * const blobServiceClient = new BlobServiceClient(
631
- * `https://${account}.blob.core.windows.net`,
632
- * new DefaultAzureCredential(),
633
- * );
634
- *
635
- * const containerName = "<container name>";
636
- * const containerClient = blobServiceClient.getContainerClient(containerName);
637
- *
638
- * // Example using `for await` syntax
639
- * let i = 1;
640
- * const blobs = containerClient.listBlobsFlat();
641
- * for await (const blob of blobs) {
642
- * console.log(`Blob ${i++}: ${blob.name}`);
643
- * }
644
- *
645
- * // Example using `iter.next()` syntax
646
- * i = 1;
647
- * const iter = containerClient.listBlobsFlat();
648
- * let { value, done } = await iter.next();
649
- * while (!done) {
650
- * console.log(`Blob ${i++}: ${value.name}`);
651
- * ({ value, done } = await iter.next());
652
- * }
653
- *
654
- * // Example using `byPage()` syntax
655
- * i = 1;
656
- * for await (const page of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) {
657
- * for (const blob of page.segment.blobItems) {
658
- * console.log(`Blob ${i++}: ${blob.name}`);
659
- * }
660
- * }
661
- *
662
- * // Example using paging with a marker
663
- * i = 1;
664
- * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 });
665
- * let response = (await iterator.next()).value;
666
- * // Prints 2 blob names
667
- * if (response.segment.blobItems) {
668
- * for (const blob of response.segment.blobItems) {
669
- * console.log(`Blob ${i++}: ${blob.name}`);
670
- * }
671
- * }
672
- * // Gets next marker
673
- * let marker = response.continuationToken;
674
- * // Passing next marker as continuationToken
675
- * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 });
676
- * response = (await iterator.next()).value;
677
- * // Prints 10 blob names
678
- * if (response.segment.blobItems) {
679
- * for (const blob of response.segment.blobItems) {
680
- * console.log(`Blob ${i++}: ${blob.name}`);
681
- * }
682
- * }
683
- * ```
684
- *
685
- * @param options - Options to list blobs.
686
- * @returns An asyncIterableIterator that supports paging.
687
- */
688
- listBlobsFlat(options = {}) {
689
- const include = [];
690
- if (options.includeCopy) {
691
- include.push("copy");
692
- }
693
- if (options.includeDeleted) {
694
- include.push("deleted");
695
- }
696
- if (options.includeMetadata) {
697
- include.push("metadata");
698
- }
699
- if (options.includeSnapshots) {
700
- include.push("snapshots");
701
- }
702
- if (options.includeVersions) {
703
- include.push("versions");
704
- }
705
- if (options.includeUncommitedBlobs) {
706
- include.push("uncommittedblobs");
707
- }
708
- if (options.includeTags) {
709
- include.push("tags");
710
- }
711
- if (options.includeDeletedWithVersions) {
712
- include.push("deletedwithversions");
713
- }
714
- if (options.includeImmutabilityPolicy) {
715
- include.push("immutabilitypolicy");
716
- }
717
- if (options.includeLegalHold) {
718
- include.push("legalhold");
719
- }
720
- if (options.prefix === "") {
721
- options.prefix = undefined;
722
- }
723
- const updatedOptions = {
724
- ...options,
725
- ...(include.length > 0 ? { include: include } : {}),
726
- };
727
- // AsyncIterableIterator to iterate over blobs
728
- const iter = this.listItems(updatedOptions);
729
- return {
730
- /**
731
- * The next method, part of the iteration protocol
732
- */
733
- next() {
734
- return iter.next();
735
- },
736
- /**
737
- * The connection to the async iterator, part of the iteration protocol
738
- */
739
- [Symbol.asyncIterator]() {
740
- return this;
741
- },
742
- /**
743
- * Return an AsyncIterableIterator that works a page at a time
744
- */
745
- byPage: (settings = {}) => {
746
- return this.listSegments(settings.continuationToken, {
747
- maxPageSize: settings.maxPageSize,
748
- ...updatedOptions,
749
- });
750
- },
751
- };
975
+ const include = [];
976
+ if (options.includeCopy) {
977
+ include.push("copy");
752
978
  }
753
- /**
754
- * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse
755
- *
756
- * @param delimiter - The character or string used to define the virtual hierarchy
757
- * @param marker - A string value that identifies the portion of
758
- * the list of blobs to be returned with the next listing operation. The
759
- * operation returns the ContinuationToken value within the response body if the
760
- * listing operation did not return all blobs remaining to be listed
761
- * with the current page. The ContinuationToken value can be used as the value for
762
- * the marker parameter in a subsequent call to request the next page of list
763
- * items. The marker value is opaque to the client.
764
- * @param options - Options to list blobs operation.
765
- */
766
- async *listHierarchySegments(delimiter, marker, options = {}) {
767
- let listBlobsHierarchySegmentResponse;
768
- if (!!marker || marker === undefined) {
769
- do {
770
- listBlobsHierarchySegmentResponse = await this.listBlobHierarchySegment(delimiter, marker, options);
771
- marker = listBlobsHierarchySegmentResponse.continuationToken;
772
- yield await listBlobsHierarchySegmentResponse;
773
- } while (marker);
774
- }
979
+ if (options.includeDeleted) {
980
+ include.push("deleted");
775
981
  }
776
- /**
777
- * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects.
778
- *
779
- * @param delimiter - The character or string used to define the virtual hierarchy
780
- * @param options - Options to list blobs operation.
781
- */
782
- async *listItemsByHierarchy(delimiter, options = {}) {
783
- let marker;
784
- for await (const listBlobsHierarchySegmentResponse of this.listHierarchySegments(delimiter, marker, options)) {
785
- const segment = listBlobsHierarchySegmentResponse.segment;
786
- if (segment.blobPrefixes) {
787
- for (const prefix of segment.blobPrefixes) {
788
- yield {
789
- kind: "prefix",
790
- ...prefix,
791
- };
792
- }
793
- }
794
- for (const blob of segment.blobItems) {
795
- yield { kind: "blob", ...blob };
796
- }
797
- }
982
+ if (options.includeMetadata) {
983
+ include.push("metadata");
798
984
  }
799
- /**
800
- * Returns an async iterable iterator to list all the blobs by hierarchy.
801
- * under the specified account.
802
- *
803
- * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages.
804
- *
805
- * ```ts snippet:ReadmeSampleListBlobsByHierarchy
806
- * import { BlobServiceClient } from "@azure/storage-blob";
807
- * import { DefaultAzureCredential } from "@azure/identity";
808
- *
809
- * const account = "<account>";
810
- * const blobServiceClient = new BlobServiceClient(
811
- * `https://${account}.blob.core.windows.net`,
812
- * new DefaultAzureCredential(),
813
- * );
814
- *
815
- * const containerName = "<container name>";
816
- * const containerClient = blobServiceClient.getContainerClient(containerName);
817
- *
818
- * // Example using `for await` syntax
819
- * let i = 1;
820
- * const blobs = containerClient.listBlobsByHierarchy("/");
821
- * for await (const blob of blobs) {
822
- * if (blob.kind === "prefix") {
823
- * console.log(`\tBlobPrefix: ${blob.name}`);
824
- * } else {
825
- * console.log(`\tBlobItem: name - ${blob.name}`);
826
- * }
827
- * }
828
- *
829
- * // Example using `iter.next()` syntax
830
- * i = 1;
831
- * const iter = containerClient.listBlobsByHierarchy("/");
832
- * let { value, done } = await iter.next();
833
- * while (!done) {
834
- * if (value.kind === "prefix") {
835
- * console.log(`\tBlobPrefix: ${value.name}`);
836
- * } else {
837
- * console.log(`\tBlobItem: name - ${value.name}`);
838
- * }
839
- * ({ value, done } = await iter.next());
840
- * }
841
- *
842
- * // Example using `byPage()` syntax
843
- * i = 1;
844
- * for await (const page of containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 20 })) {
845
- * const segment = page.segment;
846
- * if (segment.blobPrefixes) {
847
- * for (const prefix of segment.blobPrefixes) {
848
- * console.log(`\tBlobPrefix: ${prefix.name}`);
849
- * }
850
- * }
851
- * for (const blob of page.segment.blobItems) {
852
- * console.log(`\tBlobItem: name - ${blob.name}`);
853
- * }
854
- * }
855
- *
856
- * // Example using paging with a marker
857
- * i = 1;
858
- * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 });
859
- * let response = (await iterator.next()).value;
860
- * // Prints 2 blob names
861
- * if (response.blobPrefixes) {
862
- * for (const prefix of response.blobPrefixes) {
863
- * console.log(`\tBlobPrefix: ${prefix.name}`);
864
- * }
865
- * }
866
- * if (response.segment.blobItems) {
867
- * for (const blob of response.segment.blobItems) {
868
- * console.log(`\tBlobItem: name - ${blob.name}`);
869
- * }
870
- * }
871
- * // Gets next marker
872
- * let marker = response.continuationToken;
873
- * // Passing next marker as continuationToken
874
- * iterator = containerClient
875
- * .listBlobsByHierarchy("/")
876
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
877
- * response = (await iterator.next()).value;
878
- * // Prints 10 blob names
879
- * if (response.blobPrefixes) {
880
- * for (const prefix of response.blobPrefixes) {
881
- * console.log(`\tBlobPrefix: ${prefix.name}`);
882
- * }
883
- * }
884
- * if (response.segment.blobItems) {
885
- * for (const blob of response.segment.blobItems) {
886
- * console.log(`Blob ${i++}: ${blob.name}`);
887
- * }
888
- * }
889
- * ```
890
- *
891
- * @param delimiter - The character or string used to define the virtual hierarchy
892
- * @param options - Options to list blobs operation.
893
- */
894
- listBlobsByHierarchy(delimiter, options = {}) {
895
- if (delimiter === "") {
896
- throw new RangeError("delimiter should contain one or more characters");
897
- }
898
- const include = [];
899
- if (options.includeCopy) {
900
- include.push("copy");
901
- }
902
- if (options.includeDeleted) {
903
- include.push("deleted");
904
- }
905
- if (options.includeMetadata) {
906
- include.push("metadata");
907
- }
908
- if (options.includeSnapshots) {
909
- include.push("snapshots");
910
- }
911
- if (options.includeVersions) {
912
- include.push("versions");
913
- }
914
- if (options.includeUncommitedBlobs) {
915
- include.push("uncommittedblobs");
916
- }
917
- if (options.includeTags) {
918
- include.push("tags");
919
- }
920
- if (options.includeDeletedWithVersions) {
921
- include.push("deletedwithversions");
922
- }
923
- if (options.includeImmutabilityPolicy) {
924
- include.push("immutabilitypolicy");
925
- }
926
- if (options.includeLegalHold) {
927
- include.push("legalhold");
928
- }
929
- if (options.prefix === "") {
930
- options.prefix = undefined;
931
- }
932
- const updatedOptions = {
933
- ...options,
934
- ...(include.length > 0 ? { include: include } : {}),
935
- };
936
- // AsyncIterableIterator to iterate over blob prefixes and blobs
937
- const iter = this.listItemsByHierarchy(delimiter, updatedOptions);
938
- return {
939
- /**
940
- * The next method, part of the iteration protocol
941
- */
942
- async next() {
943
- return iter.next();
944
- },
945
- /**
946
- * The connection to the async iterator, part of the iteration protocol
947
- */
948
- [Symbol.asyncIterator]() {
949
- return this;
950
- },
951
- /**
952
- * Return an AsyncIterableIterator that works a page at a time
953
- */
954
- byPage: (settings = {}) => {
955
- return this.listHierarchySegments(delimiter, settings.continuationToken, {
956
- maxPageSize: settings.maxPageSize,
957
- ...updatedOptions,
958
- });
959
- },
960
- };
985
+ if (options.includeSnapshots) {
986
+ include.push("snapshots");
961
987
  }
962
- /**
963
- * The Filter Blobs operation enables callers to list blobs in the container whose tags
964
- * match a given search expression.
965
- *
966
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
967
- * The given expression must evaluate to true for a blob to be returned in the results.
968
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
969
- * however, only a subset of the OData filter syntax is supported in the Blob service.
970
- * @param marker - A string value that identifies the portion of
971
- * the list of blobs to be returned with the next listing operation. The
972
- * operation returns the continuationToken value within the response body if the
973
- * listing operation did not return all blobs remaining to be listed
974
- * with the current page. The continuationToken value can be used as the value for
975
- * the marker parameter in a subsequent call to request the next page of list
976
- * items. The marker value is opaque to the client.
977
- * @param options - Options to find blobs by tags.
978
- */
979
- async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
980
- return tracing_js_1.tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => {
981
- const response = (0, utils_common_js_1.assertResponse)(await this.containerContext.filterBlobs({
982
- abortSignal: options.abortSignal,
983
- where: tagFilterSqlExpression,
984
- marker,
985
- maxPageSize: options.maxPageSize,
986
- tracingOptions: updatedOptions.tracingOptions,
987
- }));
988
- const wrappedResponse = {
989
- ...response,
990
- _response: response._response, // _response is made non-enumerable
991
- blobs: response.blobs.map((blob) => {
992
- let tagValue = "";
993
- if (blob.tags?.blobTagSet.length === 1) {
994
- tagValue = blob.tags.blobTagSet[0].value;
995
- }
996
- return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue };
997
- }),
998
- };
999
- return wrappedResponse;
1000
- });
988
+ if (options.includeVersions) {
989
+ include.push("versions");
1001
990
  }
1002
- /**
1003
- * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
1004
- *
1005
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1006
- * The given expression must evaluate to true for a blob to be returned in the results.
1007
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1008
- * however, only a subset of the OData filter syntax is supported in the Blob service.
1009
- * @param marker - A string value that identifies the portion of
1010
- * the list of blobs to be returned with the next listing operation. The
1011
- * operation returns the continuationToken value within the response body if the
1012
- * listing operation did not return all blobs remaining to be listed
1013
- * with the current page. The continuationToken value can be used as the value for
1014
- * the marker parameter in a subsequent call to request the next page of list
1015
- * items. The marker value is opaque to the client.
1016
- * @param options - Options to find blobs by tags.
1017
- */
1018
- async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
1019
- let response;
1020
- if (!!marker || marker === undefined) {
1021
- do {
1022
- response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
1023
- response.blobs = response.blobs || [];
1024
- marker = response.continuationToken;
1025
- yield response;
1026
- } while (marker);
1027
- }
991
+ if (options.includeUncommitedBlobs) {
992
+ include.push("uncommittedblobs");
1028
993
  }
1029
- /**
1030
- * Returns an AsyncIterableIterator for blobs.
1031
- *
1032
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1033
- * The given expression must evaluate to true for a blob to be returned in the results.
1034
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1035
- * however, only a subset of the OData filter syntax is supported in the Blob service.
1036
- * @param options - Options to findBlobsByTagsItems.
1037
- */
1038
- async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
1039
- let marker;
1040
- for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
1041
- yield* segment.blobs;
1042
- }
994
+ if (options.includeTags) {
995
+ include.push("tags");
1043
996
  }
1044
- /**
1045
- * Returns an async iterable iterator to find all blobs with specified tag
1046
- * under the specified container.
1047
- *
1048
- * .byPage() returns an async iterable iterator to list the blobs in pages.
1049
- *
1050
- * Example using `for await` syntax:
1051
- *
1052
- * ```ts snippet:ReadmeSampleFindBlobsByTags
1053
- * import { BlobServiceClient } from "@azure/storage-blob";
1054
- * import { DefaultAzureCredential } from "@azure/identity";
1055
- *
1056
- * const account = "<account>";
1057
- * const blobServiceClient = new BlobServiceClient(
1058
- * `https://${account}.blob.core.windows.net`,
1059
- * new DefaultAzureCredential(),
1060
- * );
1061
- *
1062
- * const containerName = "<container name>";
1063
- * const containerClient = blobServiceClient.getContainerClient(containerName);
1064
- *
1065
- * // Example using `for await` syntax
1066
- * let i = 1;
1067
- * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
1068
- * console.log(`Blob ${i++}: ${blob.name}`);
1069
- * }
1070
- *
1071
- * // Example using `iter.next()` syntax
1072
- * i = 1;
1073
- * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
1074
- * let { value, done } = await iter.next();
1075
- * while (!done) {
1076
- * console.log(`Blob ${i++}: ${value.name}`);
1077
- * ({ value, done } = await iter.next());
1078
- * }
1079
- *
1080
- * // Example using `byPage()` syntax
1081
- * i = 1;
1082
- * for await (const page of containerClient
1083
- * .findBlobsByTags("tagkey='tagvalue'")
1084
- * .byPage({ maxPageSize: 20 })) {
1085
- * for (const blob of page.blobs) {
1086
- * console.log(`Blob ${i++}: ${blob.name}`);
1087
- * }
1088
- * }
1089
- *
1090
- * // Example using paging with a marker
1091
- * i = 1;
1092
- * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
1093
- * let response = (await iterator.next()).value;
1094
- * // Prints 2 blob names
1095
- * if (response.blobs) {
1096
- * for (const blob of response.blobs) {
1097
- * console.log(`Blob ${i++}: ${blob.name}`);
1098
- * }
1099
- * }
1100
- * // Gets next marker
1101
- * let marker = response.continuationToken;
1102
- * // Passing next marker as continuationToken
1103
- * iterator = containerClient
1104
- * .findBlobsByTags("tagkey='tagvalue'")
1105
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
1106
- * response = (await iterator.next()).value;
1107
- * // Prints 10 blob names
1108
- * if (response.blobs) {
1109
- * for (const blob of response.blobs) {
1110
- * console.log(`Blob ${i++}: ${blob.name}`);
1111
- * }
1112
- * }
1113
- * ```
1114
- *
1115
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1116
- * The given expression must evaluate to true for a blob to be returned in the results.
1117
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1118
- * however, only a subset of the OData filter syntax is supported in the Blob service.
1119
- * @param options - Options to find blobs by tags.
1120
- */
1121
- findBlobsByTags(tagFilterSqlExpression, options = {}) {
1122
- // AsyncIterableIterator to iterate over blobs
1123
- const listSegmentOptions = {
1124
- ...options,
1125
- };
1126
- const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
1127
- return {
1128
- /**
1129
- * The next method, part of the iteration protocol
1130
- */
1131
- next() {
1132
- return iter.next();
1133
- },
1134
- /**
1135
- * The connection to the async iterator, part of the iteration protocol
1136
- */
1137
- [Symbol.asyncIterator]() {
1138
- return this;
1139
- },
1140
- /**
1141
- * Return an AsyncIterableIterator that works a page at a time
1142
- */
1143
- byPage: (settings = {}) => {
1144
- return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
1145
- maxPageSize: settings.maxPageSize,
1146
- ...listSegmentOptions,
1147
- });
1148
- },
1149
- };
997
+ if (options.includeDeletedWithVersions) {
998
+ include.push("deletedwithversions");
1150
999
  }
1151
- /**
1152
- * The Get Account Information operation returns the sku name and account kind
1153
- * for the specified account.
1154
- * The Get Account Information operation is available on service versions beginning
1155
- * with version 2018-03-28.
1156
- * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
1157
- *
1158
- * @param options - Options to the Service Get Account Info operation.
1159
- * @returns Response data for the Service Get Account Info operation.
1160
- */
1161
- async getAccountInfo(options = {}) {
1162
- return tracing_js_1.tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => {
1163
- return (0, utils_common_js_1.assertResponse)(await this.containerContext.getAccountInfo({
1164
- abortSignal: options.abortSignal,
1165
- tracingOptions: updatedOptions.tracingOptions,
1166
- }));
1167
- });
1000
+ if (options.includeImmutabilityPolicy) {
1001
+ include.push("immutabilitypolicy");
1168
1002
  }
1169
- getContainerNameFromUrl() {
1170
- let containerName;
1171
- try {
1172
- // URL may look like the following
1173
- // "https://myaccount.blob.core.windows.net/mycontainer?sasString";
1174
- // "https://myaccount.blob.core.windows.net/mycontainer";
1175
- // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername`
1176
- // http://localhost:10001/devstoreaccount1/containername
1177
- const parsedUrl = new URL(this.url);
1178
- if (parsedUrl.hostname.split(".")[1] === "blob") {
1179
- // "https://myaccount.blob.core.windows.net/containername".
1180
- // "https://customdomain.com/containername".
1181
- // .getPath() -> /containername
1182
- containerName = parsedUrl.pathname.split("/")[1];
1183
- }
1184
- else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) {
1185
- // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername
1186
- // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername
1187
- // .getPath() -> /devstoreaccount1/containername
1188
- containerName = parsedUrl.pathname.split("/")[2];
1189
- }
1190
- else {
1191
- // "https://customdomain.com/containername".
1192
- // .getPath() -> /containername
1193
- containerName = parsedUrl.pathname.split("/")[1];
1194
- }
1195
- // decode the encoded containerName - to get all the special characters that might be present in it
1196
- containerName = decodeURIComponent(containerName);
1197
- if (!containerName) {
1198
- throw new Error("Provided containerName is invalid.");
1199
- }
1200
- return containerName;
1201
- }
1202
- catch (error) {
1203
- throw new Error("Unable to extract containerName with provided information.");
1204
- }
1003
+ if (options.includeLegalHold) {
1004
+ include.push("legalhold");
1205
1005
  }
1206
- /**
1207
- * Only available for ContainerClient constructed with a shared key credential.
1208
- *
1209
- * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
1210
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
1211
- *
1212
- * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1213
- *
1214
- * @param options - Optional parameters.
1215
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1216
- */
1217
- generateSasUrl(options) {
1218
- return new Promise((resolve) => {
1219
- if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
1220
- throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1221
- }
1222
- const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({
1223
- containerName: this._containerName,
1224
- ...options,
1225
- }, this.credential).toString();
1226
- resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
1006
+ if (options.prefix === "") {
1007
+ options.prefix = void 0;
1008
+ }
1009
+ const updatedOptions = {
1010
+ ...options,
1011
+ ...include.length > 0 ? { include } : {}
1012
+ };
1013
+ const iter = this.listItemsByHierarchy(delimiter, updatedOptions);
1014
+ return {
1015
+ /**
1016
+ * The next method, part of the iteration protocol
1017
+ */
1018
+ async next() {
1019
+ return iter.next();
1020
+ },
1021
+ /**
1022
+ * The connection to the async iterator, part of the iteration protocol
1023
+ */
1024
+ [Symbol.asyncIterator]() {
1025
+ return this;
1026
+ },
1027
+ /**
1028
+ * Return an AsyncIterableIterator that works a page at a time
1029
+ */
1030
+ byPage: (settings = {}) => {
1031
+ return this.listHierarchySegments(delimiter, settings.continuationToken, {
1032
+ maxPageSize: settings.maxPageSize,
1033
+ ...updatedOptions
1227
1034
  });
1035
+ }
1036
+ };
1037
+ }
1038
+ /**
1039
+ * The Filter Blobs operation enables callers to list blobs in the container whose tags
1040
+ * match a given search expression.
1041
+ *
1042
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1043
+ * The given expression must evaluate to true for a blob to be returned in the results.
1044
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1045
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
1046
+ * @param marker - A string value that identifies the portion of
1047
+ * the list of blobs to be returned with the next listing operation. The
1048
+ * operation returns the continuationToken value within the response body if the
1049
+ * listing operation did not return all blobs remaining to be listed
1050
+ * with the current page. The continuationToken value can be used as the value for
1051
+ * the marker parameter in a subsequent call to request the next page of list
1052
+ * items. The marker value is opaque to the client.
1053
+ * @param options - Options to find blobs by tags.
1054
+ */
1055
+ async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
1056
+ return import_tracing.tracingClient.withSpan(
1057
+ "ContainerClient-findBlobsByTagsSegment",
1058
+ options,
1059
+ async (updatedOptions) => {
1060
+ const response = (0, import_utils_common.assertResponse)(
1061
+ await this.containerContext.filterBlobs({
1062
+ abortSignal: options.abortSignal,
1063
+ where: tagFilterSqlExpression,
1064
+ marker,
1065
+ maxPageSize: options.maxPageSize,
1066
+ tracingOptions: updatedOptions.tracingOptions
1067
+ })
1068
+ );
1069
+ const wrappedResponse = {
1070
+ ...response,
1071
+ _response: response._response,
1072
+ // _response is made non-enumerable
1073
+ blobs: response.blobs.map((blob) => {
1074
+ let tagValue = "";
1075
+ if (blob.tags?.blobTagSet.length === 1) {
1076
+ tagValue = blob.tags.blobTagSet[0].value;
1077
+ }
1078
+ return { ...blob, tags: (0, import_utils_common.toTags)(blob.tags), tagValue };
1079
+ })
1080
+ };
1081
+ return wrappedResponse;
1082
+ }
1083
+ );
1084
+ }
1085
+ /**
1086
+ * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
1087
+ *
1088
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1089
+ * The given expression must evaluate to true for a blob to be returned in the results.
1090
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1091
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
1092
+ * @param marker - A string value that identifies the portion of
1093
+ * the list of blobs to be returned with the next listing operation. The
1094
+ * operation returns the continuationToken value within the response body if the
1095
+ * listing operation did not return all blobs remaining to be listed
1096
+ * with the current page. The continuationToken value can be used as the value for
1097
+ * the marker parameter in a subsequent call to request the next page of list
1098
+ * items. The marker value is opaque to the client.
1099
+ * @param options - Options to find blobs by tags.
1100
+ */
1101
+ async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
1102
+ let response;
1103
+ if (!!marker || marker === void 0) {
1104
+ do {
1105
+ response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
1106
+ response.blobs = response.blobs || [];
1107
+ marker = response.continuationToken;
1108
+ yield response;
1109
+ } while (marker);
1228
1110
  }
1229
- /**
1230
- * Only available for ContainerClient constructed with a shared key credential.
1231
- *
1232
- * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
1233
- * based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
1234
- *
1235
- * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1236
- *
1237
- * @param options - Optional parameters.
1238
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1239
- */
1240
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1241
- generateSasStringToSign(options) {
1242
- if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
1243
- throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1244
- }
1245
- return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({
1246
- containerName: this._containerName,
1247
- ...options,
1248
- }, this.credential).stringToSign;
1111
+ }
1112
+ /**
1113
+ * Returns an AsyncIterableIterator for blobs.
1114
+ *
1115
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1116
+ * The given expression must evaluate to true for a blob to be returned in the results.
1117
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1118
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
1119
+ * @param options - Options to findBlobsByTagsItems.
1120
+ */
1121
+ async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
1122
+ let marker;
1123
+ for await (const segment of this.findBlobsByTagsSegments(
1124
+ tagFilterSqlExpression,
1125
+ marker,
1126
+ options
1127
+ )) {
1128
+ yield* segment.blobs;
1249
1129
  }
1250
- /**
1251
- * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
1252
- * and parameters passed in. The SAS is signed by the input user delegation key.
1253
- *
1254
- * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1255
- *
1256
- * @param options - Optional parameters.
1257
- * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1258
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1259
- */
1260
- generateUserDelegationSasUrl(options, userDelegationKey) {
1261
- return new Promise((resolve) => {
1262
- const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({
1263
- containerName: this._containerName,
1264
- ...options,
1265
- }, userDelegationKey, this.accountName).toString();
1266
- resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
1130
+ }
1131
+ /**
1132
+ * Returns an async iterable iterator to find all blobs with specified tag
1133
+ * under the specified container.
1134
+ *
1135
+ * .byPage() returns an async iterable iterator to list the blobs in pages.
1136
+ *
1137
+ * Example using `for await` syntax:
1138
+ *
1139
+ * ```ts snippet:ReadmeSampleFindBlobsByTags
1140
+ * import { BlobServiceClient } from "@azure/storage-blob";
1141
+ * import { DefaultAzureCredential } from "@azure/identity";
1142
+ *
1143
+ * const account = "<account>";
1144
+ * const blobServiceClient = new BlobServiceClient(
1145
+ * `https://${account}.blob.core.windows.net`,
1146
+ * new DefaultAzureCredential(),
1147
+ * );
1148
+ *
1149
+ * const containerName = "<container name>";
1150
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
1151
+ *
1152
+ * // Example using `for await` syntax
1153
+ * let i = 1;
1154
+ * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
1155
+ * console.log(`Blob ${i++}: ${blob.name}`);
1156
+ * }
1157
+ *
1158
+ * // Example using `iter.next()` syntax
1159
+ * i = 1;
1160
+ * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
1161
+ * let { value, done } = await iter.next();
1162
+ * while (!done) {
1163
+ * console.log(`Blob ${i++}: ${value.name}`);
1164
+ * ({ value, done } = await iter.next());
1165
+ * }
1166
+ *
1167
+ * // Example using `byPage()` syntax
1168
+ * i = 1;
1169
+ * for await (const page of containerClient
1170
+ * .findBlobsByTags("tagkey='tagvalue'")
1171
+ * .byPage({ maxPageSize: 20 })) {
1172
+ * for (const blob of page.blobs) {
1173
+ * console.log(`Blob ${i++}: ${blob.name}`);
1174
+ * }
1175
+ * }
1176
+ *
1177
+ * // Example using paging with a marker
1178
+ * i = 1;
1179
+ * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
1180
+ * let response = (await iterator.next()).value;
1181
+ * // Prints 2 blob names
1182
+ * if (response.blobs) {
1183
+ * for (const blob of response.blobs) {
1184
+ * console.log(`Blob ${i++}: ${blob.name}`);
1185
+ * }
1186
+ * }
1187
+ * // Gets next marker
1188
+ * let marker = response.continuationToken;
1189
+ * // Passing next marker as continuationToken
1190
+ * iterator = containerClient
1191
+ * .findBlobsByTags("tagkey='tagvalue'")
1192
+ * .byPage({ continuationToken: marker, maxPageSize: 10 });
1193
+ * response = (await iterator.next()).value;
1194
+ * // Prints 10 blob names
1195
+ * if (response.blobs) {
1196
+ * for (const blob of response.blobs) {
1197
+ * console.log(`Blob ${i++}: ${blob.name}`);
1198
+ * }
1199
+ * }
1200
+ * ```
1201
+ *
1202
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
1203
+ * The given expression must evaluate to true for a blob to be returned in the results.
1204
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
1205
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
1206
+ * @param options - Options to find blobs by tags.
1207
+ */
1208
+ findBlobsByTags(tagFilterSqlExpression, options = {}) {
1209
+ const listSegmentOptions = {
1210
+ ...options
1211
+ };
1212
+ const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
1213
+ return {
1214
+ /**
1215
+ * The next method, part of the iteration protocol
1216
+ */
1217
+ next() {
1218
+ return iter.next();
1219
+ },
1220
+ /**
1221
+ * The connection to the async iterator, part of the iteration protocol
1222
+ */
1223
+ [Symbol.asyncIterator]() {
1224
+ return this;
1225
+ },
1226
+ /**
1227
+ * Return an AsyncIterableIterator that works a page at a time
1228
+ */
1229
+ byPage: (settings = {}) => {
1230
+ return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
1231
+ maxPageSize: settings.maxPageSize,
1232
+ ...listSegmentOptions
1267
1233
  });
1234
+ }
1235
+ };
1236
+ }
1237
+ /**
1238
+ * The Get Account Information operation returns the sku name and account kind
1239
+ * for the specified account.
1240
+ * The Get Account Information operation is available on service versions beginning
1241
+ * with version 2018-03-28.
1242
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
1243
+ *
1244
+ * @param options - Options to the Service Get Account Info operation.
1245
+ * @returns Response data for the Service Get Account Info operation.
1246
+ */
1247
+ async getAccountInfo(options = {}) {
1248
+ return import_tracing.tracingClient.withSpan(
1249
+ "ContainerClient-getAccountInfo",
1250
+ options,
1251
+ async (updatedOptions) => {
1252
+ return (0, import_utils_common.assertResponse)(
1253
+ await this.containerContext.getAccountInfo({
1254
+ abortSignal: options.abortSignal,
1255
+ tracingOptions: updatedOptions.tracingOptions
1256
+ })
1257
+ );
1258
+ }
1259
+ );
1260
+ }
1261
+ getContainerNameFromUrl() {
1262
+ let containerName;
1263
+ try {
1264
+ const parsedUrl = new URL(this.url);
1265
+ if (parsedUrl.hostname.split(".")[1] === "blob") {
1266
+ containerName = parsedUrl.pathname.split("/")[1];
1267
+ } else if ((0, import_utils_common.isIpEndpointStyle)(parsedUrl)) {
1268
+ containerName = parsedUrl.pathname.split("/")[2];
1269
+ } else {
1270
+ containerName = parsedUrl.pathname.split("/")[1];
1271
+ }
1272
+ containerName = decodeURIComponent(containerName);
1273
+ if (!containerName) {
1274
+ throw new Error("Provided containerName is invalid.");
1275
+ }
1276
+ return containerName;
1277
+ } catch (error) {
1278
+ throw new Error("Unable to extract containerName with provided information.");
1268
1279
  }
1269
- /**
1270
- * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
1271
- * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key.
1272
- *
1273
- * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1274
- *
1275
- * @param options - Optional parameters.
1276
- * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1277
- * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1278
- */
1279
- generateUserDelegationSasStringToSign(options, userDelegationKey) {
1280
- return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({
1281
- containerName: this._containerName,
1282
- ...options,
1283
- }, userDelegationKey, this.accountName).stringToSign;
1284
- }
1285
- /**
1286
- * Creates a BlobBatchClient object to conduct batch operations.
1287
- *
1288
- * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
1289
- *
1290
- * @returns A new BlobBatchClient object for this container.
1291
- */
1292
- getBlobBatchClient() {
1293
- return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline);
1280
+ }
1281
+ /**
1282
+ * Only available for ContainerClient constructed with a shared key credential.
1283
+ *
1284
+ * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
1285
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
1286
+ *
1287
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1288
+ *
1289
+ * @param options - Optional parameters.
1290
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1291
+ */
1292
+ generateSasUrl(options) {
1293
+ return new Promise((resolve) => {
1294
+ if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
1295
+ throw new RangeError(
1296
+ "Can only generate the SAS when the client is initialized with a shared key credential"
1297
+ );
1298
+ }
1299
+ const sas = (0, import_BlobSASSignatureValues.generateBlobSASQueryParameters)(
1300
+ {
1301
+ containerName: this._containerName,
1302
+ ...options
1303
+ },
1304
+ this.credential
1305
+ ).toString();
1306
+ resolve((0, import_utils_common.appendToURLQuery)(this.url, sas));
1307
+ });
1308
+ }
1309
+ /**
1310
+ * Only available for ContainerClient constructed with a shared key credential.
1311
+ *
1312
+ * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
1313
+ * based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
1314
+ *
1315
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1316
+ *
1317
+ * @param options - Optional parameters.
1318
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1319
+ */
1320
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1321
+ generateSasStringToSign(options) {
1322
+ if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
1323
+ throw new RangeError(
1324
+ "Can only generate the SAS when the client is initialized with a shared key credential"
1325
+ );
1294
1326
  }
1327
+ return (0, import_BlobSASSignatureValues.generateBlobSASQueryParametersInternal)(
1328
+ {
1329
+ containerName: this._containerName,
1330
+ ...options
1331
+ },
1332
+ this.credential
1333
+ ).stringToSign;
1334
+ }
1335
+ /**
1336
+ * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties
1337
+ * and parameters passed in. The SAS is signed by the input user delegation key.
1338
+ *
1339
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1340
+ *
1341
+ * @param options - Optional parameters.
1342
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1343
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1344
+ */
1345
+ generateUserDelegationSasUrl(options, userDelegationKey) {
1346
+ return new Promise((resolve) => {
1347
+ const sas = (0, import_BlobSASSignatureValues.generateBlobSASQueryParameters)(
1348
+ {
1349
+ containerName: this._containerName,
1350
+ ...options
1351
+ },
1352
+ userDelegationKey,
1353
+ this.accountName
1354
+ ).toString();
1355
+ resolve((0, import_utils_common.appendToURLQuery)(this.url, sas));
1356
+ });
1357
+ }
1358
+ /**
1359
+ * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI
1360
+ * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key.
1361
+ *
1362
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1363
+ *
1364
+ * @param options - Optional parameters.
1365
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1366
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1367
+ */
1368
+ generateUserDelegationSasStringToSign(options, userDelegationKey) {
1369
+ return (0, import_BlobSASSignatureValues.generateBlobSASQueryParametersInternal)(
1370
+ {
1371
+ containerName: this._containerName,
1372
+ ...options
1373
+ },
1374
+ userDelegationKey,
1375
+ this.accountName
1376
+ ).stringToSign;
1377
+ }
1378
+ /**
1379
+ * Creates a BlobBatchClient object to conduct batch operations.
1380
+ *
1381
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
1382
+ *
1383
+ * @returns A new BlobBatchClient object for this container.
1384
+ */
1385
+ getBlobBatchClient() {
1386
+ return new import_BlobBatchClient.BlobBatchClient(this.url, this.pipeline);
1387
+ }
1295
1388
  }
1296
- exports.ContainerClient = ContainerClient;
1297
- //# sourceMappingURL=ContainerClient.js.map
1389
+ // Annotate the CommonJS export names for ESM import in node:
1390
+ 0 && (module.exports = {
1391
+ ContainerClient
1392
+ });