@depup/azure__storage-blob 12.31.0-depup.0

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 (1105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/changes.json +46 -0
  4. package/dist/browser/BatchResponse.d.ts +49 -0
  5. package/dist/browser/BatchResponse.d.ts.map +1 -0
  6. package/dist/browser/BatchResponse.js +4 -0
  7. package/dist/browser/BatchResponse.js.map +1 -0
  8. package/dist/browser/BatchResponseParser.d.ts +16 -0
  9. package/dist/browser/BatchResponseParser.d.ts.map +1 -0
  10. package/dist/browser/BatchResponseParser.js +142 -0
  11. package/dist/browser/BatchResponseParser.js.map +1 -0
  12. package/dist/browser/BatchUtils-browser.d.mts.map +1 -0
  13. package/dist/browser/BatchUtils-browser.mjs.map +1 -0
  14. package/dist/browser/BatchUtils.d.ts +4 -0
  15. package/dist/browser/BatchUtils.js +14 -0
  16. package/dist/browser/BlobBatch.d.ts +111 -0
  17. package/dist/browser/BlobBatch.d.ts.map +1 -0
  18. package/dist/browser/BlobBatch.js +274 -0
  19. package/dist/browser/BlobBatch.js.map +1 -0
  20. package/dist/browser/BlobBatchClient.d.ts +180 -0
  21. package/dist/browser/BlobBatchClient.d.ts.map +1 -0
  22. package/dist/browser/BlobBatchClient.js +172 -0
  23. package/dist/browser/BlobBatchClient.js.map +1 -0
  24. package/dist/browser/BlobDownloadResponse-browser.d.mts.map +1 -0
  25. package/dist/browser/BlobDownloadResponse-browser.mjs.map +1 -0
  26. package/dist/browser/BlobDownloadResponse.d.ts +2 -0
  27. package/dist/browser/BlobDownloadResponse.js +7 -0
  28. package/dist/browser/BlobLeaseClient.d.ts +159 -0
  29. package/dist/browser/BlobLeaseClient.d.ts.map +1 -0
  30. package/dist/browser/BlobLeaseClient.js +201 -0
  31. package/dist/browser/BlobLeaseClient.js.map +1 -0
  32. package/dist/browser/BlobQueryResponse-browser.d.mts.map +1 -0
  33. package/dist/browser/BlobQueryResponse-browser.mjs.map +1 -0
  34. package/dist/browser/BlobQueryResponse.common.d.ts +291 -0
  35. package/dist/browser/BlobQueryResponse.common.d.ts.map +1 -0
  36. package/dist/browser/BlobQueryResponse.common.js +363 -0
  37. package/dist/browser/BlobQueryResponse.common.js.map +1 -0
  38. package/dist/browser/BlobQueryResponse.d.ts +2 -0
  39. package/dist/browser/BlobQueryResponse.js +4 -0
  40. package/dist/browser/BlobServiceClient.d.ts +615 -0
  41. package/dist/browser/BlobServiceClient.d.ts.map +1 -0
  42. package/dist/browser/BlobServiceClient.js +702 -0
  43. package/dist/browser/BlobServiceClient.js.map +1 -0
  44. package/dist/browser/Clients.d.ts +3233 -0
  45. package/dist/browser/Clients.d.ts.map +1 -0
  46. package/dist/browser/Clients.js +2845 -0
  47. package/dist/browser/Clients.js.map +1 -0
  48. package/dist/browser/ContainerClient.d.ts +1103 -0
  49. package/dist/browser/ContainerClient.d.ts.map +1 -0
  50. package/dist/browser/ContainerClient.js +1293 -0
  51. package/dist/browser/ContainerClient.js.map +1 -0
  52. package/dist/browser/PageBlobRangeResponse.d.ts +35 -0
  53. package/dist/browser/PageBlobRangeResponse.d.ts.map +1 -0
  54. package/dist/browser/PageBlobRangeResponse.js +31 -0
  55. package/dist/browser/PageBlobRangeResponse.js.map +1 -0
  56. package/dist/browser/Pipeline.d.ts +135 -0
  57. package/dist/browser/Pipeline.d.ts.map +1 -0
  58. package/dist/browser/Pipeline.js +271 -0
  59. package/dist/browser/Pipeline.js.map +1 -0
  60. package/dist/browser/Range.d.ts +24 -0
  61. package/dist/browser/Range.d.ts.map +1 -0
  62. package/dist/browser/Range.js +21 -0
  63. package/dist/browser/Range.js.map +1 -0
  64. package/dist/browser/StorageClient.d.ts +50 -0
  65. package/dist/browser/StorageClient.d.ts.map +1 -0
  66. package/dist/browser/StorageClient.js +52 -0
  67. package/dist/browser/StorageClient.js.map +1 -0
  68. package/dist/browser/StorageContextClient.d.ts +9 -0
  69. package/dist/browser/StorageContextClient.d.ts.map +1 -0
  70. package/dist/browser/StorageContextClient.js +17 -0
  71. package/dist/browser/StorageContextClient.js.map +1 -0
  72. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts +3 -0
  73. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.d.mts.map +1 -0
  74. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs +5 -0
  75. package/dist/browser/credentials/StorageSharedKeyCredential-react-native.mjs.map +1 -0
  76. package/dist/browser/generated/src/index.d.ts +4 -0
  77. package/dist/browser/generated/src/index.d.ts.map +1 -0
  78. package/dist/browser/generated/src/index.js +11 -0
  79. package/dist/browser/generated/src/index.js.map +1 -0
  80. package/dist/browser/generated/src/models/index.d.ts +3978 -0
  81. package/dist/browser/generated/src/models/index.d.ts.map +1 -0
  82. package/dist/browser/generated/src/models/index.js +264 -0
  83. package/dist/browser/generated/src/models/index.js.map +1 -0
  84. package/dist/browser/generated/src/models/mappers.d.ts +181 -0
  85. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
  86. package/dist/browser/generated/src/models/mappers.js +8330 -0
  87. package/dist/browser/generated/src/models/mappers.js.map +1 -0
  88. package/dist/browser/generated/src/models/parameters.d.ts +152 -0
  89. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
  90. package/dist/browser/generated/src/models/parameters.js +1674 -0
  91. package/dist/browser/generated/src/models/parameters.js.map +1 -0
  92. package/dist/browser/generated/src/operations/appendBlob.d.ts +45 -0
  93. package/dist/browser/generated/src/operations/appendBlob.d.ts.map +1 -0
  94. package/dist/browser/generated/src/operations/appendBlob.js +223 -0
  95. package/dist/browser/generated/src/operations/appendBlob.js.map +1 -0
  96. package/dist/browser/generated/src/operations/blob.d.ts +178 -0
  97. package/dist/browser/generated/src/operations/blob.d.ts.map +1 -0
  98. package/dist/browser/generated/src/operations/blob.js +1030 -0
  99. package/dist/browser/generated/src/operations/blob.js.map +1 -0
  100. package/dist/browser/generated/src/operations/blockBlob.d.ts +79 -0
  101. package/dist/browser/generated/src/operations/blockBlob.d.ts.map +1 -0
  102. package/dist/browser/generated/src/operations/blockBlob.js +368 -0
  103. package/dist/browser/generated/src/operations/blockBlob.js.map +1 -0
  104. package/dist/browser/generated/src/operations/container.d.ts +130 -0
  105. package/dist/browser/generated/src/operations/container.d.ts.map +1 -0
  106. package/dist/browser/generated/src/operations/container.js +716 -0
  107. package/dist/browser/generated/src/operations/container.js.map +1 -0
  108. package/dist/browser/generated/src/operations/index.d.ts +7 -0
  109. package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
  110. package/dist/browser/generated/src/operations/index.js +14 -0
  111. package/dist/browser/generated/src/operations/index.js.map +1 -0
  112. package/dist/browser/generated/src/operations/pageBlob.d.ts +87 -0
  113. package/dist/browser/generated/src/operations/pageBlob.d.ts.map +1 -0
  114. package/dist/browser/generated/src/operations/pageBlob.js +458 -0
  115. package/dist/browser/generated/src/operations/pageBlob.js.map +1 -0
  116. package/dist/browser/generated/src/operations/service.d.ts +67 -0
  117. package/dist/browser/generated/src/operations/service.d.ts.map +1 -0
  118. package/dist/browser/generated/src/operations/service.js +324 -0
  119. package/dist/browser/generated/src/operations/service.js.map +1 -0
  120. package/dist/browser/generated/src/operationsInterfaces/appendBlob.d.ts +37 -0
  121. package/dist/browser/generated/src/operationsInterfaces/appendBlob.d.ts.map +1 -0
  122. package/dist/browser/generated/src/operationsInterfaces/appendBlob.js +9 -0
  123. package/dist/browser/generated/src/operationsInterfaces/appendBlob.js.map +1 -0
  124. package/dist/browser/generated/src/operationsInterfaces/blob.d.ts +170 -0
  125. package/dist/browser/generated/src/operationsInterfaces/blob.d.ts.map +1 -0
  126. package/dist/browser/generated/src/operationsInterfaces/blob.js +9 -0
  127. package/dist/browser/generated/src/operationsInterfaces/blob.js.map +1 -0
  128. package/dist/browser/generated/src/operationsInterfaces/blockBlob.d.ts +71 -0
  129. package/dist/browser/generated/src/operationsInterfaces/blockBlob.d.ts.map +1 -0
  130. package/dist/browser/generated/src/operationsInterfaces/blockBlob.js +9 -0
  131. package/dist/browser/generated/src/operationsInterfaces/blockBlob.js.map +1 -0
  132. package/dist/browser/generated/src/operationsInterfaces/container.d.ts +122 -0
  133. package/dist/browser/generated/src/operationsInterfaces/container.d.ts.map +1 -0
  134. package/dist/browser/generated/src/operationsInterfaces/container.js +9 -0
  135. package/dist/browser/generated/src/operationsInterfaces/container.js.map +1 -0
  136. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +7 -0
  137. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  138. package/dist/browser/generated/src/operationsInterfaces/index.js +14 -0
  139. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -0
  140. package/dist/browser/generated/src/operationsInterfaces/pageBlob.d.ts +79 -0
  141. package/dist/browser/generated/src/operationsInterfaces/pageBlob.d.ts.map +1 -0
  142. package/dist/browser/generated/src/operationsInterfaces/pageBlob.js +9 -0
  143. package/dist/browser/generated/src/operationsInterfaces/pageBlob.js.map +1 -0
  144. package/dist/browser/generated/src/operationsInterfaces/service.d.ts +59 -0
  145. package/dist/browser/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  146. package/dist/browser/generated/src/operationsInterfaces/service.js +9 -0
  147. package/dist/browser/generated/src/operationsInterfaces/service.js.map +1 -0
  148. package/dist/browser/generated/src/storageClient.d.ts +21 -0
  149. package/dist/browser/generated/src/storageClient.d.ts.map +1 -0
  150. package/dist/browser/generated/src/storageClient.js +61 -0
  151. package/dist/browser/generated/src/storageClient.js.map +1 -0
  152. package/dist/browser/generatedModels.d.ts +260 -0
  153. package/dist/browser/generatedModels.d.ts.map +1 -0
  154. package/dist/browser/generatedModels.js +8 -0
  155. package/dist/browser/generatedModels.js.map +1 -0
  156. package/dist/browser/index-browser.d.mts.map +1 -0
  157. package/dist/browser/index-browser.mjs.map +1 -0
  158. package/dist/browser/index.d.ts +19 -0
  159. package/dist/browser/index.js +18 -0
  160. package/dist/browser/internal-avro/AvroConstants.d.ts +5 -0
  161. package/dist/browser/internal-avro/AvroConstants.d.ts.map +1 -0
  162. package/dist/browser/internal-avro/AvroConstants.js +7 -0
  163. package/dist/browser/internal-avro/AvroConstants.js.map +1 -0
  164. package/dist/browser/internal-avro/AvroParser.d.ts +57 -0
  165. package/dist/browser/internal-avro/AvroParser.d.ts.map +1 -0
  166. package/dist/browser/internal-avro/AvroParser.js +323 -0
  167. package/dist/browser/internal-avro/AvroParser.js.map +1 -0
  168. package/dist/browser/internal-avro/AvroReadable.d.ts +16 -0
  169. package/dist/browser/internal-avro/AvroReadable.d.ts.map +1 -0
  170. package/dist/browser/internal-avro/AvroReadable.js +5 -0
  171. package/dist/browser/internal-avro/AvroReadable.js.map +1 -0
  172. package/dist/browser/internal-avro/AvroReadableFromBlob.d.ts +10 -0
  173. package/dist/browser/internal-avro/AvroReadableFromBlob.d.ts.map +1 -0
  174. package/dist/browser/internal-avro/AvroReadableFromBlob.js +49 -0
  175. package/dist/browser/internal-avro/AvroReadableFromBlob.js.map +1 -0
  176. package/dist/browser/internal-avro/AvroReadableFromStream.d.ts +11 -0
  177. package/dist/browser/internal-avro/AvroReadableFromStream.d.ts.map +1 -0
  178. package/dist/browser/internal-avro/AvroReadableFromStream.js +86 -0
  179. package/dist/browser/internal-avro/AvroReadableFromStream.js.map +1 -0
  180. package/dist/browser/internal-avro/AvroReader.d.ts +32 -0
  181. package/dist/browser/internal-avro/AvroReader.d.ts.map +1 -0
  182. package/dist/browser/internal-avro/AvroReader.js +116 -0
  183. package/dist/browser/internal-avro/AvroReader.js.map +1 -0
  184. package/dist/browser/internal-avro/index-browser.d.mts.map +1 -0
  185. package/dist/browser/internal-avro/index-browser.mjs.map +1 -0
  186. package/dist/browser/internal-avro/index.d.ts +4 -0
  187. package/dist/browser/internal-avro/index.js +6 -0
  188. package/dist/browser/internal-avro/utils/utils.common.d.ts +6 -0
  189. package/dist/browser/internal-avro/utils/utils.common.d.ts.map +1 -0
  190. package/dist/browser/internal-avro/utils/utils.common.js +16 -0
  191. package/dist/browser/internal-avro/utils/utils.common.js.map +1 -0
  192. package/dist/browser/log.d.ts +5 -0
  193. package/dist/browser/log.d.ts.map +1 -0
  194. package/dist/browser/log.js +8 -0
  195. package/dist/browser/log.js.map +1 -0
  196. package/dist/browser/models.d.ts +333 -0
  197. package/dist/browser/models.d.ts.map +1 -0
  198. package/dist/browser/models.js +115 -0
  199. package/dist/browser/models.js.map +1 -0
  200. package/dist/browser/package.json +3 -0
  201. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +17 -0
  202. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +1 -0
  203. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +18 -0
  204. package/dist/browser/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +1 -0
  205. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.d.ts +74 -0
  206. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.d.ts.map +1 -0
  207. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js +134 -0
  208. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js.map +1 -0
  209. package/dist/browser/sas/AccountSASPermissions.d.ts +146 -0
  210. package/dist/browser/sas/AccountSASPermissions.d.ts.map +1 -0
  211. package/dist/browser/sas/AccountSASPermissions.js +225 -0
  212. package/dist/browser/sas/AccountSASPermissions.js.map +1 -0
  213. package/dist/browser/sas/AccountSASResourceTypes.d.ts +38 -0
  214. package/dist/browser/sas/AccountSASResourceTypes.d.ts.map +1 -0
  215. package/dist/browser/sas/AccountSASResourceTypes.js +70 -0
  216. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -0
  217. package/dist/browser/sas/AccountSASServices.d.ts +40 -0
  218. package/dist/browser/sas/AccountSASServices.d.ts.map +1 -0
  219. package/dist/browser/sas/AccountSASServices.js +78 -0
  220. package/dist/browser/sas/AccountSASServices.js.map +1 -0
  221. package/dist/browser/sas/AccountSASSignatureValues.d.ts +78 -0
  222. package/dist/browser/sas/AccountSASSignatureValues.d.ts.map +1 -0
  223. package/dist/browser/sas/AccountSASSignatureValues.js +100 -0
  224. package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -0
  225. package/dist/browser/sas/BlobSASPermissions.d.ts +127 -0
  226. package/dist/browser/sas/BlobSASPermissions.d.ts.map +1 -0
  227. package/dist/browser/sas/BlobSASPermissions.js +193 -0
  228. package/dist/browser/sas/BlobSASPermissions.js.map +1 -0
  229. package/dist/browser/sas/BlobSASSignatureValues.d.ts +289 -0
  230. package/dist/browser/sas/BlobSASSignatureValues.d.ts.map +1 -0
  231. package/dist/browser/sas/BlobSASSignatureValues.js +666 -0
  232. package/dist/browser/sas/BlobSASSignatureValues.js.map +1 -0
  233. package/dist/browser/sas/ContainerSASPermissions.d.ts +143 -0
  234. package/dist/browser/sas/ContainerSASPermissions.d.ts.map +1 -0
  235. package/dist/browser/sas/ContainerSASPermissions.js +219 -0
  236. package/dist/browser/sas/ContainerSASPermissions.js.map +1 -0
  237. package/dist/browser/sas/SASQueryParameters.d.ts +298 -0
  238. package/dist/browser/sas/SASQueryParameters.d.ts.map +1 -0
  239. package/dist/browser/sas/SASQueryParameters.js +363 -0
  240. package/dist/browser/sas/SASQueryParameters.js.map +1 -0
  241. package/dist/browser/sas/SasIPRange.d.ts +24 -0
  242. package/dist/browser/sas/SasIPRange.d.ts.map +1 -0
  243. package/dist/browser/sas/SasIPRange.js +13 -0
  244. package/dist/browser/sas/SasIPRange.js.map +1 -0
  245. package/dist/browser/utils/Batch.d.ts +68 -0
  246. package/dist/browser/utils/Batch.d.ts.map +1 -0
  247. package/dist/browser/utils/Batch.js +130 -0
  248. package/dist/browser/utils/Batch.js.map +1 -0
  249. package/dist/browser/utils/BlobQuickQueryStream.d.ts +42 -0
  250. package/dist/browser/utils/BlobQuickQueryStream.d.ts.map +1 -0
  251. package/dist/browser/utils/BlobQuickQueryStream.js +116 -0
  252. package/dist/browser/utils/BlobQuickQueryStream.js.map +1 -0
  253. package/dist/browser/utils/Mutex.d.ts +23 -0
  254. package/dist/browser/utils/Mutex.d.ts.map +1 -0
  255. package/dist/browser/utils/Mutex.js +65 -0
  256. package/dist/browser/utils/Mutex.js.map +1 -0
  257. package/dist/browser/utils/RetriableReadableStream.d.ts +62 -0
  258. package/dist/browser/utils/RetriableReadableStream.d.ts.map +1 -0
  259. package/dist/browser/utils/RetriableReadableStream.js +127 -0
  260. package/dist/browser/utils/RetriableReadableStream.js.map +1 -0
  261. package/dist/browser/utils/SharedKeyComparator.d.ts +2 -0
  262. package/dist/browser/utils/SharedKeyComparator.d.ts.map +1 -0
  263. package/dist/browser/utils/SharedKeyComparator.js +73 -0
  264. package/dist/browser/utils/SharedKeyComparator.js.map +1 -0
  265. package/dist/browser/utils/constants.d.ts +70 -0
  266. package/dist/browser/utils/constants.d.ts.map +1 -0
  267. package/dist/browser/utils/constants.js +226 -0
  268. package/dist/browser/utils/constants.js.map +1 -0
  269. package/dist/browser/utils/tracing.d.ts +6 -0
  270. package/dist/browser/utils/tracing.d.ts.map +1 -0
  271. package/dist/browser/utils/tracing.js +14 -0
  272. package/dist/browser/utils/tracing.js.map +1 -0
  273. package/dist/browser/utils/utils-browser.d.mts.map +1 -0
  274. package/dist/browser/utils/utils-browser.mjs.map +1 -0
  275. package/dist/browser/utils/utils.common.d.ts +323 -0
  276. package/dist/browser/utils/utils.common.d.ts.map +1 -0
  277. package/dist/browser/utils/utils.common.js +769 -0
  278. package/dist/browser/utils/utils.common.js.map +1 -0
  279. package/dist/browser/utils/utils.d.ts +18 -0
  280. package/dist/browser/utils/utils.js +48 -0
  281. package/dist/commonjs/BatchResponse.d.ts +49 -0
  282. package/dist/commonjs/BatchResponse.d.ts.map +1 -0
  283. package/dist/commonjs/BatchResponse.js +5 -0
  284. package/dist/commonjs/BatchResponse.js.map +1 -0
  285. package/dist/commonjs/BatchResponseParser.d.ts +16 -0
  286. package/dist/commonjs/BatchResponseParser.d.ts.map +1 -0
  287. package/dist/commonjs/BatchResponseParser.js +146 -0
  288. package/dist/commonjs/BatchResponseParser.js.map +1 -0
  289. package/dist/commonjs/BatchUtils.d.ts +4 -0
  290. package/dist/commonjs/BatchUtils.d.ts.map +1 -0
  291. package/dist/commonjs/BatchUtils.js +19 -0
  292. package/dist/commonjs/BatchUtils.js.map +1 -0
  293. package/dist/commonjs/BlobBatch.d.ts +111 -0
  294. package/dist/commonjs/BlobBatch.d.ts.map +1 -0
  295. package/dist/commonjs/BlobBatch.js +278 -0
  296. package/dist/commonjs/BlobBatch.js.map +1 -0
  297. package/dist/commonjs/BlobBatchClient.d.ts +180 -0
  298. package/dist/commonjs/BlobBatchClient.d.ts.map +1 -0
  299. package/dist/commonjs/BlobBatchClient.js +176 -0
  300. package/dist/commonjs/BlobBatchClient.js.map +1 -0
  301. package/dist/commonjs/BlobDownloadResponse.d.ts +370 -0
  302. package/dist/commonjs/BlobDownloadResponse.d.ts.map +1 -0
  303. package/dist/commonjs/BlobDownloadResponse.js +469 -0
  304. package/dist/commonjs/BlobDownloadResponse.js.map +1 -0
  305. package/dist/commonjs/BlobLeaseClient.d.ts +159 -0
  306. package/dist/commonjs/BlobLeaseClient.d.ts.map +1 -0
  307. package/dist/commonjs/BlobLeaseClient.js +205 -0
  308. package/dist/commonjs/BlobLeaseClient.js.map +1 -0
  309. package/dist/commonjs/BlobQueryResponse.common.d.ts +291 -0
  310. package/dist/commonjs/BlobQueryResponse.common.d.ts.map +1 -0
  311. package/dist/commonjs/BlobQueryResponse.common.js +367 -0
  312. package/dist/commonjs/BlobQueryResponse.common.js.map +1 -0
  313. package/dist/commonjs/BlobQueryResponse.d.ts +295 -0
  314. package/dist/commonjs/BlobQueryResponse.d.ts.map +1 -0
  315. package/dist/commonjs/BlobQueryResponse.js +373 -0
  316. package/dist/commonjs/BlobQueryResponse.js.map +1 -0
  317. package/dist/commonjs/BlobServiceClient.d.ts +615 -0
  318. package/dist/commonjs/BlobServiceClient.d.ts.map +1 -0
  319. package/dist/commonjs/BlobServiceClient.js +706 -0
  320. package/dist/commonjs/BlobServiceClient.js.map +1 -0
  321. package/dist/commonjs/Clients.d.ts +3233 -0
  322. package/dist/commonjs/Clients.d.ts.map +1 -0
  323. package/dist/commonjs/Clients.js +2852 -0
  324. package/dist/commonjs/Clients.js.map +1 -0
  325. package/dist/commonjs/ContainerClient.d.ts +1103 -0
  326. package/dist/commonjs/ContainerClient.d.ts.map +1 -0
  327. package/dist/commonjs/ContainerClient.js +1297 -0
  328. package/dist/commonjs/ContainerClient.js.map +1 -0
  329. package/dist/commonjs/PageBlobRangeResponse.d.ts +35 -0
  330. package/dist/commonjs/PageBlobRangeResponse.d.ts.map +1 -0
  331. package/dist/commonjs/PageBlobRangeResponse.js +34 -0
  332. package/dist/commonjs/PageBlobRangeResponse.js.map +1 -0
  333. package/dist/commonjs/Pipeline.d.ts +135 -0
  334. package/dist/commonjs/Pipeline.d.ts.map +1 -0
  335. package/dist/commonjs/Pipeline.js +277 -0
  336. package/dist/commonjs/Pipeline.js.map +1 -0
  337. package/dist/commonjs/Range.d.ts +24 -0
  338. package/dist/commonjs/Range.d.ts.map +1 -0
  339. package/dist/commonjs/Range.js +24 -0
  340. package/dist/commonjs/Range.js.map +1 -0
  341. package/dist/commonjs/StorageClient.d.ts +50 -0
  342. package/dist/commonjs/StorageClient.d.ts.map +1 -0
  343. package/dist/commonjs/StorageClient.js +56 -0
  344. package/dist/commonjs/StorageClient.js.map +1 -0
  345. package/dist/commonjs/StorageContextClient.d.ts +9 -0
  346. package/dist/commonjs/StorageContextClient.d.ts.map +1 -0
  347. package/dist/commonjs/StorageContextClient.js +21 -0
  348. package/dist/commonjs/StorageContextClient.js.map +1 -0
  349. package/dist/commonjs/generated/src/index.d.ts +4 -0
  350. package/dist/commonjs/generated/src/index.d.ts.map +1 -0
  351. package/dist/commonjs/generated/src/index.js +16 -0
  352. package/dist/commonjs/generated/src/index.js.map +1 -0
  353. package/dist/commonjs/generated/src/models/index.d.ts +3978 -0
  354. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
  355. package/dist/commonjs/generated/src/models/index.js +267 -0
  356. package/dist/commonjs/generated/src/models/index.js.map +1 -0
  357. package/dist/commonjs/generated/src/models/mappers.d.ts +181 -0
  358. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
  359. package/dist/commonjs/generated/src/models/mappers.js +8336 -0
  360. package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
  361. package/dist/commonjs/generated/src/models/parameters.d.ts +152 -0
  362. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
  363. package/dist/commonjs/generated/src/models/parameters.js +1679 -0
  364. package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
  365. package/dist/commonjs/generated/src/operations/appendBlob.d.ts +45 -0
  366. package/dist/commonjs/generated/src/operations/appendBlob.d.ts.map +1 -0
  367. package/dist/commonjs/generated/src/operations/appendBlob.js +228 -0
  368. package/dist/commonjs/generated/src/operations/appendBlob.js.map +1 -0
  369. package/dist/commonjs/generated/src/operations/blob.d.ts +178 -0
  370. package/dist/commonjs/generated/src/operations/blob.d.ts.map +1 -0
  371. package/dist/commonjs/generated/src/operations/blob.js +1035 -0
  372. package/dist/commonjs/generated/src/operations/blob.js.map +1 -0
  373. package/dist/commonjs/generated/src/operations/blockBlob.d.ts +79 -0
  374. package/dist/commonjs/generated/src/operations/blockBlob.d.ts.map +1 -0
  375. package/dist/commonjs/generated/src/operations/blockBlob.js +373 -0
  376. package/dist/commonjs/generated/src/operations/blockBlob.js.map +1 -0
  377. package/dist/commonjs/generated/src/operations/container.d.ts +130 -0
  378. package/dist/commonjs/generated/src/operations/container.d.ts.map +1 -0
  379. package/dist/commonjs/generated/src/operations/container.js +721 -0
  380. package/dist/commonjs/generated/src/operations/container.js.map +1 -0
  381. package/dist/commonjs/generated/src/operations/index.d.ts +7 -0
  382. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
  383. package/dist/commonjs/generated/src/operations/index.js +17 -0
  384. package/dist/commonjs/generated/src/operations/index.js.map +1 -0
  385. package/dist/commonjs/generated/src/operations/pageBlob.d.ts +87 -0
  386. package/dist/commonjs/generated/src/operations/pageBlob.d.ts.map +1 -0
  387. package/dist/commonjs/generated/src/operations/pageBlob.js +463 -0
  388. package/dist/commonjs/generated/src/operations/pageBlob.js.map +1 -0
  389. package/dist/commonjs/generated/src/operations/service.d.ts +67 -0
  390. package/dist/commonjs/generated/src/operations/service.d.ts.map +1 -0
  391. package/dist/commonjs/generated/src/operations/service.js +329 -0
  392. package/dist/commonjs/generated/src/operations/service.js.map +1 -0
  393. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.d.ts +37 -0
  394. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.d.ts.map +1 -0
  395. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js +10 -0
  396. package/dist/commonjs/generated/src/operationsInterfaces/appendBlob.js.map +1 -0
  397. package/dist/commonjs/generated/src/operationsInterfaces/blob.d.ts +170 -0
  398. package/dist/commonjs/generated/src/operationsInterfaces/blob.d.ts.map +1 -0
  399. package/dist/commonjs/generated/src/operationsInterfaces/blob.js +10 -0
  400. package/dist/commonjs/generated/src/operationsInterfaces/blob.js.map +1 -0
  401. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.d.ts +71 -0
  402. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.d.ts.map +1 -0
  403. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js +10 -0
  404. package/dist/commonjs/generated/src/operationsInterfaces/blockBlob.js.map +1 -0
  405. package/dist/commonjs/generated/src/operationsInterfaces/container.d.ts +122 -0
  406. package/dist/commonjs/generated/src/operationsInterfaces/container.d.ts.map +1 -0
  407. package/dist/commonjs/generated/src/operationsInterfaces/container.js +10 -0
  408. package/dist/commonjs/generated/src/operationsInterfaces/container.js.map +1 -0
  409. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +7 -0
  410. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  411. package/dist/commonjs/generated/src/operationsInterfaces/index.js +17 -0
  412. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
  413. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.d.ts +79 -0
  414. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.d.ts.map +1 -0
  415. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js +10 -0
  416. package/dist/commonjs/generated/src/operationsInterfaces/pageBlob.js.map +1 -0
  417. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts +59 -0
  418. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  419. package/dist/commonjs/generated/src/operationsInterfaces/service.js +10 -0
  420. package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -0
  421. package/dist/commonjs/generated/src/storageClient.d.ts +21 -0
  422. package/dist/commonjs/generated/src/storageClient.d.ts.map +1 -0
  423. package/dist/commonjs/generated/src/storageClient.js +66 -0
  424. package/dist/commonjs/generated/src/storageClient.js.map +1 -0
  425. package/dist/commonjs/generatedModels.d.ts +260 -0
  426. package/dist/commonjs/generatedModels.d.ts.map +1 -0
  427. package/dist/commonjs/generatedModels.js +11 -0
  428. package/dist/commonjs/generatedModels.js.map +1 -0
  429. package/dist/commonjs/index.d.ts +31 -0
  430. package/dist/commonjs/index.d.ts.map +1 -0
  431. package/dist/commonjs/index.js +52 -0
  432. package/dist/commonjs/index.js.map +1 -0
  433. package/dist/commonjs/internal-avro/AvroConstants.d.ts +5 -0
  434. package/dist/commonjs/internal-avro/AvroConstants.d.ts.map +1 -0
  435. package/dist/commonjs/internal-avro/AvroConstants.js +10 -0
  436. package/dist/commonjs/internal-avro/AvroConstants.js.map +1 -0
  437. package/dist/commonjs/internal-avro/AvroParser.d.ts +57 -0
  438. package/dist/commonjs/internal-avro/AvroParser.d.ts.map +1 -0
  439. package/dist/commonjs/internal-avro/AvroParser.js +328 -0
  440. package/dist/commonjs/internal-avro/AvroParser.js.map +1 -0
  441. package/dist/commonjs/internal-avro/AvroReadable.d.ts +16 -0
  442. package/dist/commonjs/internal-avro/AvroReadable.d.ts.map +1 -0
  443. package/dist/commonjs/internal-avro/AvroReadable.js +9 -0
  444. package/dist/commonjs/internal-avro/AvroReadable.js.map +1 -0
  445. package/dist/commonjs/internal-avro/AvroReadableFromBlob.d.ts +10 -0
  446. package/dist/commonjs/internal-avro/AvroReadableFromBlob.d.ts.map +1 -0
  447. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js +53 -0
  448. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js.map +1 -0
  449. package/dist/commonjs/internal-avro/AvroReadableFromStream.d.ts +11 -0
  450. package/dist/commonjs/internal-avro/AvroReadableFromStream.d.ts.map +1 -0
  451. package/dist/commonjs/internal-avro/AvroReadableFromStream.js +90 -0
  452. package/dist/commonjs/internal-avro/AvroReadableFromStream.js.map +1 -0
  453. package/dist/commonjs/internal-avro/AvroReader.d.ts +32 -0
  454. package/dist/commonjs/internal-avro/AvroReader.d.ts.map +1 -0
  455. package/dist/commonjs/internal-avro/AvroReader.js +120 -0
  456. package/dist/commonjs/internal-avro/AvroReader.js.map +1 -0
  457. package/dist/commonjs/internal-avro/index.d.ts +4 -0
  458. package/dist/commonjs/internal-avro/index.d.ts.map +1 -0
  459. package/dist/commonjs/internal-avro/index.js +12 -0
  460. package/dist/commonjs/internal-avro/index.js.map +1 -0
  461. package/dist/commonjs/internal-avro/utils/utils.common.d.ts +6 -0
  462. package/dist/commonjs/internal-avro/utils/utils.common.d.ts.map +1 -0
  463. package/dist/commonjs/internal-avro/utils/utils.common.js +19 -0
  464. package/dist/commonjs/internal-avro/utils/utils.common.js.map +1 -0
  465. package/dist/commonjs/log.d.ts +5 -0
  466. package/dist/commonjs/log.d.ts.map +1 -0
  467. package/dist/commonjs/log.js +11 -0
  468. package/dist/commonjs/log.js.map +1 -0
  469. package/dist/commonjs/models.d.ts +333 -0
  470. package/dist/commonjs/models.d.ts.map +1 -0
  471. package/dist/commonjs/models.js +121 -0
  472. package/dist/commonjs/models.js.map +1 -0
  473. package/dist/commonjs/package.json +3 -0
  474. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.d.ts +74 -0
  475. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.d.ts.map +1 -0
  476. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +138 -0
  477. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js.map +1 -0
  478. package/dist/commonjs/sas/AccountSASPermissions.d.ts +146 -0
  479. package/dist/commonjs/sas/AccountSASPermissions.d.ts.map +1 -0
  480. package/dist/commonjs/sas/AccountSASPermissions.js +229 -0
  481. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -0
  482. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +38 -0
  483. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts.map +1 -0
  484. package/dist/commonjs/sas/AccountSASResourceTypes.js +74 -0
  485. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -0
  486. package/dist/commonjs/sas/AccountSASServices.d.ts +40 -0
  487. package/dist/commonjs/sas/AccountSASServices.d.ts.map +1 -0
  488. package/dist/commonjs/sas/AccountSASServices.js +82 -0
  489. package/dist/commonjs/sas/AccountSASServices.js.map +1 -0
  490. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +78 -0
  491. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts.map +1 -0
  492. package/dist/commonjs/sas/AccountSASSignatureValues.js +104 -0
  493. package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -0
  494. package/dist/commonjs/sas/BlobSASPermissions.d.ts +127 -0
  495. package/dist/commonjs/sas/BlobSASPermissions.d.ts.map +1 -0
  496. package/dist/commonjs/sas/BlobSASPermissions.js +197 -0
  497. package/dist/commonjs/sas/BlobSASPermissions.js.map +1 -0
  498. package/dist/commonjs/sas/BlobSASSignatureValues.d.ts +289 -0
  499. package/dist/commonjs/sas/BlobSASSignatureValues.d.ts.map +1 -0
  500. package/dist/commonjs/sas/BlobSASSignatureValues.js +670 -0
  501. package/dist/commonjs/sas/BlobSASSignatureValues.js.map +1 -0
  502. package/dist/commonjs/sas/ContainerSASPermissions.d.ts +143 -0
  503. package/dist/commonjs/sas/ContainerSASPermissions.d.ts.map +1 -0
  504. package/dist/commonjs/sas/ContainerSASPermissions.js +223 -0
  505. package/dist/commonjs/sas/ContainerSASPermissions.js.map +1 -0
  506. package/dist/commonjs/sas/SASQueryParameters.d.ts +298 -0
  507. package/dist/commonjs/sas/SASQueryParameters.d.ts.map +1 -0
  508. package/dist/commonjs/sas/SASQueryParameters.js +367 -0
  509. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -0
  510. package/dist/commonjs/sas/SasIPRange.d.ts +24 -0
  511. package/dist/commonjs/sas/SasIPRange.d.ts.map +1 -0
  512. package/dist/commonjs/sas/SasIPRange.js +16 -0
  513. package/dist/commonjs/sas/SasIPRange.js.map +1 -0
  514. package/dist/commonjs/tsdoc-metadata.json +11 -0
  515. package/dist/commonjs/utils/Batch.d.ts +68 -0
  516. package/dist/commonjs/utils/Batch.d.ts.map +1 -0
  517. package/dist/commonjs/utils/Batch.js +134 -0
  518. package/dist/commonjs/utils/Batch.js.map +1 -0
  519. package/dist/commonjs/utils/BlobQuickQueryStream.d.ts +42 -0
  520. package/dist/commonjs/utils/BlobQuickQueryStream.d.ts.map +1 -0
  521. package/dist/commonjs/utils/BlobQuickQueryStream.js +120 -0
  522. package/dist/commonjs/utils/BlobQuickQueryStream.js.map +1 -0
  523. package/dist/commonjs/utils/Mutex.d.ts +23 -0
  524. package/dist/commonjs/utils/Mutex.d.ts.map +1 -0
  525. package/dist/commonjs/utils/Mutex.js +69 -0
  526. package/dist/commonjs/utils/Mutex.js.map +1 -0
  527. package/dist/commonjs/utils/RetriableReadableStream.d.ts +62 -0
  528. package/dist/commonjs/utils/RetriableReadableStream.d.ts.map +1 -0
  529. package/dist/commonjs/utils/RetriableReadableStream.js +131 -0
  530. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -0
  531. package/dist/commonjs/utils/SharedKeyComparator.d.ts +2 -0
  532. package/dist/commonjs/utils/SharedKeyComparator.d.ts.map +1 -0
  533. package/dist/commonjs/utils/SharedKeyComparator.js +76 -0
  534. package/dist/commonjs/utils/SharedKeyComparator.js.map +1 -0
  535. package/dist/commonjs/utils/constants.d.ts +70 -0
  536. package/dist/commonjs/utils/constants.d.ts.map +1 -0
  537. package/dist/commonjs/utils/constants.js +229 -0
  538. package/dist/commonjs/utils/constants.js.map +1 -0
  539. package/dist/commonjs/utils/tracing.d.ts +6 -0
  540. package/dist/commonjs/utils/tracing.d.ts.map +1 -0
  541. package/dist/commonjs/utils/tracing.js +17 -0
  542. package/dist/commonjs/utils/tracing.js.map +1 -0
  543. package/dist/commonjs/utils/utils.common.d.ts +323 -0
  544. package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
  545. package/dist/commonjs/utils/utils.common.js +807 -0
  546. package/dist/commonjs/utils/utils.common.js.map +1 -0
  547. package/dist/commonjs/utils/utils.d.ts +46 -0
  548. package/dist/commonjs/utils/utils.d.ts.map +1 -0
  549. package/dist/commonjs/utils/utils.js +140 -0
  550. package/dist/commonjs/utils/utils.js.map +1 -0
  551. package/dist/esm/BatchResponse.d.ts +49 -0
  552. package/dist/esm/BatchResponse.d.ts.map +1 -0
  553. package/dist/esm/BatchResponse.js +4 -0
  554. package/dist/esm/BatchResponse.js.map +1 -0
  555. package/dist/esm/BatchResponseParser.d.ts +16 -0
  556. package/dist/esm/BatchResponseParser.d.ts.map +1 -0
  557. package/dist/esm/BatchResponseParser.js +142 -0
  558. package/dist/esm/BatchResponseParser.js.map +1 -0
  559. package/dist/esm/BatchUtils.d.ts +4 -0
  560. package/dist/esm/BatchUtils.d.ts.map +1 -0
  561. package/dist/esm/BatchUtils.js +15 -0
  562. package/dist/esm/BatchUtils.js.map +1 -0
  563. package/dist/esm/BlobBatch.d.ts +111 -0
  564. package/dist/esm/BlobBatch.d.ts.map +1 -0
  565. package/dist/esm/BlobBatch.js +274 -0
  566. package/dist/esm/BlobBatch.js.map +1 -0
  567. package/dist/esm/BlobBatchClient.d.ts +180 -0
  568. package/dist/esm/BlobBatchClient.d.ts.map +1 -0
  569. package/dist/esm/BlobBatchClient.js +172 -0
  570. package/dist/esm/BlobBatchClient.js.map +1 -0
  571. package/dist/esm/BlobDownloadResponse.d.ts +370 -0
  572. package/dist/esm/BlobDownloadResponse.d.ts.map +1 -0
  573. package/dist/esm/BlobDownloadResponse.js +465 -0
  574. package/dist/esm/BlobDownloadResponse.js.map +1 -0
  575. package/dist/esm/BlobLeaseClient.d.ts +159 -0
  576. package/dist/esm/BlobLeaseClient.d.ts.map +1 -0
  577. package/dist/esm/BlobLeaseClient.js +201 -0
  578. package/dist/esm/BlobLeaseClient.js.map +1 -0
  579. package/dist/esm/BlobQueryResponse.common.d.ts +291 -0
  580. package/dist/esm/BlobQueryResponse.common.d.ts.map +1 -0
  581. package/dist/esm/BlobQueryResponse.common.js +363 -0
  582. package/dist/esm/BlobQueryResponse.common.js.map +1 -0
  583. package/dist/esm/BlobQueryResponse.d.ts +295 -0
  584. package/dist/esm/BlobQueryResponse.d.ts.map +1 -0
  585. package/dist/esm/BlobQueryResponse.js +369 -0
  586. package/dist/esm/BlobQueryResponse.js.map +1 -0
  587. package/dist/esm/BlobServiceClient.d.ts +615 -0
  588. package/dist/esm/BlobServiceClient.d.ts.map +1 -0
  589. package/dist/esm/BlobServiceClient.js +702 -0
  590. package/dist/esm/BlobServiceClient.js.map +1 -0
  591. package/dist/esm/Clients.d.ts +3233 -0
  592. package/dist/esm/Clients.d.ts.map +1 -0
  593. package/dist/esm/Clients.js +2845 -0
  594. package/dist/esm/Clients.js.map +1 -0
  595. package/dist/esm/ContainerClient.d.ts +1103 -0
  596. package/dist/esm/ContainerClient.d.ts.map +1 -0
  597. package/dist/esm/ContainerClient.js +1293 -0
  598. package/dist/esm/ContainerClient.js.map +1 -0
  599. package/dist/esm/PageBlobRangeResponse.d.ts +35 -0
  600. package/dist/esm/PageBlobRangeResponse.d.ts.map +1 -0
  601. package/dist/esm/PageBlobRangeResponse.js +31 -0
  602. package/dist/esm/PageBlobRangeResponse.js.map +1 -0
  603. package/dist/esm/Pipeline.d.ts +135 -0
  604. package/dist/esm/Pipeline.d.ts.map +1 -0
  605. package/dist/esm/Pipeline.js +271 -0
  606. package/dist/esm/Pipeline.js.map +1 -0
  607. package/dist/esm/Range.d.ts +24 -0
  608. package/dist/esm/Range.d.ts.map +1 -0
  609. package/dist/esm/Range.js +21 -0
  610. package/dist/esm/Range.js.map +1 -0
  611. package/dist/esm/StorageClient.d.ts +50 -0
  612. package/dist/esm/StorageClient.d.ts.map +1 -0
  613. package/dist/esm/StorageClient.js +52 -0
  614. package/dist/esm/StorageClient.js.map +1 -0
  615. package/dist/esm/StorageContextClient.d.ts +9 -0
  616. package/dist/esm/StorageContextClient.d.ts.map +1 -0
  617. package/dist/esm/StorageContextClient.js +17 -0
  618. package/dist/esm/StorageContextClient.js.map +1 -0
  619. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts +3 -0
  620. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.d.mts.map +1 -0
  621. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs +5 -0
  622. package/dist/esm/credentials/StorageSharedKeyCredential-react-native.mjs.map +1 -0
  623. package/dist/esm/generated/src/index.d.ts +4 -0
  624. package/dist/esm/generated/src/index.d.ts.map +1 -0
  625. package/dist/esm/generated/src/index.js +11 -0
  626. package/dist/esm/generated/src/index.js.map +1 -0
  627. package/dist/esm/generated/src/models/index.d.ts +3978 -0
  628. package/dist/esm/generated/src/models/index.d.ts.map +1 -0
  629. package/dist/esm/generated/src/models/index.js +264 -0
  630. package/dist/esm/generated/src/models/index.js.map +1 -0
  631. package/dist/esm/generated/src/models/mappers.d.ts +181 -0
  632. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
  633. package/dist/esm/generated/src/models/mappers.js +8330 -0
  634. package/dist/esm/generated/src/models/mappers.js.map +1 -0
  635. package/dist/esm/generated/src/models/parameters.d.ts +152 -0
  636. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
  637. package/dist/esm/generated/src/models/parameters.js +1674 -0
  638. package/dist/esm/generated/src/models/parameters.js.map +1 -0
  639. package/dist/esm/generated/src/operations/appendBlob.d.ts +45 -0
  640. package/dist/esm/generated/src/operations/appendBlob.d.ts.map +1 -0
  641. package/dist/esm/generated/src/operations/appendBlob.js +223 -0
  642. package/dist/esm/generated/src/operations/appendBlob.js.map +1 -0
  643. package/dist/esm/generated/src/operations/blob.d.ts +178 -0
  644. package/dist/esm/generated/src/operations/blob.d.ts.map +1 -0
  645. package/dist/esm/generated/src/operations/blob.js +1030 -0
  646. package/dist/esm/generated/src/operations/blob.js.map +1 -0
  647. package/dist/esm/generated/src/operations/blockBlob.d.ts +79 -0
  648. package/dist/esm/generated/src/operations/blockBlob.d.ts.map +1 -0
  649. package/dist/esm/generated/src/operations/blockBlob.js +368 -0
  650. package/dist/esm/generated/src/operations/blockBlob.js.map +1 -0
  651. package/dist/esm/generated/src/operations/container.d.ts +130 -0
  652. package/dist/esm/generated/src/operations/container.d.ts.map +1 -0
  653. package/dist/esm/generated/src/operations/container.js +716 -0
  654. package/dist/esm/generated/src/operations/container.js.map +1 -0
  655. package/dist/esm/generated/src/operations/index.d.ts +7 -0
  656. package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
  657. package/dist/esm/generated/src/operations/index.js +14 -0
  658. package/dist/esm/generated/src/operations/index.js.map +1 -0
  659. package/dist/esm/generated/src/operations/pageBlob.d.ts +87 -0
  660. package/dist/esm/generated/src/operations/pageBlob.d.ts.map +1 -0
  661. package/dist/esm/generated/src/operations/pageBlob.js +458 -0
  662. package/dist/esm/generated/src/operations/pageBlob.js.map +1 -0
  663. package/dist/esm/generated/src/operations/service.d.ts +67 -0
  664. package/dist/esm/generated/src/operations/service.d.ts.map +1 -0
  665. package/dist/esm/generated/src/operations/service.js +324 -0
  666. package/dist/esm/generated/src/operations/service.js.map +1 -0
  667. package/dist/esm/generated/src/operationsInterfaces/appendBlob.d.ts +37 -0
  668. package/dist/esm/generated/src/operationsInterfaces/appendBlob.d.ts.map +1 -0
  669. package/dist/esm/generated/src/operationsInterfaces/appendBlob.js +9 -0
  670. package/dist/esm/generated/src/operationsInterfaces/appendBlob.js.map +1 -0
  671. package/dist/esm/generated/src/operationsInterfaces/blob.d.ts +170 -0
  672. package/dist/esm/generated/src/operationsInterfaces/blob.d.ts.map +1 -0
  673. package/dist/esm/generated/src/operationsInterfaces/blob.js +9 -0
  674. package/dist/esm/generated/src/operationsInterfaces/blob.js.map +1 -0
  675. package/dist/esm/generated/src/operationsInterfaces/blockBlob.d.ts +71 -0
  676. package/dist/esm/generated/src/operationsInterfaces/blockBlob.d.ts.map +1 -0
  677. package/dist/esm/generated/src/operationsInterfaces/blockBlob.js +9 -0
  678. package/dist/esm/generated/src/operationsInterfaces/blockBlob.js.map +1 -0
  679. package/dist/esm/generated/src/operationsInterfaces/container.d.ts +122 -0
  680. package/dist/esm/generated/src/operationsInterfaces/container.d.ts.map +1 -0
  681. package/dist/esm/generated/src/operationsInterfaces/container.js +9 -0
  682. package/dist/esm/generated/src/operationsInterfaces/container.js.map +1 -0
  683. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +7 -0
  684. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  685. package/dist/esm/generated/src/operationsInterfaces/index.js +14 -0
  686. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
  687. package/dist/esm/generated/src/operationsInterfaces/pageBlob.d.ts +79 -0
  688. package/dist/esm/generated/src/operationsInterfaces/pageBlob.d.ts.map +1 -0
  689. package/dist/esm/generated/src/operationsInterfaces/pageBlob.js +9 -0
  690. package/dist/esm/generated/src/operationsInterfaces/pageBlob.js.map +1 -0
  691. package/dist/esm/generated/src/operationsInterfaces/service.d.ts +59 -0
  692. package/dist/esm/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  693. package/dist/esm/generated/src/operationsInterfaces/service.js +9 -0
  694. package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -0
  695. package/dist/esm/generated/src/storageClient.d.ts +21 -0
  696. package/dist/esm/generated/src/storageClient.d.ts.map +1 -0
  697. package/dist/esm/generated/src/storageClient.js +61 -0
  698. package/dist/esm/generated/src/storageClient.js.map +1 -0
  699. package/dist/esm/generatedModels.d.ts +260 -0
  700. package/dist/esm/generatedModels.d.ts.map +1 -0
  701. package/dist/esm/generatedModels.js +8 -0
  702. package/dist/esm/generatedModels.js.map +1 -0
  703. package/dist/esm/index.d.ts +31 -0
  704. package/dist/esm/index.d.ts.map +1 -0
  705. package/dist/esm/index.js +25 -0
  706. package/dist/esm/index.js.map +1 -0
  707. package/dist/esm/internal-avro/AvroConstants.d.ts +5 -0
  708. package/dist/esm/internal-avro/AvroConstants.d.ts.map +1 -0
  709. package/dist/esm/internal-avro/AvroConstants.js +7 -0
  710. package/dist/esm/internal-avro/AvroConstants.js.map +1 -0
  711. package/dist/esm/internal-avro/AvroParser.d.ts +57 -0
  712. package/dist/esm/internal-avro/AvroParser.d.ts.map +1 -0
  713. package/dist/esm/internal-avro/AvroParser.js +323 -0
  714. package/dist/esm/internal-avro/AvroParser.js.map +1 -0
  715. package/dist/esm/internal-avro/AvroReadable.d.ts +16 -0
  716. package/dist/esm/internal-avro/AvroReadable.d.ts.map +1 -0
  717. package/dist/esm/internal-avro/AvroReadable.js +5 -0
  718. package/dist/esm/internal-avro/AvroReadable.js.map +1 -0
  719. package/dist/esm/internal-avro/AvroReadableFromBlob.d.ts +10 -0
  720. package/dist/esm/internal-avro/AvroReadableFromBlob.d.ts.map +1 -0
  721. package/dist/esm/internal-avro/AvroReadableFromBlob.js +49 -0
  722. package/dist/esm/internal-avro/AvroReadableFromBlob.js.map +1 -0
  723. package/dist/esm/internal-avro/AvroReadableFromStream.d.ts +11 -0
  724. package/dist/esm/internal-avro/AvroReadableFromStream.d.ts.map +1 -0
  725. package/dist/esm/internal-avro/AvroReadableFromStream.js +86 -0
  726. package/dist/esm/internal-avro/AvroReadableFromStream.js.map +1 -0
  727. package/dist/esm/internal-avro/AvroReader.d.ts +32 -0
  728. package/dist/esm/internal-avro/AvroReader.d.ts.map +1 -0
  729. package/dist/esm/internal-avro/AvroReader.js +116 -0
  730. package/dist/esm/internal-avro/AvroReader.js.map +1 -0
  731. package/dist/esm/internal-avro/index.d.ts +4 -0
  732. package/dist/esm/internal-avro/index.d.ts.map +1 -0
  733. package/dist/esm/internal-avro/index.js +6 -0
  734. package/dist/esm/internal-avro/index.js.map +1 -0
  735. package/dist/esm/internal-avro/utils/utils.common.d.ts +6 -0
  736. package/dist/esm/internal-avro/utils/utils.common.d.ts.map +1 -0
  737. package/dist/esm/internal-avro/utils/utils.common.js +16 -0
  738. package/dist/esm/internal-avro/utils/utils.common.js.map +1 -0
  739. package/dist/esm/log.d.ts +5 -0
  740. package/dist/esm/log.d.ts.map +1 -0
  741. package/dist/esm/log.js +8 -0
  742. package/dist/esm/log.js.map +1 -0
  743. package/dist/esm/models.d.ts +333 -0
  744. package/dist/esm/models.d.ts.map +1 -0
  745. package/dist/esm/models.js +115 -0
  746. package/dist/esm/models.js.map +1 -0
  747. package/dist/esm/package.json +3 -0
  748. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +17 -0
  749. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +1 -0
  750. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +18 -0
  751. package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +1 -0
  752. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.d.ts +74 -0
  753. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.d.ts.map +1 -0
  754. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js +134 -0
  755. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js.map +1 -0
  756. package/dist/esm/sas/AccountSASPermissions.d.ts +146 -0
  757. package/dist/esm/sas/AccountSASPermissions.d.ts.map +1 -0
  758. package/dist/esm/sas/AccountSASPermissions.js +225 -0
  759. package/dist/esm/sas/AccountSASPermissions.js.map +1 -0
  760. package/dist/esm/sas/AccountSASResourceTypes.d.ts +38 -0
  761. package/dist/esm/sas/AccountSASResourceTypes.d.ts.map +1 -0
  762. package/dist/esm/sas/AccountSASResourceTypes.js +70 -0
  763. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -0
  764. package/dist/esm/sas/AccountSASServices.d.ts +40 -0
  765. package/dist/esm/sas/AccountSASServices.d.ts.map +1 -0
  766. package/dist/esm/sas/AccountSASServices.js +78 -0
  767. package/dist/esm/sas/AccountSASServices.js.map +1 -0
  768. package/dist/esm/sas/AccountSASSignatureValues.d.ts +78 -0
  769. package/dist/esm/sas/AccountSASSignatureValues.d.ts.map +1 -0
  770. package/dist/esm/sas/AccountSASSignatureValues.js +100 -0
  771. package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -0
  772. package/dist/esm/sas/BlobSASPermissions.d.ts +127 -0
  773. package/dist/esm/sas/BlobSASPermissions.d.ts.map +1 -0
  774. package/dist/esm/sas/BlobSASPermissions.js +193 -0
  775. package/dist/esm/sas/BlobSASPermissions.js.map +1 -0
  776. package/dist/esm/sas/BlobSASSignatureValues.d.ts +289 -0
  777. package/dist/esm/sas/BlobSASSignatureValues.d.ts.map +1 -0
  778. package/dist/esm/sas/BlobSASSignatureValues.js +666 -0
  779. package/dist/esm/sas/BlobSASSignatureValues.js.map +1 -0
  780. package/dist/esm/sas/ContainerSASPermissions.d.ts +143 -0
  781. package/dist/esm/sas/ContainerSASPermissions.d.ts.map +1 -0
  782. package/dist/esm/sas/ContainerSASPermissions.js +219 -0
  783. package/dist/esm/sas/ContainerSASPermissions.js.map +1 -0
  784. package/dist/esm/sas/SASQueryParameters.d.ts +298 -0
  785. package/dist/esm/sas/SASQueryParameters.d.ts.map +1 -0
  786. package/dist/esm/sas/SASQueryParameters.js +363 -0
  787. package/dist/esm/sas/SASQueryParameters.js.map +1 -0
  788. package/dist/esm/sas/SasIPRange.d.ts +24 -0
  789. package/dist/esm/sas/SasIPRange.d.ts.map +1 -0
  790. package/dist/esm/sas/SasIPRange.js +13 -0
  791. package/dist/esm/sas/SasIPRange.js.map +1 -0
  792. package/dist/esm/utils/Batch.d.ts +68 -0
  793. package/dist/esm/utils/Batch.d.ts.map +1 -0
  794. package/dist/esm/utils/Batch.js +130 -0
  795. package/dist/esm/utils/Batch.js.map +1 -0
  796. package/dist/esm/utils/BlobQuickQueryStream.d.ts +42 -0
  797. package/dist/esm/utils/BlobQuickQueryStream.d.ts.map +1 -0
  798. package/dist/esm/utils/BlobQuickQueryStream.js +116 -0
  799. package/dist/esm/utils/BlobQuickQueryStream.js.map +1 -0
  800. package/dist/esm/utils/Mutex.d.ts +23 -0
  801. package/dist/esm/utils/Mutex.d.ts.map +1 -0
  802. package/dist/esm/utils/Mutex.js +65 -0
  803. package/dist/esm/utils/Mutex.js.map +1 -0
  804. package/dist/esm/utils/RetriableReadableStream.d.ts +62 -0
  805. package/dist/esm/utils/RetriableReadableStream.d.ts.map +1 -0
  806. package/dist/esm/utils/RetriableReadableStream.js +127 -0
  807. package/dist/esm/utils/RetriableReadableStream.js.map +1 -0
  808. package/dist/esm/utils/SharedKeyComparator.d.ts +2 -0
  809. package/dist/esm/utils/SharedKeyComparator.d.ts.map +1 -0
  810. package/dist/esm/utils/SharedKeyComparator.js +73 -0
  811. package/dist/esm/utils/SharedKeyComparator.js.map +1 -0
  812. package/dist/esm/utils/constants.d.ts +70 -0
  813. package/dist/esm/utils/constants.d.ts.map +1 -0
  814. package/dist/esm/utils/constants.js +226 -0
  815. package/dist/esm/utils/constants.js.map +1 -0
  816. package/dist/esm/utils/tracing.d.ts +6 -0
  817. package/dist/esm/utils/tracing.d.ts.map +1 -0
  818. package/dist/esm/utils/tracing.js +14 -0
  819. package/dist/esm/utils/tracing.js.map +1 -0
  820. package/dist/esm/utils/utils.common.d.ts +323 -0
  821. package/dist/esm/utils/utils.common.d.ts.map +1 -0
  822. package/dist/esm/utils/utils.common.js +769 -0
  823. package/dist/esm/utils/utils.common.js.map +1 -0
  824. package/dist/esm/utils/utils.d.ts +46 -0
  825. package/dist/esm/utils/utils.d.ts.map +1 -0
  826. package/dist/esm/utils/utils.js +132 -0
  827. package/dist/esm/utils/utils.js.map +1 -0
  828. package/dist/react-native/BatchResponse.d.ts +49 -0
  829. package/dist/react-native/BatchResponse.d.ts.map +1 -0
  830. package/dist/react-native/BatchResponse.js +4 -0
  831. package/dist/react-native/BatchResponse.js.map +1 -0
  832. package/dist/react-native/BatchResponseParser.d.ts +16 -0
  833. package/dist/react-native/BatchResponseParser.d.ts.map +1 -0
  834. package/dist/react-native/BatchResponseParser.js +142 -0
  835. package/dist/react-native/BatchResponseParser.js.map +1 -0
  836. package/dist/react-native/BatchUtils.d.ts +4 -0
  837. package/dist/react-native/BatchUtils.d.ts.map +1 -0
  838. package/dist/react-native/BatchUtils.js +15 -0
  839. package/dist/react-native/BatchUtils.js.map +1 -0
  840. package/dist/react-native/BlobBatch.d.ts +111 -0
  841. package/dist/react-native/BlobBatch.d.ts.map +1 -0
  842. package/dist/react-native/BlobBatch.js +274 -0
  843. package/dist/react-native/BlobBatch.js.map +1 -0
  844. package/dist/react-native/BlobBatchClient.d.ts +180 -0
  845. package/dist/react-native/BlobBatchClient.d.ts.map +1 -0
  846. package/dist/react-native/BlobBatchClient.js +172 -0
  847. package/dist/react-native/BlobBatchClient.js.map +1 -0
  848. package/dist/react-native/BlobDownloadResponse-react-native.d.mts.map +1 -0
  849. package/dist/react-native/BlobDownloadResponse-react-native.mjs.map +1 -0
  850. package/dist/react-native/BlobDownloadResponse.d.ts +2 -0
  851. package/dist/react-native/BlobDownloadResponse.js +7 -0
  852. package/dist/react-native/BlobLeaseClient.d.ts +159 -0
  853. package/dist/react-native/BlobLeaseClient.d.ts.map +1 -0
  854. package/dist/react-native/BlobLeaseClient.js +201 -0
  855. package/dist/react-native/BlobLeaseClient.js.map +1 -0
  856. package/dist/react-native/BlobQueryResponse-react-native.d.mts.map +1 -0
  857. package/dist/react-native/BlobQueryResponse-react-native.mjs.map +1 -0
  858. package/dist/react-native/BlobQueryResponse.common.d.ts +291 -0
  859. package/dist/react-native/BlobQueryResponse.common.d.ts.map +1 -0
  860. package/dist/react-native/BlobQueryResponse.common.js +363 -0
  861. package/dist/react-native/BlobQueryResponse.common.js.map +1 -0
  862. package/dist/react-native/BlobQueryResponse.d.ts +2 -0
  863. package/dist/react-native/BlobQueryResponse.js +4 -0
  864. package/dist/react-native/BlobServiceClient.d.ts +615 -0
  865. package/dist/react-native/BlobServiceClient.d.ts.map +1 -0
  866. package/dist/react-native/BlobServiceClient.js +702 -0
  867. package/dist/react-native/BlobServiceClient.js.map +1 -0
  868. package/dist/react-native/Clients.d.ts +3233 -0
  869. package/dist/react-native/Clients.d.ts.map +1 -0
  870. package/dist/react-native/Clients.js +2845 -0
  871. package/dist/react-native/Clients.js.map +1 -0
  872. package/dist/react-native/ContainerClient.d.ts +1103 -0
  873. package/dist/react-native/ContainerClient.d.ts.map +1 -0
  874. package/dist/react-native/ContainerClient.js +1293 -0
  875. package/dist/react-native/ContainerClient.js.map +1 -0
  876. package/dist/react-native/PageBlobRangeResponse.d.ts +35 -0
  877. package/dist/react-native/PageBlobRangeResponse.d.ts.map +1 -0
  878. package/dist/react-native/PageBlobRangeResponse.js +31 -0
  879. package/dist/react-native/PageBlobRangeResponse.js.map +1 -0
  880. package/dist/react-native/Pipeline.d.ts +135 -0
  881. package/dist/react-native/Pipeline.d.ts.map +1 -0
  882. package/dist/react-native/Pipeline.js +271 -0
  883. package/dist/react-native/Pipeline.js.map +1 -0
  884. package/dist/react-native/Range.d.ts +24 -0
  885. package/dist/react-native/Range.d.ts.map +1 -0
  886. package/dist/react-native/Range.js +21 -0
  887. package/dist/react-native/Range.js.map +1 -0
  888. package/dist/react-native/StorageClient.d.ts +50 -0
  889. package/dist/react-native/StorageClient.d.ts.map +1 -0
  890. package/dist/react-native/StorageClient.js +52 -0
  891. package/dist/react-native/StorageClient.js.map +1 -0
  892. package/dist/react-native/StorageContextClient.d.ts +9 -0
  893. package/dist/react-native/StorageContextClient.d.ts.map +1 -0
  894. package/dist/react-native/StorageContextClient.js +17 -0
  895. package/dist/react-native/StorageContextClient.js.map +1 -0
  896. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts +3 -0
  897. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts.map +1 -0
  898. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs +5 -0
  899. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs.map +1 -0
  900. package/dist/react-native/generated/src/index.d.ts +4 -0
  901. package/dist/react-native/generated/src/index.d.ts.map +1 -0
  902. package/dist/react-native/generated/src/index.js +11 -0
  903. package/dist/react-native/generated/src/index.js.map +1 -0
  904. package/dist/react-native/generated/src/models/index.d.ts +3978 -0
  905. package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
  906. package/dist/react-native/generated/src/models/index.js +264 -0
  907. package/dist/react-native/generated/src/models/index.js.map +1 -0
  908. package/dist/react-native/generated/src/models/mappers.d.ts +181 -0
  909. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
  910. package/dist/react-native/generated/src/models/mappers.js +8330 -0
  911. package/dist/react-native/generated/src/models/mappers.js.map +1 -0
  912. package/dist/react-native/generated/src/models/parameters.d.ts +152 -0
  913. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
  914. package/dist/react-native/generated/src/models/parameters.js +1674 -0
  915. package/dist/react-native/generated/src/models/parameters.js.map +1 -0
  916. package/dist/react-native/generated/src/operations/appendBlob.d.ts +45 -0
  917. package/dist/react-native/generated/src/operations/appendBlob.d.ts.map +1 -0
  918. package/dist/react-native/generated/src/operations/appendBlob.js +223 -0
  919. package/dist/react-native/generated/src/operations/appendBlob.js.map +1 -0
  920. package/dist/react-native/generated/src/operations/blob.d.ts +178 -0
  921. package/dist/react-native/generated/src/operations/blob.d.ts.map +1 -0
  922. package/dist/react-native/generated/src/operations/blob.js +1030 -0
  923. package/dist/react-native/generated/src/operations/blob.js.map +1 -0
  924. package/dist/react-native/generated/src/operations/blockBlob.d.ts +79 -0
  925. package/dist/react-native/generated/src/operations/blockBlob.d.ts.map +1 -0
  926. package/dist/react-native/generated/src/operations/blockBlob.js +368 -0
  927. package/dist/react-native/generated/src/operations/blockBlob.js.map +1 -0
  928. package/dist/react-native/generated/src/operations/container.d.ts +130 -0
  929. package/dist/react-native/generated/src/operations/container.d.ts.map +1 -0
  930. package/dist/react-native/generated/src/operations/container.js +716 -0
  931. package/dist/react-native/generated/src/operations/container.js.map +1 -0
  932. package/dist/react-native/generated/src/operations/index.d.ts +7 -0
  933. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
  934. package/dist/react-native/generated/src/operations/index.js +14 -0
  935. package/dist/react-native/generated/src/operations/index.js.map +1 -0
  936. package/dist/react-native/generated/src/operations/pageBlob.d.ts +87 -0
  937. package/dist/react-native/generated/src/operations/pageBlob.d.ts.map +1 -0
  938. package/dist/react-native/generated/src/operations/pageBlob.js +458 -0
  939. package/dist/react-native/generated/src/operations/pageBlob.js.map +1 -0
  940. package/dist/react-native/generated/src/operations/service.d.ts +67 -0
  941. package/dist/react-native/generated/src/operations/service.d.ts.map +1 -0
  942. package/dist/react-native/generated/src/operations/service.js +324 -0
  943. package/dist/react-native/generated/src/operations/service.js.map +1 -0
  944. package/dist/react-native/generated/src/operationsInterfaces/appendBlob.d.ts +37 -0
  945. package/dist/react-native/generated/src/operationsInterfaces/appendBlob.d.ts.map +1 -0
  946. package/dist/react-native/generated/src/operationsInterfaces/appendBlob.js +9 -0
  947. package/dist/react-native/generated/src/operationsInterfaces/appendBlob.js.map +1 -0
  948. package/dist/react-native/generated/src/operationsInterfaces/blob.d.ts +170 -0
  949. package/dist/react-native/generated/src/operationsInterfaces/blob.d.ts.map +1 -0
  950. package/dist/react-native/generated/src/operationsInterfaces/blob.js +9 -0
  951. package/dist/react-native/generated/src/operationsInterfaces/blob.js.map +1 -0
  952. package/dist/react-native/generated/src/operationsInterfaces/blockBlob.d.ts +71 -0
  953. package/dist/react-native/generated/src/operationsInterfaces/blockBlob.d.ts.map +1 -0
  954. package/dist/react-native/generated/src/operationsInterfaces/blockBlob.js +9 -0
  955. package/dist/react-native/generated/src/operationsInterfaces/blockBlob.js.map +1 -0
  956. package/dist/react-native/generated/src/operationsInterfaces/container.d.ts +122 -0
  957. package/dist/react-native/generated/src/operationsInterfaces/container.d.ts.map +1 -0
  958. package/dist/react-native/generated/src/operationsInterfaces/container.js +9 -0
  959. package/dist/react-native/generated/src/operationsInterfaces/container.js.map +1 -0
  960. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +7 -0
  961. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  962. package/dist/react-native/generated/src/operationsInterfaces/index.js +14 -0
  963. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
  964. package/dist/react-native/generated/src/operationsInterfaces/pageBlob.d.ts +79 -0
  965. package/dist/react-native/generated/src/operationsInterfaces/pageBlob.d.ts.map +1 -0
  966. package/dist/react-native/generated/src/operationsInterfaces/pageBlob.js +9 -0
  967. package/dist/react-native/generated/src/operationsInterfaces/pageBlob.js.map +1 -0
  968. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts +59 -0
  969. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  970. package/dist/react-native/generated/src/operationsInterfaces/service.js +9 -0
  971. package/dist/react-native/generated/src/operationsInterfaces/service.js.map +1 -0
  972. package/dist/react-native/generated/src/storageClient.d.ts +21 -0
  973. package/dist/react-native/generated/src/storageClient.d.ts.map +1 -0
  974. package/dist/react-native/generated/src/storageClient.js +61 -0
  975. package/dist/react-native/generated/src/storageClient.js.map +1 -0
  976. package/dist/react-native/generatedModels.d.ts +260 -0
  977. package/dist/react-native/generatedModels.d.ts.map +1 -0
  978. package/dist/react-native/generatedModels.js +8 -0
  979. package/dist/react-native/generatedModels.js.map +1 -0
  980. package/dist/react-native/index.d.ts +31 -0
  981. package/dist/react-native/index.d.ts.map +1 -0
  982. package/dist/react-native/index.js +25 -0
  983. package/dist/react-native/index.js.map +1 -0
  984. package/dist/react-native/internal-avro/AvroConstants.d.ts +5 -0
  985. package/dist/react-native/internal-avro/AvroConstants.d.ts.map +1 -0
  986. package/dist/react-native/internal-avro/AvroConstants.js +7 -0
  987. package/dist/react-native/internal-avro/AvroConstants.js.map +1 -0
  988. package/dist/react-native/internal-avro/AvroParser.d.ts +57 -0
  989. package/dist/react-native/internal-avro/AvroParser.d.ts.map +1 -0
  990. package/dist/react-native/internal-avro/AvroParser.js +323 -0
  991. package/dist/react-native/internal-avro/AvroParser.js.map +1 -0
  992. package/dist/react-native/internal-avro/AvroReadable.d.ts +16 -0
  993. package/dist/react-native/internal-avro/AvroReadable.d.ts.map +1 -0
  994. package/dist/react-native/internal-avro/AvroReadable.js +5 -0
  995. package/dist/react-native/internal-avro/AvroReadable.js.map +1 -0
  996. package/dist/react-native/internal-avro/AvroReadableFromBlob.d.ts +10 -0
  997. package/dist/react-native/internal-avro/AvroReadableFromBlob.d.ts.map +1 -0
  998. package/dist/react-native/internal-avro/AvroReadableFromBlob.js +49 -0
  999. package/dist/react-native/internal-avro/AvroReadableFromBlob.js.map +1 -0
  1000. package/dist/react-native/internal-avro/AvroReadableFromStream.d.ts +11 -0
  1001. package/dist/react-native/internal-avro/AvroReadableFromStream.d.ts.map +1 -0
  1002. package/dist/react-native/internal-avro/AvroReadableFromStream.js +86 -0
  1003. package/dist/react-native/internal-avro/AvroReadableFromStream.js.map +1 -0
  1004. package/dist/react-native/internal-avro/AvroReader.d.ts +32 -0
  1005. package/dist/react-native/internal-avro/AvroReader.d.ts.map +1 -0
  1006. package/dist/react-native/internal-avro/AvroReader.js +116 -0
  1007. package/dist/react-native/internal-avro/AvroReader.js.map +1 -0
  1008. package/dist/react-native/internal-avro/index.d.ts +4 -0
  1009. package/dist/react-native/internal-avro/index.d.ts.map +1 -0
  1010. package/dist/react-native/internal-avro/index.js +6 -0
  1011. package/dist/react-native/internal-avro/index.js.map +1 -0
  1012. package/dist/react-native/internal-avro/utils/utils.common.d.ts +6 -0
  1013. package/dist/react-native/internal-avro/utils/utils.common.d.ts.map +1 -0
  1014. package/dist/react-native/internal-avro/utils/utils.common.js +16 -0
  1015. package/dist/react-native/internal-avro/utils/utils.common.js.map +1 -0
  1016. package/dist/react-native/log.d.ts +5 -0
  1017. package/dist/react-native/log.d.ts.map +1 -0
  1018. package/dist/react-native/log.js +8 -0
  1019. package/dist/react-native/log.js.map +1 -0
  1020. package/dist/react-native/models.d.ts +333 -0
  1021. package/dist/react-native/models.d.ts.map +1 -0
  1022. package/dist/react-native/models.js +115 -0
  1023. package/dist/react-native/models.js.map +1 -0
  1024. package/dist/react-native/package.json +3 -0
  1025. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts +17 -0
  1026. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +1 -0
  1027. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs +18 -0
  1028. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +1 -0
  1029. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.d.ts +74 -0
  1030. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.d.ts.map +1 -0
  1031. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js +134 -0
  1032. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js.map +1 -0
  1033. package/dist/react-native/sas/AccountSASPermissions.d.ts +146 -0
  1034. package/dist/react-native/sas/AccountSASPermissions.d.ts.map +1 -0
  1035. package/dist/react-native/sas/AccountSASPermissions.js +225 -0
  1036. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -0
  1037. package/dist/react-native/sas/AccountSASResourceTypes.d.ts +38 -0
  1038. package/dist/react-native/sas/AccountSASResourceTypes.d.ts.map +1 -0
  1039. package/dist/react-native/sas/AccountSASResourceTypes.js +70 -0
  1040. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -0
  1041. package/dist/react-native/sas/AccountSASServices.d.ts +40 -0
  1042. package/dist/react-native/sas/AccountSASServices.d.ts.map +1 -0
  1043. package/dist/react-native/sas/AccountSASServices.js +78 -0
  1044. package/dist/react-native/sas/AccountSASServices.js.map +1 -0
  1045. package/dist/react-native/sas/AccountSASSignatureValues.d.ts +78 -0
  1046. package/dist/react-native/sas/AccountSASSignatureValues.d.ts.map +1 -0
  1047. package/dist/react-native/sas/AccountSASSignatureValues.js +100 -0
  1048. package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -0
  1049. package/dist/react-native/sas/BlobSASPermissions.d.ts +127 -0
  1050. package/dist/react-native/sas/BlobSASPermissions.d.ts.map +1 -0
  1051. package/dist/react-native/sas/BlobSASPermissions.js +193 -0
  1052. package/dist/react-native/sas/BlobSASPermissions.js.map +1 -0
  1053. package/dist/react-native/sas/BlobSASSignatureValues.d.ts +289 -0
  1054. package/dist/react-native/sas/BlobSASSignatureValues.d.ts.map +1 -0
  1055. package/dist/react-native/sas/BlobSASSignatureValues.js +666 -0
  1056. package/dist/react-native/sas/BlobSASSignatureValues.js.map +1 -0
  1057. package/dist/react-native/sas/ContainerSASPermissions.d.ts +143 -0
  1058. package/dist/react-native/sas/ContainerSASPermissions.d.ts.map +1 -0
  1059. package/dist/react-native/sas/ContainerSASPermissions.js +219 -0
  1060. package/dist/react-native/sas/ContainerSASPermissions.js.map +1 -0
  1061. package/dist/react-native/sas/SASQueryParameters.d.ts +298 -0
  1062. package/dist/react-native/sas/SASQueryParameters.d.ts.map +1 -0
  1063. package/dist/react-native/sas/SASQueryParameters.js +363 -0
  1064. package/dist/react-native/sas/SASQueryParameters.js.map +1 -0
  1065. package/dist/react-native/sas/SasIPRange.d.ts +24 -0
  1066. package/dist/react-native/sas/SasIPRange.d.ts.map +1 -0
  1067. package/dist/react-native/sas/SasIPRange.js +13 -0
  1068. package/dist/react-native/sas/SasIPRange.js.map +1 -0
  1069. package/dist/react-native/utils/Batch.d.ts +68 -0
  1070. package/dist/react-native/utils/Batch.d.ts.map +1 -0
  1071. package/dist/react-native/utils/Batch.js +130 -0
  1072. package/dist/react-native/utils/Batch.js.map +1 -0
  1073. package/dist/react-native/utils/BlobQuickQueryStream.d.ts +42 -0
  1074. package/dist/react-native/utils/BlobQuickQueryStream.d.ts.map +1 -0
  1075. package/dist/react-native/utils/BlobQuickQueryStream.js +116 -0
  1076. package/dist/react-native/utils/BlobQuickQueryStream.js.map +1 -0
  1077. package/dist/react-native/utils/Mutex.d.ts +23 -0
  1078. package/dist/react-native/utils/Mutex.d.ts.map +1 -0
  1079. package/dist/react-native/utils/Mutex.js +65 -0
  1080. package/dist/react-native/utils/Mutex.js.map +1 -0
  1081. package/dist/react-native/utils/RetriableReadableStream.d.ts +62 -0
  1082. package/dist/react-native/utils/RetriableReadableStream.d.ts.map +1 -0
  1083. package/dist/react-native/utils/RetriableReadableStream.js +127 -0
  1084. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -0
  1085. package/dist/react-native/utils/SharedKeyComparator.d.ts +2 -0
  1086. package/dist/react-native/utils/SharedKeyComparator.d.ts.map +1 -0
  1087. package/dist/react-native/utils/SharedKeyComparator.js +73 -0
  1088. package/dist/react-native/utils/SharedKeyComparator.js.map +1 -0
  1089. package/dist/react-native/utils/constants.d.ts +70 -0
  1090. package/dist/react-native/utils/constants.d.ts.map +1 -0
  1091. package/dist/react-native/utils/constants.js +226 -0
  1092. package/dist/react-native/utils/constants.js.map +1 -0
  1093. package/dist/react-native/utils/tracing.d.ts +6 -0
  1094. package/dist/react-native/utils/tracing.d.ts.map +1 -0
  1095. package/dist/react-native/utils/tracing.js +14 -0
  1096. package/dist/react-native/utils/tracing.js.map +1 -0
  1097. package/dist/react-native/utils/utils-react-native.d.mts.map +1 -0
  1098. package/dist/react-native/utils/utils-react-native.mjs.map +1 -0
  1099. package/dist/react-native/utils/utils.common.d.ts +323 -0
  1100. package/dist/react-native/utils/utils.common.d.ts.map +1 -0
  1101. package/dist/react-native/utils/utils.common.js +769 -0
  1102. package/dist/react-native/utils/utils.common.js.map +1 -0
  1103. package/dist/react-native/utils/utils.d.ts +6 -0
  1104. package/dist/react-native/utils/utils.js +18 -0
  1105. package/package.json +225 -0
@@ -0,0 +1,2845 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { getDefaultProxySettings } from "@azure/core-rest-pipeline";
4
+ import { isTokenCredential } from "@azure/core-auth";
5
+ import { isNodeLike } from "@azure/core-util";
6
+ import { randomUUID } from "@azure/core-util";
7
+ import { BlobDownloadResponse } from "./BlobDownloadResponse.js";
8
+ import { BlobQueryResponse } from "./BlobQueryResponse.js";
9
+ import { AnonymousCredential, StorageSharedKeyCredential, } from "@azure/storage-common";
10
+ import { ensureCpkIfSpecified, toAccessTier } from "./models.js";
11
+ import { rangeResponseFromModel } from "./PageBlobRangeResponse.js";
12
+ import { newPipeline, isPipelineLike } from "./Pipeline.js";
13
+ import { BlobBeginCopyFromUrlPoller } from "./pollers/BlobStartCopyFromUrlPoller.js";
14
+ import { rangeToString } from "./Range.js";
15
+ import { StorageClient } from "./StorageClient.js";
16
+ import { Batch } from "./utils/Batch.js";
17
+ import { BufferScheduler } from "@azure/storage-common";
18
+ import { BlobDoesNotUseCustomerSpecifiedEncryption, BlobUsesCustomerSpecifiedEncryptionMsg, BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES, DEFAULT_BLOCK_BUFFER_SIZE_BYTES, DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, ETagAny, URLConstants, } from "./utils/constants.js";
19
+ import { tracingClient } from "./utils/tracing.js";
20
+ import { appendToURLPath, appendToURLQuery, assertResponse, extractConnectionStringParts, ExtractPageRangeInfoItems, generateBlockID, getURLParameter, httpAuthorizationToString, isIpEndpointStyle, parseObjectReplicationRecord, setURLParameter, toBlobTags, toBlobTagsString, toQuerySerialization, toTags, } from "./utils/utils.common.js";
21
+ import { fsCreateReadStream, fsStat, readStreamToLocalFile, streamToBuffer, } from "./utils/utils.js";
22
+ import { generateBlobSASQueryParameters, generateBlobSASQueryParametersInternal, } from "./sas/BlobSASSignatureValues.js";
23
+ import { BlobLeaseClient } from "./BlobLeaseClient.js";
24
+ /**
25
+ * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob,
26
+ * append blob, or page blob.
27
+ */
28
+ export class BlobClient extends StorageClient {
29
+ /**
30
+ * blobContext provided by protocol layer.
31
+ */
32
+ blobContext;
33
+ _name;
34
+ _containerName;
35
+ _versionId;
36
+ _snapshot;
37
+ /**
38
+ * The name of the blob.
39
+ */
40
+ get name() {
41
+ return this._name;
42
+ }
43
+ /**
44
+ * The name of the storage container the blob is associated with.
45
+ */
46
+ get containerName() {
47
+ return this._containerName;
48
+ }
49
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
50
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
51
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
52
+ options) {
53
+ options = options || {};
54
+ let pipeline;
55
+ let url;
56
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
57
+ // (url: string, pipeline: Pipeline)
58
+ url = urlOrConnectionString;
59
+ pipeline = credentialOrPipelineOrContainerName;
60
+ }
61
+ else if ((isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
62
+ credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
63
+ isTokenCredential(credentialOrPipelineOrContainerName)) {
64
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
65
+ url = urlOrConnectionString;
66
+ options = blobNameOrOptions;
67
+ pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
68
+ }
69
+ else if (!credentialOrPipelineOrContainerName &&
70
+ typeof credentialOrPipelineOrContainerName !== "string") {
71
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
72
+ // The second parameter is undefined. Use anonymous credential.
73
+ url = urlOrConnectionString;
74
+ if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
75
+ options = blobNameOrOptions;
76
+ }
77
+ pipeline = newPipeline(new AnonymousCredential(), options);
78
+ }
79
+ else if (credentialOrPipelineOrContainerName &&
80
+ typeof credentialOrPipelineOrContainerName === "string" &&
81
+ blobNameOrOptions &&
82
+ typeof blobNameOrOptions === "string") {
83
+ // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
84
+ const containerName = credentialOrPipelineOrContainerName;
85
+ const blobName = blobNameOrOptions;
86
+ const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
87
+ if (extractedCreds.kind === "AccountConnString") {
88
+ if (isNodeLike) {
89
+ const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
90
+ url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
91
+ if (!options.proxyOptions) {
92
+ options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);
93
+ }
94
+ pipeline = newPipeline(sharedKeyCredential, options);
95
+ }
96
+ else {
97
+ throw new Error("Account connection string is only supported in Node.js environment");
98
+ }
99
+ }
100
+ else if (extractedCreds.kind === "SASConnString") {
101
+ url =
102
+ appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
103
+ "?" +
104
+ extractedCreds.accountSas;
105
+ pipeline = newPipeline(new AnonymousCredential(), options);
106
+ }
107
+ else {
108
+ throw new Error("Connection string must be either an Account connection string or a SAS connection string");
109
+ }
110
+ }
111
+ else {
112
+ throw new Error("Expecting non-empty strings for containerName and blobName parameters");
113
+ }
114
+ super(url, pipeline);
115
+ ({ blobName: this._name, containerName: this._containerName } =
116
+ this.getBlobAndContainerNamesFromUrl());
117
+ this.blobContext = this.storageClientContext.blob;
118
+ this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT);
119
+ this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID);
120
+ }
121
+ /**
122
+ * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp.
123
+ * Provide "" will remove the snapshot and return a Client to the base blob.
124
+ *
125
+ * @param snapshot - The snapshot timestamp.
126
+ * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp
127
+ */
128
+ withSnapshot(snapshot) {
129
+ return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
130
+ }
131
+ /**
132
+ * Creates a new BlobClient object pointing to a version of this blob.
133
+ * Provide "" will remove the versionId and return a Client to the base blob.
134
+ *
135
+ * @param versionId - The versionId.
136
+ * @returns A new BlobClient object pointing to the version of this blob.
137
+ */
138
+ withVersion(versionId) {
139
+ return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline);
140
+ }
141
+ /**
142
+ * Creates a AppendBlobClient object.
143
+ *
144
+ */
145
+ getAppendBlobClient() {
146
+ return new AppendBlobClient(this.url, this.pipeline);
147
+ }
148
+ /**
149
+ * Creates a BlockBlobClient object.
150
+ *
151
+ */
152
+ getBlockBlobClient() {
153
+ return new BlockBlobClient(this.url, this.pipeline);
154
+ }
155
+ /**
156
+ * Creates a PageBlobClient object.
157
+ *
158
+ */
159
+ getPageBlobClient() {
160
+ return new PageBlobClient(this.url, this.pipeline);
161
+ }
162
+ /**
163
+ * Reads or downloads a blob from the system, including its metadata and properties.
164
+ * You can also call Get Blob to read a snapshot.
165
+ *
166
+ * * In Node.js, data returns in a Readable stream readableStreamBody
167
+ * * In browsers, data returns in a promise blobBody
168
+ *
169
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob
170
+ *
171
+ * @param offset - From which position of the blob to download, greater than or equal to 0
172
+ * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
173
+ * @param options - Optional options to Blob Download operation.
174
+ *
175
+ *
176
+ * Example usage (Node.js):
177
+ *
178
+ * ```ts snippet:ReadmeSampleDownloadBlob_Node
179
+ * import { BlobServiceClient } from "@azure/storage-blob";
180
+ * import { DefaultAzureCredential } from "@azure/identity";
181
+ *
182
+ * const account = "<account>";
183
+ * const blobServiceClient = new BlobServiceClient(
184
+ * `https://${account}.blob.core.windows.net`,
185
+ * new DefaultAzureCredential(),
186
+ * );
187
+ *
188
+ * const containerName = "<container name>";
189
+ * const blobName = "<blob name>";
190
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
191
+ * const blobClient = containerClient.getBlobClient(blobName);
192
+ *
193
+ * // Get blob content from position 0 to the end
194
+ * // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody
195
+ * const downloadBlockBlobResponse = await blobClient.download();
196
+ * if (downloadBlockBlobResponse.readableStreamBody) {
197
+ * const downloaded = await streamToString(downloadBlockBlobResponse.readableStreamBody);
198
+ * console.log(`Downloaded blob content: ${downloaded}`);
199
+ * }
200
+ *
201
+ * async function streamToString(stream: NodeJS.ReadableStream): Promise<string> {
202
+ * const result = await new Promise<Buffer<ArrayBuffer>>((resolve, reject) => {
203
+ * const chunks: Buffer[] = [];
204
+ * stream.on("data", (data) => {
205
+ * chunks.push(Buffer.isBuffer(data) ? data : Buffer.from(data));
206
+ * });
207
+ * stream.on("end", () => {
208
+ * resolve(Buffer.concat(chunks));
209
+ * });
210
+ * stream.on("error", reject);
211
+ * });
212
+ * return result.toString();
213
+ * }
214
+ * ```
215
+ *
216
+ * Example usage (browser):
217
+ *
218
+ * ```ts snippet:ReadmeSampleDownloadBlob_Browser
219
+ * import { BlobServiceClient } from "@azure/storage-blob";
220
+ * import { DefaultAzureCredential } from "@azure/identity";
221
+ *
222
+ * const account = "<account>";
223
+ * const blobServiceClient = new BlobServiceClient(
224
+ * `https://${account}.blob.core.windows.net`,
225
+ * new DefaultAzureCredential(),
226
+ * );
227
+ *
228
+ * const containerName = "<container name>";
229
+ * const blobName = "<blob name>";
230
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
231
+ * const blobClient = containerClient.getBlobClient(blobName);
232
+ *
233
+ * // Get blob content from position 0 to the end
234
+ * // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody
235
+ * const downloadBlockBlobResponse = await blobClient.download();
236
+ * const blobBody = await downloadBlockBlobResponse.blobBody;
237
+ * if (blobBody) {
238
+ * const downloaded = await blobBody.text();
239
+ * console.log(`Downloaded blob content: ${downloaded}`);
240
+ * }
241
+ * ```
242
+ */
243
+ async download(offset = 0, count, options = {}) {
244
+ options.conditions = options.conditions || {};
245
+ options.conditions = options.conditions || {};
246
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
247
+ return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => {
248
+ const res = assertResponse((await this.blobContext.download({
249
+ abortSignal: options.abortSignal,
250
+ leaseAccessConditions: options.conditions,
251
+ modifiedAccessConditions: {
252
+ ...options.conditions,
253
+ ifTags: options.conditions?.tagConditions,
254
+ },
255
+ requestOptions: {
256
+ onDownloadProgress: isNodeLike ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
257
+ },
258
+ range: offset === 0 && !count ? undefined : rangeToString({ offset, count }),
259
+ rangeGetContentMD5: options.rangeGetContentMD5,
260
+ rangeGetContentCRC64: options.rangeGetContentCrc64,
261
+ snapshot: options.snapshot,
262
+ cpkInfo: options.customerProvidedKey,
263
+ tracingOptions: updatedOptions.tracingOptions,
264
+ })));
265
+ const wrappedRes = {
266
+ ...res,
267
+ _response: res._response, // _response is made non-enumerable
268
+ objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
269
+ objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
270
+ };
271
+ // Return browser response immediately
272
+ if (!isNodeLike) {
273
+ return wrappedRes;
274
+ }
275
+ // We support retrying when download stream unexpected ends in Node.js runtime
276
+ // Following code shouldn't be bundled into browser build, however some
277
+ // bundlers may try to bundle following code and "FileReadResponse.ts".
278
+ // In this case, "FileDownloadResponse.browser.ts" will be used as a shim of "FileDownloadResponse.ts"
279
+ // The config is in package.json "browser" field
280
+ if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) {
281
+ // TODO: Default value or make it a required parameter?
282
+ options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;
283
+ }
284
+ if (res.contentLength === undefined) {
285
+ throw new RangeError(`File download response doesn't contain valid content length header`);
286
+ }
287
+ if (!res.etag) {
288
+ throw new RangeError(`File download response doesn't contain valid etag header`);
289
+ }
290
+ return new BlobDownloadResponse(wrappedRes, async (start) => {
291
+ const updatedDownloadOptions = {
292
+ leaseAccessConditions: options.conditions,
293
+ modifiedAccessConditions: {
294
+ ifMatch: options.conditions.ifMatch || res.etag,
295
+ ifModifiedSince: options.conditions.ifModifiedSince,
296
+ ifNoneMatch: options.conditions.ifNoneMatch,
297
+ ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
298
+ ifTags: options.conditions?.tagConditions,
299
+ },
300
+ range: rangeToString({
301
+ count: offset + res.contentLength - start,
302
+ offset: start,
303
+ }),
304
+ rangeGetContentMD5: options.rangeGetContentMD5,
305
+ rangeGetContentCRC64: options.rangeGetContentCrc64,
306
+ snapshot: options.snapshot,
307
+ cpkInfo: options.customerProvidedKey,
308
+ };
309
+ // Debug purpose only
310
+ // console.log(
311
+ // `Read from internal stream, range: ${
312
+ // updatedOptions.range
313
+ // }, options: ${JSON.stringify(updatedOptions)}`
314
+ // );
315
+ return (await this.blobContext.download({
316
+ abortSignal: options.abortSignal,
317
+ ...updatedDownloadOptions,
318
+ })).readableStreamBody;
319
+ }, offset, res.contentLength, {
320
+ maxRetryRequests: options.maxRetryRequests,
321
+ onProgress: options.onProgress,
322
+ });
323
+ });
324
+ }
325
+ /**
326
+ * Returns true if the Azure blob resource represented by this client exists; false otherwise.
327
+ *
328
+ * NOTE: use this function with care since an existing blob might be deleted by other clients or
329
+ * applications. Vice versa new blobs might be added by other clients or applications after this
330
+ * function completes.
331
+ *
332
+ * @param options - options to Exists operation.
333
+ */
334
+ async exists(options = {}) {
335
+ return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => {
336
+ try {
337
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
338
+ await this.getProperties({
339
+ abortSignal: options.abortSignal,
340
+ customerProvidedKey: options.customerProvidedKey,
341
+ conditions: options.conditions,
342
+ tracingOptions: updatedOptions.tracingOptions,
343
+ });
344
+ return true;
345
+ }
346
+ catch (e) {
347
+ if (e.statusCode === 404) {
348
+ // Expected exception when checking blob existence
349
+ return false;
350
+ }
351
+ else if (e.statusCode === 409 &&
352
+ (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg ||
353
+ e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) {
354
+ // Expected exception when checking blob existence
355
+ return true;
356
+ }
357
+ throw e;
358
+ }
359
+ });
360
+ }
361
+ /**
362
+ * Returns all user-defined metadata, standard HTTP properties, and system properties
363
+ * for the blob. It does not return the content of the blob.
364
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties
365
+ *
366
+ * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
367
+ * they originally contained uppercase characters. This differs from the metadata keys returned by
368
+ * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which
369
+ * will retain their original casing.
370
+ *
371
+ * @param options - Optional options to Get Properties operation.
372
+ */
373
+ async getProperties(options = {}) {
374
+ options.conditions = options.conditions || {};
375
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
376
+ return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => {
377
+ const res = assertResponse(await this.blobContext.getProperties({
378
+ abortSignal: options.abortSignal,
379
+ leaseAccessConditions: options.conditions,
380
+ modifiedAccessConditions: {
381
+ ...options.conditions,
382
+ ifTags: options.conditions?.tagConditions,
383
+ },
384
+ cpkInfo: options.customerProvidedKey,
385
+ tracingOptions: updatedOptions.tracingOptions,
386
+ }));
387
+ return {
388
+ ...res,
389
+ _response: res._response, // _response is made non-enumerable
390
+ objectReplicationDestinationPolicyId: res.objectReplicationPolicyId,
391
+ objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules),
392
+ };
393
+ });
394
+ }
395
+ /**
396
+ * Marks the specified blob or snapshot for deletion. The blob is later deleted
397
+ * during garbage collection. Note that in order to delete a blob, you must delete
398
+ * all of its snapshots. You can delete both at the same time with the Delete
399
+ * Blob operation.
400
+ * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
401
+ *
402
+ * @param options - Optional options to Blob Delete operation.
403
+ */
404
+ async delete(options = {}) {
405
+ options.conditions = options.conditions || {};
406
+ return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => {
407
+ return assertResponse(await this.blobContext.delete({
408
+ abortSignal: options.abortSignal,
409
+ deleteSnapshots: options.deleteSnapshots,
410
+ leaseAccessConditions: options.conditions,
411
+ modifiedAccessConditions: {
412
+ ...options.conditions,
413
+ ifTags: options.conditions?.tagConditions,
414
+ },
415
+ tracingOptions: updatedOptions.tracingOptions,
416
+ }));
417
+ });
418
+ }
419
+ /**
420
+ * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted
421
+ * during garbage collection. Note that in order to delete a blob, you must delete
422
+ * all of its snapshots. You can delete both at the same time with the Delete
423
+ * Blob operation.
424
+ * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob
425
+ *
426
+ * @param options - Optional options to Blob Delete operation.
427
+ */
428
+ async deleteIfExists(options = {}) {
429
+ return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => {
430
+ try {
431
+ const res = assertResponse(await this.delete(updatedOptions));
432
+ return {
433
+ succeeded: true,
434
+ ...res,
435
+ _response: res._response, // _response is made non-enumerable
436
+ };
437
+ }
438
+ catch (e) {
439
+ if (e.details?.errorCode === "BlobNotFound") {
440
+ return {
441
+ succeeded: false,
442
+ ...e.response?.parsedHeaders,
443
+ _response: e.response,
444
+ };
445
+ }
446
+ throw e;
447
+ }
448
+ });
449
+ }
450
+ /**
451
+ * Restores the contents and metadata of soft deleted blob and any associated
452
+ * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29
453
+ * or later.
454
+ * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob
455
+ *
456
+ * @param options - Optional options to Blob Undelete operation.
457
+ */
458
+ async undelete(options = {}) {
459
+ return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => {
460
+ return assertResponse(await this.blobContext.undelete({
461
+ abortSignal: options.abortSignal,
462
+ tracingOptions: updatedOptions.tracingOptions,
463
+ }));
464
+ });
465
+ }
466
+ /**
467
+ * Sets system properties on the blob.
468
+ *
469
+ * If no value provided, or no value provided for the specified blob HTTP headers,
470
+ * these blob HTTP headers without a value will be cleared.
471
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
472
+ *
473
+ * @param blobHTTPHeaders - If no value provided, or no value provided for
474
+ * the specified blob HTTP headers, these blob HTTP
475
+ * headers without a value will be cleared.
476
+ * A common header to set is `blobContentType`
477
+ * enabling the browser to provide functionality
478
+ * based on file type.
479
+ * @param options - Optional options to Blob Set HTTP Headers operation.
480
+ */
481
+ async setHTTPHeaders(blobHTTPHeaders, options = {}) {
482
+ options.conditions = options.conditions || {};
483
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
484
+ return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => {
485
+ return assertResponse(await this.blobContext.setHttpHeaders({
486
+ abortSignal: options.abortSignal,
487
+ blobHttpHeaders: blobHTTPHeaders,
488
+ leaseAccessConditions: options.conditions,
489
+ modifiedAccessConditions: {
490
+ ...options.conditions,
491
+ ifTags: options.conditions?.tagConditions,
492
+ },
493
+ // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger.
494
+ tracingOptions: updatedOptions.tracingOptions,
495
+ }));
496
+ });
497
+ }
498
+ /**
499
+ * Sets user-defined metadata for the specified blob as one or more name-value pairs.
500
+ *
501
+ * If no option provided, or no metadata defined in the parameter, the blob
502
+ * metadata will be removed.
503
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata
504
+ *
505
+ * @param metadata - Replace existing metadata with this value.
506
+ * If no value provided the existing metadata will be removed.
507
+ * @param options - Optional options to Set Metadata operation.
508
+ */
509
+ async setMetadata(metadata, options = {}) {
510
+ options.conditions = options.conditions || {};
511
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
512
+ return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => {
513
+ return assertResponse(await this.blobContext.setMetadata({
514
+ abortSignal: options.abortSignal,
515
+ leaseAccessConditions: options.conditions,
516
+ metadata,
517
+ modifiedAccessConditions: {
518
+ ...options.conditions,
519
+ ifTags: options.conditions?.tagConditions,
520
+ },
521
+ cpkInfo: options.customerProvidedKey,
522
+ encryptionScope: options.encryptionScope,
523
+ tracingOptions: updatedOptions.tracingOptions,
524
+ }));
525
+ });
526
+ }
527
+ /**
528
+ * Sets tags on the underlying blob.
529
+ * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters.
530
+ * Valid tag key and value characters include lower and upper case letters, digits (0-9),
531
+ * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_').
532
+ *
533
+ * @param tags -
534
+ * @param options -
535
+ */
536
+ async setTags(tags, options = {}) {
537
+ return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => {
538
+ return assertResponse(await this.blobContext.setTags({
539
+ abortSignal: options.abortSignal,
540
+ leaseAccessConditions: options.conditions,
541
+ modifiedAccessConditions: {
542
+ ...options.conditions,
543
+ ifTags: options.conditions?.tagConditions,
544
+ },
545
+ blobModifiedAccessConditions: options.conditions,
546
+ tracingOptions: updatedOptions.tracingOptions,
547
+ tags: toBlobTags(tags),
548
+ }));
549
+ });
550
+ }
551
+ /**
552
+ * Gets the tags associated with the underlying blob.
553
+ *
554
+ * @param options -
555
+ */
556
+ async getTags(options = {}) {
557
+ return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => {
558
+ const response = assertResponse(await this.blobContext.getTags({
559
+ abortSignal: options.abortSignal,
560
+ leaseAccessConditions: options.conditions,
561
+ modifiedAccessConditions: {
562
+ ...options.conditions,
563
+ ifTags: options.conditions?.tagConditions,
564
+ },
565
+ blobModifiedAccessConditions: options.conditions,
566
+ tracingOptions: updatedOptions.tracingOptions,
567
+ }));
568
+ const wrappedResponse = {
569
+ ...response,
570
+ _response: response._response, // _response is made non-enumerable
571
+ tags: toTags({ blobTagSet: response.blobTagSet }) || {},
572
+ };
573
+ return wrappedResponse;
574
+ });
575
+ }
576
+ /**
577
+ * Get a {@link BlobLeaseClient} that manages leases on the blob.
578
+ *
579
+ * @param proposeLeaseId - Initial proposed lease Id.
580
+ * @returns A new BlobLeaseClient object for managing leases on the blob.
581
+ */
582
+ getBlobLeaseClient(proposeLeaseId) {
583
+ return new BlobLeaseClient(this, proposeLeaseId);
584
+ }
585
+ /**
586
+ * Creates a read-only snapshot of a blob.
587
+ * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob
588
+ *
589
+ * @param options - Optional options to the Blob Create Snapshot operation.
590
+ */
591
+ async createSnapshot(options = {}) {
592
+ options.conditions = options.conditions || {};
593
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
594
+ return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => {
595
+ return assertResponse(await this.blobContext.createSnapshot({
596
+ abortSignal: options.abortSignal,
597
+ leaseAccessConditions: options.conditions,
598
+ metadata: options.metadata,
599
+ modifiedAccessConditions: {
600
+ ...options.conditions,
601
+ ifTags: options.conditions?.tagConditions,
602
+ },
603
+ cpkInfo: options.customerProvidedKey,
604
+ encryptionScope: options.encryptionScope,
605
+ tracingOptions: updatedOptions.tracingOptions,
606
+ }));
607
+ });
608
+ }
609
+ /**
610
+ * Asynchronously copies a blob to a destination within the storage account.
611
+ * This method returns a long running operation poller that allows you to wait
612
+ * indefinitely until the copy is completed.
613
+ * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller.
614
+ * Note that the onProgress callback will not be invoked if the operation completes in the first
615
+ * request, and attempting to cancel a completed copy will result in an error being thrown.
616
+ *
617
+ * In version 2012-02-12 and later, the source for a Copy Blob operation can be
618
+ * a committed blob in any Azure storage account.
619
+ * Beginning with version 2015-02-21, the source for a Copy Blob operation can be
620
+ * an Azure file in any Azure storage account.
621
+ * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
622
+ * operation to copy from another storage account.
623
+ * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob
624
+ *
625
+ * ```ts snippet:ClientsBeginCopyFromURL
626
+ * import { BlobServiceClient } from "@azure/storage-blob";
627
+ * import { DefaultAzureCredential } from "@azure/identity";
628
+ *
629
+ * const account = "<account>";
630
+ * const blobServiceClient = new BlobServiceClient(
631
+ * `https://${account}.blob.core.windows.net`,
632
+ * new DefaultAzureCredential(),
633
+ * );
634
+ *
635
+ * const containerName = "<container name>";
636
+ * const blobName = "<blob name>";
637
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
638
+ * const blobClient = containerClient.getBlobClient(blobName);
639
+ *
640
+ * // Example using automatic polling
641
+ * const automaticCopyPoller = await blobClient.beginCopyFromURL("url");
642
+ * const automaticResult = await automaticCopyPoller.pollUntilDone();
643
+ *
644
+ * // Example using manual polling
645
+ * const manualCopyPoller = await blobClient.beginCopyFromURL("url");
646
+ * while (!manualCopyPoller.isDone()) {
647
+ * await manualCopyPoller.poll();
648
+ * }
649
+ * const manualResult = manualCopyPoller.getResult();
650
+ *
651
+ * // Example using progress updates
652
+ * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", {
653
+ * onProgress(state) {
654
+ * console.log(`Progress: ${state.copyProgress}`);
655
+ * },
656
+ * });
657
+ * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone();
658
+ *
659
+ * // Example using a changing polling interval (default 15 seconds)
660
+ * const pollingIntervalCopyPoller = await blobClient.beginCopyFromURL("url", {
661
+ * intervalInMs: 1000, // poll blob every 1 second for copy progress
662
+ * });
663
+ * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone();
664
+ *
665
+ * // Example using copy cancellation:
666
+ * const cancelCopyPoller = await blobClient.beginCopyFromURL("url");
667
+ * // cancel operation after starting it.
668
+ * try {
669
+ * await cancelCopyPoller.cancelOperation();
670
+ * // calls to get the result now throw PollerCancelledError
671
+ * cancelCopyPoller.getResult();
672
+ * } catch (err: any) {
673
+ * if (err.name === "PollerCancelledError") {
674
+ * console.log("The copy was cancelled.");
675
+ * }
676
+ * }
677
+ * ```
678
+ *
679
+ * @param copySource - url to the source Azure Blob/File.
680
+ * @param options - Optional options to the Blob Start Copy From URL operation.
681
+ */
682
+ async beginCopyFromURL(copySource, options = {}) {
683
+ const client = {
684
+ abortCopyFromURL: (...args) => this.abortCopyFromURL(...args),
685
+ getProperties: (...args) => this.getProperties(...args),
686
+ startCopyFromURL: (...args) => this.startCopyFromURL(...args),
687
+ };
688
+ const poller = new BlobBeginCopyFromUrlPoller({
689
+ blobClient: client,
690
+ copySource,
691
+ intervalInMs: options.intervalInMs,
692
+ onProgress: options.onProgress,
693
+ resumeFrom: options.resumeFrom,
694
+ startCopyFromURLOptions: options,
695
+ });
696
+ // Trigger the startCopyFromURL call by calling poll.
697
+ // Any errors from this method should be surfaced to the user.
698
+ await poller.poll();
699
+ return poller;
700
+ }
701
+ /**
702
+ * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero
703
+ * length and full metadata. Version 2012-02-12 and newer.
704
+ * @see https://learn.microsoft.com/rest/api/storageservices/abort-copy-blob
705
+ *
706
+ * @param copyId - Id of the Copy From URL operation.
707
+ * @param options - Optional options to the Blob Abort Copy From URL operation.
708
+ */
709
+ async abortCopyFromURL(copyId, options = {}) {
710
+ return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => {
711
+ return assertResponse(await this.blobContext.abortCopyFromURL(copyId, {
712
+ abortSignal: options.abortSignal,
713
+ leaseAccessConditions: options.conditions,
714
+ tracingOptions: updatedOptions.tracingOptions,
715
+ }));
716
+ });
717
+ }
718
+ /**
719
+ * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not
720
+ * return a response until the copy is complete.
721
+ * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob-from-url
722
+ *
723
+ * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication
724
+ * @param options -
725
+ */
726
+ async syncCopyFromURL(copySource, options = {}) {
727
+ options.conditions = options.conditions || {};
728
+ options.sourceConditions = options.sourceConditions || {};
729
+ return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => {
730
+ return assertResponse(await this.blobContext.copyFromURL(copySource, {
731
+ abortSignal: options.abortSignal,
732
+ metadata: options.metadata,
733
+ leaseAccessConditions: options.conditions,
734
+ modifiedAccessConditions: {
735
+ ...options.conditions,
736
+ ifTags: options.conditions?.tagConditions,
737
+ },
738
+ sourceModifiedAccessConditions: {
739
+ sourceIfMatch: options.sourceConditions?.ifMatch,
740
+ sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
741
+ sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
742
+ sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
743
+ },
744
+ sourceContentMD5: options.sourceContentMD5,
745
+ copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
746
+ tier: toAccessTier(options.tier),
747
+ blobTagsString: toBlobTagsString(options.tags),
748
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
749
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
750
+ legalHold: options.legalHold,
751
+ encryptionScope: options.encryptionScope,
752
+ copySourceTags: options.copySourceTags,
753
+ fileRequestIntent: options.sourceShareTokenIntent,
754
+ tracingOptions: updatedOptions.tracingOptions,
755
+ }));
756
+ });
757
+ }
758
+ /**
759
+ * Sets the tier on a blob. The operation is allowed on a page blob in a premium
760
+ * storage account and on a block blob in a blob storage account (locally redundant
761
+ * storage only). A premium page blob's tier determines the allowed size, IOPS,
762
+ * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
763
+ * storage type. This operation does not update the blob's ETag.
764
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-tier
765
+ *
766
+ * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive.
767
+ * @param options - Optional options to the Blob Set Tier operation.
768
+ */
769
+ async setAccessTier(tier, options = {}) {
770
+ return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => {
771
+ return assertResponse(await this.blobContext.setTier(toAccessTier(tier), {
772
+ abortSignal: options.abortSignal,
773
+ leaseAccessConditions: options.conditions,
774
+ modifiedAccessConditions: {
775
+ ...options.conditions,
776
+ ifTags: options.conditions?.tagConditions,
777
+ },
778
+ rehydratePriority: options.rehydratePriority,
779
+ tracingOptions: updatedOptions.tracingOptions,
780
+ }));
781
+ });
782
+ }
783
+ async downloadToBuffer(param1, param2, param3, param4 = {}) {
784
+ let buffer;
785
+ let offset = 0;
786
+ let count = 0;
787
+ let options = param4;
788
+ if (param1 instanceof Buffer) {
789
+ buffer = param1;
790
+ offset = param2 || 0;
791
+ count = typeof param3 === "number" ? param3 : 0;
792
+ }
793
+ else {
794
+ offset = typeof param1 === "number" ? param1 : 0;
795
+ count = typeof param2 === "number" ? param2 : 0;
796
+ options = param3 || {};
797
+ }
798
+ let blockSize = options.blockSize ?? 0;
799
+ if (blockSize < 0) {
800
+ throw new RangeError("blockSize option must be >= 0");
801
+ }
802
+ if (blockSize === 0) {
803
+ blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
804
+ }
805
+ if (offset < 0) {
806
+ throw new RangeError("offset option must be >= 0");
807
+ }
808
+ if (count && count <= 0) {
809
+ throw new RangeError("count option must be greater than 0");
810
+ }
811
+ if (!options.conditions) {
812
+ options.conditions = {};
813
+ }
814
+ return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => {
815
+ // Customer doesn't specify length, get it
816
+ if (!count) {
817
+ const response = await this.getProperties({
818
+ ...options,
819
+ tracingOptions: updatedOptions.tracingOptions,
820
+ });
821
+ count = response.contentLength - offset;
822
+ if (count < 0) {
823
+ throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`);
824
+ }
825
+ }
826
+ // Allocate the buffer of size = count if the buffer is not provided
827
+ if (!buffer) {
828
+ try {
829
+ buffer = Buffer.alloc(count);
830
+ }
831
+ catch (error) {
832
+ throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${error.message}`);
833
+ }
834
+ }
835
+ if (buffer.length < count) {
836
+ throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`);
837
+ }
838
+ let transferProgress = 0;
839
+ const batch = new Batch(options.concurrency);
840
+ for (let off = offset; off < offset + count; off = off + blockSize) {
841
+ batch.addOperation(async () => {
842
+ // Exclusive chunk end position
843
+ let chunkEnd = offset + count;
844
+ if (off + blockSize < chunkEnd) {
845
+ chunkEnd = off + blockSize;
846
+ }
847
+ const response = await this.download(off, chunkEnd - off, {
848
+ abortSignal: options.abortSignal,
849
+ conditions: options.conditions,
850
+ maxRetryRequests: options.maxRetryRequestsPerBlock,
851
+ customerProvidedKey: options.customerProvidedKey,
852
+ tracingOptions: updatedOptions.tracingOptions,
853
+ });
854
+ const stream = response.readableStreamBody;
855
+ await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);
856
+ // Update progress after block is downloaded, in case of block trying
857
+ // Could provide finer grained progress updating inside HTTP requests,
858
+ // only if convenience layer download try is enabled
859
+ transferProgress += chunkEnd - off;
860
+ if (options.onProgress) {
861
+ options.onProgress({ loadedBytes: transferProgress });
862
+ }
863
+ });
864
+ }
865
+ await batch.do();
866
+ return buffer;
867
+ });
868
+ }
869
+ /**
870
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
871
+ *
872
+ * Downloads an Azure Blob to a local file.
873
+ * Fails if the the given file path already exits.
874
+ * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
875
+ *
876
+ * @param filePath -
877
+ * @param offset - From which position of the block blob to download.
878
+ * @param count - How much data to be downloaded. Will download to the end when passing undefined.
879
+ * @param options - Options to Blob download options.
880
+ * @returns The response data for blob download operation,
881
+ * but with readableStreamBody set to undefined since its
882
+ * content is already read and written into a local file
883
+ * at the specified path.
884
+ */
885
+ async downloadToFile(filePath, offset = 0, count, options = {}) {
886
+ return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => {
887
+ const response = await this.download(offset, count, {
888
+ ...options,
889
+ tracingOptions: updatedOptions.tracingOptions,
890
+ });
891
+ if (response.readableStreamBody) {
892
+ await readStreamToLocalFile(response.readableStreamBody, filePath);
893
+ }
894
+ // The stream is no longer accessible so setting it to undefined.
895
+ response.blobDownloadStream = undefined;
896
+ return response;
897
+ });
898
+ }
899
+ getBlobAndContainerNamesFromUrl() {
900
+ let containerName;
901
+ let blobName;
902
+ try {
903
+ // URL may look like the following
904
+ // "https://myaccount.blob.core.windows.net/mycontainer/blob?sasString";
905
+ // "https://myaccount.blob.core.windows.net/mycontainer/blob";
906
+ // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt?sasString";
907
+ // "https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt";
908
+ // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername/blob`
909
+ // http://localhost:10001/devstoreaccount1/containername/blob
910
+ const parsedUrl = new URL(this.url);
911
+ if (parsedUrl.host.split(".")[1] === "blob") {
912
+ // "https://myaccount.blob.core.windows.net/containername/blob".
913
+ // .getPath() -> /containername/blob
914
+ const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?");
915
+ containerName = pathComponents[1];
916
+ blobName = pathComponents[3];
917
+ }
918
+ else if (isIpEndpointStyle(parsedUrl)) {
919
+ // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob
920
+ // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob
921
+ // .getPath() -> /devstoreaccount1/containername/blob
922
+ const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?");
923
+ containerName = pathComponents[2];
924
+ blobName = pathComponents[4];
925
+ }
926
+ else {
927
+ // "https://customdomain.com/containername/blob".
928
+ // .getPath() -> /containername/blob
929
+ const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?");
930
+ containerName = pathComponents[1];
931
+ blobName = pathComponents[3];
932
+ }
933
+ // decode the encoded blobName, containerName - to get all the special characters that might be present in them
934
+ containerName = decodeURIComponent(containerName);
935
+ blobName = decodeURIComponent(blobName);
936
+ // Azure Storage Server will replace "\" with "/" in the blob names
937
+ // doing the same in the SDK side so that the user doesn't have to replace "\" instances in the blobName
938
+ blobName = blobName.replace(/\\/g, "/");
939
+ if (!containerName) {
940
+ throw new Error("Provided containerName is invalid.");
941
+ }
942
+ return { blobName, containerName };
943
+ }
944
+ catch (error) {
945
+ throw new Error("Unable to extract blobName and containerName with provided information.");
946
+ }
947
+ }
948
+ /**
949
+ * Asynchronously copies a blob to a destination within the storage account.
950
+ * In version 2012-02-12 and later, the source for a Copy Blob operation can be
951
+ * a committed blob in any Azure storage account.
952
+ * Beginning with version 2015-02-21, the source for a Copy Blob operation can be
953
+ * an Azure file in any Azure storage account.
954
+ * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
955
+ * operation to copy from another storage account.
956
+ * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob
957
+ *
958
+ * @param copySource - url to the source Azure Blob/File.
959
+ * @param options - Optional options to the Blob Start Copy From URL operation.
960
+ */
961
+ async startCopyFromURL(copySource, options = {}) {
962
+ return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => {
963
+ options.conditions = options.conditions || {};
964
+ options.sourceConditions = options.sourceConditions || {};
965
+ return assertResponse(await this.blobContext.startCopyFromURL(copySource, {
966
+ abortSignal: options.abortSignal,
967
+ leaseAccessConditions: options.conditions,
968
+ metadata: options.metadata,
969
+ modifiedAccessConditions: {
970
+ ...options.conditions,
971
+ ifTags: options.conditions?.tagConditions,
972
+ },
973
+ sourceModifiedAccessConditions: {
974
+ sourceIfMatch: options.sourceConditions.ifMatch,
975
+ sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
976
+ sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
977
+ sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
978
+ sourceIfTags: options.sourceConditions.tagConditions,
979
+ },
980
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
981
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
982
+ legalHold: options.legalHold,
983
+ rehydratePriority: options.rehydratePriority,
984
+ tier: toAccessTier(options.tier),
985
+ blobTagsString: toBlobTagsString(options.tags),
986
+ sealBlob: options.sealBlob,
987
+ tracingOptions: updatedOptions.tracingOptions,
988
+ }));
989
+ });
990
+ }
991
+ /**
992
+ * Only available for BlobClient constructed with a shared key credential.
993
+ *
994
+ * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties
995
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
996
+ *
997
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
998
+ *
999
+ * @param options - Optional parameters.
1000
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1001
+ */
1002
+ generateSasUrl(options) {
1003
+ return new Promise((resolve) => {
1004
+ if (!(this.credential instanceof StorageSharedKeyCredential)) {
1005
+ throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1006
+ }
1007
+ const sas = generateBlobSASQueryParameters({
1008
+ containerName: this._containerName,
1009
+ blobName: this._name,
1010
+ snapshotTime: this._snapshot,
1011
+ versionId: this._versionId,
1012
+ ...options,
1013
+ }, this.credential).toString();
1014
+ resolve(appendToURLQuery(this.url, sas));
1015
+ });
1016
+ }
1017
+ /**
1018
+ * Only available for BlobClient constructed with a shared key credential.
1019
+ *
1020
+ * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on
1021
+ * the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
1022
+ *
1023
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1024
+ *
1025
+ * @param options - Optional parameters.
1026
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1027
+ */
1028
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1029
+ generateSasStringToSign(options) {
1030
+ if (!(this.credential instanceof StorageSharedKeyCredential)) {
1031
+ throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1032
+ }
1033
+ return generateBlobSASQueryParametersInternal({
1034
+ containerName: this._containerName,
1035
+ blobName: this._name,
1036
+ snapshotTime: this._snapshot,
1037
+ versionId: this._versionId,
1038
+ ...options,
1039
+ }, this.credential).stringToSign;
1040
+ }
1041
+ /**
1042
+ *
1043
+ * Generates a Blob Service Shared Access Signature (SAS) URI based on
1044
+ * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
1045
+ *
1046
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1047
+ *
1048
+ * @param options - Optional parameters.
1049
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1050
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1051
+ */
1052
+ generateUserDelegationSasUrl(options, userDelegationKey) {
1053
+ return new Promise((resolve) => {
1054
+ const sas = generateBlobSASQueryParameters({
1055
+ containerName: this._containerName,
1056
+ blobName: this._name,
1057
+ snapshotTime: this._snapshot,
1058
+ versionId: this._versionId,
1059
+ ...options,
1060
+ }, userDelegationKey, this.accountName).toString();
1061
+ resolve(appendToURLQuery(this.url, sas));
1062
+ });
1063
+ }
1064
+ /**
1065
+ * Only available for BlobClient constructed with a shared key credential.
1066
+ *
1067
+ * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on
1068
+ * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
1069
+ *
1070
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1071
+ *
1072
+ * @param options - Optional parameters.
1073
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1074
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1075
+ */
1076
+ generateUserDelegationSasStringToSign(options, userDelegationKey) {
1077
+ return generateBlobSASQueryParametersInternal({
1078
+ containerName: this._containerName,
1079
+ blobName: this._name,
1080
+ snapshotTime: this._snapshot,
1081
+ versionId: this._versionId,
1082
+ ...options,
1083
+ }, userDelegationKey, this.accountName).stringToSign;
1084
+ }
1085
+ /**
1086
+ * Delete the immutablility policy on the blob.
1087
+ *
1088
+ * @param options - Optional options to delete immutability policy on the blob.
1089
+ */
1090
+ async deleteImmutabilityPolicy(options = {}) {
1091
+ return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => {
1092
+ return assertResponse(await this.blobContext.deleteImmutabilityPolicy({
1093
+ tracingOptions: updatedOptions.tracingOptions,
1094
+ }));
1095
+ });
1096
+ }
1097
+ /**
1098
+ * Set immutability policy on the blob.
1099
+ *
1100
+ * @param options - Optional options to set immutability policy on the blob.
1101
+ */
1102
+ async setImmutabilityPolicy(immutabilityPolicy, options = {}) {
1103
+ return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => {
1104
+ return assertResponse(await this.blobContext.setImmutabilityPolicy({
1105
+ immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn,
1106
+ immutabilityPolicyMode: immutabilityPolicy.policyMode,
1107
+ tracingOptions: updatedOptions.tracingOptions,
1108
+ }));
1109
+ });
1110
+ }
1111
+ /**
1112
+ * Set legal hold on the blob.
1113
+ *
1114
+ * @param options - Optional options to set legal hold on the blob.
1115
+ */
1116
+ async setLegalHold(legalHoldEnabled, options = {}) {
1117
+ return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => {
1118
+ return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, {
1119
+ tracingOptions: updatedOptions.tracingOptions,
1120
+ }));
1121
+ });
1122
+ }
1123
+ /**
1124
+ * The Get Account Information operation returns the sku name and account kind
1125
+ * for the specified account.
1126
+ * The Get Account Information operation is available on service versions beginning
1127
+ * with version 2018-03-28.
1128
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
1129
+ *
1130
+ * @param options - Options to the Service Get Account Info operation.
1131
+ * @returns Response data for the Service Get Account Info operation.
1132
+ */
1133
+ async getAccountInfo(options = {}) {
1134
+ return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => {
1135
+ return assertResponse(await this.blobContext.getAccountInfo({
1136
+ abortSignal: options.abortSignal,
1137
+ tracingOptions: updatedOptions.tracingOptions,
1138
+ }));
1139
+ });
1140
+ }
1141
+ }
1142
+ /**
1143
+ * AppendBlobClient defines a set of operations applicable to append blobs.
1144
+ */
1145
+ export class AppendBlobClient extends BlobClient {
1146
+ /**
1147
+ * appendBlobsContext provided by protocol layer.
1148
+ */
1149
+ appendBlobContext;
1150
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
1151
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
1152
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1153
+ options) {
1154
+ // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
1155
+ // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
1156
+ let pipeline;
1157
+ let url;
1158
+ options = options || {};
1159
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
1160
+ // (url: string, pipeline: Pipeline)
1161
+ url = urlOrConnectionString;
1162
+ pipeline = credentialOrPipelineOrContainerName;
1163
+ }
1164
+ else if ((isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
1165
+ credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
1166
+ isTokenCredential(credentialOrPipelineOrContainerName)) {
1167
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) url = urlOrConnectionString;
1168
+ url = urlOrConnectionString;
1169
+ options = blobNameOrOptions;
1170
+ pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
1171
+ }
1172
+ else if (!credentialOrPipelineOrContainerName &&
1173
+ typeof credentialOrPipelineOrContainerName !== "string") {
1174
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
1175
+ url = urlOrConnectionString;
1176
+ // The second parameter is undefined. Use anonymous credential.
1177
+ pipeline = newPipeline(new AnonymousCredential(), options);
1178
+ }
1179
+ else if (credentialOrPipelineOrContainerName &&
1180
+ typeof credentialOrPipelineOrContainerName === "string" &&
1181
+ blobNameOrOptions &&
1182
+ typeof blobNameOrOptions === "string") {
1183
+ // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
1184
+ const containerName = credentialOrPipelineOrContainerName;
1185
+ const blobName = blobNameOrOptions;
1186
+ const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
1187
+ if (extractedCreds.kind === "AccountConnString") {
1188
+ if (isNodeLike) {
1189
+ const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
1190
+ url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
1191
+ if (!options.proxyOptions) {
1192
+ options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);
1193
+ }
1194
+ pipeline = newPipeline(sharedKeyCredential, options);
1195
+ }
1196
+ else {
1197
+ throw new Error("Account connection string is only supported in Node.js environment");
1198
+ }
1199
+ }
1200
+ else if (extractedCreds.kind === "SASConnString") {
1201
+ url =
1202
+ appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
1203
+ "?" +
1204
+ extractedCreds.accountSas;
1205
+ pipeline = newPipeline(new AnonymousCredential(), options);
1206
+ }
1207
+ else {
1208
+ throw new Error("Connection string must be either an Account connection string or a SAS connection string");
1209
+ }
1210
+ }
1211
+ else {
1212
+ throw new Error("Expecting non-empty strings for containerName and blobName parameters");
1213
+ }
1214
+ super(url, pipeline);
1215
+ this.appendBlobContext = this.storageClientContext.appendBlob;
1216
+ }
1217
+ /**
1218
+ * Creates a new AppendBlobClient object identical to the source but with the
1219
+ * specified snapshot timestamp.
1220
+ * Provide "" will remove the snapshot and return a Client to the base blob.
1221
+ *
1222
+ * @param snapshot - The snapshot timestamp.
1223
+ * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.
1224
+ */
1225
+ withSnapshot(snapshot) {
1226
+ return new AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
1227
+ }
1228
+ /**
1229
+ * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
1230
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
1231
+ *
1232
+ * @param options - Options to the Append Block Create operation.
1233
+ *
1234
+ *
1235
+ * Example usage:
1236
+ *
1237
+ * ```ts snippet:ClientsCreateAppendBlob
1238
+ * import { BlobServiceClient } from "@azure/storage-blob";
1239
+ * import { DefaultAzureCredential } from "@azure/identity";
1240
+ *
1241
+ * const account = "<account>";
1242
+ * const blobServiceClient = new BlobServiceClient(
1243
+ * `https://${account}.blob.core.windows.net`,
1244
+ * new DefaultAzureCredential(),
1245
+ * );
1246
+ *
1247
+ * const containerName = "<container name>";
1248
+ * const blobName = "<blob name>";
1249
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
1250
+ *
1251
+ * const appendBlobClient = containerClient.getAppendBlobClient(blobName);
1252
+ * await appendBlobClient.create();
1253
+ * ```
1254
+ */
1255
+ async create(options = {}) {
1256
+ options.conditions = options.conditions || {};
1257
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1258
+ return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => {
1259
+ return assertResponse(await this.appendBlobContext.create(0, {
1260
+ abortSignal: options.abortSignal,
1261
+ blobHttpHeaders: options.blobHTTPHeaders,
1262
+ leaseAccessConditions: options.conditions,
1263
+ metadata: options.metadata,
1264
+ modifiedAccessConditions: {
1265
+ ...options.conditions,
1266
+ ifTags: options.conditions?.tagConditions,
1267
+ },
1268
+ cpkInfo: options.customerProvidedKey,
1269
+ encryptionScope: options.encryptionScope,
1270
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
1271
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
1272
+ legalHold: options.legalHold,
1273
+ blobTagsString: toBlobTagsString(options.tags),
1274
+ tracingOptions: updatedOptions.tracingOptions,
1275
+ }));
1276
+ });
1277
+ }
1278
+ /**
1279
+ * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
1280
+ * If the blob with the same name already exists, the content of the existing blob will remain unchanged.
1281
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
1282
+ *
1283
+ * @param options -
1284
+ */
1285
+ async createIfNotExists(options = {}) {
1286
+ const conditions = { ifNoneMatch: ETagAny };
1287
+ return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => {
1288
+ try {
1289
+ const res = assertResponse(await this.create({
1290
+ ...updatedOptions,
1291
+ conditions,
1292
+ }));
1293
+ return {
1294
+ succeeded: true,
1295
+ ...res,
1296
+ _response: res._response, // _response is made non-enumerable
1297
+ };
1298
+ }
1299
+ catch (e) {
1300
+ if (e.details?.errorCode === "BlobAlreadyExists") {
1301
+ return {
1302
+ succeeded: false,
1303
+ ...e.response?.parsedHeaders,
1304
+ _response: e.response,
1305
+ };
1306
+ }
1307
+ throw e;
1308
+ }
1309
+ });
1310
+ }
1311
+ /**
1312
+ * Seals the append blob, making it read only.
1313
+ *
1314
+ * @param options -
1315
+ */
1316
+ async seal(options = {}) {
1317
+ options.conditions = options.conditions || {};
1318
+ return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => {
1319
+ return assertResponse(await this.appendBlobContext.seal({
1320
+ abortSignal: options.abortSignal,
1321
+ appendPositionAccessConditions: options.conditions,
1322
+ leaseAccessConditions: options.conditions,
1323
+ modifiedAccessConditions: {
1324
+ ...options.conditions,
1325
+ ifTags: options.conditions?.tagConditions,
1326
+ },
1327
+ tracingOptions: updatedOptions.tracingOptions,
1328
+ }));
1329
+ });
1330
+ }
1331
+ /**
1332
+ * Commits a new block of data to the end of the existing append blob.
1333
+ * @see https://learn.microsoft.com/rest/api/storageservices/append-block
1334
+ *
1335
+ * @param body - Data to be appended.
1336
+ * @param contentLength - Length of the body in bytes.
1337
+ * @param options - Options to the Append Block operation.
1338
+ *
1339
+ *
1340
+ * Example usage:
1341
+ *
1342
+ * ```ts snippet:ClientsAppendBlock
1343
+ * import { BlobServiceClient } from "@azure/storage-blob";
1344
+ * import { DefaultAzureCredential } from "@azure/identity";
1345
+ *
1346
+ * const account = "<account>";
1347
+ * const blobServiceClient = new BlobServiceClient(
1348
+ * `https://${account}.blob.core.windows.net`,
1349
+ * new DefaultAzureCredential(),
1350
+ * );
1351
+ *
1352
+ * const containerName = "<container name>";
1353
+ * const blobName = "<blob name>";
1354
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
1355
+ *
1356
+ * const content = "Hello World!";
1357
+ *
1358
+ * // Create a new append blob and append data to the blob.
1359
+ * const newAppendBlobClient = containerClient.getAppendBlobClient(blobName);
1360
+ * await newAppendBlobClient.create();
1361
+ * await newAppendBlobClient.appendBlock(content, content.length);
1362
+ *
1363
+ * // Append data to an existing append blob.
1364
+ * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName);
1365
+ * await existingAppendBlobClient.appendBlock(content, content.length);
1366
+ * ```
1367
+ */
1368
+ async appendBlock(body, contentLength, options = {}) {
1369
+ options.conditions = options.conditions || {};
1370
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1371
+ return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => {
1372
+ return assertResponse(await this.appendBlobContext.appendBlock(contentLength, body, {
1373
+ abortSignal: options.abortSignal,
1374
+ appendPositionAccessConditions: options.conditions,
1375
+ leaseAccessConditions: options.conditions,
1376
+ modifiedAccessConditions: {
1377
+ ...options.conditions,
1378
+ ifTags: options.conditions?.tagConditions,
1379
+ },
1380
+ requestOptions: {
1381
+ onUploadProgress: options.onProgress,
1382
+ },
1383
+ transactionalContentMD5: options.transactionalContentMD5,
1384
+ transactionalContentCrc64: options.transactionalContentCrc64,
1385
+ cpkInfo: options.customerProvidedKey,
1386
+ encryptionScope: options.encryptionScope,
1387
+ tracingOptions: updatedOptions.tracingOptions,
1388
+ }));
1389
+ });
1390
+ }
1391
+ /**
1392
+ * The Append Block operation commits a new block of data to the end of an existing append blob
1393
+ * where the contents are read from a source url.
1394
+ * @see https://learn.microsoft.com/rest/api/storageservices/append-block-from-url
1395
+ *
1396
+ * @param sourceURL -
1397
+ * The url to the blob that will be the source of the copy. A source blob in the same storage account can
1398
+ * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob
1399
+ * must either be public or must be authenticated via a shared access signature. If the source blob is
1400
+ * public, no authentication is required to perform the operation.
1401
+ * @param sourceOffset - Offset in source to be appended
1402
+ * @param count - Number of bytes to be appended as a block
1403
+ * @param options -
1404
+ */
1405
+ async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) {
1406
+ options.conditions = options.conditions || {};
1407
+ options.sourceConditions = options.sourceConditions || {};
1408
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1409
+ return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => {
1410
+ return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, {
1411
+ abortSignal: options.abortSignal,
1412
+ sourceRange: rangeToString({ offset: sourceOffset, count }),
1413
+ sourceContentMD5: options.sourceContentMD5,
1414
+ sourceContentCrc64: options.sourceContentCrc64,
1415
+ leaseAccessConditions: options.conditions,
1416
+ appendPositionAccessConditions: options.conditions,
1417
+ modifiedAccessConditions: {
1418
+ ...options.conditions,
1419
+ ifTags: options.conditions?.tagConditions,
1420
+ },
1421
+ sourceModifiedAccessConditions: {
1422
+ sourceIfMatch: options.sourceConditions?.ifMatch,
1423
+ sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
1424
+ sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
1425
+ sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
1426
+ },
1427
+ copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
1428
+ cpkInfo: options.customerProvidedKey,
1429
+ encryptionScope: options.encryptionScope,
1430
+ fileRequestIntent: options.sourceShareTokenIntent,
1431
+ tracingOptions: updatedOptions.tracingOptions,
1432
+ }));
1433
+ });
1434
+ }
1435
+ }
1436
+ /**
1437
+ * BlockBlobClient defines a set of operations applicable to block blobs.
1438
+ */
1439
+ export class BlockBlobClient extends BlobClient {
1440
+ /**
1441
+ * blobContext provided by protocol layer.
1442
+ *
1443
+ * Note. Ideally BlobClient should set BlobClient.blobContext to protected. However, API
1444
+ * extractor has issue blocking that. Here we redecelare _blobContext in BlockBlobClient.
1445
+ */
1446
+ _blobContext;
1447
+ /**
1448
+ * blockBlobContext provided by protocol layer.
1449
+ */
1450
+ blockBlobContext;
1451
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
1452
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
1453
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1454
+ options) {
1455
+ // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
1456
+ // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
1457
+ let pipeline;
1458
+ let url;
1459
+ options = options || {};
1460
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
1461
+ // (url: string, pipeline: Pipeline)
1462
+ url = urlOrConnectionString;
1463
+ pipeline = credentialOrPipelineOrContainerName;
1464
+ }
1465
+ else if ((isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
1466
+ credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
1467
+ isTokenCredential(credentialOrPipelineOrContainerName)) {
1468
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
1469
+ url = urlOrConnectionString;
1470
+ options = blobNameOrOptions;
1471
+ pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
1472
+ }
1473
+ else if (!credentialOrPipelineOrContainerName &&
1474
+ typeof credentialOrPipelineOrContainerName !== "string") {
1475
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
1476
+ // The second parameter is undefined. Use anonymous credential.
1477
+ url = urlOrConnectionString;
1478
+ if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
1479
+ options = blobNameOrOptions;
1480
+ }
1481
+ pipeline = newPipeline(new AnonymousCredential(), options);
1482
+ }
1483
+ else if (credentialOrPipelineOrContainerName &&
1484
+ typeof credentialOrPipelineOrContainerName === "string" &&
1485
+ blobNameOrOptions &&
1486
+ typeof blobNameOrOptions === "string") {
1487
+ // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
1488
+ const containerName = credentialOrPipelineOrContainerName;
1489
+ const blobName = blobNameOrOptions;
1490
+ const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
1491
+ if (extractedCreds.kind === "AccountConnString") {
1492
+ if (isNodeLike) {
1493
+ const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
1494
+ url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
1495
+ if (!options.proxyOptions) {
1496
+ options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);
1497
+ }
1498
+ pipeline = newPipeline(sharedKeyCredential, options);
1499
+ }
1500
+ else {
1501
+ throw new Error("Account connection string is only supported in Node.js environment");
1502
+ }
1503
+ }
1504
+ else if (extractedCreds.kind === "SASConnString") {
1505
+ url =
1506
+ appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
1507
+ "?" +
1508
+ extractedCreds.accountSas;
1509
+ pipeline = newPipeline(new AnonymousCredential(), options);
1510
+ }
1511
+ else {
1512
+ throw new Error("Connection string must be either an Account connection string or a SAS connection string");
1513
+ }
1514
+ }
1515
+ else {
1516
+ throw new Error("Expecting non-empty strings for containerName and blobName parameters");
1517
+ }
1518
+ super(url, pipeline);
1519
+ this.blockBlobContext = this.storageClientContext.blockBlob;
1520
+ this._blobContext = this.storageClientContext.blob;
1521
+ }
1522
+ /**
1523
+ * Creates a new BlockBlobClient object identical to the source but with the
1524
+ * specified snapshot timestamp.
1525
+ * Provide "" will remove the snapshot and return a URL to the base blob.
1526
+ *
1527
+ * @param snapshot - The snapshot timestamp.
1528
+ * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp.
1529
+ */
1530
+ withSnapshot(snapshot) {
1531
+ return new BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
1532
+ }
1533
+ /**
1534
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
1535
+ *
1536
+ * Quick query for a JSON or CSV formatted blob.
1537
+ *
1538
+ * Example usage (Node.js):
1539
+ *
1540
+ * ```ts snippet:ClientsQuery
1541
+ * import { BlobServiceClient } from "@azure/storage-blob";
1542
+ * import { DefaultAzureCredential } from "@azure/identity";
1543
+ *
1544
+ * const account = "<account>";
1545
+ * const blobServiceClient = new BlobServiceClient(
1546
+ * `https://${account}.blob.core.windows.net`,
1547
+ * new DefaultAzureCredential(),
1548
+ * );
1549
+ *
1550
+ * const containerName = "<container name>";
1551
+ * const blobName = "<blob name>";
1552
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
1553
+ * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
1554
+ *
1555
+ * // Query and convert a blob to a string
1556
+ * const queryBlockBlobResponse = await blockBlobClient.query("select from BlobStorage");
1557
+ * if (queryBlockBlobResponse.readableStreamBody) {
1558
+ * const downloadedBuffer = await streamToBuffer(queryBlockBlobResponse.readableStreamBody);
1559
+ * const downloaded = downloadedBuffer.toString();
1560
+ * console.log(`Query blob content: ${downloaded}`);
1561
+ * }
1562
+ *
1563
+ * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise<Buffer> {
1564
+ * return new Promise((resolve, reject) => {
1565
+ * const chunks: Buffer[] = [];
1566
+ * readableStream.on("data", (data) => {
1567
+ * chunks.push(data instanceof Buffer ? data : Buffer.from(data));
1568
+ * });
1569
+ * readableStream.on("end", () => {
1570
+ * resolve(Buffer.concat(chunks));
1571
+ * });
1572
+ * readableStream.on("error", reject);
1573
+ * });
1574
+ * }
1575
+ * ```
1576
+ *
1577
+ * @param query -
1578
+ * @param options -
1579
+ */
1580
+ async query(query, options = {}) {
1581
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1582
+ if (!isNodeLike) {
1583
+ throw new Error("This operation currently is only supported in Node.js.");
1584
+ }
1585
+ return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => {
1586
+ const response = assertResponse((await this._blobContext.query({
1587
+ abortSignal: options.abortSignal,
1588
+ queryRequest: {
1589
+ queryType: "SQL",
1590
+ expression: query,
1591
+ inputSerialization: toQuerySerialization(options.inputTextConfiguration),
1592
+ outputSerialization: toQuerySerialization(options.outputTextConfiguration),
1593
+ },
1594
+ leaseAccessConditions: options.conditions,
1595
+ modifiedAccessConditions: {
1596
+ ...options.conditions,
1597
+ ifTags: options.conditions?.tagConditions,
1598
+ },
1599
+ cpkInfo: options.customerProvidedKey,
1600
+ tracingOptions: updatedOptions.tracingOptions,
1601
+ })));
1602
+ return new BlobQueryResponse(response, {
1603
+ abortSignal: options.abortSignal,
1604
+ onProgress: options.onProgress,
1605
+ onError: options.onError,
1606
+ });
1607
+ });
1608
+ }
1609
+ /**
1610
+ * Creates a new block blob, or updates the content of an existing block blob.
1611
+ * Updating an existing block blob overwrites any existing metadata on the blob.
1612
+ * Partial updates are not supported; the content of the existing blob is
1613
+ * overwritten with the new content. To perform a partial update of a block blob's,
1614
+ * use {@link stageBlock} and {@link commitBlockList}.
1615
+ *
1616
+ * This is a non-parallel uploading method, please use {@link uploadFile},
1617
+ * {@link uploadStream} or {@link uploadBrowserData} for better performance
1618
+ * with concurrency uploading.
1619
+ *
1620
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
1621
+ *
1622
+ * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function
1623
+ * which returns a new Readable stream whose offset is from data source beginning.
1624
+ * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a
1625
+ * string including non non-Base64/Hex-encoded characters.
1626
+ * @param options - Options to the Block Blob Upload operation.
1627
+ * @returns Response data for the Block Blob Upload operation.
1628
+ *
1629
+ * Example usage:
1630
+ *
1631
+ * ```ts snippet:ClientsUpload
1632
+ * import { BlobServiceClient } from "@azure/storage-blob";
1633
+ * import { DefaultAzureCredential } from "@azure/identity";
1634
+ *
1635
+ * const account = "<account>";
1636
+ * const blobServiceClient = new BlobServiceClient(
1637
+ * `https://${account}.blob.core.windows.net`,
1638
+ * new DefaultAzureCredential(),
1639
+ * );
1640
+ *
1641
+ * const containerName = "<container name>";
1642
+ * const blobName = "<blob name>";
1643
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
1644
+ * const blockBlobClient = containerClient.getBlockBlobClient(blobName);
1645
+ *
1646
+ * const content = "Hello world!";
1647
+ * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);
1648
+ * ```
1649
+ */
1650
+ async upload(body, contentLength, options = {}) {
1651
+ options.conditions = options.conditions || {};
1652
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1653
+ return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => {
1654
+ return assertResponse(await this.blockBlobContext.upload(contentLength, body, {
1655
+ abortSignal: options.abortSignal,
1656
+ blobHttpHeaders: options.blobHTTPHeaders,
1657
+ leaseAccessConditions: options.conditions,
1658
+ metadata: options.metadata,
1659
+ modifiedAccessConditions: {
1660
+ ...options.conditions,
1661
+ ifTags: options.conditions?.tagConditions,
1662
+ },
1663
+ requestOptions: {
1664
+ onUploadProgress: options.onProgress,
1665
+ },
1666
+ cpkInfo: options.customerProvidedKey,
1667
+ encryptionScope: options.encryptionScope,
1668
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
1669
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
1670
+ legalHold: options.legalHold,
1671
+ tier: toAccessTier(options.tier),
1672
+ blobTagsString: toBlobTagsString(options.tags),
1673
+ tracingOptions: updatedOptions.tracingOptions,
1674
+ }));
1675
+ });
1676
+ }
1677
+ /**
1678
+ * Creates a new Block Blob where the contents of the blob are read from a given URL.
1679
+ * This API is supported beginning with the 2020-04-08 version. Partial updates
1680
+ * are not supported with Put Blob from URL; the content of an existing blob is overwritten with
1681
+ * the content of the new blob. To perform partial updates to a block blob’s contents using a
1682
+ * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}.
1683
+ *
1684
+ * @param sourceURL - Specifies the URL of the blob. The value
1685
+ * may be a URL of up to 2 KB in length that specifies a blob.
1686
+ * The value should be URL-encoded as it would appear
1687
+ * in a request URI. The source blob must either be public
1688
+ * or must be authenticated via a shared access signature.
1689
+ * If the source blob is public, no authentication is required
1690
+ * to perform the operation. Here are some examples of source object URLs:
1691
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob
1692
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
1693
+ * @param options - Optional parameters.
1694
+ */
1695
+ async syncUploadFromURL(sourceURL, options = {}) {
1696
+ options.conditions = options.conditions || {};
1697
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1698
+ return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => {
1699
+ return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, {
1700
+ ...options,
1701
+ blobHttpHeaders: options.blobHTTPHeaders,
1702
+ leaseAccessConditions: options.conditions,
1703
+ modifiedAccessConditions: {
1704
+ ...options.conditions,
1705
+ ifTags: options.conditions?.tagConditions,
1706
+ },
1707
+ sourceModifiedAccessConditions: {
1708
+ sourceIfMatch: options.sourceConditions?.ifMatch,
1709
+ sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
1710
+ sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
1711
+ sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
1712
+ sourceIfTags: options.sourceConditions?.tagConditions,
1713
+ },
1714
+ cpkInfo: options.customerProvidedKey,
1715
+ copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
1716
+ tier: toAccessTier(options.tier),
1717
+ blobTagsString: toBlobTagsString(options.tags),
1718
+ copySourceTags: options.copySourceTags,
1719
+ fileRequestIntent: options.sourceShareTokenIntent,
1720
+ tracingOptions: updatedOptions.tracingOptions,
1721
+ }));
1722
+ });
1723
+ }
1724
+ /**
1725
+ * Uploads the specified block to the block blob's "staging area" to be later
1726
+ * committed by a call to commitBlockList.
1727
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-block
1728
+ *
1729
+ * @param blockId - A 64-byte value that is base64-encoded
1730
+ * @param body - Data to upload to the staging area.
1731
+ * @param contentLength - Number of bytes to upload.
1732
+ * @param options - Options to the Block Blob Stage Block operation.
1733
+ * @returns Response data for the Block Blob Stage Block operation.
1734
+ */
1735
+ async stageBlock(blockId, body, contentLength, options = {}) {
1736
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1737
+ return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => {
1738
+ return assertResponse(await this.blockBlobContext.stageBlock(blockId, contentLength, body, {
1739
+ abortSignal: options.abortSignal,
1740
+ leaseAccessConditions: options.conditions,
1741
+ requestOptions: {
1742
+ onUploadProgress: options.onProgress,
1743
+ },
1744
+ transactionalContentMD5: options.transactionalContentMD5,
1745
+ transactionalContentCrc64: options.transactionalContentCrc64,
1746
+ cpkInfo: options.customerProvidedKey,
1747
+ encryptionScope: options.encryptionScope,
1748
+ tracingOptions: updatedOptions.tracingOptions,
1749
+ }));
1750
+ });
1751
+ }
1752
+ /**
1753
+ * The Stage Block From URL operation creates a new block to be committed as part
1754
+ * of a blob where the contents are read from a URL.
1755
+ * This API is available starting in version 2018-03-28.
1756
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-block-from-url
1757
+ *
1758
+ * @param blockId - A 64-byte value that is base64-encoded
1759
+ * @param sourceURL - Specifies the URL of the blob. The value
1760
+ * may be a URL of up to 2 KB in length that specifies a blob.
1761
+ * The value should be URL-encoded as it would appear
1762
+ * in a request URI. The source blob must either be public
1763
+ * or must be authenticated via a shared access signature.
1764
+ * If the source blob is public, no authentication is required
1765
+ * to perform the operation. Here are some examples of source object URLs:
1766
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob
1767
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
1768
+ * @param offset - From which position of the blob to download, greater than or equal to 0
1769
+ * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
1770
+ * @param options - Options to the Block Blob Stage Block From URL operation.
1771
+ * @returns Response data for the Block Blob Stage Block From URL operation.
1772
+ */
1773
+ async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) {
1774
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1775
+ return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => {
1776
+ return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, {
1777
+ abortSignal: options.abortSignal,
1778
+ leaseAccessConditions: options.conditions,
1779
+ sourceContentMD5: options.sourceContentMD5,
1780
+ sourceContentCrc64: options.sourceContentCrc64,
1781
+ sourceRange: offset === 0 && !count ? undefined : rangeToString({ offset, count }),
1782
+ cpkInfo: options.customerProvidedKey,
1783
+ encryptionScope: options.encryptionScope,
1784
+ copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
1785
+ fileRequestIntent: options.sourceShareTokenIntent,
1786
+ tracingOptions: updatedOptions.tracingOptions,
1787
+ }));
1788
+ });
1789
+ }
1790
+ /**
1791
+ * Writes a blob by specifying the list of block IDs that make up the blob.
1792
+ * In order to be written as part of a blob, a block must have been successfully written
1793
+ * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to
1794
+ * update a blob by uploading only those blocks that have changed, then committing the new and existing
1795
+ * blocks together. Any blocks not specified in the block list and permanently deleted.
1796
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-block-list
1797
+ *
1798
+ * @param blocks - Array of 64-byte value that is base64-encoded
1799
+ * @param options - Options to the Block Blob Commit Block List operation.
1800
+ * @returns Response data for the Block Blob Commit Block List operation.
1801
+ */
1802
+ async commitBlockList(blocks, options = {}) {
1803
+ options.conditions = options.conditions || {};
1804
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
1805
+ return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => {
1806
+ return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks }, {
1807
+ abortSignal: options.abortSignal,
1808
+ blobHttpHeaders: options.blobHTTPHeaders,
1809
+ leaseAccessConditions: options.conditions,
1810
+ metadata: options.metadata,
1811
+ modifiedAccessConditions: {
1812
+ ...options.conditions,
1813
+ ifTags: options.conditions?.tagConditions,
1814
+ },
1815
+ cpkInfo: options.customerProvidedKey,
1816
+ encryptionScope: options.encryptionScope,
1817
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
1818
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
1819
+ legalHold: options.legalHold,
1820
+ tier: toAccessTier(options.tier),
1821
+ blobTagsString: toBlobTagsString(options.tags),
1822
+ tracingOptions: updatedOptions.tracingOptions,
1823
+ }));
1824
+ });
1825
+ }
1826
+ /**
1827
+ * Returns the list of blocks that have been uploaded as part of a block blob
1828
+ * using the specified block list filter.
1829
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-block-list
1830
+ *
1831
+ * @param listType - Specifies whether to return the list of committed blocks,
1832
+ * the list of uncommitted blocks, or both lists together.
1833
+ * @param options - Options to the Block Blob Get Block List operation.
1834
+ * @returns Response data for the Block Blob Get Block List operation.
1835
+ */
1836
+ async getBlockList(listType, options = {}) {
1837
+ return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => {
1838
+ const res = assertResponse(await this.blockBlobContext.getBlockList(listType, {
1839
+ abortSignal: options.abortSignal,
1840
+ leaseAccessConditions: options.conditions,
1841
+ modifiedAccessConditions: {
1842
+ ...options.conditions,
1843
+ ifTags: options.conditions?.tagConditions,
1844
+ },
1845
+ tracingOptions: updatedOptions.tracingOptions,
1846
+ }));
1847
+ if (!res.committedBlocks) {
1848
+ res.committedBlocks = [];
1849
+ }
1850
+ if (!res.uncommittedBlocks) {
1851
+ res.uncommittedBlocks = [];
1852
+ }
1853
+ return res;
1854
+ });
1855
+ }
1856
+ // High level functions
1857
+ /**
1858
+ * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.
1859
+ *
1860
+ * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
1861
+ * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
1862
+ * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
1863
+ * to commit the block list.
1864
+ *
1865
+ * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
1866
+ * `blobContentType`, enabling the browser to provide
1867
+ * functionality based on file type.
1868
+ *
1869
+ * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView
1870
+ * @param options -
1871
+ */
1872
+ async uploadData(data, options = {}) {
1873
+ return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => {
1874
+ if (isNodeLike) {
1875
+ let buffer;
1876
+ if (data instanceof Buffer) {
1877
+ buffer = data;
1878
+ }
1879
+ else if (data instanceof ArrayBuffer) {
1880
+ buffer = Buffer.from(data);
1881
+ }
1882
+ else {
1883
+ data = data;
1884
+ buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1885
+ }
1886
+ return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);
1887
+ }
1888
+ else {
1889
+ const browserBlob = new Blob([data]);
1890
+ return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
1891
+ }
1892
+ });
1893
+ }
1894
+ /**
1895
+ * ONLY AVAILABLE IN BROWSERS.
1896
+ *
1897
+ * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob.
1898
+ *
1899
+ * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
1900
+ * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call
1901
+ * {@link commitBlockList} to commit the block list.
1902
+ *
1903
+ * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is
1904
+ * `blobContentType`, enabling the browser to provide
1905
+ * functionality based on file type.
1906
+ *
1907
+ * @deprecated Use {@link uploadData} instead.
1908
+ *
1909
+ * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView
1910
+ * @param options - Options to upload browser data.
1911
+ * @returns Response data for the Blob Upload operation.
1912
+ */
1913
+ async uploadBrowserData(browserData, options = {}) {
1914
+ return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => {
1915
+ const browserBlob = new Blob([browserData]);
1916
+ return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
1917
+ });
1918
+ }
1919
+ /**
1920
+ *
1921
+ * Uploads data to block blob. Requires a bodyFactory as the data source,
1922
+ * which need to return a {@link HttpRequestBody} object with the offset and size provided.
1923
+ *
1924
+ * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
1925
+ * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
1926
+ * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
1927
+ * to commit the block list.
1928
+ *
1929
+ * @param bodyFactory -
1930
+ * @param size - size of the data to upload.
1931
+ * @param options - Options to Upload to Block Blob operation.
1932
+ * @returns Response data for the Blob Upload operation.
1933
+ */
1934
+ async uploadSeekableInternal(bodyFactory, size, options = {}) {
1935
+ let blockSize = options.blockSize ?? 0;
1936
+ if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
1937
+ throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);
1938
+ }
1939
+ const maxSingleShotSize = options.maxSingleShotSize ?? BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
1940
+ if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
1941
+ throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);
1942
+ }
1943
+ if (blockSize === 0) {
1944
+ if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) {
1945
+ throw new RangeError(`${size} is too larger to upload to a block blob.`);
1946
+ }
1947
+ if (size > maxSingleShotSize) {
1948
+ blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
1949
+ if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) {
1950
+ blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
1951
+ }
1952
+ }
1953
+ }
1954
+ if (!options.blobHTTPHeaders) {
1955
+ options.blobHTTPHeaders = {};
1956
+ }
1957
+ if (!options.conditions) {
1958
+ options.conditions = {};
1959
+ }
1960
+ return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => {
1961
+ if (size <= maxSingleShotSize) {
1962
+ return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions));
1963
+ }
1964
+ const numBlocks = Math.floor((size - 1) / blockSize) + 1;
1965
+ if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) {
1966
+ throw new RangeError(`The buffer's size is too big or the BlockSize is too small;` +
1967
+ `the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`);
1968
+ }
1969
+ const blockList = [];
1970
+ const blockIDPrefix = randomUUID();
1971
+ let transferProgress = 0;
1972
+ const batch = new Batch(options.concurrency);
1973
+ for (let i = 0; i < numBlocks; i++) {
1974
+ batch.addOperation(async () => {
1975
+ const blockID = generateBlockID(blockIDPrefix, i);
1976
+ const start = blockSize * i;
1977
+ const end = i === numBlocks - 1 ? size : start + blockSize;
1978
+ const contentLength = end - start;
1979
+ blockList.push(blockID);
1980
+ await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, {
1981
+ abortSignal: options.abortSignal,
1982
+ conditions: options.conditions,
1983
+ encryptionScope: options.encryptionScope,
1984
+ tracingOptions: updatedOptions.tracingOptions,
1985
+ });
1986
+ // Update progress after block is successfully uploaded to server, in case of block trying
1987
+ // TODO: Hook with convenience layer progress event in finer level
1988
+ transferProgress += contentLength;
1989
+ if (options.onProgress) {
1990
+ options.onProgress({
1991
+ loadedBytes: transferProgress,
1992
+ });
1993
+ }
1994
+ });
1995
+ }
1996
+ await batch.do();
1997
+ return this.commitBlockList(blockList, updatedOptions);
1998
+ });
1999
+ }
2000
+ /**
2001
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
2002
+ *
2003
+ * Uploads a local file in blocks to a block blob.
2004
+ *
2005
+ * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.
2006
+ * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList
2007
+ * to commit the block list.
2008
+ *
2009
+ * @param filePath - Full path of local file
2010
+ * @param options - Options to Upload to Block Blob operation.
2011
+ * @returns Response data for the Blob Upload operation.
2012
+ */
2013
+ async uploadFile(filePath, options = {}) {
2014
+ return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => {
2015
+ const size = (await fsStat(filePath)).size;
2016
+ return this.uploadSeekableInternal((offset, count) => {
2017
+ return () => fsCreateReadStream(filePath, {
2018
+ autoClose: true,
2019
+ end: count ? offset + count - 1 : Infinity,
2020
+ start: offset,
2021
+ });
2022
+ }, size, {
2023
+ ...options,
2024
+ tracingOptions: updatedOptions.tracingOptions,
2025
+ });
2026
+ });
2027
+ }
2028
+ /**
2029
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
2030
+ *
2031
+ * Uploads a Node.js Readable stream into block blob.
2032
+ *
2033
+ * PERFORMANCE IMPROVEMENT TIPS:
2034
+ * * Input stream highWaterMark is better to set a same value with bufferSize
2035
+ * parameter, which will avoid Buffer.concat() operations.
2036
+ *
2037
+ * @param stream - Node.js Readable stream
2038
+ * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB
2039
+ * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated,
2040
+ * positive correlation with max uploading concurrency. Default value is 5
2041
+ * @param options - Options to Upload Stream to Block Blob operation.
2042
+ * @returns Response data for the Blob Upload operation.
2043
+ */
2044
+ async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) {
2045
+ if (!options.blobHTTPHeaders) {
2046
+ options.blobHTTPHeaders = {};
2047
+ }
2048
+ if (!options.conditions) {
2049
+ options.conditions = {};
2050
+ }
2051
+ return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => {
2052
+ let blockNum = 0;
2053
+ const blockIDPrefix = randomUUID();
2054
+ let transferProgress = 0;
2055
+ const blockList = [];
2056
+ const scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, async (body, length) => {
2057
+ const blockID = generateBlockID(blockIDPrefix, blockNum);
2058
+ blockList.push(blockID);
2059
+ blockNum++;
2060
+ await this.stageBlock(blockID, body, length, {
2061
+ customerProvidedKey: options.customerProvidedKey,
2062
+ conditions: options.conditions,
2063
+ encryptionScope: options.encryptionScope,
2064
+ tracingOptions: updatedOptions.tracingOptions,
2065
+ });
2066
+ // Update progress after block is successfully uploaded to server, in case of block trying
2067
+ transferProgress += length;
2068
+ if (options.onProgress) {
2069
+ options.onProgress({ loadedBytes: transferProgress });
2070
+ }
2071
+ },
2072
+ // concurrency should set a smaller value than maxConcurrency, which is helpful to
2073
+ // reduce the possibility when a outgoing handler waits for stream data, in
2074
+ // this situation, outgoing handlers are blocked.
2075
+ // Outgoing queue shouldn't be empty.
2076
+ Math.ceil((maxConcurrency / 4) * 3));
2077
+ await scheduler.do();
2078
+ return assertResponse(await this.commitBlockList(blockList, {
2079
+ ...options,
2080
+ tracingOptions: updatedOptions.tracingOptions,
2081
+ }));
2082
+ });
2083
+ }
2084
+ }
2085
+ /**
2086
+ * PageBlobClient defines a set of operations applicable to page blobs.
2087
+ */
2088
+ export class PageBlobClient extends BlobClient {
2089
+ /**
2090
+ * pageBlobsContext provided by protocol layer.
2091
+ */
2092
+ pageBlobContext;
2093
+ constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions,
2094
+ // Legacy, no fix for eslint error without breaking. Disable it for this interface.
2095
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
2096
+ options) {
2097
+ // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.
2098
+ // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);
2099
+ let pipeline;
2100
+ let url;
2101
+ options = options || {};
2102
+ if (isPipelineLike(credentialOrPipelineOrContainerName)) {
2103
+ // (url: string, pipeline: Pipeline)
2104
+ url = urlOrConnectionString;
2105
+ pipeline = credentialOrPipelineOrContainerName;
2106
+ }
2107
+ else if ((isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||
2108
+ credentialOrPipelineOrContainerName instanceof AnonymousCredential ||
2109
+ isTokenCredential(credentialOrPipelineOrContainerName)) {
2110
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
2111
+ url = urlOrConnectionString;
2112
+ options = blobNameOrOptions;
2113
+ pipeline = newPipeline(credentialOrPipelineOrContainerName, options);
2114
+ }
2115
+ else if (!credentialOrPipelineOrContainerName &&
2116
+ typeof credentialOrPipelineOrContainerName !== "string") {
2117
+ // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
2118
+ // The second parameter is undefined. Use anonymous credential.
2119
+ url = urlOrConnectionString;
2120
+ pipeline = newPipeline(new AnonymousCredential(), options);
2121
+ }
2122
+ else if (credentialOrPipelineOrContainerName &&
2123
+ typeof credentialOrPipelineOrContainerName === "string" &&
2124
+ blobNameOrOptions &&
2125
+ typeof blobNameOrOptions === "string") {
2126
+ // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
2127
+ const containerName = credentialOrPipelineOrContainerName;
2128
+ const blobName = blobNameOrOptions;
2129
+ const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
2130
+ if (extractedCreds.kind === "AccountConnString") {
2131
+ if (isNodeLike) {
2132
+ const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
2133
+ url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
2134
+ if (!options.proxyOptions) {
2135
+ options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);
2136
+ }
2137
+ pipeline = newPipeline(sharedKeyCredential, options);
2138
+ }
2139
+ else {
2140
+ throw new Error("Account connection string is only supported in Node.js environment");
2141
+ }
2142
+ }
2143
+ else if (extractedCreds.kind === "SASConnString") {
2144
+ url =
2145
+ appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
2146
+ "?" +
2147
+ extractedCreds.accountSas;
2148
+ pipeline = newPipeline(new AnonymousCredential(), options);
2149
+ }
2150
+ else {
2151
+ throw new Error("Connection string must be either an Account connection string or a SAS connection string");
2152
+ }
2153
+ }
2154
+ else {
2155
+ throw new Error("Expecting non-empty strings for containerName and blobName parameters");
2156
+ }
2157
+ super(url, pipeline);
2158
+ this.pageBlobContext = this.storageClientContext.pageBlob;
2159
+ }
2160
+ /**
2161
+ * Creates a new PageBlobClient object identical to the source but with the
2162
+ * specified snapshot timestamp.
2163
+ * Provide "" will remove the snapshot and return a Client to the base blob.
2164
+ *
2165
+ * @param snapshot - The snapshot timestamp.
2166
+ * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp.
2167
+ */
2168
+ withSnapshot(snapshot) {
2169
+ return new PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
2170
+ }
2171
+ /**
2172
+ * Creates a page blob of the specified length. Call uploadPages to upload data
2173
+ * data to a page blob.
2174
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
2175
+ *
2176
+ * @param size - size of the page blob.
2177
+ * @param options - Options to the Page Blob Create operation.
2178
+ * @returns Response data for the Page Blob Create operation.
2179
+ */
2180
+ async create(size, options = {}) {
2181
+ options.conditions = options.conditions || {};
2182
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
2183
+ return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => {
2184
+ return assertResponse(await this.pageBlobContext.create(0, size, {
2185
+ abortSignal: options.abortSignal,
2186
+ blobHttpHeaders: options.blobHTTPHeaders,
2187
+ blobSequenceNumber: options.blobSequenceNumber,
2188
+ leaseAccessConditions: options.conditions,
2189
+ metadata: options.metadata,
2190
+ modifiedAccessConditions: {
2191
+ ...options.conditions,
2192
+ ifTags: options.conditions?.tagConditions,
2193
+ },
2194
+ cpkInfo: options.customerProvidedKey,
2195
+ encryptionScope: options.encryptionScope,
2196
+ immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn,
2197
+ immutabilityPolicyMode: options.immutabilityPolicy?.policyMode,
2198
+ legalHold: options.legalHold,
2199
+ tier: toAccessTier(options.tier),
2200
+ blobTagsString: toBlobTagsString(options.tags),
2201
+ tracingOptions: updatedOptions.tracingOptions,
2202
+ }));
2203
+ });
2204
+ }
2205
+ /**
2206
+ * Creates a page blob of the specified length. Call uploadPages to upload data
2207
+ * data to a page blob. If the blob with the same name already exists, the content
2208
+ * of the existing blob will remain unchanged.
2209
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-blob
2210
+ *
2211
+ * @param size - size of the page blob.
2212
+ * @param options -
2213
+ */
2214
+ async createIfNotExists(size, options = {}) {
2215
+ return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => {
2216
+ try {
2217
+ const conditions = { ifNoneMatch: ETagAny };
2218
+ const res = assertResponse(await this.create(size, {
2219
+ ...options,
2220
+ conditions,
2221
+ tracingOptions: updatedOptions.tracingOptions,
2222
+ }));
2223
+ return {
2224
+ succeeded: true,
2225
+ ...res,
2226
+ _response: res._response, // _response is made non-enumerable
2227
+ };
2228
+ }
2229
+ catch (e) {
2230
+ if (e.details?.errorCode === "BlobAlreadyExists") {
2231
+ return {
2232
+ succeeded: false,
2233
+ ...e.response?.parsedHeaders,
2234
+ _response: e.response,
2235
+ };
2236
+ }
2237
+ throw e;
2238
+ }
2239
+ });
2240
+ }
2241
+ /**
2242
+ * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512.
2243
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-page
2244
+ *
2245
+ * @param body - Data to upload
2246
+ * @param offset - Offset of destination page blob
2247
+ * @param count - Content length of the body, also number of bytes to be uploaded
2248
+ * @param options - Options to the Page Blob Upload Pages operation.
2249
+ * @returns Response data for the Page Blob Upload Pages operation.
2250
+ */
2251
+ async uploadPages(body, offset, count, options = {}) {
2252
+ options.conditions = options.conditions || {};
2253
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
2254
+ return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => {
2255
+ return assertResponse(await this.pageBlobContext.uploadPages(count, body, {
2256
+ abortSignal: options.abortSignal,
2257
+ leaseAccessConditions: options.conditions,
2258
+ modifiedAccessConditions: {
2259
+ ...options.conditions,
2260
+ ifTags: options.conditions?.tagConditions,
2261
+ },
2262
+ requestOptions: {
2263
+ onUploadProgress: options.onProgress,
2264
+ },
2265
+ range: rangeToString({ offset, count }),
2266
+ sequenceNumberAccessConditions: options.conditions,
2267
+ transactionalContentMD5: options.transactionalContentMD5,
2268
+ transactionalContentCrc64: options.transactionalContentCrc64,
2269
+ cpkInfo: options.customerProvidedKey,
2270
+ encryptionScope: options.encryptionScope,
2271
+ tracingOptions: updatedOptions.tracingOptions,
2272
+ }));
2273
+ });
2274
+ }
2275
+ /**
2276
+ * The Upload Pages operation writes a range of pages to a page blob where the
2277
+ * contents are read from a URL.
2278
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-page-from-url
2279
+ *
2280
+ * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication
2281
+ * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob
2282
+ * @param destOffset - Offset of destination page blob
2283
+ * @param count - Number of bytes to be uploaded from source page blob
2284
+ * @param options -
2285
+ */
2286
+ async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) {
2287
+ options.conditions = options.conditions || {};
2288
+ options.sourceConditions = options.sourceConditions || {};
2289
+ ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
2290
+ return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => {
2291
+ return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), {
2292
+ abortSignal: options.abortSignal,
2293
+ sourceContentMD5: options.sourceContentMD5,
2294
+ sourceContentCrc64: options.sourceContentCrc64,
2295
+ leaseAccessConditions: options.conditions,
2296
+ sequenceNumberAccessConditions: options.conditions,
2297
+ modifiedAccessConditions: {
2298
+ ...options.conditions,
2299
+ ifTags: options.conditions?.tagConditions,
2300
+ },
2301
+ sourceModifiedAccessConditions: {
2302
+ sourceIfMatch: options.sourceConditions?.ifMatch,
2303
+ sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince,
2304
+ sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch,
2305
+ sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince,
2306
+ },
2307
+ cpkInfo: options.customerProvidedKey,
2308
+ encryptionScope: options.encryptionScope,
2309
+ copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization),
2310
+ fileRequestIntent: options.sourceShareTokenIntent,
2311
+ tracingOptions: updatedOptions.tracingOptions,
2312
+ }));
2313
+ });
2314
+ }
2315
+ /**
2316
+ * Frees the specified pages from the page blob.
2317
+ * @see https://learn.microsoft.com/rest/api/storageservices/put-page
2318
+ *
2319
+ * @param offset - Starting byte position of the pages to clear.
2320
+ * @param count - Number of bytes to clear.
2321
+ * @param options - Options to the Page Blob Clear Pages operation.
2322
+ * @returns Response data for the Page Blob Clear Pages operation.
2323
+ */
2324
+ async clearPages(offset = 0, count, options = {}) {
2325
+ options.conditions = options.conditions || {};
2326
+ return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => {
2327
+ return assertResponse(await this.pageBlobContext.clearPages(0, {
2328
+ abortSignal: options.abortSignal,
2329
+ leaseAccessConditions: options.conditions,
2330
+ modifiedAccessConditions: {
2331
+ ...options.conditions,
2332
+ ifTags: options.conditions?.tagConditions,
2333
+ },
2334
+ range: rangeToString({ offset, count }),
2335
+ sequenceNumberAccessConditions: options.conditions,
2336
+ cpkInfo: options.customerProvidedKey,
2337
+ encryptionScope: options.encryptionScope,
2338
+ tracingOptions: updatedOptions.tracingOptions,
2339
+ }));
2340
+ });
2341
+ }
2342
+ /**
2343
+ * Returns the list of valid page ranges for a page blob or snapshot of a page blob.
2344
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2345
+ *
2346
+ * @param offset - Starting byte position of the page ranges.
2347
+ * @param count - Number of bytes to get.
2348
+ * @param options - Options to the Page Blob Get Ranges operation.
2349
+ * @returns Response data for the Page Blob Get Ranges operation.
2350
+ */
2351
+ async getPageRanges(offset = 0, count, options = {}) {
2352
+ options.conditions = options.conditions || {};
2353
+ return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => {
2354
+ const response = assertResponse(await this.pageBlobContext.getPageRanges({
2355
+ abortSignal: options.abortSignal,
2356
+ leaseAccessConditions: options.conditions,
2357
+ modifiedAccessConditions: {
2358
+ ...options.conditions,
2359
+ ifTags: options.conditions?.tagConditions,
2360
+ },
2361
+ range: rangeToString({ offset, count }),
2362
+ tracingOptions: updatedOptions.tracingOptions,
2363
+ }));
2364
+ return rangeResponseFromModel(response);
2365
+ });
2366
+ }
2367
+ /**
2368
+ * getPageRangesSegment returns a single segment of page ranges starting from the
2369
+ * specified Marker. Use an empty Marker to start enumeration from the beginning.
2370
+ * After getting a segment, process it, and then call getPageRangesSegment again
2371
+ * (passing the the previously-returned Marker) to get the next segment.
2372
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2373
+ *
2374
+ * @param offset - Starting byte position of the page ranges.
2375
+ * @param count - Number of bytes to get.
2376
+ * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
2377
+ * @param options - Options to PageBlob Get Page Ranges Segment operation.
2378
+ */
2379
+ async listPageRangesSegment(offset = 0, count, marker, options = {}) {
2380
+ return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => {
2381
+ return assertResponse(await this.pageBlobContext.getPageRanges({
2382
+ abortSignal: options.abortSignal,
2383
+ leaseAccessConditions: options.conditions,
2384
+ modifiedAccessConditions: {
2385
+ ...options.conditions,
2386
+ ifTags: options.conditions?.tagConditions,
2387
+ },
2388
+ range: rangeToString({ offset, count }),
2389
+ marker: marker,
2390
+ maxPageSize: options.maxPageSize,
2391
+ tracingOptions: updatedOptions.tracingOptions,
2392
+ }));
2393
+ });
2394
+ }
2395
+ /**
2396
+ * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel}
2397
+ *
2398
+ * @param offset - Starting byte position of the page ranges.
2399
+ * @param count - Number of bytes to get.
2400
+ * @param marker - A string value that identifies the portion of
2401
+ * the get of page ranges to be returned with the next getting operation. The
2402
+ * operation returns the ContinuationToken value within the response body if the
2403
+ * getting operation did not return all page ranges remaining within the current page.
2404
+ * The ContinuationToken value can be used as the value for
2405
+ * the marker parameter in a subsequent call to request the next page of get
2406
+ * items. The marker value is opaque to the client.
2407
+ * @param options - Options to List Page Ranges operation.
2408
+ */
2409
+ async *listPageRangeItemSegments(offset = 0, count, marker, options = {}) {
2410
+ let getPageRangeItemSegmentsResponse;
2411
+ if (!!marker || marker === undefined) {
2412
+ do {
2413
+ getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker, options);
2414
+ marker = getPageRangeItemSegmentsResponse.continuationToken;
2415
+ yield await getPageRangeItemSegmentsResponse;
2416
+ } while (marker);
2417
+ }
2418
+ }
2419
+ /**
2420
+ * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
2421
+ *
2422
+ * @param offset - Starting byte position of the page ranges.
2423
+ * @param count - Number of bytes to get.
2424
+ * @param options - Options to List Page Ranges operation.
2425
+ */
2426
+ async *listPageRangeItems(offset = 0, count, options = {}) {
2427
+ let marker;
2428
+ for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker, options)) {
2429
+ yield* ExtractPageRangeInfoItems(getPageRangesSegment);
2430
+ }
2431
+ }
2432
+ /**
2433
+ * Returns an async iterable iterator to list of page ranges for a page blob.
2434
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2435
+ *
2436
+ * .byPage() returns an async iterable iterator to list of page ranges for a page blob.
2437
+ *
2438
+ * ```ts snippet:ClientsListPageBlobs
2439
+ * import { BlobServiceClient } from "@azure/storage-blob";
2440
+ * import { DefaultAzureCredential } from "@azure/identity";
2441
+ *
2442
+ * const account = "<account>";
2443
+ * const blobServiceClient = new BlobServiceClient(
2444
+ * `https://${account}.blob.core.windows.net`,
2445
+ * new DefaultAzureCredential(),
2446
+ * );
2447
+ *
2448
+ * const containerName = "<container name>";
2449
+ * const blobName = "<blob name>";
2450
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
2451
+ * const pageBlobClient = containerClient.getPageBlobClient(blobName);
2452
+ *
2453
+ * // Example using `for await` syntax
2454
+ * let i = 1;
2455
+ * for await (const pageRange of pageBlobClient.listPageRanges()) {
2456
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2457
+ * }
2458
+ *
2459
+ * // Example using `iter.next()` syntax
2460
+ * i = 1;
2461
+ * const iter = pageBlobClient.listPageRanges();
2462
+ * let { value, done } = await iter.next();
2463
+ * while (!done) {
2464
+ * console.log(`Page range ${i++}: ${value.start} - ${value.end}`);
2465
+ * ({ value, done } = await iter.next());
2466
+ * }
2467
+ *
2468
+ * // Example using `byPage()` syntax
2469
+ * i = 1;
2470
+ * for await (const page of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) {
2471
+ * for (const pageRange of page.pageRange || []) {
2472
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2473
+ * }
2474
+ * }
2475
+ *
2476
+ * // Example using paging with a marker
2477
+ * i = 1;
2478
+ * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 });
2479
+ * let response = (await iterator.next()).value;
2480
+ * // Prints 2 page ranges
2481
+ * if (response.pageRange) {
2482
+ * for (const pageRange of response.pageRange) {
2483
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2484
+ * }
2485
+ * }
2486
+ * // Gets next marker
2487
+ * let marker = response.continuationToken;
2488
+ * // Passing next marker as continuationToken
2489
+ * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 });
2490
+ * response = (await iterator.next()).value;
2491
+ * // Prints 10 page ranges
2492
+ * if (response.pageRange) {
2493
+ * for (const pageRange of response.pageRange) {
2494
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2495
+ * }
2496
+ * }
2497
+ * ```
2498
+ *
2499
+ * @param offset - Starting byte position of the page ranges.
2500
+ * @param count - Number of bytes to get.
2501
+ * @param options - Options to the Page Blob Get Ranges operation.
2502
+ * @returns An asyncIterableIterator that supports paging.
2503
+ */
2504
+ listPageRanges(offset = 0, count, options = {}) {
2505
+ options.conditions = options.conditions || {};
2506
+ // AsyncIterableIterator to iterate over blobs
2507
+ const iter = this.listPageRangeItems(offset, count, options);
2508
+ return {
2509
+ /**
2510
+ * The next method, part of the iteration protocol
2511
+ */
2512
+ next() {
2513
+ return iter.next();
2514
+ },
2515
+ /**
2516
+ * The connection to the async iterator, part of the iteration protocol
2517
+ */
2518
+ [Symbol.asyncIterator]() {
2519
+ return this;
2520
+ },
2521
+ /**
2522
+ * Return an AsyncIterableIterator that works a page at a time
2523
+ */
2524
+ byPage: (settings = {}) => {
2525
+ return this.listPageRangeItemSegments(offset, count, settings.continuationToken, {
2526
+ maxPageSize: settings.maxPageSize,
2527
+ ...options,
2528
+ });
2529
+ },
2530
+ };
2531
+ }
2532
+ /**
2533
+ * Gets the collection of page ranges that differ between a specified snapshot and this page blob.
2534
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2535
+ *
2536
+ * @param offset - Starting byte position of the page blob
2537
+ * @param count - Number of bytes to get ranges diff.
2538
+ * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
2539
+ * @param options - Options to the Page Blob Get Page Ranges Diff operation.
2540
+ * @returns Response data for the Page Blob Get Page Range Diff operation.
2541
+ */
2542
+ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) {
2543
+ options.conditions = options.conditions || {};
2544
+ return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => {
2545
+ const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({
2546
+ abortSignal: options.abortSignal,
2547
+ leaseAccessConditions: options.conditions,
2548
+ modifiedAccessConditions: {
2549
+ ...options.conditions,
2550
+ ifTags: options.conditions?.tagConditions,
2551
+ },
2552
+ prevsnapshot: prevSnapshot,
2553
+ range: rangeToString({ offset, count }),
2554
+ tracingOptions: updatedOptions.tracingOptions,
2555
+ }));
2556
+ return rangeResponseFromModel(result);
2557
+ });
2558
+ }
2559
+ /**
2560
+ * getPageRangesDiffSegment returns a single segment of page ranges starting from the
2561
+ * specified Marker for difference between previous snapshot and the target page blob.
2562
+ * Use an empty Marker to start enumeration from the beginning.
2563
+ * After getting a segment, process it, and then call getPageRangesDiffSegment again
2564
+ * (passing the the previously-returned Marker) to get the next segment.
2565
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2566
+ *
2567
+ * @param offset - Starting byte position of the page ranges.
2568
+ * @param count - Number of bytes to get.
2569
+ * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
2570
+ * @param marker - A string value that identifies the portion of the get to be returned with the next get operation.
2571
+ * @param options - Options to the Page Blob Get Page Ranges Diff operation.
2572
+ */
2573
+ async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options = {}) {
2574
+ return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => {
2575
+ return assertResponse(await this.pageBlobContext.getPageRangesDiff({
2576
+ abortSignal: options?.abortSignal,
2577
+ leaseAccessConditions: options?.conditions,
2578
+ modifiedAccessConditions: {
2579
+ ...options?.conditions,
2580
+ ifTags: options?.conditions?.tagConditions,
2581
+ },
2582
+ prevsnapshot: prevSnapshotOrUrl,
2583
+ range: rangeToString({
2584
+ offset: offset,
2585
+ count: count,
2586
+ }),
2587
+ marker: marker,
2588
+ maxPageSize: options?.maxPageSize,
2589
+ tracingOptions: updatedOptions.tracingOptions,
2590
+ }));
2591
+ });
2592
+ }
2593
+ /**
2594
+ * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel}
2595
+ *
2596
+ *
2597
+ * @param offset - Starting byte position of the page ranges.
2598
+ * @param count - Number of bytes to get.
2599
+ * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
2600
+ * @param marker - A string value that identifies the portion of
2601
+ * the get of page ranges to be returned with the next getting operation. The
2602
+ * operation returns the ContinuationToken value within the response body if the
2603
+ * getting operation did not return all page ranges remaining within the current page.
2604
+ * The ContinuationToken value can be used as the value for
2605
+ * the marker parameter in a subsequent call to request the next page of get
2606
+ * items. The marker value is opaque to the client.
2607
+ * @param options - Options to the Page Blob Get Page Ranges Diff operation.
2608
+ */
2609
+ async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {
2610
+ let getPageRangeItemSegmentsResponse;
2611
+ if (!!marker || marker === undefined) {
2612
+ do {
2613
+ getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options);
2614
+ marker = getPageRangeItemSegmentsResponse.continuationToken;
2615
+ yield await getPageRangeItemSegmentsResponse;
2616
+ } while (marker);
2617
+ }
2618
+ }
2619
+ /**
2620
+ * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects
2621
+ *
2622
+ * @param offset - Starting byte position of the page ranges.
2623
+ * @param count - Number of bytes to get.
2624
+ * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.
2625
+ * @param options - Options to the Page Blob Get Page Ranges Diff operation.
2626
+ */
2627
+ async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {
2628
+ let marker;
2629
+ for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)) {
2630
+ yield* ExtractPageRangeInfoItems(getPageRangesSegment);
2631
+ }
2632
+ }
2633
+ /**
2634
+ * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
2635
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2636
+ *
2637
+ * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.
2638
+ *
2639
+ * ```ts snippet:ClientsListPageBlobsDiff
2640
+ * import { BlobServiceClient } from "@azure/storage-blob";
2641
+ * import { DefaultAzureCredential } from "@azure/identity";
2642
+ *
2643
+ * const account = "<account>";
2644
+ * const blobServiceClient = new BlobServiceClient(
2645
+ * `https://${account}.blob.core.windows.net`,
2646
+ * new DefaultAzureCredential(),
2647
+ * );
2648
+ *
2649
+ * const containerName = "<container name>";
2650
+ * const blobName = "<blob name>";
2651
+ * const containerClient = blobServiceClient.getContainerClient(containerName);
2652
+ * const pageBlobClient = containerClient.getPageBlobClient(blobName);
2653
+ *
2654
+ * const offset = 0;
2655
+ * const count = 1024;
2656
+ * const previousSnapshot = "<previous snapshot>";
2657
+ * // Example using `for await` syntax
2658
+ * let i = 1;
2659
+ * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) {
2660
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2661
+ * }
2662
+ *
2663
+ * // Example using `iter.next()` syntax
2664
+ * i = 1;
2665
+ * const iter = pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot);
2666
+ * let { value, done } = await iter.next();
2667
+ * while (!done) {
2668
+ * console.log(`Page range ${i++}: ${value.start} - ${value.end}`);
2669
+ * ({ value, done } = await iter.next());
2670
+ * }
2671
+ *
2672
+ * // Example using `byPage()` syntax
2673
+ * i = 1;
2674
+ * for await (const page of pageBlobClient
2675
+ * .listPageRangesDiff(offset, count, previousSnapshot)
2676
+ * .byPage({ maxPageSize: 20 })) {
2677
+ * for (const pageRange of page.pageRange || []) {
2678
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2679
+ * }
2680
+ * }
2681
+ *
2682
+ * // Example using paging with a marker
2683
+ * i = 1;
2684
+ * let iterator = pageBlobClient
2685
+ * .listPageRangesDiff(offset, count, previousSnapshot)
2686
+ * .byPage({ maxPageSize: 2 });
2687
+ * let response = (await iterator.next()).value;
2688
+ * // Prints 2 page ranges
2689
+ * if (response.pageRange) {
2690
+ * for (const pageRange of response.pageRange) {
2691
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2692
+ * }
2693
+ * }
2694
+ * // Gets next marker
2695
+ * let marker = response.continuationToken;
2696
+ * // Passing next marker as continuationToken
2697
+ * iterator = pageBlobClient
2698
+ * .listPageRangesDiff(offset, count, previousSnapshot)
2699
+ * .byPage({ continuationToken: marker, maxPageSize: 10 });
2700
+ * response = (await iterator.next()).value;
2701
+ * // Prints 10 page ranges
2702
+ * if (response.pageRange) {
2703
+ * for (const pageRange of response.pageRange) {
2704
+ * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);
2705
+ * }
2706
+ * }
2707
+ * ```
2708
+ *
2709
+ * @param offset - Starting byte position of the page ranges.
2710
+ * @param count - Number of bytes to get.
2711
+ * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.
2712
+ * @param options - Options to the Page Blob Get Ranges operation.
2713
+ * @returns An asyncIterableIterator that supports paging.
2714
+ */
2715
+ listPageRangesDiff(offset, count, prevSnapshot, options = {}) {
2716
+ options.conditions = options.conditions || {};
2717
+ // AsyncIterableIterator to iterate over blobs
2718
+ const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, {
2719
+ ...options,
2720
+ });
2721
+ return {
2722
+ /**
2723
+ * The next method, part of the iteration protocol
2724
+ */
2725
+ next() {
2726
+ return iter.next();
2727
+ },
2728
+ /**
2729
+ * The connection to the async iterator, part of the iteration protocol
2730
+ */
2731
+ [Symbol.asyncIterator]() {
2732
+ return this;
2733
+ },
2734
+ /**
2735
+ * Return an AsyncIterableIterator that works a page at a time
2736
+ */
2737
+ byPage: (settings = {}) => {
2738
+ return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, {
2739
+ maxPageSize: settings.maxPageSize,
2740
+ ...options,
2741
+ });
2742
+ },
2743
+ };
2744
+ }
2745
+ /**
2746
+ * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks.
2747
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-page-ranges
2748
+ *
2749
+ * @param offset - Starting byte position of the page blob
2750
+ * @param count - Number of bytes to get ranges diff.
2751
+ * @param prevSnapshotUrl - URL of snapshot to retrieve the difference.
2752
+ * @param options - Options to the Page Blob Get Page Ranges Diff operation.
2753
+ * @returns Response data for the Page Blob Get Page Range Diff operation.
2754
+ */
2755
+ async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) {
2756
+ options.conditions = options.conditions || {};
2757
+ return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => {
2758
+ const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({
2759
+ abortSignal: options.abortSignal,
2760
+ leaseAccessConditions: options.conditions,
2761
+ modifiedAccessConditions: {
2762
+ ...options.conditions,
2763
+ ifTags: options.conditions?.tagConditions,
2764
+ },
2765
+ prevSnapshotUrl,
2766
+ range: rangeToString({ offset, count }),
2767
+ tracingOptions: updatedOptions.tracingOptions,
2768
+ }));
2769
+ return rangeResponseFromModel(response);
2770
+ });
2771
+ }
2772
+ /**
2773
+ * Resizes the page blob to the specified size (which must be a multiple of 512).
2774
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
2775
+ *
2776
+ * @param size - Target size
2777
+ * @param options - Options to the Page Blob Resize operation.
2778
+ * @returns Response data for the Page Blob Resize operation.
2779
+ */
2780
+ async resize(size, options = {}) {
2781
+ options.conditions = options.conditions || {};
2782
+ return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => {
2783
+ return assertResponse(await this.pageBlobContext.resize(size, {
2784
+ abortSignal: options.abortSignal,
2785
+ leaseAccessConditions: options.conditions,
2786
+ modifiedAccessConditions: {
2787
+ ...options.conditions,
2788
+ ifTags: options.conditions?.tagConditions,
2789
+ },
2790
+ encryptionScope: options.encryptionScope,
2791
+ tracingOptions: updatedOptions.tracingOptions,
2792
+ }));
2793
+ });
2794
+ }
2795
+ /**
2796
+ * Sets a page blob's sequence number.
2797
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
2798
+ *
2799
+ * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number.
2800
+ * @param sequenceNumber - Required if sequenceNumberAction is max or update
2801
+ * @param options - Options to the Page Blob Update Sequence Number operation.
2802
+ * @returns Response data for the Page Blob Update Sequence Number operation.
2803
+ */
2804
+ async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) {
2805
+ options.conditions = options.conditions || {};
2806
+ return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => {
2807
+ return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, {
2808
+ abortSignal: options.abortSignal,
2809
+ blobSequenceNumber: sequenceNumber,
2810
+ leaseAccessConditions: options.conditions,
2811
+ modifiedAccessConditions: {
2812
+ ...options.conditions,
2813
+ ifTags: options.conditions?.tagConditions,
2814
+ },
2815
+ tracingOptions: updatedOptions.tracingOptions,
2816
+ }));
2817
+ });
2818
+ }
2819
+ /**
2820
+ * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob.
2821
+ * The snapshot is copied such that only the differential changes between the previously
2822
+ * copied snapshot are transferred to the destination.
2823
+ * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual.
2824
+ * @see https://learn.microsoft.com/rest/api/storageservices/incremental-copy-blob
2825
+ * @see https://learn.microsoft.com/azure/virtual-machines/windows/incremental-snapshots
2826
+ *
2827
+ * @param copySource - Specifies the name of the source page blob snapshot. For example,
2828
+ * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>
2829
+ * @param options - Options to the Page Blob Copy Incremental operation.
2830
+ * @returns Response data for the Page Blob Copy Incremental operation.
2831
+ */
2832
+ async startCopyIncremental(copySource, options = {}) {
2833
+ return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => {
2834
+ return assertResponse(await this.pageBlobContext.copyIncremental(copySource, {
2835
+ abortSignal: options.abortSignal,
2836
+ modifiedAccessConditions: {
2837
+ ...options.conditions,
2838
+ ifTags: options.conditions?.tagConditions,
2839
+ },
2840
+ tracingOptions: updatedOptions.tracingOptions,
2841
+ }));
2842
+ });
2843
+ }
2844
+ }
2845
+ //# sourceMappingURL=Clients.js.map