@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,706 +1,806 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlobServiceClient = void 0;
4
- const core_auth_1 = require("@azure/core-auth");
5
- const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
6
- const core_util_1 = require("@azure/core-util");
7
- const Pipeline_js_1 = require("./Pipeline.js");
8
- const ContainerClient_js_1 = require("./ContainerClient.js");
9
- const utils_common_js_1 = require("./utils/utils.common.js");
10
- const storage_common_1 = require("@azure/storage-common");
11
- const utils_common_js_2 = require("./utils/utils.common.js");
12
- const tracing_js_1 = require("./utils/tracing.js");
13
- const BlobBatchClient_js_1 = require("./BlobBatchClient.js");
14
- const StorageClient_js_1 = require("./StorageClient.js");
15
- const AccountSASPermissions_js_1 = require("./sas/AccountSASPermissions.js");
16
- const AccountSASSignatureValues_js_1 = require("./sas/AccountSASSignatureValues.js");
17
- const AccountSASServices_js_1 = require("./sas/AccountSASServices.js");
18
- /**
19
- * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you
20
- * to manipulate blob containers.
21
- */
22
- class BlobServiceClient extends StorageClient_js_1.StorageClient {
23
- /**
24
- * serviceContext provided by protocol layer.
25
- */
26
- serviceContext;
27
- /**
28
- *
29
- * Creates an instance of BlobServiceClient from connection string.
30
- *
31
- * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
32
- * [ Note - Account connection string can only be used in NODE.JS runtime. ]
33
- * Account connection string example -
34
- * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
35
- * SAS connection string example -
36
- * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
37
- * @param options - Optional. Options to configure the HTTP pipeline.
38
- */
39
- static fromConnectionString(connectionString,
40
- // Legacy, no fix for eslint error without breaking. Disable it for this interface.
41
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
42
- options) {
43
- options = options || {};
44
- const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString);
45
- if (extractedCreds.kind === "AccountConnString") {
46
- if (core_util_1.isNodeLike) {
47
- const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
48
- if (!options.proxyOptions) {
49
- options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
50
- }
51
- const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options);
52
- return new BlobServiceClient(extractedCreds.url, pipeline);
53
- }
54
- else {
55
- throw new Error("Account connection string is only supported in Node.js environment");
56
- }
57
- }
58
- else if (extractedCreds.kind === "SASConnString") {
59
- const pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
60
- return new BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
61
- }
62
- else {
63
- throw new Error("Connection string must be either an Account connection string or a SAS connection string");
64
- }
65
- }
66
- constructor(url, credentialOrPipeline,
67
- // Legacy, no fix for eslint error without breaking. Disable it for this interface.
68
- /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
69
- options) {
70
- let pipeline;
71
- if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
72
- pipeline = credentialOrPipeline;
73
- }
74
- else if ((core_util_1.isNodeLike && credentialOrPipeline instanceof storage_common_1.StorageSharedKeyCredential) ||
75
- credentialOrPipeline instanceof storage_common_1.AnonymousCredential ||
76
- (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
77
- pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
78
- }
79
- else {
80
- // The second parameter is undefined. Use anonymous credential
81
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), 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 BlobServiceClient_exports = {};
19
+ __export(BlobServiceClient_exports, {
20
+ BlobServiceClient: () => BlobServiceClient
21
+ });
22
+ module.exports = __toCommonJS(BlobServiceClient_exports);
23
+ var import_core_auth = require("@azure/core-auth");
24
+ var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
25
+ var import_core_util = require("@azure/core-util");
26
+ var import_Pipeline = require("./Pipeline.js");
27
+ var import_ContainerClient = require("./ContainerClient.js");
28
+ var import_utils_common = require("./utils/utils.common.js");
29
+ var import_storage_common = require("@azure/storage-common");
30
+ var import_utils_common2 = require("./utils/utils.common.js");
31
+ var import_tracing = require("./utils/tracing.js");
32
+ var import_BlobBatchClient = require("./BlobBatchClient.js");
33
+ var import_StorageClient = require("./StorageClient.js");
34
+ var import_AccountSASPermissions = require("./sas/AccountSASPermissions.js");
35
+ var import_AccountSASSignatureValues = require("./sas/AccountSASSignatureValues.js");
36
+ var import_AccountSASServices = require("./sas/AccountSASServices.js");
37
+ function isBlobGetUserDelegationKeyParameters(parameter) {
38
+ if (!parameter || typeof parameter !== "object") {
39
+ return false;
40
+ }
41
+ const castParameter = parameter;
42
+ return castParameter.expiresOn instanceof Date;
43
+ }
44
+ class BlobServiceClient extends import_StorageClient.StorageClient {
45
+ /**
46
+ * serviceContext provided by protocol layer.
47
+ */
48
+ serviceContext;
49
+ blobClientConfig;
50
+ /**
51
+ *
52
+ * Creates an instance of BlobServiceClient from connection string.
53
+ *
54
+ * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
55
+ * [ Note - Account connection string can only be used in NODE.JS runtime. ]
56
+ * Account connection string example -
57
+ * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
58
+ * SAS connection string example -
59
+ * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
60
+ * @param options - Optional. Options to configure the HTTP pipeline.
61
+ */
62
+ static fromConnectionString(connectionString, options) {
63
+ options = options || {};
64
+ const extractedCreds = (0, import_utils_common.extractConnectionStringParts)(connectionString);
65
+ if (extractedCreds.kind === "AccountConnString") {
66
+ if (import_core_util.isNodeLike) {
67
+ const sharedKeyCredential = new import_storage_common.StorageSharedKeyCredential(
68
+ extractedCreds.accountName,
69
+ extractedCreds.accountKey
70
+ );
71
+ if (!options.proxyOptions) {
72
+ options.proxyOptions = (0, import_core_rest_pipeline.getDefaultProxySettings)(extractedCreds.proxyUri);
82
73
  }
83
- super(url, pipeline);
84
- this.serviceContext = this.storageClientContext.service;
74
+ const pipeline = (0, import_Pipeline.newPipeline)(sharedKeyCredential, options);
75
+ return new BlobServiceClient(extractedCreds.url, pipeline);
76
+ } else {
77
+ throw new Error("Account connection string is only supported in Node.js environment");
78
+ }
79
+ } else if (extractedCreds.kind === "SASConnString") {
80
+ const pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
81
+ return new BlobServiceClient(
82
+ extractedCreds.url + "?" + extractedCreds.accountSas,
83
+ pipeline,
84
+ options
85
+ );
86
+ } else {
87
+ throw new Error(
88
+ "Connection string must be either an Account connection string or a SAS connection string"
89
+ );
85
90
  }
86
- /**
87
- * Creates a {@link ContainerClient} object
88
- *
89
- * @param containerName - A container name
90
- * @returns A new ContainerClient object for the given container name.
91
- *
92
- * Example usage:
93
- *
94
- * ```ts snippet:BlobServiceClientGetContainerClient
95
- * import { BlobServiceClient } from "@azure/storage-blob";
96
- * import { DefaultAzureCredential } from "@azure/identity";
97
- *
98
- * const account = "<account>";
99
- * const blobServiceClient = new BlobServiceClient(
100
- * `https://${account}.blob.core.windows.net`,
101
- * new DefaultAzureCredential(),
102
- * );
103
- *
104
- * const containerClient = blobServiceClient.getContainerClient("<container name>");
105
- * ```
106
- */
107
- getContainerClient(containerName) {
108
- return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline);
91
+ }
92
+ constructor(url, credentialOrPipeline, options) {
93
+ options = options ?? {};
94
+ let pipeline;
95
+ if ((0, import_Pipeline.isPipelineLike)(credentialOrPipeline)) {
96
+ pipeline = credentialOrPipeline;
97
+ } else if (import_core_util.isNodeLike && credentialOrPipeline instanceof import_storage_common.StorageSharedKeyCredential || credentialOrPipeline instanceof import_storage_common.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrPipeline)) {
98
+ pipeline = (0, import_Pipeline.newPipeline)(credentialOrPipeline, options);
99
+ } else {
100
+ pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common.AnonymousCredential(), options);
109
101
  }
110
- /**
111
- * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
112
- *
113
- * @param containerName - Name of the container to create.
114
- * @param options - Options to configure Container Create operation.
115
- * @returns Container creation response and the corresponding container client.
116
- */
117
- async createContainer(containerName, options = {}) {
118
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => {
119
- const containerClient = this.getContainerClient(containerName);
120
- const containerCreateResponse = await containerClient.create(updatedOptions);
121
- return {
122
- containerClient,
123
- containerCreateResponse,
124
- };
125
- });
102
+ super(url, pipeline);
103
+ this.serviceContext = this.storageClientContext.service;
104
+ this.blobClientConfig = options;
105
+ }
106
+ /**
107
+ * Creates a {@link ContainerClient} object
108
+ *
109
+ * @param containerName - A container name
110
+ * @returns A new ContainerClient object for the given container name.
111
+ *
112
+ * Example usage:
113
+ *
114
+ * ```ts snippet:BlobServiceClientGetContainerClient
115
+ * import { BlobServiceClient } from "@azure/storage-blob";
116
+ * import { DefaultAzureCredential } from "@azure/identity";
117
+ *
118
+ * const account = "<account>";
119
+ * const blobServiceClient = new BlobServiceClient(
120
+ * `https://${account}.blob.core.windows.net`,
121
+ * new DefaultAzureCredential(),
122
+ * );
123
+ *
124
+ * const containerClient = blobServiceClient.getContainerClient("<container name>");
125
+ * ```
126
+ */
127
+ getContainerClient(containerName) {
128
+ return new import_ContainerClient.ContainerClient(
129
+ (0, import_utils_common.appendToURLPath)(this.url, encodeURIComponent(containerName)),
130
+ this.pipeline,
131
+ this.blobClientConfig
132
+ );
133
+ }
134
+ /**
135
+ * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
136
+ *
137
+ * @param containerName - Name of the container to create.
138
+ * @param options - Options to configure Container Create operation.
139
+ * @returns Container creation response and the corresponding container client.
140
+ */
141
+ async createContainer(containerName, options = {}) {
142
+ return import_tracing.tracingClient.withSpan(
143
+ "BlobServiceClient-createContainer",
144
+ options,
145
+ async (updatedOptions) => {
146
+ const containerClient = this.getContainerClient(containerName);
147
+ const containerCreateResponse = await containerClient.create(updatedOptions);
148
+ return {
149
+ containerClient,
150
+ containerCreateResponse
151
+ };
152
+ }
153
+ );
154
+ }
155
+ /**
156
+ * Deletes a Blob container.
157
+ *
158
+ * @param containerName - Name of the container to delete.
159
+ * @param options - Options to configure Container Delete operation.
160
+ * @returns Container deletion response.
161
+ */
162
+ async deleteContainer(containerName, options = {}) {
163
+ return import_tracing.tracingClient.withSpan(
164
+ "BlobServiceClient-deleteContainer",
165
+ options,
166
+ async (updatedOptions) => {
167
+ const containerClient = this.getContainerClient(containerName);
168
+ return containerClient.delete(updatedOptions);
169
+ }
170
+ );
171
+ }
172
+ /**
173
+ * Restore a previously deleted Blob container.
174
+ * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
175
+ *
176
+ * @param deletedContainerName - Name of the previously deleted container.
177
+ * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container.
178
+ * @param options - Options to configure Container Restore operation.
179
+ * @returns Container deletion response.
180
+ */
181
+ async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) {
182
+ return import_tracing.tracingClient.withSpan(
183
+ "BlobServiceClient-undeleteContainer",
184
+ options,
185
+ async (updatedOptions) => {
186
+ const containerClient = this.getContainerClient(
187
+ options.destinationContainerName || deletedContainerName
188
+ );
189
+ const containerContext = containerClient["storageClientContext"].container;
190
+ const containerUndeleteResponse = (0, import_utils_common2.assertResponse)(
191
+ await containerContext.restore({
192
+ deletedContainerName,
193
+ deletedContainerVersion,
194
+ tracingOptions: updatedOptions.tracingOptions
195
+ })
196
+ );
197
+ return { containerClient, containerUndeleteResponse };
198
+ }
199
+ );
200
+ }
201
+ /**
202
+ * Gets the properties of a storage account’s Blob service, including properties
203
+ * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
204
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
205
+ *
206
+ * @param options - Options to the Service Get Properties operation.
207
+ * @returns Response data for the Service Get Properties operation.
208
+ */
209
+ async getProperties(options = {}) {
210
+ return import_tracing.tracingClient.withSpan(
211
+ "BlobServiceClient-getProperties",
212
+ options,
213
+ async (updatedOptions) => {
214
+ return (0, import_utils_common2.assertResponse)(
215
+ await this.serviceContext.getProperties({
216
+ abortSignal: options.abortSignal,
217
+ tracingOptions: updatedOptions.tracingOptions
218
+ })
219
+ );
220
+ }
221
+ );
222
+ }
223
+ /**
224
+ * Sets properties for a storage account’s Blob service endpoint, including properties
225
+ * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
226
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
227
+ *
228
+ * @param properties -
229
+ * @param options - Options to the Service Set Properties operation.
230
+ * @returns Response data for the Service Set Properties operation.
231
+ */
232
+ async setProperties(properties, options = {}) {
233
+ return import_tracing.tracingClient.withSpan(
234
+ "BlobServiceClient-setProperties",
235
+ options,
236
+ async (updatedOptions) => {
237
+ return (0, import_utils_common2.assertResponse)(
238
+ await this.serviceContext.setProperties(properties, {
239
+ abortSignal: options.abortSignal,
240
+ tracingOptions: updatedOptions.tracingOptions
241
+ })
242
+ );
243
+ }
244
+ );
245
+ }
246
+ /**
247
+ * Retrieves statistics related to replication for the Blob service. It is only
248
+ * available on the secondary location endpoint when read-access geo-redundant
249
+ * replication is enabled for the storage account.
250
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
251
+ *
252
+ * @param options - Options to the Service Get Statistics operation.
253
+ * @returns Response data for the Service Get Statistics operation.
254
+ */
255
+ async getStatistics(options = {}) {
256
+ return import_tracing.tracingClient.withSpan(
257
+ "BlobServiceClient-getStatistics",
258
+ options,
259
+ async (updatedOptions) => {
260
+ return (0, import_utils_common2.assertResponse)(
261
+ await this.serviceContext.getStatistics({
262
+ abortSignal: options.abortSignal,
263
+ tracingOptions: updatedOptions.tracingOptions
264
+ })
265
+ );
266
+ }
267
+ );
268
+ }
269
+ /**
270
+ * The Get Account Information operation returns the sku name and account kind
271
+ * for the specified account.
272
+ * The Get Account Information operation is available on service versions beginning
273
+ * with version 2018-03-28.
274
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
275
+ *
276
+ * @param options - Options to the Service Get Account Info operation.
277
+ * @returns Response data for the Service Get Account Info operation.
278
+ */
279
+ async getAccountInfo(options = {}) {
280
+ return import_tracing.tracingClient.withSpan(
281
+ "BlobServiceClient-getAccountInfo",
282
+ options,
283
+ async (updatedOptions) => {
284
+ return (0, import_utils_common2.assertResponse)(
285
+ await this.serviceContext.getAccountInfo({
286
+ abortSignal: options.abortSignal,
287
+ tracingOptions: updatedOptions.tracingOptions
288
+ })
289
+ );
290
+ }
291
+ );
292
+ }
293
+ /**
294
+ * Returns a list of the containers under the specified account.
295
+ * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
296
+ *
297
+ * @param marker - A string value that identifies the portion of
298
+ * the list of containers to be returned with the next listing operation. The
299
+ * operation returns the continuationToken value within the response body if the
300
+ * listing operation did not return all containers remaining to be listed
301
+ * with the current page. The continuationToken value can be used as the value for
302
+ * the marker parameter in a subsequent call to request the next page of list
303
+ * items. The marker value is opaque to the client.
304
+ * @param options - Options to the Service List Container Segment operation.
305
+ * @returns Response data for the Service List Container Segment operation.
306
+ */
307
+ async listContainersSegment(marker, options = {}) {
308
+ return import_tracing.tracingClient.withSpan(
309
+ "BlobServiceClient-listContainersSegment",
310
+ options,
311
+ async (updatedOptions) => {
312
+ return (0, import_utils_common2.assertResponse)(
313
+ await this.serviceContext.listContainersSegment({
314
+ abortSignal: options.abortSignal,
315
+ marker,
316
+ ...options,
317
+ include: typeof options.include === "string" ? [options.include] : options.include,
318
+ tracingOptions: updatedOptions.tracingOptions
319
+ })
320
+ );
321
+ }
322
+ );
323
+ }
324
+ /**
325
+ * The Filter Blobs operation enables callers to list blobs across all containers whose tags
326
+ * match a given search expression. Filter blobs searches across all containers within a
327
+ * storage account but can be scoped within the expression to a single container.
328
+ *
329
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
330
+ * The given expression must evaluate to true for a blob to be returned in the results.
331
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
332
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
333
+ * @param marker - A string value that identifies the portion of
334
+ * the list of blobs to be returned with the next listing operation. The
335
+ * operation returns the continuationToken value within the response body if the
336
+ * listing operation did not return all blobs remaining to be listed
337
+ * with the current page. The continuationToken value can be used as the value for
338
+ * the marker parameter in a subsequent call to request the next page of list
339
+ * items. The marker value is opaque to the client.
340
+ * @param options - Options to find blobs by tags.
341
+ */
342
+ async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
343
+ return import_tracing.tracingClient.withSpan(
344
+ "BlobServiceClient-findBlobsByTagsSegment",
345
+ options,
346
+ async (updatedOptions) => {
347
+ const response = (0, import_utils_common2.assertResponse)(
348
+ await this.serviceContext.filterBlobs({
349
+ abortSignal: options.abortSignal,
350
+ where: tagFilterSqlExpression,
351
+ marker,
352
+ maxPageSize: options.maxPageSize,
353
+ tracingOptions: updatedOptions.tracingOptions
354
+ })
355
+ );
356
+ const wrappedResponse = {
357
+ ...response,
358
+ _response: response._response,
359
+ // _response is made non-enumerable
360
+ blobs: response.blobs.map((blob) => {
361
+ let tagValue = "";
362
+ if (blob.tags?.blobTagSet.length === 1) {
363
+ tagValue = blob.tags.blobTagSet[0].value;
364
+ }
365
+ return { ...blob, tags: (0, import_utils_common.toTags)(blob.tags), tagValue };
366
+ })
367
+ };
368
+ return wrappedResponse;
369
+ }
370
+ );
371
+ }
372
+ /**
373
+ * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse.
374
+ *
375
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
376
+ * The given expression must evaluate to true for a blob to be returned in the results.
377
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
378
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
379
+ * @param marker - A string value that identifies the portion of
380
+ * the list of blobs to be returned with the next listing operation. The
381
+ * operation returns the continuationToken value within the response body if the
382
+ * listing operation did not return all blobs remaining to be listed
383
+ * with the current page. The continuationToken value can be used as the value for
384
+ * the marker parameter in a subsequent call to request the next page of list
385
+ * items. The marker value is opaque to the client.
386
+ * @param options - Options to find blobs by tags.
387
+ */
388
+ async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
389
+ let response;
390
+ if (!!marker || marker === void 0) {
391
+ do {
392
+ response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
393
+ response.blobs = response.blobs || [];
394
+ marker = response.continuationToken;
395
+ yield response;
396
+ } while (marker);
126
397
  }
