@azure/storage-blob 12.28.0-alpha.20250717.2 → 12.28.0-alpha.20250718.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/dist/browser/BatchResponseParser.js +5 -0
  2. package/dist/browser/BatchResponseParser.js.map +1 -1
  3. package/dist/browser/BlobBatch.js +10 -1
  4. package/dist/browser/BlobBatch.js.map +1 -1
  5. package/dist/browser/BlobBatchClient.js +4 -1
  6. package/dist/browser/BlobBatchClient.js.map +1 -1
  7. package/dist/browser/BlobLeaseClient.js +39 -30
  8. package/dist/browser/BlobLeaseClient.js.map +1 -1
  9. package/dist/browser/BlobQueryResponse-browser.mjs.map +1 -1
  10. package/dist/browser/BlobQueryResponse.js +1 -0
  11. package/dist/browser/BlobServiceClient.js +86 -81
  12. package/dist/browser/BlobServiceClient.js.map +1 -1
  13. package/dist/browser/Clients.js +351 -196
  14. package/dist/browser/Clients.js.map +1 -1
  15. package/dist/browser/ContainerClient.js +182 -135
  16. package/dist/browser/ContainerClient.js.map +1 -1
  17. package/dist/browser/PageBlobRangeResponse.js +10 -3
  18. package/dist/browser/PageBlobRangeResponse.js.map +1 -1
  19. package/dist/browser/Pipeline.js +27 -10
  20. package/dist/browser/Pipeline.js.map +1 -1
  21. package/dist/browser/StorageClient.js +23 -0
  22. package/dist/browser/StorageClient.js.map +1 -1
  23. package/dist/browser/StorageContextClient.js +1 -1
  24. package/dist/browser/StorageContextClient.js.map +1 -1
  25. package/dist/browser/StorageRetryPolicyFactory.js +1 -0
  26. package/dist/browser/StorageRetryPolicyFactory.js.map +1 -1
  27. package/dist/browser/generated/src/operations/appendBlob.js +1 -0
  28. package/dist/browser/generated/src/operations/appendBlob.js.map +1 -1
  29. package/dist/browser/generated/src/operations/blob.js +1 -0
  30. package/dist/browser/generated/src/operations/blob.js.map +1 -1
  31. package/dist/browser/generated/src/operations/blockBlob.js +1 -0
  32. package/dist/browser/generated/src/operations/blockBlob.js.map +1 -1
  33. package/dist/browser/generated/src/operations/container.js +1 -0
  34. package/dist/browser/generated/src/operations/container.js.map +1 -1
  35. package/dist/browser/generated/src/operations/pageBlob.js +1 -0
  36. package/dist/browser/generated/src/operations/pageBlob.js.map +1 -1
  37. package/dist/browser/generated/src/operations/service.js +1 -0
  38. package/dist/browser/generated/src/operations/service.js.map +1 -1
  39. package/dist/browser/generated/src/storageClient.js +15 -3
  40. package/dist/browser/generated/src/storageClient.js.map +1 -1
  41. package/dist/browser/internal-avro/AvroParser.js +7 -1
  42. package/dist/browser/internal-avro/AvroParser.js.map +1 -1
  43. package/dist/browser/internal-avro/AvroReadableFromBlob.js +2 -0
  44. package/dist/browser/internal-avro/AvroReadableFromBlob.js.map +1 -1
  45. package/dist/browser/internal-avro/AvroReadableFromStream.js +3 -2
  46. package/dist/browser/internal-avro/AvroReadableFromStream.js.map +1 -1
  47. package/dist/browser/internal-avro/AvroReader.js +44 -34
  48. package/dist/browser/internal-avro/AvroReader.js.map +1 -1
  49. package/dist/browser/policies/RequestPolicy.js +2 -0
  50. package/dist/browser/policies/RequestPolicy.js.map +1 -1
  51. package/dist/browser/policies/StorageRetryPolicy.js +5 -1
  52. package/dist/browser/policies/StorageRetryPolicy.js.map +1 -1
  53. package/dist/browser/policies/StorageRetryPolicyV2.js +10 -12
  54. package/dist/browser/policies/StorageRetryPolicyV2.js.map +1 -1
  55. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js +4 -0
  56. package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  57. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  58. package/dist/browser/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  59. package/dist/browser/sas/AccountSASPermissions.js +52 -54
  60. package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
  61. package/dist/browser/sas/AccountSASResourceTypes.js +12 -14
  62. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
  63. package/dist/browser/sas/AccountSASServices.js +16 -18
  64. package/dist/browser/sas/AccountSASServices.js.map +1 -1
  65. package/dist/browser/sas/BlobSASPermissions.js +44 -46
  66. package/dist/browser/sas/BlobSASPermissions.js.map +1 -1
  67. package/dist/browser/sas/ContainerSASPermissions.js +52 -54
  68. package/dist/browser/sas/ContainerSASPermissions.js.map +1 -1
  69. package/dist/browser/sas/SASQueryParameters.js +117 -0
  70. package/dist/browser/sas/SASQueryParameters.js.map +1 -1
  71. package/dist/browser/utils/Batch.js +29 -21
  72. package/dist/browser/utils/Batch.js.map +1 -1
  73. package/dist/browser/utils/BlobQuickQueryStream.js +6 -1
  74. package/dist/browser/utils/BlobQuickQueryStream.js.map +1 -1
  75. package/dist/browser/utils/Mutex.js +2 -2
  76. package/dist/browser/utils/Mutex.js.map +1 -1
  77. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  78. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  79. package/dist/browser/utils/utils.common.js +24 -11
  80. package/dist/browser/utils/utils.common.js.map +1 -1
  81. package/dist/commonjs/BatchResponseParser.js +5 -0
  82. package/dist/commonjs/BatchResponseParser.js.map +1 -1
  83. package/dist/commonjs/BlobBatch.js +10 -1
  84. package/dist/commonjs/BlobBatch.js.map +1 -1
  85. package/dist/commonjs/BlobBatchClient.js +4 -1
  86. package/dist/commonjs/BlobBatchClient.js.map +1 -1
  87. package/dist/commonjs/BlobDownloadResponse.js +2 -0
  88. package/dist/commonjs/BlobDownloadResponse.js.map +1 -1
  89. package/dist/commonjs/BlobLeaseClient.js +39 -30
  90. package/dist/commonjs/BlobLeaseClient.js.map +1 -1
  91. package/dist/commonjs/BlobQueryResponse.js +2 -0
  92. package/dist/commonjs/BlobQueryResponse.js.map +1 -1
  93. package/dist/commonjs/BlobServiceClient.js +86 -81
  94. package/dist/commonjs/BlobServiceClient.js.map +1 -1
  95. package/dist/commonjs/Clients.js +351 -196
  96. package/dist/commonjs/Clients.js.map +1 -1
  97. package/dist/commonjs/ContainerClient.js +182 -135
  98. package/dist/commonjs/ContainerClient.js.map +1 -1
  99. package/dist/commonjs/PageBlobRangeResponse.js +10 -3
  100. package/dist/commonjs/PageBlobRangeResponse.js.map +1 -1
  101. package/dist/commonjs/Pipeline.js +27 -10
  102. package/dist/commonjs/Pipeline.js.map +1 -1
  103. package/dist/commonjs/StorageClient.js +23 -0
  104. package/dist/commonjs/StorageClient.js.map +1 -1
  105. package/dist/commonjs/StorageContextClient.js +1 -1
  106. package/dist/commonjs/StorageContextClient.js.map +1 -1
  107. package/dist/commonjs/StorageRetryPolicyFactory.js +1 -0
  108. package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -1
  109. package/dist/commonjs/credentials/StorageSharedKeyCredential.js +8 -0
  110. package/dist/commonjs/credentials/StorageSharedKeyCredential.js.map +1 -1
  111. package/dist/commonjs/credentials/UserDelegationKeyCredential.js +12 -0
  112. package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
  113. package/dist/commonjs/generated/src/operations/appendBlob.js +1 -0
  114. package/dist/commonjs/generated/src/operations/appendBlob.js.map +1 -1
  115. package/dist/commonjs/generated/src/operations/blob.js +1 -0
  116. package/dist/commonjs/generated/src/operations/blob.js.map +1 -1
  117. package/dist/commonjs/generated/src/operations/blockBlob.js +1 -0
  118. package/dist/commonjs/generated/src/operations/blockBlob.js.map +1 -1
  119. package/dist/commonjs/generated/src/operations/container.js +1 -0
  120. package/dist/commonjs/generated/src/operations/container.js.map +1 -1
  121. package/dist/commonjs/generated/src/operations/pageBlob.js +1 -0
  122. package/dist/commonjs/generated/src/operations/pageBlob.js.map +1 -1
  123. package/dist/commonjs/generated/src/operations/service.js +1 -0
  124. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  125. package/dist/commonjs/generated/src/storageClient.js +15 -3
  126. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  127. package/dist/commonjs/internal-avro/AvroParser.js +7 -1
  128. package/dist/commonjs/internal-avro/AvroParser.js.map +1 -1
  129. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js +2 -0
  130. package/dist/commonjs/internal-avro/AvroReadableFromBlob.js.map +1 -1
  131. package/dist/commonjs/internal-avro/AvroReadableFromStream.js +3 -2
  132. package/dist/commonjs/internal-avro/AvroReadableFromStream.js.map +1 -1
  133. package/dist/commonjs/internal-avro/AvroReader.js +44 -34
  134. package/dist/commonjs/internal-avro/AvroReader.js.map +1 -1
  135. package/dist/commonjs/policies/RequestPolicy.js +2 -0
  136. package/dist/commonjs/policies/RequestPolicy.js.map +1 -1
  137. package/dist/commonjs/policies/StorageRetryPolicy.js +5 -1
  138. package/dist/commonjs/policies/StorageRetryPolicy.js.map +1 -1
  139. package/dist/commonjs/policies/StorageRetryPolicyV2.js +10 -12
  140. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +1 -1
  141. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +4 -0
  142. package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  143. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  144. package/dist/commonjs/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  145. package/dist/commonjs/sas/AccountSASPermissions.js +52 -54
  146. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
  147. package/dist/commonjs/sas/AccountSASResourceTypes.js +12 -14
  148. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
  149. package/dist/commonjs/sas/AccountSASServices.js +16 -18
  150. package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
  151. package/dist/commonjs/sas/BlobSASPermissions.js +44 -46
  152. package/dist/commonjs/sas/BlobSASPermissions.js.map +1 -1
  153. package/dist/commonjs/sas/ContainerSASPermissions.js +52 -54
  154. package/dist/commonjs/sas/ContainerSASPermissions.js.map +1 -1
  155. package/dist/commonjs/sas/SASQueryParameters.js +117 -0
  156. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
  157. package/dist/commonjs/tsdoc-metadata.json +11 -11
  158. package/dist/commonjs/utils/Batch.js +29 -21
  159. package/dist/commonjs/utils/Batch.js.map +1 -1
  160. package/dist/commonjs/utils/BlobQuickQueryStream.js +6 -1
  161. package/dist/commonjs/utils/BlobQuickQueryStream.js.map +1 -1
  162. package/dist/commonjs/utils/Mutex.js +2 -2
  163. package/dist/commonjs/utils/Mutex.js.map +1 -1
  164. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  165. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  166. package/dist/commonjs/utils/utils.common.js +24 -11
  167. package/dist/commonjs/utils/utils.common.js.map +1 -1
  168. package/dist/esm/BatchResponseParser.js +5 -0
  169. package/dist/esm/BatchResponseParser.js.map +1 -1
  170. package/dist/esm/BlobBatch.js +10 -1
  171. package/dist/esm/BlobBatch.js.map +1 -1
  172. package/dist/esm/BlobBatchClient.js +4 -1
  173. package/dist/esm/BlobBatchClient.js.map +1 -1
  174. package/dist/esm/BlobDownloadResponse.js +2 -0
  175. package/dist/esm/BlobDownloadResponse.js.map +1 -1
  176. package/dist/esm/BlobLeaseClient.js +39 -30
  177. package/dist/esm/BlobLeaseClient.js.map +1 -1
  178. package/dist/esm/BlobQueryResponse.js +2 -0
  179. package/dist/esm/BlobQueryResponse.js.map +1 -1
  180. package/dist/esm/BlobServiceClient.js +86 -81
  181. package/dist/esm/BlobServiceClient.js.map +1 -1
  182. package/dist/esm/Clients.js +351 -196
  183. package/dist/esm/Clients.js.map +1 -1
  184. package/dist/esm/ContainerClient.js +182 -135
  185. package/dist/esm/ContainerClient.js.map +1 -1
  186. package/dist/esm/PageBlobRangeResponse.js +10 -3
  187. package/dist/esm/PageBlobRangeResponse.js.map +1 -1
  188. package/dist/esm/Pipeline.js +27 -10
  189. package/dist/esm/Pipeline.js.map +1 -1
  190. package/dist/esm/StorageClient.js +23 -0
  191. package/dist/esm/StorageClient.js.map +1 -1
  192. package/dist/esm/StorageContextClient.js +1 -1
  193. package/dist/esm/StorageContextClient.js.map +1 -1
  194. package/dist/esm/StorageRetryPolicyFactory.js +1 -0
  195. package/dist/esm/StorageRetryPolicyFactory.js.map +1 -1
  196. package/dist/esm/credentials/StorageSharedKeyCredential.js +8 -0
  197. package/dist/esm/credentials/StorageSharedKeyCredential.js.map +1 -1
  198. package/dist/esm/credentials/UserDelegationKeyCredential.js +12 -0
  199. package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
  200. package/dist/esm/generated/src/operations/appendBlob.js +1 -0
  201. package/dist/esm/generated/src/operations/appendBlob.js.map +1 -1
  202. package/dist/esm/generated/src/operations/blob.js +1 -0
  203. package/dist/esm/generated/src/operations/blob.js.map +1 -1
  204. package/dist/esm/generated/src/operations/blockBlob.js +1 -0
  205. package/dist/esm/generated/src/operations/blockBlob.js.map +1 -1
  206. package/dist/esm/generated/src/operations/container.js +1 -0
  207. package/dist/esm/generated/src/operations/container.js.map +1 -1
  208. package/dist/esm/generated/src/operations/pageBlob.js +1 -0
  209. package/dist/esm/generated/src/operations/pageBlob.js.map +1 -1
  210. package/dist/esm/generated/src/operations/service.js +1 -0
  211. package/dist/esm/generated/src/operations/service.js.map +1 -1
  212. package/dist/esm/generated/src/storageClient.js +15 -3
  213. package/dist/esm/generated/src/storageClient.js.map +1 -1
  214. package/dist/esm/internal-avro/AvroParser.js +7 -1
  215. package/dist/esm/internal-avro/AvroParser.js.map +1 -1
  216. package/dist/esm/internal-avro/AvroReadableFromBlob.js +2 -0
  217. package/dist/esm/internal-avro/AvroReadableFromBlob.js.map +1 -1
  218. package/dist/esm/internal-avro/AvroReadableFromStream.js +3 -2
  219. package/dist/esm/internal-avro/AvroReadableFromStream.js.map +1 -1
  220. package/dist/esm/internal-avro/AvroReader.js +44 -34
  221. package/dist/esm/internal-avro/AvroReader.js.map +1 -1
  222. package/dist/esm/policies/RequestPolicy.js +2 -0
  223. package/dist/esm/policies/RequestPolicy.js.map +1 -1
  224. package/dist/esm/policies/StorageRetryPolicy.js +5 -1
  225. package/dist/esm/policies/StorageRetryPolicy.js.map +1 -1
  226. package/dist/esm/policies/StorageRetryPolicyV2.js +10 -12
  227. package/dist/esm/policies/StorageRetryPolicyV2.js.map +1 -1
  228. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js +4 -0
  229. package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  230. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  231. package/dist/esm/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  232. package/dist/esm/sas/AccountSASPermissions.js +52 -54
  233. package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
  234. package/dist/esm/sas/AccountSASResourceTypes.js +12 -14
  235. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
  236. package/dist/esm/sas/AccountSASServices.js +16 -18
  237. package/dist/esm/sas/AccountSASServices.js.map +1 -1
  238. package/dist/esm/sas/BlobSASPermissions.js +44 -46
  239. package/dist/esm/sas/BlobSASPermissions.js.map +1 -1
  240. package/dist/esm/sas/ContainerSASPermissions.js +52 -54
  241. package/dist/esm/sas/ContainerSASPermissions.js.map +1 -1
  242. package/dist/esm/sas/SASQueryParameters.js +117 -0
  243. package/dist/esm/sas/SASQueryParameters.js.map +1 -1
  244. package/dist/esm/utils/Batch.js +29 -21
  245. package/dist/esm/utils/Batch.js.map +1 -1
  246. package/dist/esm/utils/BlobQuickQueryStream.js +6 -1
  247. package/dist/esm/utils/BlobQuickQueryStream.js.map +1 -1
  248. package/dist/esm/utils/Mutex.js +2 -2
  249. package/dist/esm/utils/Mutex.js.map +1 -1
  250. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  251. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  252. package/dist/esm/utils/utils.common.js +24 -11
  253. package/dist/esm/utils/utils.common.js.map +1 -1
  254. package/dist/react-native/BatchResponseParser.js +5 -0
  255. package/dist/react-native/BatchResponseParser.js.map +1 -1
  256. package/dist/react-native/BlobBatch.js +10 -1
  257. package/dist/react-native/BlobBatch.js.map +1 -1
  258. package/dist/react-native/BlobBatchClient.js +4 -1
  259. package/dist/react-native/BlobBatchClient.js.map +1 -1
  260. package/dist/react-native/BlobDownloadResponse.js +2 -0
  261. package/dist/react-native/BlobDownloadResponse.js.map +1 -1
  262. package/dist/react-native/BlobLeaseClient.js +39 -30
  263. package/dist/react-native/BlobLeaseClient.js.map +1 -1
  264. package/dist/react-native/BlobQueryResponse.js +2 -0
  265. package/dist/react-native/BlobQueryResponse.js.map +1 -1
  266. package/dist/react-native/BlobServiceClient.js +86 -81
  267. package/dist/react-native/BlobServiceClient.js.map +1 -1
  268. package/dist/react-native/Clients.js +351 -196
  269. package/dist/react-native/Clients.js.map +1 -1
  270. package/dist/react-native/ContainerClient.js +182 -135
  271. package/dist/react-native/ContainerClient.js.map +1 -1
  272. package/dist/react-native/PageBlobRangeResponse.js +10 -3
  273. package/dist/react-native/PageBlobRangeResponse.js.map +1 -1
  274. package/dist/react-native/Pipeline.js +27 -10
  275. package/dist/react-native/Pipeline.js.map +1 -1
  276. package/dist/react-native/StorageClient.js +23 -0
  277. package/dist/react-native/StorageClient.js.map +1 -1
  278. package/dist/react-native/StorageContextClient.js +1 -1
  279. package/dist/react-native/StorageContextClient.js.map +1 -1
  280. package/dist/react-native/StorageRetryPolicyFactory.js +1 -0
  281. package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -1
  282. package/dist/react-native/credentials/StorageSharedKeyCredential.js +8 -0
  283. package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +1 -1
  284. package/dist/react-native/credentials/UserDelegationKeyCredential.js +12 -0
  285. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
  286. package/dist/react-native/generated/src/operations/appendBlob.js +1 -0
  287. package/dist/react-native/generated/src/operations/appendBlob.js.map +1 -1
  288. package/dist/react-native/generated/src/operations/blob.js +1 -0
  289. package/dist/react-native/generated/src/operations/blob.js.map +1 -1
  290. package/dist/react-native/generated/src/operations/blockBlob.js +1 -0
  291. package/dist/react-native/generated/src/operations/blockBlob.js.map +1 -1
  292. package/dist/react-native/generated/src/operations/container.js +1 -0
  293. package/dist/react-native/generated/src/operations/container.js.map +1 -1
  294. package/dist/react-native/generated/src/operations/pageBlob.js +1 -0
  295. package/dist/react-native/generated/src/operations/pageBlob.js.map +1 -1
  296. package/dist/react-native/generated/src/operations/service.js +1 -0
  297. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  298. package/dist/react-native/generated/src/storageClient.js +15 -3
  299. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  300. package/dist/react-native/internal-avro/AvroParser.js +7 -1
  301. package/dist/react-native/internal-avro/AvroParser.js.map +1 -1
  302. package/dist/react-native/internal-avro/AvroReadableFromBlob.js +2 -0
  303. package/dist/react-native/internal-avro/AvroReadableFromBlob.js.map +1 -1
  304. package/dist/react-native/internal-avro/AvroReadableFromStream.js +3 -2
  305. package/dist/react-native/internal-avro/AvroReadableFromStream.js.map +1 -1
  306. package/dist/react-native/internal-avro/AvroReader.js +44 -34
  307. package/dist/react-native/internal-avro/AvroReader.js.map +1 -1
  308. package/dist/react-native/policies/RequestPolicy.js +2 -0
  309. package/dist/react-native/policies/RequestPolicy.js.map +1 -1
  310. package/dist/react-native/policies/StorageRetryPolicy.js +5 -1
  311. package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -1
  312. package/dist/react-native/policies/StorageRetryPolicyV2.js +10 -12
  313. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +1 -1
  314. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js +4 -0
  315. package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  316. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js +7 -3
  317. package/dist/react-native/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  318. package/dist/react-native/sas/AccountSASPermissions.js +52 -54
  319. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
  320. package/dist/react-native/sas/AccountSASResourceTypes.js +12 -14
  321. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
  322. package/dist/react-native/sas/AccountSASServices.js +16 -18
  323. package/dist/react-native/sas/AccountSASServices.js.map +1 -1
  324. package/dist/react-native/sas/BlobSASPermissions.js +44 -46
  325. package/dist/react-native/sas/BlobSASPermissions.js.map +1 -1
  326. package/dist/react-native/sas/ContainerSASPermissions.js +52 -54
  327. package/dist/react-native/sas/ContainerSASPermissions.js.map +1 -1
  328. package/dist/react-native/sas/SASQueryParameters.js +117 -0
  329. package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
  330. package/dist/react-native/utils/Batch.js +29 -21
  331. package/dist/react-native/utils/Batch.js.map +1 -1
  332. package/dist/react-native/utils/BlobQuickQueryStream.js +6 -1
  333. package/dist/react-native/utils/BlobQuickQueryStream.js.map +1 -1
  334. package/dist/react-native/utils/Mutex.js +2 -2
  335. package/dist/react-native/utils/Mutex.js.map +1 -1
  336. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  337. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  338. package/dist/react-native/utils/utils.common.js +24 -11
  339. package/dist/react-native/utils/utils.common.js.map +1 -1
  340. package/package.json +2 -2