127
- /**
128
- * Deletes a Blob container.
129
- *
130
- * @param containerName - Name of the container to delete.
131
- * @param options - Options to configure Container Delete operation.
132
- * @returns Container deletion response.
133
- */
134
- async deleteContainer(containerName, options = {}) {
135
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => {
136
- const containerClient = this.getContainerClient(containerName);
137
- return containerClient.delete(updatedOptions);
138
- });
398
+ }
399
+ /**
400
+ * Returns an AsyncIterableIterator for blobs.
401
+ *
402
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
403
+ * The given expression must evaluate to true for a blob to be returned in the results.
404
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
405
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
406
+ * @param options - Options to findBlobsByTagsItems.
407
+ */
408
+ async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
409
+ let marker;
410
+ for await (const segment of this.findBlobsByTagsSegments(
411
+ tagFilterSqlExpression,
412
+ marker,
413
+ options
414
+ )) {
415
+ yield* segment.blobs;
139
416
  }
140
- /**
141
- * Restore a previously deleted Blob container.
142
- * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
143
- *
144
- * @param deletedContainerName - Name of the previously deleted container.
145
- * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container.
146
- * @param options - Options to configure Container Restore operation.
147
- * @returns Container deletion response.
148
- */
149
- async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) {
150
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => {
151
- const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName);
152
- // Hack to access a protected member.
153
- const containerContext = containerClient["storageClientContext"].container;
154
- const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({
155
- deletedContainerName,
156
- deletedContainerVersion,
157
- tracingOptions: updatedOptions.tracingOptions,
158
- }));
159
- return { containerClient, containerUndeleteResponse };
417
+ }
418
+ /**
419
+ * Returns an async iterable iterator to find all blobs with specified tag
420
+ * under the specified account.
421
+ *
422
+ * .byPage() returns an async iterable iterator to list the blobs in pages.
423
+ *
424
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
425
+ *
426
+ * ```ts snippet:BlobServiceClientFindBlobsByTags
427
+ * import { BlobServiceClient } from "@azure/storage-blob";
428
+ * import { DefaultAzureCredential } from "@azure/identity";
429
+ *
430
+ * const account = "<account>";
431
+ * const blobServiceClient = new BlobServiceClient(
432
+ * `https://${account}.blob.core.windows.net`,
433
+ * new DefaultAzureCredential(),
434
+ * );
435
+ *
436
+ * // Use for await to iterate the blobs
437
+ * let i = 1;
438
+ * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) {
439
+ * console.log(`Blob ${i++}: ${blob.name}`);
440
+ * }
441
+ *
442
+ * // Use iter.next() to iterate the blobs
443
+ * i = 1;
444
+ * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'");
445
+ * let { value, done } = await iter.next();
446
+ * while (!done) {
447
+ * console.log(`Blob ${i++}: ${value.name}`);
448
+ * ({ value, done } = await iter.next());
449
+ * }
450
+ *
451
+ * // Use byPage() to iterate the blobs
452
+ * i = 1;
453
+ * for await (const page of blobServiceClient
454
+ * .findBlobsByTags("tagkey='tagvalue'")
455
+ * .byPage({ maxPageSize: 20 })) {
456
+ * for (const blob of page.blobs) {
457
+ * console.log(`Blob ${i++}: ${blob.name}`);
458
+ * }
459
+ * }
460
+ *
461
+ * // Use paging with a marker
462
+ * i = 1;
463
+ * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
464
+ * let response = (await iterator.next()).value;
465
+ * // Prints 2 blob names
466
+ * if (response.blobs) {
467
+ * for (const blob of response.blobs) {
468
+ * console.log(`Blob ${i++}: ${blob.name}`);
469
+ * }
470
+ * }
471
+ * // Gets next marker
472
+ * let marker = response.continuationToken;
473
+ * // Passing next marker as continuationToken
474
+ * iterator = blobServiceClient
475
+ * .findBlobsByTags("tagkey='tagvalue'")
476
+ * .byPage({ continuationToken: marker, maxPageSize: 10 });
477
+ * response = (await iterator.next()).value;
478
+ *
479
+ * // Prints blob names
480
+ * if (response.blobs) {
481
+ * for (const blob of response.blobs) {
482
+ * console.log(`Blob ${i++}: ${blob.name}`);
483
+ * }
484
+ * }
485
+ * ```
486
+ *
487
+ * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
488
+ * The given expression must evaluate to true for a blob to be returned in the results.
489
+ * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
490
+ * however, only a subset of the OData filter syntax is supported in the Blob service.
491
+ * @param options - Options to find blobs by tags.
492
+ */
493
+ findBlobsByTags(tagFilterSqlExpression, options = {}) {
494
+ const listSegmentOptions = {
495
+ ...options
496
+ };
497
+ const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
498
+ return {
499
+ /**
500
+ * The next method, part of the iteration protocol
501
+ */
502
+ next() {
503
+ return iter.next();
504
+ },
505
+ /**
506
+ * The connection to the async iterator, part of the iteration protocol
507
+ */
508
+ [Symbol.asyncIterator]() {
509
+ return this;
510
+ },
511
+ /**
512
+ * Return an AsyncIterableIterator that works a page at a time
513
+ */
514
+ byPage: (settings = {}) => {
515
+ return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
516
+ maxPageSize: settings.maxPageSize,
517
+ ...listSegmentOptions
160
518
  });
519
+ }
520
+ };
521
+ }
522
+ /**
523
+ * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses
524
+ *
525
+ * @param marker - A string value that identifies the portion of
526
+ * the list of containers to be returned with the next listing operation. The
527
+ * operation returns the continuationToken value within the response body if the
528
+ * listing operation did not return all containers remaining to be listed
529
+ * with the current page. The continuationToken value can be used as the value for
530
+ * the marker parameter in a subsequent call to request the next page of list
531
+ * items. The marker value is opaque to the client.
532
+ * @param options - Options to list containers operation.
533
+ */
534
+ async *listSegments(marker, options = {}) {
535
+ let listContainersSegmentResponse;
536
+ if (!!marker || marker === void 0) {
537
+ do {
538
+ listContainersSegmentResponse = await this.listContainersSegment(marker, options);
539
+ listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || [];
540
+ marker = listContainersSegmentResponse.continuationToken;
541
+ yield await listContainersSegmentResponse;
542
+ } while (marker);
161
543
  }
162
- /**
163
- * Gets the properties of a storage account’s Blob service, including properties
164
- * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
165
- * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
166
- *
167
- * @param options - Options to the Service Get Properties operation.
168
- * @returns Response data for the Service Get Properties operation.
169
- */
170
- async getProperties(options = {}) {
171
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => {
172
- return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getProperties({
173
- abortSignal: options.abortSignal,
174
- tracingOptions: updatedOptions.tracingOptions,
175
- }));
176
- });
544
+ }
545
+ /**
546
+ * Returns an AsyncIterableIterator for Container Items
547
+ *
548
+ * @param options - Options to list containers operation.
549
+ */
550
+ async *listItems(options = {}) {
551
+ let marker;
552
+ for await (const segment of this.listSegments(marker, options)) {
553
+ yield* segment.containerItems;
177
554
  }
178
- /**
179
- * Sets properties for a storage account’s Blob service endpoint, including properties
180
- * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
181
- * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
182
- *
183
- * @param properties -
184
- * @param options - Options to the Service Set Properties operation.
185
- * @returns Response data for the Service Set Properties operation.
186
- */
187
- async setProperties(properties, options = {}) {
188
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => {
189
- return (0, utils_common_js_2.assertResponse)(await this.serviceContext.setProperties(properties, {
190
- abortSignal: options.abortSignal,
191
- tracingOptions: updatedOptions.tracingOptions,
192
- }));
193
- });
555
+ }
556
+ /**
557
+ * Returns an async iterable iterator to list all the containers
558
+ * under the specified account.
559
+ *
560
+ * .byPage() returns an async iterable iterator to list the containers in pages.
561
+ *
562
+ * ```ts snippet:BlobServiceClientListContainers
563
+ * import { BlobServiceClient } from "@azure/storage-blob";
564
+ * import { DefaultAzureCredential } from "@azure/identity";
565
+ *
566
+ * const account = "<account>";
567
+ * const blobServiceClient = new BlobServiceClient(
568
+ * `https://${account}.blob.core.windows.net`,
569
+ * new DefaultAzureCredential(),
570
+ * );
571
+ *
572
+ * // Use for await to iterate the containers
573
+ * let i = 1;
574
+ * for await (const container of blobServiceClient.listContainers()) {
575
+ * console.log(`Container ${i++}: ${container.name}`);
576
+ * }
577
+ *
578
+ * // Use iter.next() to iterate the containers
579
+ * i = 1;
580
+ * const iter = blobServiceClient.listContainers();
581
+ * let { value, done } = await iter.next();
582
+ * while (!done) {
583
+ * console.log(`Container ${i++}: ${value.name}`);
584
+ * ({ value, done } = await iter.next());
585
+ * }
586
+ *
587
+ * // Use byPage() to iterate the containers
588
+ * i = 1;
589
+ * for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {
590
+ * for (const container of page.containerItems) {
591
+ * console.log(`Container ${i++}: ${container.name}`);
592
+ * }
593
+ * }
594
+ *
595
+ * // Use paging with a marker
596
+ * i = 1;
597
+ * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });
598
+ * let response = (await iterator.next()).value;
599
+ *
600
+ * // Prints 2 container names
601
+ * if (response.containerItems) {
602
+ * for (const container of response.containerItems) {
603
+ * console.log(`Container ${i++}: ${container.name}`);
604
+ * }
605
+ * }
606
+ *
607
+ * // Gets next marker
608
+ * let marker = response.continuationToken;
609
+ * // Passing next marker as continuationToken
610
+ * iterator = blobServiceClient
611
+ * .listContainers()
612
+ * .byPage({ continuationToken: marker, maxPageSize: 10 });
613
+ * response = (await iterator.next()).value;
614
+ *
615
+ * // Prints 10 container names
616
+ * if (response.containerItems) {
617
+ * for (const container of response.containerItems) {
618
+ * console.log(`Container ${i++}: ${container.name}`);
619
+ * }
620
+ * }
621
+ * ```
622
+ *
623
+ * @param options - Options to list containers.
624
+ * @returns An asyncIterableIterator that supports paging.
625
+ */
626
+ listContainers(options = {}) {
627
+ if (options.prefix === "") {
628
+ options.prefix = void 0;
194
629
  }
195
- /**
196
- * Retrieves statistics related to replication for the Blob service. It is only
197
- * available on the secondary location endpoint when read-access geo-redundant
198
- * replication is enabled for the storage account.
199
- * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
200
- *
201
- * @param options - Options to the Service Get Statistics operation.
202
- * @returns Response data for the Service Get Statistics operation.
203
- */
204
- async getStatistics(options = {}) {
205
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => {
206
- return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getStatistics({
207
- abortSignal: options.abortSignal,
208
- tracingOptions: updatedOptions.tracingOptions,
209
- }));
210
- });
630
+ const include = [];
631
+ if (options.includeDeleted) {
632
+ include.push("deleted");
211
633
  }