@@ -7,7 +7,6 @@ exports.isPipelineLike = isPipelineLike;
7
7
  exports.newPipeline = newPipeline;
8
8
  exports.getCoreClientOptions = getCoreClientOptions;
9
9
  exports.getCredentialFromPipeline = getCredentialFromPipeline;
10
- const tslib_1 = require("tslib");
11
10
  const core_http_compat_1 = require("@azure/core-http-compat");
12
11
  const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
13
12
  const core_client_1 = require("@azure/core-client");
@@ -48,6 +47,14 @@ function isPipelineLike(pipeline) {
48
47
  * customized Pipeline.
49
48
  */
50
49
  class Pipeline {
50
+ /**
51
+ * A list of chained request policy factories.
52
+ */
53
+ factories;
54
+ /**
55
+ * Configures pipeline logger and HTTP client.
56
+ */
57
+ options;
51
58
  /**
52
59
  * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
53
60
  *
@@ -113,8 +120,7 @@ function processDownlevelPipeline(pipeline) {
113
120
  return undefined;
114
121
  }
115
122
  function getCoreClientOptions(pipeline) {
116
- var _a;
117
- const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib_1.__rest(_b, ["httpClient"]);
123
+ const { httpClient: v1Client, ...restOptions } = pipeline.options;
118
124
  let httpClient = pipeline._coreHttpClient;
119
125
  if (!httpClient) {
120
126
  httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)();
@@ -126,13 +132,17 @@ function getCoreClientOptions(pipeline) {
126
132
  const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
127
133
  ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
128
134
  : `${packageDetails}`;
129
- corePipeline = (0, core_client_1.createClientPipeline)(Object.assign(Object.assign({}, restOptions), { loggingOptions: {
135
+ corePipeline = (0, core_client_1.createClientPipeline)({
136
+ ...restOptions,
137
+ loggingOptions: {
130
138
  additionalAllowedHeaderNames: constants_js_1.StorageBlobLoggingAllowedHeaderNames,
131
139
  additionalAllowedQueryParameters: constants_js_1.StorageBlobLoggingAllowedQueryParameters,
132
140
  logger: log_js_1.logger.info,
133
- }, userAgentOptions: {
141
+ },
142
+ userAgentOptions: {
134
143
  userAgentPrefix,
135
- }, serializationOptions: {
144
+ },
145
+ serializationOptions: {
136
146
  stringifyXML: core_xml_1.stringifyXML,
137
147
  serializerOptions: {
138
148
  xml: {
@@ -141,7 +151,8 @@ function getCoreClientOptions(pipeline) {
141
151
  xmlCharKey: "#",
142
152
  },
143
153
  },
144
- }, deserializationOptions: {
154
+ },
155
+ deserializationOptions: {
145
156
  parseXML: core_xml_1.parseXML,
146
157
  serializerOptions: {
147
158
  xml: {
@@ -150,7 +161,8 @@ function getCoreClientOptions(pipeline) {
150
161
  xmlCharKey: "#",
151
162
  },
152
163
  },
153
- } }));
164
+ },
165
+ });
154
166
  corePipeline.removePolicy({ phase: "Retry" });
155
167
  corePipeline.removePolicy({ name: core_rest_pipeline_1.decompressResponsePolicyName });
156
168
  corePipeline.addPolicy((0, StorageCorrectContentLengthPolicy_js_1.storageCorrectContentLengthPolicy)());
@@ -164,7 +176,7 @@ function getCoreClientOptions(pipeline) {
164
176
  if ((0, core_auth_1.isTokenCredential)(credential)) {
165
177
  corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({
166
178
  credential,
167
- scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : constants_js_1.StorageOAuthScopes,
179
+ scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes,
168
180
  challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge },
169
181
  }), { phase: "Sign" });
170
182
  }
@@ -176,7 +188,12 @@ function getCoreClientOptions(pipeline) {
176
188
  }
177
189
  pipeline._corePipeline = corePipeline;
178
190
  }
179
- return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline });
191
+ return {
192
+ ...restOptions,
193
+ allowInsecureConnection: true,
194
+ httpClient,
195
+ pipeline: corePipeline,
196
+ };
180
197
  }
181
198
  function getCredentialFromPipeline(pipeline) {
182
199
  // see if we squirreled one away on the type itself
@@ -1 +1 @@
1
- {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2HlC,wCAYC;AAmFD,kCAUC;AA8BD,oDAsFC;AAED,8DAmBC;;AAtWD,8DAUiC;AAQjC,kEAImC;AACnC,oDAA6F;AAC7F,8CAAyD;AAEzD,gDAAqD;AACrD,qCAAkC;AAElC,iFAA2E;AAC3E,+FAAyF;AACzF,iFAA2E;AAC3E,uDAK8B;AAW5B,mGAfA,iCAAkB,OAeA;AAVpB,0DAAmE;AACnE,oFAA4E;AAC5E,gFAAwE;AACxE,4GAAoG;AACpG,q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AC,WAAW,CAAC,IAAI,KAAK,uBAAuB,CAAC;AAC9D,CAAC;AAED,SAAS,uBAAuB,CAAC,OAA6B;IAC5D,MAAM,aAAa,GAAG;QACpB,+BAA+B;QAC/B,eAAe;QACf,WAAW;QACX,aAAa;QACb,oCAAoC;QACpC,iBAAiB;QACjB,uBAAuB;KACxB,CAAC;IAEF,MAAM,cAAc,GAAgB;QAClC,WAAW,EAAE,KAAK,EAAE,OAAoB,EAAE,EAAE;YAC1C,OAAO;gBACL,OAAO;gBACP,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;gBAChC,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,CAAC;KACF,CAAC;IACF,MAAM,wBAAwB,GAAyB;QACrD,GAAG,CAAC,SAA+B,EAAE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"./StorageRetryPolicyFactory.js\";\nimport { StorageRetryPolicyFactory } from \"./StorageRetryPolicyFactory.js\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport {\n StorageOAuthScopes,\n StorageBlobLoggingAllowedHeaderNames,\n StorageBlobLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport { getCachedDefaultHttpClient } from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"./policies/StorageBrowserPolicyV2.js\";\nimport { storageRetryPolicy } from \"./policies/StorageRetryPolicyV2.js\";\nimport { storageSharedKeyCredentialPolicy } from \"./policies/StorageSharedKeyCredentialPolicyV2.js\";\nimport { StorageBrowserPolicyFactory } from \"./StorageBrowserPolicyFactory.js\";\nimport { storageCorrectContentLengthPolicy } from \"./policies/StorageCorrectContentLengthPolicy.js\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n};\n\n/**\n * A subset of `@azure/core-http` ServiceClientOptions\n */\nexport interface ServiceClientOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * Optional. Overrides the default policy factories.\n */\n requestPolicyFactories?:\n | RequestPolicyFactory[]\n | ((defaultRequestPolicyFactories: RequestPolicyFactory[]) => void | RequestPolicyFactory[]);\n}\n\n/**\n * Option interface for Pipeline constructor.\n */\nexport interface PipelineOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n}\n\n/**\n * An interface for the {@link Pipeline} class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport interface PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n readonly options: PipelineOptions;\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions(): ServiceClientOptions;\n}\n\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nexport function isPipelineLike(pipeline: unknown): pipeline is PipelineLike {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n\n const castPipeline = pipeline as PipelineLike;\n\n return (\n Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\"\n );\n}\n\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport class Pipeline implements PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n public readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n public readonly options: PipelineOptions;\n\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) {\n this.factories = factories;\n this.options = options;\n }\n\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n public toServiceClientOptions(): ServiceClientOptions {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string | string[];\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
1
+ {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2HlC,wCAYC;AAmFD,kCAUC;AA8BD,oDAsFC;AAED,8DAmBC;AAtWD,8DAUiC;AAQjC,kEAImC;AACnC,oDAA6F;AAC7F,8CAAyD;AAEzD,gDAAqD;AACrD,qCAAkC;AAElC,iFAA2E;AAC3E,+FAAyF;AACzF,iFAA2E;AAC3E,uDAK8B;AAW5B,mGAfA,iCAAkB,OAeA;AAVpB,0DAAmE;AACnE,oFAA4E;AAC5E,gFAAwE;AACxE,4GAAoG;AACpG,qFAA+E;AAC/E,0GAAoG;AAoEpG;;;;GAIG;AACH,SAAgB,cAAc,CAAC,QAAiB;IAC9C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,QAAwB,CAAC;IAE9C,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;QACrC,OAAO,YAAY,CAAC,OAAO,KAAK,QAAQ;QACxC,OAAO,YAAY,CAAC,sBAAsB,KAAK,UAAU,CAC1D,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACa,SAAS,CAAyB;IAClD;;OAEG;IACa,OAAO,CAAkB;IAEzC;;;;;OAKG;IACH,YAAY,SAAiC,EAAE,UAA2B,EAAE;QAC1E,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACI,sBAAsB;QAC3B,OAAO;YACL,UAAU,E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Ac,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"./StorageRetryPolicyFactory.js\";\nimport { StorageRetryPolicyFactory } from \"./StorageRetryPolicyFactory.js\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport {\n StorageOAuthScopes,\n StorageBlobLoggingAllowedHeaderNames,\n StorageBlobLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport { getCachedDefaultHttpClient } from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"./policies/StorageBrowserPolicyV2.js\";\nimport { storageRetryPolicy } from \"./policies/StorageRetryPolicyV2.js\";\nimport { storageSharedKeyCredentialPolicy } from \"./policies/StorageSharedKeyCredentialPolicyV2.js\";\nimport { StorageBrowserPolicyFactory } from \"./StorageBrowserPolicyFactory.js\";\nimport { storageCorrectContentLengthPolicy } from \"./policies/StorageCorrectContentLengthPolicy.js\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n};\n\n/**\n * A subset of `@azure/core-http` ServiceClientOptions\n */\nexport interface ServiceClientOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * Optional. Overrides the default policy factories.\n */\n requestPolicyFactories?:\n | RequestPolicyFactory[]\n | ((defaultRequestPolicyFactories: RequestPolicyFactory[]) => void | RequestPolicyFactory[]);\n}\n\n/**\n * Option interface for Pipeline constructor.\n */\nexport interface PipelineOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n}\n\n/**\n * An interface for the {@link Pipeline} class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport interface PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n readonly options: PipelineOptions;\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions(): ServiceClientOptions;\n}\n\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nexport function isPipelineLike(pipeline: unknown): pipeline is PipelineLike {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n\n const castPipeline = pipeline as PipelineLike;\n\n return (\n Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\"\n );\n}\n\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport class Pipeline implements PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n public readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n public readonly options: PipelineOptions;\n\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) {\n this.factories = factories;\n this.options = options;\n }\n\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n public toServiceClientOptions(): ServiceClientOptions {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string | string[];\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
@@ -11,6 +11,29 @@ const utils_common_js_1 = require("./utils/utils.common.js");
11
11
  * and etc.
12
12
  */