212
- /**
213
- * The Get Account Information operation returns the sku name and account kind
214
- * for the specified account.
215
- * The Get Account Information operation is available on service versions beginning
216
- * with version 2018-03-28.
217
- * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
218
- *
219
- * @param options - Options to the Service Get Account Info operation.
220
- * @returns Response data for the Service Get Account Info operation.
221
- */
222
- async getAccountInfo(options = {}) {
223
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => {
224
- return (0, utils_common_js_2.assertResponse)(await this.serviceContext.getAccountInfo({
225
- abortSignal: options.abortSignal,
226
- tracingOptions: updatedOptions.tracingOptions,
227
- }));
228
- });
634
+ if (options.includeMetadata) {
635
+ include.push("metadata");
229
636
  }
230
- /**
231
- * Returns a list of the containers under the specified account.
232
- * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
233
- *
234
- * @param marker - A string value that identifies the portion of
235
- * the list of containers to be returned with the next listing operation. The
236
- * operation returns the continuationToken value within the response body if the
237
- * listing operation did not return all containers remaining to be listed
238
- * with the current page. The continuationToken value can be used as the value for
239
- * the marker parameter in a subsequent call to request the next page of list
240
- * items. The marker value is opaque to the client.
241
- * @param options - Options to the Service List Container Segment operation.
242
- * @returns Response data for the Service List Container Segment operation.
243
- */
244
- async listContainersSegment(marker, options = {}) {
245
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => {
246
- return (0, utils_common_js_2.assertResponse)(await this.serviceContext.listContainersSegment({
247
- abortSignal: options.abortSignal,
248
- marker,
249
- ...options,
250
- include: typeof options.include === "string" ? [options.include] : options.include,
251
- tracingOptions: updatedOptions.tracingOptions,
252
- }));
253
- });
637
+ if (options.includeSystem) {
638
+ include.push("system");
254
639
  }
255
- /**
256
- * The Filter Blobs operation enables callers to list blobs across all containers whose tags
257
- * match a given search expression. Filter blobs searches across all containers within a
258
- * storage account but can be scoped within the expression to a single container.
259
- *
260
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
261
- * The given expression must evaluate to true for a blob to be returned in the results.
262
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
263
- * however, only a subset of the OData filter syntax is supported in the Blob service.
264
- * @param marker - A string value that identifies the portion of
265
- * the list of blobs to be returned with the next listing operation. The
266
- * operation returns the continuationToken value within the response body if the
267
- * listing operation did not return all blobs remaining to be listed
268
- * with the current page. The continuationToken value can be used as the value for
269
- * the marker parameter in a subsequent call to request the next page of list
270
- * items. The marker value is opaque to the client.
271
- * @param options - Options to find blobs by tags.
272
- */
273
- async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
274
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => {
275
- const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.filterBlobs({
276
- abortSignal: options.abortSignal,
277
- where: tagFilterSqlExpression,
278
- marker,
279
- maxPageSize: options.maxPageSize,
280
- tracingOptions: updatedOptions.tracingOptions,
281
- }));
282
- const wrappedResponse = {
283
- ...response,
284
- _response: response._response, // _response is made non-enumerable
285
- blobs: response.blobs.map((blob) => {
286
- let tagValue = "";
287
- if (blob.tags?.blobTagSet.length === 1) {
288
- tagValue = blob.tags.blobTagSet[0].value;
289
- }
290
- return { ...blob, tags: (0, utils_common_js_1.toTags)(blob.tags), tagValue };
291
- }),
292
- };
293
- return wrappedResponse;
640
+ const listSegmentOptions = {
641
+ ...options,
642
+ ...include.length > 0 ? { include } : {}
643
+ };
644
+ const iter = this.listItems(listSegmentOptions);
645
+ return {
646
+ /**
647
+ * The next method, part of the iteration protocol
648
+ */
649
+ next() {
650
+ return iter.next();
651
+ },
652
+ /**
653
+ * The connection to the async iterator, part of the iteration protocol
654
+ */
655
+ [Symbol.asyncIterator]() {
656
+ return this;
657
+ },
658
+ /**
659
+ * Return an AsyncIterableIterator that works a page at a time
660
+ */
661
+ byPage: (settings = {}) => {
662
+ return this.listSegments(settings.continuationToken, {
663
+ maxPageSize: settings.maxPageSize,
664
+ ...listSegmentOptions
294
665
  });
666
+ }
667
+ };
668
+ }
669
+ async getUserDelegationKey(startsOnOrParam, expiresOnOrOption, options = {}) {
670
+ let startsOn = startsOnOrParam;
671
+ let expiresOn = expiresOnOrOption;
672
+ let userDelegationTid = void 0;
673
+ let getUserDelegationKeyOptions = options;
674
+ if (isBlobGetUserDelegationKeyParameters(startsOnOrParam)) {
675
+ startsOn = startsOnOrParam.startsOn;
676
+ expiresOn = startsOnOrParam.expiresOn;
677
+ userDelegationTid = startsOnOrParam.delegatedUserTenantId;
678
+ getUserDelegationKeyOptions = expiresOnOrOption;
679
+ getUserDelegationKeyOptions = getUserDelegationKeyOptions ?? {};
295
680
  }
296
- /**
297
- * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse.
298
- *
299
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
300
- * The given expression must evaluate to true for a blob to be returned in the results.
301
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
302
- * however, only a subset of the OData filter syntax is supported in the Blob service.
303
- * @param marker - A string value that identifies the portion of
304
- * the list of blobs to be returned with the next listing operation. The
305
- * operation returns the continuationToken value within the response body if the
306
- * listing operation did not return all blobs remaining to be listed
307
- * with the current page. The continuationToken value can be used as the value for
308
- * the marker parameter in a subsequent call to request the next page of list
309
- * items. The marker value is opaque to the client.
310
- * @param options - Options to find blobs by tags.
311
- */
312
- async *findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
313
- let response;
314
- if (!!marker || marker === undefined) {
315
- do {
316
- response = await this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options);
317
- response.blobs = response.blobs || [];
318
- marker = response.continuationToken;
319
- yield response;
320
- } while (marker);
321
- }
322
- }
323
- /**
324
- * Returns an AsyncIterableIterator for blobs.
325
- *
326
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
327
- * The given expression must evaluate to true for a blob to be returned in the results.
328
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
329
- * however, only a subset of the OData filter syntax is supported in the Blob service.
330
- * @param options - Options to findBlobsByTagsItems.
331
- */
332
- async *findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
333
- let marker;
334
- for await (const segment of this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)) {
335
- yield* segment.blobs;
336
- }
337
- }
338
- /**
339
- * Returns an async iterable iterator to find all blobs with specified tag
340
- * under the specified account.
341
- *
342
- * .byPage() returns an async iterable iterator to list the blobs in pages.
343
- *
344
- * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
345
- *
346
- * ```ts snippet:BlobServiceClientFindBlobsByTags
347
- * import { BlobServiceClient } from "@azure/storage-blob";
348
- * import { DefaultAzureCredential } from "@azure/identity";
349
- *
350
- * const account = "<account>";
351
- * const blobServiceClient = new BlobServiceClient(
352
- * `https://${account}.blob.core.windows.net`,
353
- * new DefaultAzureCredential(),
354
- * );
355
- *
356
- * // Use for await to iterate the blobs
357
- * let i = 1;
358
- * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) {
359
- * console.log(`Blob ${i++}: ${blob.name}`);
360
- * }
361
- *
362
- * // Use iter.next() to iterate the blobs
363
- * i = 1;
364
- * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'");
365
- * let { value, done } = await iter.next();
366
- * while (!done) {
367
- * console.log(`Blob ${i++}: ${value.name}`);
368
- * ({ value, done } = await iter.next());
369
- * }
370
- *
371
- * // Use byPage() to iterate the blobs
372
- * i = 1;
373
- * for await (const page of blobServiceClient
374
- * .findBlobsByTags("tagkey='tagvalue'")
375
- * .byPage({ maxPageSize: 20 })) {
376
- * for (const blob of page.blobs) {
377
- * console.log(`Blob ${i++}: ${blob.name}`);
378
- * }
379
- * }
380
- *
381
- * // Use paging with a marker
382
- * i = 1;
383
- * let iterator = blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
384
- * let response = (await iterator.next()).value;
385
- * // Prints 2 blob names
386
- * if (response.blobs) {
387
- * for (const blob of response.blobs) {
388
- * console.log(`Blob ${i++}: ${blob.name}`);
389
- * }
390
- * }
391
- * // Gets next marker
392
- * let marker = response.continuationToken;
393
- * // Passing next marker as continuationToken
394
- * iterator = blobServiceClient
395
- * .findBlobsByTags("tagkey='tagvalue'")
396
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
397
- * response = (await iterator.next()).value;
398
- *
399
- * // Prints blob names
400
- * if (response.blobs) {
401
- * for (const blob of response.blobs) {
402
- * console.log(`Blob ${i++}: ${blob.name}`);
403
- * }
404
- * }
405
- * ```
406
- *
407
- * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
408
- * The given expression must evaluate to true for a blob to be returned in the results.
409
- * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
410
- * however, only a subset of the OData filter syntax is supported in the Blob service.
411
- * @param options - Options to find blobs by tags.
412
- */
413
- findBlobsByTags(tagFilterSqlExpression, options = {}) {
414
- // AsyncIterableIterator to iterate over blobs
415
- const listSegmentOptions = {
416
- ...options,
417
- };
418
- const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
419
- return {
420
- /**
421
- * The next method, part of the iteration protocol
422
- */
423
- next() {
424
- return iter.next();
425
- },
426
- /**
427
- * The connection to the async iterator, part of the iteration protocol
428
- */
429
- [Symbol.asyncIterator]() {
430
- return this;
681
+ return import_tracing.tracingClient.withSpan(
682
+ "BlobServiceClient-getUserDelegationKey",
683
+ getUserDelegationKeyOptions,
684
+ async (updatedOptions) => {
685
+ const response = (0, import_utils_common2.assertResponse)(
686
+ await this.serviceContext.getUserDelegationKey(
687
+ {
688
+ startsOn: (0, import_utils_common2.truncatedISO8061Date)(startsOn, false),
689
+ expiresOn: (0, import_utils_common2.truncatedISO8061Date)(expiresOn, false),
690
+ delegatedUserTid: userDelegationTid
431
691
  },
432
- /**
433
- * Return an AsyncIterableIterator that works a page at a time
434
- */
435
- byPage: (settings = {}) => {
436
- return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, {
437
- maxPageSize: settings.maxPageSize,
438
- ...listSegmentOptions,
439
- });
440
- },
441
- };
442
- }
443
- /**
444
- * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses
445
- *
446
- * @param marker - A string value that identifies the portion of
447
- * the list of containers to be returned with the next listing operation. The
448
- * operation returns the continuationToken value within the response body if the
449
- * listing operation did not return all containers remaining to be listed
450
- * with the current page. The continuationToken value can be used as the value for
451
- * the marker parameter in a subsequent call to request the next page of list
452
- * items. The marker value is opaque to the client.
453
- * @param options - Options to list containers operation.
454
- */
455
- async *listSegments(marker, options = {}) {
456
- let listContainersSegmentResponse;
457
- if (!!marker || marker === undefined) {
458
- do {
459
- listContainersSegmentResponse = await this.listContainersSegment(marker, options);
460
- listContainersSegmentResponse.containerItems =
461
- listContainersSegmentResponse.containerItems || [];
462
- marker = listContainersSegmentResponse.continuationToken;
463
- yield await listContainersSegmentResponse;
464
- } while (marker);
465
- }
466
- }
467
- /**
468
- * Returns an AsyncIterableIterator for Container Items
469
- *
470
- * @param options - Options to list containers operation.
471
- */
472
- async *listItems(options = {}) {
473
- let marker;
474
- for await (const segment of this.listSegments(marker, options)) {
475
- yield* segment.containerItems;
476
- }
477
- }
478
- /**
479
- * Returns an async iterable iterator to list all the containers
480
- * under the specified account.
481
- *
482
- * .byPage() returns an async iterable iterator to list the containers in pages.
483
- *
484
- * ```ts snippet:BlobServiceClientListContainers
485
- * import { BlobServiceClient } from "@azure/storage-blob";
486
- * import { DefaultAzureCredential } from "@azure/identity";
487
- *
488
- * const account = "<account>";
489
- * const blobServiceClient = new BlobServiceClient(
490
- * `https://${account}.blob.core.windows.net`,
491
- * new DefaultAzureCredential(),
492
- * );
493
- *
494
- * // Use for await to iterate the containers
495
- * let i = 1;
496
- * for await (const container of blobServiceClient.listContainers()) {
497
- * console.log(`Container ${i++}: ${container.name}`);
498
- * }
499
- *
500
- * // Use iter.next() to iterate the containers
501
- * i = 1;
502
- * const iter = blobServiceClient.listContainers();
503
- * let { value, done } = await iter.next();
504
- * while (!done) {
505
- * console.log(`Container ${i++}: ${value.name}`);
506
- * ({ value, done } = await iter.next());
507
- * }
508
- *
509
- * // Use byPage() to iterate the containers
510
- * i = 1;
511
- * for await (const page of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {
512
- * for (const container of page.containerItems) {
513
- * console.log(`Container ${i++}: ${container.name}`);
514
- * }
515
- * }
516
- *
517
- * // Use paging with a marker
518
- * i = 1;
519
- * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });
520
- * let response = (await iterator.next()).value;
521
- *
522
- * // Prints 2 container names
523
- * if (response.containerItems) {
524
- * for (const container of response.containerItems) {
525
- * console.log(`Container ${i++}: ${container.name}`);
526
- * }
527
- * }
528
- *
529
- * // Gets next marker
530
- * let marker = response.continuationToken;
531
- * // Passing next marker as continuationToken
532
- * iterator = blobServiceClient
533
- * .listContainers()
534
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
535
- * response = (await iterator.next()).value;
536
- *
537
- * // Prints 10 container names
538
- * if (response.containerItems) {
539
- * for (const container of response.containerItems) {
540
- * console.log(`Container ${i++}: ${container.name}`);
541
- * }
542
- * }
543
- * ```
544
- *
545
- * @param options - Options to list containers.
546
- * @returns An asyncIterableIterator that supports paging.
547
- */
548
- listContainers(options = {}) {
549
- if (options.prefix === "") {
550
- options.prefix = undefined;
551
- }
552
- const include = [];
553
- if (options.includeDeleted) {
554
- include.push("deleted");
555
- }
556
- if (options.includeMetadata) {
557
- include.push("metadata");
558
- }
559
- if (options.includeSystem) {
560
- include.push("system");
561
- }
562
- // AsyncIterableIterator to iterate over containers
563
- const listSegmentOptions = {
564
- ...options,
565
- ...(include.length > 0 ? { include } : {}),
692
+ {
693
+ abortSignal: getUserDelegationKeyOptions.abortSignal,
694
+ tracingOptions: updatedOptions.tracingOptions
695
+ }
696
+ )
697
+ );
698
+ const userDelegationKey = {
699
+ signedObjectId: response.signedObjectId,
700
+ signedTenantId: response.signedTenantId,
701
+ signedStartsOn: new Date(response.signedStartsOn),
702
+ signedExpiresOn: new Date(response.signedExpiresOn),
703
+ signedService: response.signedService,
704
+ signedVersion: response.signedVersion,
705
+ signedDelegatedUserTenantId: response.signedDelegatedUserTenantId,
706
+ value: response.value
566
707
  };
567
- const iter = this.listItems(listSegmentOptions);
568
- return {
569
- /**
570
- * The next method, part of the iteration protocol
571
- */
572
- next() {
573
- return iter.next();
574
- },
575
- /**
576
- * The connection to the async iterator, part of the iteration protocol
577
- */
578
- [Symbol.asyncIterator]() {
579
- return this;
580
- },
581
- /**
582
- * Return an AsyncIterableIterator that works a page at a time
583
- */
584
- byPage: (settings = {}) => {
585
- return this.listSegments(settings.continuationToken, {
586
- maxPageSize: settings.maxPageSize,
587
- ...listSegmentOptions,
588
- });
589
- },
708
+ const res = {
709
+ _response: response._response,
710
+ requestId: response.requestId,
711
+ clientRequestId: response.clientRequestId,
712
+ version: response.version,
713
+ date: response.date,
714
+ errorCode: response.errorCode,
715
+ ...userDelegationKey
590
716
  };
717
+ return res;
718
+ }
719
+ );
720
+ }
721
+ /**
722
+ * Creates a BlobBatchClient object to conduct batch operations.
723
+ *
724
+ * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
725
+ *
726
+ * @returns A new BlobBatchClient object for this service.
727
+ */
728
+ getBlobBatchClient() {
729
+ return new import_BlobBatchClient.BlobBatchClient(this.url, this.pipeline);
730
+ }
731
+ /**
732
+ * Only available for BlobServiceClient constructed with a shared key credential.
733
+ *
734
+ * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
735
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
736
+ *
737
+ * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
738
+ *
739
+ * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
740
+ * @param permissions - Specifies the list of permissions to be associated with the SAS.
741
+ * @param resourceTypes - Specifies the resource types associated with the shared access signature.
742
+ * @param options - Optional parameters.
743
+ * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
744
+ */
745
+ generateAccountSasUrl(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
746
+ if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
747
+ throw RangeError(
748
+ "Can only generate the account SAS when the client is initialized with a shared key credential"
749
+ );
591
750
  }
592
- /**
593
- * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).
594
- *
595
- * Retrieves a user delegation key for the Blob service. This is only a valid operation when using
596
- * bearer token authentication.
597
- *
598
- * @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
599
- *
600
- * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
601
- * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
602
- */
603
- async getUserDelegationKey(startsOn, expiresOn, options = {}) {
604
- return tracing_js_1.tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => {
605
- const response = (0, utils_common_js_2.assertResponse)(await this.serviceContext.getUserDelegationKey({
606
- startsOn: (0, utils_common_js_2.truncatedISO8061Date)(startsOn, false),
607
- expiresOn: (0, utils_common_js_2.truncatedISO8061Date)(expiresOn, false),
608
- }, {
609
- abortSignal: options.abortSignal,
610
- tracingOptions: updatedOptions.tracingOptions,
611
- }));
612
- const userDelegationKey = {
613
- signedObjectId: response.signedObjectId,
614
- signedTenantId: response.signedTenantId,
615
- signedStartsOn: new Date(response.signedStartsOn),
616
- signedExpiresOn: new Date(response.signedExpiresOn),
617
- signedService: response.signedService,
618
- signedVersion: response.signedVersion,
619
- value: response.value,
620
- };
621
- const res = {
622
- _response: response._response,
623
- requestId: response.requestId,
624
- clientRequestId: response.clientRequestId,
625
- version: response.version,
626
- date: response.date,
627
- errorCode: response.errorCode,
628
- ...userDelegationKey,
629
- };
630
- return res;
631
- });
751
+ if (expiresOn === void 0) {
752
+ const now = /* @__PURE__ */ new Date();
753
+ expiresOn = new Date(now.getTime() + 3600 * 1e3);
632
754
  }
633
- /**
634
- * Creates a BlobBatchClient object to conduct batch operations.
635
- *
636
- * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
637
- *
638
- * @returns A new BlobBatchClient object for this service.
639
- */
640
- getBlobBatchClient() {
641
- return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline);
755
+ const sas = (0, import_AccountSASSignatureValues.generateAccountSASQueryParameters)(
756
+ {
757
+ permissions,
758
+ expiresOn,
759
+ resourceTypes,
760
+ services: import_AccountSASServices.AccountSASServices.parse("b").toString(),
761
+ ...options
762
+ },
763
+ this.credential
764
+ ).toString();
765
+ return (0, import_utils_common.appendToURLQuery)(this.url, sas);
766
+ }
767
+ /**
768
+ * Only available for BlobServiceClient constructed with a shared key credential.
769
+ *
770
+ * Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
771
+ * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
772
+ *
773
+ * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
774
+ *
775
+ * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
776
+ * @param permissions - Specifies the list of permissions to be associated with the SAS.
777
+ * @param resourceTypes - Specifies the resource types associated with the shared access signature.
778
+ * @param options - Optional parameters.
779
+ * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
780
+ */
781
+ generateSasStringToSign(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
782
+ if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
783
+ throw RangeError(
784
+ "Can only generate the account SAS when the client is initialized with a shared key credential"
785
+ );
642
786
  }
643
- /**
644
- * Only available for BlobServiceClient constructed with a shared key credential.
645
- *
646
- * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
647
- * and parameters passed in. The SAS is signed by the shared key credential of the client.
648
- *
649
- * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
650
- *
651
- * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
652
- * @param permissions - Specifies the list of permissions to be associated with the SAS.
653
- * @param resourceTypes - Specifies the resource types associated with the shared access signature.
654
- * @param options - Optional parameters.
655
- * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
656
- */
657
- generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
658
- if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
659
- throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
660
- }
661
- if (expiresOn === undefined) {
662
- const now = new Date();
663
- expiresOn = new Date(now.getTime() + 3600 * 1000);
664
- }
665
- const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({
666
- permissions,
667
- expiresOn,
668
- resourceTypes,
669
- services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(),
670
- ...options,
671
- }, this.credential).toString();
672
- return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
673
- }
674
- /**
675
- * Only available for BlobServiceClient constructed with a shared key credential.
676
- *
677
- * Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
678
- * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
679
- *
680
- * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
681
- *
682
- * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
683
- * @param permissions - Specifies the list of permissions to be associated with the SAS.
684
- * @param resourceTypes - Specifies the resource types associated with the shared access signature.
685
- * @param options - Optional parameters.
686
- * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
687
- */
688
- generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
689
- if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
690
- throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
691
- }
692
- if (expiresOn === undefined) {
693
- const now = new Date();
694
- expiresOn = new Date(now.getTime() + 3600 * 1000);
695
- }
696
- return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({
697
- permissions,
698
- expiresOn,
699
- resourceTypes,
700
- services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(),
701
- ...options,
702
- }, this.credential).stringToSign;
787
+ if (expiresOn === void 0) {
788
+ const now = /* @__PURE__ */ new Date();
789
+ expiresOn = new Date(now.getTime() + 3600 * 1e3);
703
790
  }
791
+ return (0, import_AccountSASSignatureValues.generateAccountSASQueryParametersInternal)(
792
+ {
793
+ permissions,
794
+ expiresOn,
795
+ resourceTypes,
796
+ services: import_AccountSASServices.AccountSASServices.parse("b").toString(),
797
+ ...options
798
+ },
799
+ this.credential
800
+ ).stringToSign;
801
+ }
704
802
  }
705
- exports.BlobServiceClient = BlobServiceClient;
706
- //# sourceMappingURL=BlobServiceClient.js.map
803
+ // Annotate the CommonJS export names for ESM import in node:
804
+ 0 && (module.exports = {
805
+ BlobServiceClient
806
+ });