13
13
  class StorageClient {
14
+ /**
15
+ * Encoded URL string value.
16
+ */
17
+ url;
18
+ accountName;
19
+ /**
20
+ * Request policy pipeline.
21
+ *
22
+ * @internal
23
+ */
24
+ pipeline;
25
+ /**
26
+ * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
27
+ */
28
+ credential;
29
+ /**
30
+ * StorageClient is a reference to protocol layer operations entry, which is
31
+ * generated by AutoRest generator.
32
+ */
33
+ storageClientContext;
34
+ /**
35
+ */
36
+ isHttps;
14
37
  /**
15
38
  * Creates an instance of StorageClient.
16
39
  * @param url - url to resource
@@ -1 +1 @@
1
- {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uEAAiE;AAEjE,+CAAgF;AAChF,6DAKiC;AAgBjC;;;GAGG;AACH,MAAsB,aAAa;IAyBjC;;;;OAIG;IACH,YAAsB,GAAW,EAAE,QAAsB;QACvD,iFAAiF;QACjF,IAAI,CAAC,GAAG,GAAG,IAAA,+BAAa,EAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAA,uCAAqB,EAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAE/F,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAM,EAAC,IAAA,8BAAY,EAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,UAAU,GAAG,IAAA,uCAAyB,EAAC,QAAQ,CAAC,CAAC;QAEtD,iDAAiD;QACjD,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtD,CAAC;CACF;AA7CD,sCA6CC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike } from \"./Pipeline.js\";\nimport { getCoreClientOptions, getCredentialFromPipeline } from \"./Pipeline.js\";\nimport {\n escapeURLPath,\n getURLScheme,\n iEqual,\n getAccountNameFromUrl,\n} from \"./utils/utils.common.js\";\nimport type { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n /**\n * Options to configure spans created when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n public readonly accountName: string;\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: PipelineLike;\n /**\n * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n public readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n this.pipeline = pipeline;\n this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = getCredentialFromPipeline(pipeline);\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uEAAiE;AAEjE,+CAAgF;AAChF,6DAKiC;AAgBjC;;;GAGG;AACH,MAAsB,aAAa;IACjC;;OAEG;IACa,GAAG,CAAS;IACZ,WAAW,CAAS;IACpC;;;;OAIG;IACgB,QAAQ,CAAe;IAC1C;;OAEG;IACa,UAAU,CAAqE;IAC/F;;;OAGG;IACgB,oBAAoB,CAAuB;IAC9D;OACG;IACgB,OAAO,CAAU;IAEpC;;;;OAIG;IACH,YAAsB,GAAW,EAAE,QAAsB;QACvD,iFAAiF;QACjF,IAAI,CAAC,GAAG,GAAG,IAAA,+BAAa,EAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAA,uCAAqB,EAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAE/F,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAM,EAAC,IAAA,8BAAY,EAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,UAAU,GAAG,IAAA,uCAAyB,EAAC,QAAQ,CAAC,CAAC;QAEtD,iDAAiD;QACjD,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtD,CAAC;CACF;AA7CD,sCA6CC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike } from \"./Pipeline.js\";\nimport { getCoreClientOptions, getCredentialFromPipeline } from \"./Pipeline.js\";\nimport {\n escapeURLPath,\n getURLScheme,\n iEqual,\n getAccountNameFromUrl,\n} from \"./utils/utils.common.js\";\nimport type { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n /**\n * Options to configure spans created when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n public readonly accountName: string;\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: PipelineLike;\n /**\n * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n public readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n this.pipeline = pipeline;\n this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = getCredentialFromPipeline(pipeline);\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n }\n}\n"]}
@@ -9,7 +9,7 @@ const index_js_1 = require("./generated/src/index.js");
9
9
  */
10
10
  class StorageContextClient extends index_js_1.StorageClient {
11
11
  async sendOperationRequest(operationArguments, operationSpec) {
12
- const operationSpecToSend = Object.assign({}, operationSpec);
12
+ const operationSpecToSend = { ...operationSpec };
13
13
  if (operationSpecToSend.path === "/{containerName}" ||
14
14
  operationSpecToSend.path === "/{containerName}/{blob}") {
15
15
  operationSpecToSend.path = "";
@@ -1 +1 @@
1
- {"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uDAAyD;AAEzD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,wBAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;QAE5B,MAAM,mBAAmB,qBAAQ,aAAa,CAAE,CAAC;QAEjD,IACE,mBAAmB,CAAC,IAAI,KAAK,kBAAkB;YAC/C,mBAAmB,CAAC,IAAI,KAAK,yBAAyB,EACtD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF;AAfD,oDAeC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { StorageClient } from \"./generated/src/index.js\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n operationSpecToSend.path === \"/{containerName}\" ||\n operationSpecToSend.path === \"/{containerName}/{blob}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
1
+ {"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uDAAyD;AAEzD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,wBAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;QAE5B,MAAM,mBAAmB,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;QAEjD,IACE,mBAAmB,CAAC,IAAI,KAAK,kBAAkB;YAC/C,mBAAmB,CAAC,IAAI,KAAK,yBAAyB,EACtD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF;AAfD,oDAeC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { StorageClient } from \"./generated/src/index.js\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n operationSpecToSend.path === \"/{containerName}\" ||\n operationSpecToSend.path === \"/{containerName}/{blob}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "StorageRetryPolicyType", { enumerable: true, get
11
11
  * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.
12
12
  */
13
13
  class StorageRetryPolicyFactory {
14
+ retryOptions;
14
15
  /**
15
16
  * Creates an instance of StorageRetryPolicyFactory.
16
17
  * @param retryOptions -
@@ -1 +1 @@
1
- {"version":3,"file":"StorageRetryPolicyFactory.js","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAOlC,4EAAsE;AAGrC,mGAHxB,0CAAkB,OAGwB;AAFnD,oFAA8E;AAErE,uGAFA,kDAAsB,OAEA;AAmD/B;;GAEG;AACH,MAAa,yBAAyB;IAGpC;;;OAGG;IACH,YAAY,YAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAyB,EAAE,OAA6B;QACpE,OAAO,IAAI,0CAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;CACF;AApBD,8DAoBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n} from \"@azure/core-http-compat\";\nimport { StorageRetryPolicy } from \"./policies/StorageRetryPolicy.js\";\nimport { StorageRetryPolicyType } from \"./policies/StorageRetryPolicyType.js\";\n\nexport { StorageRetryPolicyType, StorageRetryPolicy };\n\n/**\n * Storage Blob retry options interface.\n */\nexport interface StorageRetryOptions {\n /**\n * Optional. StorageRetryPolicyType, default is exponential retry policy.\n */\n readonly retryPolicyType?: StorageRetryPolicyType;\n\n /**\n * Optional. Max try number of attempts, default is 4.\n * A value of 1 means 1 try and no retries.\n * A value smaller than 1 means default retry number of attempts.\n */\n readonly maxTries?: number;\n\n /**\n * Optional. Indicates the maximum time in ms allowed for any single try of an HTTP request.\n * A value of zero or undefined means no default timeout on SDK client, Azure\n * Storage server's default timeout policy will be used.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations\n */\n readonly tryTimeoutInMs?: number;\n\n /**\n * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).\n * The delay increases (exponentially or linearly) with each retry up to a maximum specified by\n * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.\n */\n readonly retryDelayInMs?: number;\n\n /**\n * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).\n * If you specify 0, then you must also specify 0 for retryDelayInMs.\n */\n readonly maxRetryDelayInMs?: number;\n\n /**\n * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined\n * (the default) then operations are not retried against another host.\n *\n * NOTE: Before setting this field, make sure you understand the issues around\n * reading stale and potentially-inconsistent data at\n * {@link https://learn.microsoft.com/azure/storage/common/storage-designing-ha-apps-with-ragrs}\n */\n readonly secondaryHost?: string;\n}\n\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nexport class StorageRetryPolicyFactory implements RequestPolicyFactory {\n private retryOptions?: StorageRetryOptions;\n\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions?: StorageRetryOptions) {\n this.retryOptions = retryOptions;\n }\n\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n"]}
1
+ {"version":3,"file":"StorageRetryPolicyFactory.js","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAOlC,4EAAsE;AAGrC,mGAHxB,0CAAkB,OAGwB;AAFnD,oFAA8E;AAErE,uGAFA,kDAAsB,OAEA;AAmD/B;;GAEG;AACH,MAAa,yBAAyB;IAC5B,YAAY,CAAuB;IAE3C;;;OAGG;IACH,YAAY,YAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAyB,EAAE,OAA6B;QACpE,OAAO,IAAI,0CAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;CACF;AApBD,8DAoBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n} from \"@azure/core-http-compat\";\nimport { StorageRetryPolicy } from \"./policies/StorageRetryPolicy.js\";\nimport { StorageRetryPolicyType } from \"./policies/StorageRetryPolicyType.js\";\n\nexport { StorageRetryPolicyType, StorageRetryPolicy };\n\n/**\n * Storage Blob retry options interface.\n */\nexport interface StorageRetryOptions {\n /**\n * Optional. StorageRetryPolicyType, default is exponential retry policy.\n */\n readonly retryPolicyType?: StorageRetryPolicyType;\n\n /**\n * Optional. Max try number of attempts, default is 4.\n * A value of 1 means 1 try and no retries.\n * A value smaller than 1 means default retry number of attempts.\n */\n readonly maxTries?: number;\n\n /**\n * Optional. Indicates the maximum time in ms allowed for any single try of an HTTP request.\n * A value of zero or undefined means no default timeout on SDK client, Azure\n * Storage server's default timeout policy will be used.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations\n */\n readonly tryTimeoutInMs?: number;\n\n /**\n * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).\n * The delay increases (exponentially or linearly) with each retry up to a maximum specified by\n * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.\n */\n readonly retryDelayInMs?: number;\n\n /**\n * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).\n * If you specify 0, then you must also specify 0 for retryDelayInMs.\n */\n readonly maxRetryDelayInMs?: number;\n\n /**\n * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined\n * (the default) then operations are not retried against another host.\n *\n * NOTE: Before setting this field, make sure you understand the issues around\n * reading stale and potentially-inconsistent data at\n * {@link https://learn.microsoft.com/azure/storage/common/storage-designing-ha-apps-with-ragrs}\n */\n readonly secondaryHost?: string;\n}\n\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nexport class StorageRetryPolicyFactory implements RequestPolicyFactory {\n private retryOptions?: StorageRetryOptions;\n\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions?: StorageRetryOptions) {\n this.retryOptions = retryOptions;\n }\n\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n"]}
@@ -12,6 +12,14 @@ const Credential_js_1 = require("./Credential.js");
12
12
  * StorageSharedKeyCredential for account key authorization of Azure Storage service.
13
13
  */
14
14
  class StorageSharedKeyCredential extends Credential_js_1.Credential {
15
+ /**
16
+ * Azure Storage account name; readonly.
17
+ */
18
+ accountName;
19
+ /**
20
+ * Azure Storage account key; readonly.
21
+ */
22
+ accountKey;
15
23
  /**
16
24
  * Creates an instance of StorageSharedKeyCredential.
17
25
  * @param accountName -
@@ -1 +1 @@
1
- {"version":3,"file":"StorageSharedKeyCredential.js","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAyC;AAKzC,yGAAmG;AACnG,mDAA6C;AAE7C;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,0BAAU;IAWxD;;;;OAIG;IACH,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CACX,UAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,sEAAgC,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,YAAoB;QAC3C,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7F,CAAC;CACF;AA3CD,gEA2CC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHmac } from \"node:crypto\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n} from \"@azure/core-http-compat\";\nimport { StorageSharedKeyCredentialPolicy } from \"../policies/StorageSharedKeyCredentialPolicy.js\";\nimport { Credential } from \"./Credential.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * StorageSharedKeyCredential for account key authorization of Azure Storage service.\n */\nexport class StorageSharedKeyCredential extends Credential {\n /**\n * Azure Storage account name; readonly.\n */\n public readonly accountName: string;\n\n /**\n * Azure Storage account key; readonly.\n */\n private readonly accountKey: Buffer;\n\n /**\n * Creates an instance of StorageSharedKeyCredential.\n * @param accountName -\n * @param accountKey -\n */\n constructor(accountName: string, accountKey: string) {\n super();\n this.accountName = accountName;\n this.accountKey = Buffer.from(accountKey, \"base64\");\n }\n\n /**\n * Creates a StorageSharedKeyCredentialPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n ): StorageSharedKeyCredentialPolicy {\n return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);\n }\n\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n public computeHMACSHA256(stringToSign: string): string {\n return createHmac(\"sha256\", this.accountKey).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n"]}
1
+ {"version":3,"file":"StorageSharedKeyCredential.js","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAyC;AAKzC,yGAAmG;AACnG,mDAA6C;AAE7C;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,0BAAU;IACxD;;OAEG;IACa,WAAW,CAAS;IAEpC;;OAEG;IACc,UAAU,CAAS;IAEpC;;;;OAIG;IACH,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CACX,UAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,sEAAgC,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,YAAoB;QAC3C,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7F,CAAC;CACF;AA3CD,gEA2CC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHmac } from \"node:crypto\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n} from \"@azure/core-http-compat\";\nimport { StorageSharedKeyCredentialPolicy } from \"../policies/StorageSharedKeyCredentialPolicy.js\";\nimport { Credential } from \"./Credential.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * StorageSharedKeyCredential for account key authorization of Azure Storage service.\n */\nexport class StorageSharedKeyCredential extends Credential {\n /**\n * Azure Storage account name; readonly.\n */\n public readonly accountName: string;\n\n /**\n * Azure Storage account key; readonly.\n */\n private readonly accountKey: Buffer;\n\n /**\n * Creates an instance of StorageSharedKeyCredential.\n * @param accountName -\n * @param accountKey -\n */\n constructor(accountName: string, accountKey: string) {\n super();\n this.accountName = accountName;\n this.accountKey = Buffer.from(accountKey, \"base64\");\n }\n\n /**\n * Creates a StorageSharedKeyCredentialPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n ): StorageSharedKeyCredentialPolicy {\n return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);\n }\n\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n public computeHMACSHA256(stringToSign: string): string {\n return createHmac(\"sha256\", this.accountKey).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n"]}
@@ -11,6 +11,18 @@ const node_crypto_1 = require("node:crypto");
11
11
  * @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas
12
12
  */
13
13
  class UserDelegationKeyCredential {
14
+ /**
15
+ * Azure Storage account name; readonly.
16
+ */
17
+ accountName;
18
+ /**
19
+ * Azure Storage user delegation key; readonly.
20
+ */
21
+ userDelegationKey;
22
+ /**
23
+ * Key value in Buffer type.
24
+ */
25
+ key;
14
26
  /**
15
27
  * Creates an instance of UserDelegationKeyCredential.
16
28
  * @param accountName -
@@ -1 +1 @@
1
- {"version":3,"file":"UserDelegationKeyCredential.js","sourceRoot":"","sources":["../../../src/credentials/UserDelegationKeyCredential.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAyC;AAGzC;;;;;GAKG;AACH,MAAa,2BAA2B;IAgBtC;;;;OAIG;IACH,YAAY,WAAmB,EAAE,iBAAoC;QACnE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,YAAoB;QAC3C,gEAAgE;QAEhE,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtF,CAAC;CACF;AArCD,kEAqCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHmac } from \"node:crypto\";\nimport type { UserDelegationKey } from \"../BlobServiceClient.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * UserDelegationKeyCredential is only used for generation of user delegation SAS.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas\n */\nexport class UserDelegationKeyCredential {\n /**\n * Azure Storage account name; readonly.\n */\n public readonly accountName: string;\n\n /**\n * Azure Storage user delegation key; readonly.\n */\n public readonly userDelegationKey: UserDelegationKey;\n\n /**\n * Key value in Buffer type.\n */\n private readonly key: Buffer;\n\n /**\n * Creates an instance of UserDelegationKeyCredential.\n * @param accountName -\n * @param userDelegationKey -\n */\n constructor(accountName: string, userDelegationKey: UserDelegationKey) {\n this.accountName = accountName;\n this.userDelegationKey = userDelegationKey;\n this.key = Buffer.from(userDelegationKey.value, \"base64\");\n }\n\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n public computeHMACSHA256(stringToSign: string): string {\n // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);\n\n return createHmac(\"sha256\", this.key).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n"]}
1
+ {"version":3,"file":"UserDelegationKeyCredential.js","sourceRoot":"","sources":["../../../src/credentials/UserDelegationKeyCredential.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAyC;AAGzC;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;OAEG;IACa,WAAW,CAAS;IAEpC;;OAEG;IACa,iBAAiB,CAAoB;IAErD;;OAEG;IACc,GAAG,CAAS;IAE7B;;;;OAIG;IACH,YAAY,WAAmB,EAAE,iBAAoC;QACnE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,YAAoB;QAC3C,gEAAgE;QAEhE,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtF,CAAC;CACF;AArCD,kEAqCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHmac } from \"node:crypto\";\nimport type { UserDelegationKey } from \"../BlobServiceClient.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * UserDelegationKeyCredential is only used for generation of user delegation SAS.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas\n */\nexport class UserDelegationKeyCredential {\n /**\n * Azure Storage account name; readonly.\n */\n public readonly accountName: string;\n\n /**\n * Azure Storage user delegation key; readonly.\n */\n public readonly userDelegationKey: UserDelegationKey;\n\n /**\n * Key value in Buffer type.\n */\n private readonly key: Buffer;\n\n /**\n * Creates an instance of UserDelegationKeyCredential.\n * @param accountName -\n * @param userDelegationKey -\n */\n constructor(accountName: string, userDelegationKey: UserDelegationKey) {\n this.accountName = accountName;\n this.userDelegationKey = userDelegationKey;\n this.key = Buffer.from(userDelegationKey.value, \"base64\");\n }\n\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n public computeHMACSHA256(stringToSign: string): string {\n // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);\n\n return createHmac(\"sha256\", this.key).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing AppendBlob operations. */
16
16
  class AppendBlobImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class AppendBlob class.
19
20
  * @param client Reference to the service client
@@ -1 +1 @@
1
- {"version":3,"file":"appendBlob.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/appendBlob.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AAEjD,sEAAgD;AAChD,4EAAsD;AAatD,8CAA8C;AAC9C,MAAa,cAAc;IAGzB;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAwC;QAExC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,aAAa,EAAE,OAAO,EAAE,EAC1B,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CACT,aAAqB,EACrB,IAAsC,EACtC,OAA6C;QAE7C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,EAChC,wBAAwB,CACzB,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,kBAAkB,CAChB,SAAiB,EACjB,aAAqB,EACrB,OAAoD;QAEpD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,EACrC,+BAA+B,CAChC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,OAAsC;QAEtC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EA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,CAAC,8BAA8B;SACtD;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,gBAAgB,EAAE,UAAU,CAAC,MAAM,CAAC;IACjE,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;IAC/B,gBAAgB,EAAE;QAChB,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,eAAe;QAC1B,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,cAAc;KAC1B;IACD,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,aAAa;CAC1B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { AppendBlob } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { StorageClient } from \"../storageClient.js\";\nimport {\n AppendBlobCreateOptionalParams,\n AppendBlobCreateResponse,\n AppendBlobAppendBlockOptionalParams,\n AppendBlobAppendBlockResponse,\n AppendBlobAppendBlockFromUrlOptionalParams,\n AppendBlobAppendBlockFromUrlResponse,\n AppendBlobSealOptionalParams,\n AppendBlobSealResponse,\n} from \"../models/index.js\";\n\n/** Class containing AppendBlob operations. */\nexport class AppendBlobImpl implements AppendBlob {\n private readonly client: StorageClient;\n\n /**\n * Initialize a new instance of the class AppendBlob class.\n * @param client Reference to the service client\n */\n constructor(client: StorageClient) {\n this.client = client;\n }\n\n /**\n * The Create Append Blob operation creates a new append blob.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n create(\n contentLength: number,\n options?: AppendBlobCreateOptionalParams,\n ): Promise<AppendBlobCreateResponse> {\n return this.client.sendOperationRequest(\n { contentLength, options },\n createOperationSpec,\n );\n }\n\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob. The\n * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to\n * AppendBlob. Append Block is supported only on version 2015-02-21 version or later.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n appendBlock(\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: AppendBlobAppendBlockOptionalParams,\n ): Promise<AppendBlobAppendBlockResponse> {\n return this.client.sendOperationRequest(\n { contentLength, body, options },\n appendBlockOperationSpec,\n );\n }\n\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob where\n * the contents are read from a source url. The Append Block operation is permitted only if the blob\n * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version\n * 2015-02-21 version or later.\n * @param sourceUrl Specify a URL to the copy source.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n appendBlockFromUrl(\n sourceUrl: string,\n contentLength: number,\n options?: AppendBlobAppendBlockFromUrlOptionalParams,\n ): Promise<AppendBlobAppendBlockFromUrlResponse> {\n return this.client.sendOperationRequest(\n { sourceUrl, contentLength, options },\n appendBlockFromUrlOperationSpec,\n );\n }\n\n /**\n * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version\n * 2019-12-12 version or later.\n * @param options The options parameters.\n */\n seal(\n options?: AppendBlobSealOptionalParams,\n ): Promise<AppendBlobSealResponse> {\n return this.client.sendOperationRequest({ options }, sealOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer = coreClient.createSerializer(Mappers, /* isXml */ true);\n\nconst createOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobCreateHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobCreateExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.contentLength,\n Parameters.metadata,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.blobCacheControl,\n Parameters.blobContentType,\n Parameters.blobContentMD5,\n Parameters.blobContentEncoding,\n Parameters.blobContentLanguage,\n Parameters.blobContentDisposition,\n Parameters.immutabilityPolicyExpiry,\n Parameters.immutabilityPolicyMode,\n Parameters.encryptionScope,\n Parameters.blobTagsString,\n Parameters.legalHold1,\n Parameters.blobType1,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\nconst appendBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobAppendBlockHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobAppendBlockExceptionHeaders,\n },\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.contentLength,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.encryptionScope,\n Parameters.transactionalContentMD5,\n Parameters.transactionalContentCrc64,\n Parameters.contentType1,\n Parameters.accept2,\n Parameters.maxSize,\n Parameters.appendPosition,\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"binary\",\n serializer: xmlSerializer,\n};\nconst appendBlockFromUrlOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.contentLength,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.encryptionScope,\n Parameters.sourceIfModifiedSince,\n Parameters.sourceIfUnmodifiedSince,\n Parameters.sourceIfMatch,\n Parameters.sourceIfNoneMatch,\n Parameters.sourceContentMD5,\n Parameters.copySourceAuthorization,\n Parameters.fileRequestIntent,\n Parameters.transactionalContentMD5,\n Parameters.sourceUrl,\n Parameters.sourceContentCrc64,\n Parameters.maxSize,\n Parameters.appendPosition,\n Parameters.sourceRange1,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\nconst sealOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: Mappers.AppendBlobSealHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobSealExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp23],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.appendPosition,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\n"]}
1
+ {"version":3,"file":"appendBlob.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/appendBlob.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AAEjD,sEAAgD;AAChD,4EAAsD;AAatD,8CAA8C;AAC9C,MAAa,cAAc;IACR,MAAM,CAAgB;IAEvC;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,aAAqB,EACrB,OAAwC;QAExC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,aAAa,EAAE,OAAO,EAAE,EAC1B,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CACT,aAAqB,EACrB,IAAsC,EACtC,OAA6C;QAE7C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,EAChC,wBAAwB,CACzB,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,kBAAkB,CAChB,SAAiB,EACjB,aAAqB,EACrB,OAAoD;QAEpD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,EACrC,+BAA+B,CAChC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,IAAI,CACF,OAAsC;QAEtC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1E,CAAC;CACF;AA3ED,wCA2EC;AACD,2BAA2B;AAC3B,MAAM,aAAa,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AAE7E,MAAM,mBAAmB,GAA6B;IACpD,IAAI,EAAE,yBAA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,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,eAAe;QAC1B,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,cAAc;KAC1B;IACD,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,aAAa;CAC1B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { AppendBlob } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { StorageClient } from \"../storageClient.js\";\nimport {\n AppendBlobCreateOptionalParams,\n AppendBlobCreateResponse,\n AppendBlobAppendBlockOptionalParams,\n AppendBlobAppendBlockResponse,\n AppendBlobAppendBlockFromUrlOptionalParams,\n AppendBlobAppendBlockFromUrlResponse,\n AppendBlobSealOptionalParams,\n AppendBlobSealResponse,\n} from \"../models/index.js\";\n\n/** Class containing AppendBlob operations. */\nexport class AppendBlobImpl implements AppendBlob {\n private readonly client: StorageClient;\n\n /**\n * Initialize a new instance of the class AppendBlob class.\n * @param client Reference to the service client\n */\n constructor(client: StorageClient) {\n this.client = client;\n }\n\n /**\n * The Create Append Blob operation creates a new append blob.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n create(\n contentLength: number,\n options?: AppendBlobCreateOptionalParams,\n ): Promise<AppendBlobCreateResponse> {\n return this.client.sendOperationRequest(\n { contentLength, options },\n createOperationSpec,\n );\n }\n\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob. The\n * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to\n * AppendBlob. Append Block is supported only on version 2015-02-21 version or later.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n appendBlock(\n contentLength: number,\n body: coreRestPipeline.RequestBodyType,\n options?: AppendBlobAppendBlockOptionalParams,\n ): Promise<AppendBlobAppendBlockResponse> {\n return this.client.sendOperationRequest(\n { contentLength, body, options },\n appendBlockOperationSpec,\n );\n }\n\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob where\n * the contents are read from a source url. The Append Block operation is permitted only if the blob\n * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version\n * 2015-02-21 version or later.\n * @param sourceUrl Specify a URL to the copy source.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n appendBlockFromUrl(\n sourceUrl: string,\n contentLength: number,\n options?: AppendBlobAppendBlockFromUrlOptionalParams,\n ): Promise<AppendBlobAppendBlockFromUrlResponse> {\n return this.client.sendOperationRequest(\n { sourceUrl, contentLength, options },\n appendBlockFromUrlOperationSpec,\n );\n }\n\n /**\n * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version\n * 2019-12-12 version or later.\n * @param options The options parameters.\n */\n seal(\n options?: AppendBlobSealOptionalParams,\n ): Promise<AppendBlobSealResponse> {\n return this.client.sendOperationRequest({ options }, sealOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer = coreClient.createSerializer(Mappers, /* isXml */ true);\n\nconst createOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobCreateHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobCreateExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.contentLength,\n Parameters.metadata,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.blobCacheControl,\n Parameters.blobContentType,\n Parameters.blobContentMD5,\n Parameters.blobContentEncoding,\n Parameters.blobContentLanguage,\n Parameters.blobContentDisposition,\n Parameters.immutabilityPolicyExpiry,\n Parameters.immutabilityPolicyMode,\n Parameters.encryptionScope,\n Parameters.blobTagsString,\n Parameters.legalHold1,\n Parameters.blobType1,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\nconst appendBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobAppendBlockHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobAppendBlockExceptionHeaders,\n },\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.contentLength,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.encryptionScope,\n Parameters.transactionalContentMD5,\n Parameters.transactionalContentCrc64,\n Parameters.contentType1,\n Parameters.accept2,\n Parameters.maxSize,\n Parameters.appendPosition,\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"binary\",\n serializer: xmlSerializer,\n};\nconst appendBlockFromUrlOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp22],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.contentLength,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.encryptionKey,\n Parameters.encryptionKeySha256,\n Parameters.encryptionAlgorithm,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.ifTags,\n Parameters.encryptionScope,\n Parameters.sourceIfModifiedSince,\n Parameters.sourceIfUnmodifiedSince,\n Parameters.sourceIfMatch,\n Parameters.sourceIfNoneMatch,\n Parameters.sourceContentMD5,\n Parameters.copySourceAuthorization,\n Parameters.fileRequestIntent,\n Parameters.transactionalContentMD5,\n Parameters.sourceUrl,\n Parameters.sourceContentCrc64,\n Parameters.maxSize,\n Parameters.appendPosition,\n Parameters.sourceRange1,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\nconst sealOperationSpec: coreClient.OperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: Mappers.AppendBlobSealHeaders,\n },\n default: {\n bodyMapper: Mappers.StorageError,\n headersMapper: Mappers.AppendBlobSealExceptionHeaders,\n },\n },\n queryParameters: [Parameters.timeoutInSeconds, Parameters.comp23],\n urlParameters: [Parameters.url],\n headerParameters: [\n Parameters.version,\n Parameters.requestId,\n Parameters.accept1,\n Parameters.leaseId,\n Parameters.ifModifiedSince,\n Parameters.ifUnmodifiedSince,\n Parameters.ifMatch,\n Parameters.ifNoneMatch,\n Parameters.appendPosition,\n ],\n isXML: true,\n serializer: xmlSerializer,\n};\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing Blob operations. */
16
16
  class BlobImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class Blob class.
19
20
  * @param client Reference to the service client