@azure/storage-file-datalake 12.26.0 → 12.27.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (836) hide show
  1. package/README.md +117 -190
  2. package/dist/browser/DataLakeFileSystemClient.d.ts +473 -0
  3. package/dist/browser/DataLakeFileSystemClient.d.ts.map +1 -0
  4. package/{dist-esm/storage-file-datalake/src → dist/browser}/DataLakeFileSystemClient.js +170 -75
  5. package/dist/browser/DataLakeFileSystemClient.js.map +1 -0
  6. package/dist/browser/DataLakeLeaseClient.d.ts +14 -0
  7. package/dist/browser/DataLakeLeaseClient.d.ts.map +1 -0
  8. package/{dist-esm/storage-file-datalake/src → dist/browser}/DataLakeLeaseClient.js +3 -1
  9. package/dist/browser/DataLakeLeaseClient.js.map +1 -0
  10. package/dist/browser/DataLakeServiceClient.d.ts +281 -0
  11. package/dist/browser/DataLakeServiceClient.d.ts.map +1 -0
  12. package/{dist-esm/storage-file-datalake/src → dist/browser}/DataLakeServiceClient.js +94 -62
  13. package/dist/browser/DataLakeServiceClient.js.map +1 -0
  14. package/dist/browser/Pipeline.d.ts +52 -0
  15. package/dist/browser/Pipeline.d.ts.map +1 -0
  16. package/{dist-esm/storage-file-datalake/src → dist/browser}/Pipeline.js +8 -8
  17. package/dist/browser/Pipeline.js.map +1 -0
  18. package/dist/browser/StorageClient.d.ts +61 -0
  19. package/dist/browser/StorageClient.d.ts.map +1 -0
  20. package/{dist-esm/storage-file-datalake/src → dist/browser}/StorageClient.js +5 -3
  21. package/dist/browser/StorageClient.js.map +1 -0
  22. package/dist/browser/StorageContextClient.d.ts +9 -0
  23. package/dist/browser/StorageContextClient.d.ts.map +1 -0
  24. package/{dist-esm/storage-file-datalake/src → dist/browser}/StorageContextClient.js +3 -3
  25. package/dist/browser/StorageContextClient.js.map +1 -0
  26. package/dist/browser/clients.d.ts +689 -0
  27. package/dist/browser/clients.d.ts.map +1 -0
  28. package/{dist-esm/storage-file-datalake/src → dist/browser}/clients.js +87 -45
  29. package/dist/browser/clients.js.map +1 -0
  30. package/dist/browser/credentials/StorageSharedKeyCredential-browser.d.mts.map +1 -0
  31. package/dist/browser/credentials/StorageSharedKeyCredential-browser.mjs.map +1 -0
  32. package/dist/browser/credentials/StorageSharedKeyCredential.d.ts +3 -0
  33. package/{dist-esm/storage-file-datalake/src/credentials/StorageSharedKeyCredential.browser.js → dist/browser/credentials/StorageSharedKeyCredential.js} +1 -1
  34. package/dist/browser/credentials/UserDelegationKeyCredential-browser.d.mts.map +1 -0
  35. package/dist/browser/credentials/UserDelegationKeyCredential-browser.mjs.map +1 -0
  36. package/dist/browser/credentials/UserDelegationKeyCredential.d.ts +3 -0
  37. package/{dist-esm/storage-file-datalake/src/credentials/UserDelegationKeyCredential.browser.js → dist/browser/credentials/UserDelegationKeyCredential.js} +1 -1
  38. package/dist/browser/generated/src/index.d.ts +4 -0
  39. package/dist/browser/generated/src/index.d.ts.map +1 -0
  40. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/index.js +3 -3
  41. package/dist/browser/generated/src/index.js.map +1 -0
  42. package/dist/browser/generated/src/models/index.d.ts +1091 -0
  43. package/dist/browser/generated/src/models/index.d.ts.map +1 -0
  44. package/dist/browser/generated/src/models/index.js.map +1 -0
  45. package/dist/browser/generated/src/models/mappers.d.ts +53 -0
  46. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
  47. package/dist/browser/generated/src/models/mappers.js.map +1 -0
  48. package/dist/browser/generated/src/models/parameters.d.ts +87 -0
  49. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
  50. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/models/parameters.js +1 -1
  51. package/dist/browser/generated/src/models/parameters.js.map +1 -0
  52. package/dist/browser/generated/src/operations/fileSystemOperations.d.ts +55 -0
  53. package/dist/browser/generated/src/operations/fileSystemOperations.d.ts.map +1 -0
  54. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operations/fileSystemOperations.js +2 -2
  55. package/dist/browser/generated/src/operations/fileSystemOperations.js.map +1 -0
  56. package/dist/browser/generated/src/operations/index.d.ts +4 -0
  57. package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
  58. package/{dist-esm/storage-file-datalake/src/generated/src/operationsInterfaces → dist/browser/generated/src/operations}/index.js +3 -3
  59. package/dist/browser/generated/src/operations/index.js.map +1 -0
  60. package/dist/browser/generated/src/operations/pathOperations.d.ts +120 -0
  61. package/dist/browser/generated/src/operations/pathOperations.d.ts.map +1 -0
  62. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operations/pathOperations.js +2 -2
  63. package/dist/browser/generated/src/operations/pathOperations.js.map +1 -0
  64. package/dist/browser/generated/src/operations/service.d.ts +18 -0
  65. package/dist/browser/generated/src/operations/service.d.ts.map +1 -0
  66. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operations/service.js +2 -2
  67. package/dist/browser/generated/src/operations/service.js.map +1 -0
  68. package/dist/browser/generated/src/operationsInterfaces/fileSystemOperations.d.ts +47 -0
  69. package/dist/browser/generated/src/operationsInterfaces/fileSystemOperations.d.ts.map +1 -0
  70. package/dist/browser/generated/src/operationsInterfaces/fileSystemOperations.js.map +1 -0
  71. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +4 -0
  72. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  73. package/dist/browser/generated/src/operationsInterfaces/index.js +11 -0
  74. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -0
  75. package/dist/browser/generated/src/operationsInterfaces/pathOperations.d.ts +112 -0
  76. package/dist/browser/generated/src/operationsInterfaces/pathOperations.d.ts.map +1 -0
  77. package/dist/browser/generated/src/operationsInterfaces/pathOperations.js.map +1 -0
  78. package/dist/browser/generated/src/operationsInterfaces/service.d.ts +10 -0
  79. package/dist/browser/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  80. package/dist/browser/generated/src/operationsInterfaces/service.js.map +1 -0
  81. package/dist/browser/generated/src/storageClient.d.ts +20 -0
  82. package/dist/browser/generated/src/storageClient.d.ts.map +1 -0
  83. package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/storageClient.js +3 -3
  84. package/dist/browser/generated/src/storageClient.js.map +1 -0
  85. package/dist/browser/index-browser.d.mts.map +1 -0
  86. package/dist/browser/index-browser.mjs.map +1 -0
  87. package/dist/browser/index.d.ts +13 -0
  88. package/{dist-esm/storage-file-datalake/src/index.browser.js → dist/browser/index.js} +10 -10
  89. package/dist/browser/log.d.ts +5 -0
  90. package/dist/browser/log.d.ts.map +1 -0
  91. package/dist/browser/log.js.map +1 -0
  92. package/dist/browser/models.d.ts +1318 -0
  93. package/dist/browser/models.d.ts.map +1 -0
  94. package/dist/browser/models.internal.d.ts +2 -0
  95. package/dist/browser/models.internal.d.ts.map +1 -0
  96. package/dist/browser/models.internal.js.map +1 -0
  97. package/{dist-esm/storage-file-datalake/src → dist/browser}/models.js +2 -0
  98. package/dist/browser/models.js.map +1 -0
  99. package/dist/browser/package.json +3 -0
  100. package/dist/browser/sas/AccountSASPermissions.d.ts +61 -0
  101. package/dist/browser/sas/AccountSASPermissions.d.ts.map +1 -0
  102. package/dist/browser/sas/AccountSASPermissions.js.map +1 -0
  103. package/dist/browser/sas/AccountSASResourceTypes.d.ts +38 -0
  104. package/dist/browser/sas/AccountSASResourceTypes.d.ts.map +1 -0
  105. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -0
  106. package/dist/browser/sas/AccountSASServices.d.ts +40 -0
  107. package/dist/browser/sas/AccountSASServices.d.ts.map +1 -0
  108. package/dist/browser/sas/AccountSASServices.js.map +1 -0
  109. package/dist/browser/sas/AccountSASSignatureValues.d.ts +78 -0
  110. package/dist/browser/sas/AccountSASSignatureValues.d.ts.map +1 -0
  111. package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/AccountSASSignatureValues.js +7 -7
  112. package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -0
  113. package/dist/browser/sas/DataLakeSASPermissions.d.ts +65 -0
  114. package/dist/browser/sas/DataLakeSASPermissions.d.ts.map +1 -0
  115. package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -0
  116. package/dist/browser/sas/DataLakeSASSignatureValues.d.ts +205 -0
  117. package/dist/browser/sas/DataLakeSASSignatureValues.d.ts.map +1 -0
  118. package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/DataLakeSASSignatureValues.js +107 -10
  119. package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -0
  120. package/dist/browser/sas/DirectorySASPermissions.d.ts +69 -0
  121. package/dist/browser/sas/DirectorySASPermissions.d.ts.map +1 -0
  122. package/dist/browser/sas/DirectorySASPermissions.js.map +1 -0
  123. package/dist/browser/sas/FileSystemSASPermissions.d.ts +69 -0
  124. package/dist/browser/sas/FileSystemSASPermissions.d.ts.map +1 -0
  125. package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -0
  126. package/dist/browser/sas/SASQueryParameters.d.ts +309 -0
  127. package/dist/browser/sas/SASQueryParameters.d.ts.map +1 -0
  128. package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/SASQueryParameters.js +4 -2
  129. package/dist/browser/sas/SASQueryParameters.js.map +1 -0
  130. package/dist/browser/sas/SasIPRange.d.ts +24 -0
  131. package/dist/browser/sas/SasIPRange.d.ts.map +1 -0
  132. package/dist/browser/sas/SasIPRange.js.map +1 -0
  133. package/dist/browser/transforms.d.ts +51 -0
  134. package/dist/browser/transforms.d.ts.map +1 -0
  135. package/{dist-esm/storage-file-datalake/src → dist/browser}/transforms.js +2 -2
  136. package/dist/browser/transforms.js.map +1 -0
  137. package/dist/browser/utils/Batch.d.ts +68 -0
  138. package/dist/browser/utils/Batch.d.ts.map +1 -0
  139. package/dist/browser/utils/Batch.js.map +1 -0
  140. package/dist/browser/utils/BufferScheduler.d.ts +158 -0
  141. package/dist/browser/utils/BufferScheduler.d.ts.map +1 -0
  142. package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/BufferScheduler.js +1 -1
  143. package/dist/browser/utils/BufferScheduler.js.map +1 -0
  144. package/dist/browser/utils/DataLakeAclChangeFailedError.d.ts +16 -0
  145. package/dist/browser/utils/DataLakeAclChangeFailedError.d.ts.map +1 -0
  146. package/dist/browser/utils/DataLakeAclChangeFailedError.js.map +1 -0
  147. package/dist/browser/utils/PathClientInternal.d.ts +24 -0
  148. package/dist/browser/utils/PathClientInternal.d.ts.map +1 -0
  149. package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/PathClientInternal.js +2 -2
  150. package/dist/browser/utils/PathClientInternal.js.map +1 -0
  151. package/dist/browser/utils/constants.d.ts +70 -0
  152. package/dist/browser/utils/constants.d.ts.map +1 -0
  153. package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/constants.js +2 -2
  154. package/dist/browser/utils/constants.js.map +1 -0
  155. package/dist/browser/utils/tracing.d.ts +6 -0
  156. package/dist/browser/utils/tracing.d.ts.map +1 -0
  157. package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/tracing.js +1 -1
  158. package/dist/browser/utils/tracing.js.map +1 -0
  159. package/dist/browser/utils/utils-browser.d.mts.map +1 -0
  160. package/dist/browser/utils/utils-browser.mjs.map +1 -0
  161. package/dist/browser/utils/utils.common.d.ts +236 -0
  162. package/dist/browser/utils/utils.common.d.ts.map +1 -0
  163. package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/utils.common.js +5 -5
  164. package/dist/browser/utils/utils.common.js.map +1 -0
  165. package/dist/browser/utils/utils.d.ts +3 -0
  166. package/dist/browser/utils/utils.js +9 -0
  167. package/dist/commonjs/DataLakeFileSystemClient.d.ts +473 -0
  168. package/dist/commonjs/DataLakeFileSystemClient.d.ts.map +1 -0
  169. package/dist/commonjs/DataLakeFileSystemClient.js +683 -0
  170. package/dist/commonjs/DataLakeFileSystemClient.js.map +1 -0
  171. package/dist/commonjs/DataLakeLeaseClient.d.ts +14 -0
  172. package/dist/commonjs/DataLakeLeaseClient.d.ts.map +1 -0
  173. package/dist/commonjs/DataLakeLeaseClient.js +49 -0
  174. package/dist/commonjs/DataLakeLeaseClient.js.map +1 -0
  175. package/dist/commonjs/DataLakeServiceClient.d.ts +281 -0
  176. package/dist/commonjs/DataLakeServiceClient.d.ts.map +1 -0
  177. package/dist/commonjs/DataLakeServiceClient.js +372 -0
  178. package/dist/commonjs/DataLakeServiceClient.js.map +1 -0
  179. package/dist/commonjs/Pipeline.d.ts +52 -0
  180. package/dist/commonjs/Pipeline.d.ts.map +1 -0
  181. package/dist/commonjs/Pipeline.js +222 -0
  182. package/dist/commonjs/Pipeline.js.map +1 -0
  183. package/dist/commonjs/StorageClient.d.ts +61 -0
  184. package/dist/commonjs/StorageClient.d.ts.map +1 -0
  185. package/dist/commonjs/StorageClient.js +55 -0
  186. package/dist/commonjs/StorageClient.js.map +1 -0
  187. package/dist/commonjs/StorageContextClient.d.ts +9 -0
  188. package/dist/commonjs/StorageContextClient.d.ts.map +1 -0
  189. package/dist/commonjs/StorageContextClient.js +39 -0
  190. package/dist/commonjs/StorageContextClient.js.map +1 -0
  191. package/dist/commonjs/clients.d.ts +689 -0
  192. package/dist/commonjs/clients.d.ts.map +1 -0
  193. package/dist/commonjs/clients.js +1195 -0
  194. package/dist/commonjs/clients.js.map +1 -0
  195. package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts +2 -0
  196. package/dist/commonjs/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  197. package/dist/commonjs/credentials/StorageSharedKeyCredential.js +8 -0
  198. package/dist/commonjs/credentials/StorageSharedKeyCredential.js.map +1 -0
  199. package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +34 -0
  200. package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts.map +1 -0
  201. package/dist/commonjs/credentials/UserDelegationKeyCredential.js +35 -0
  202. package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -0
  203. package/dist/commonjs/generated/src/index.d.ts +4 -0
  204. package/dist/commonjs/generated/src/index.d.ts.map +1 -0
  205. package/dist/commonjs/generated/src/index.js +16 -0
  206. package/dist/commonjs/generated/src/index.js.map +1 -0
  207. package/dist/commonjs/generated/src/models/index.d.ts +1091 -0
  208. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
  209. package/dist/commonjs/generated/src/models/index.js +19 -0
  210. package/dist/commonjs/generated/src/models/index.js.map +1 -0
  211. package/dist/commonjs/generated/src/models/mappers.d.ts +53 -0
  212. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
  213. package/dist/commonjs/generated/src/models/mappers.js +2450 -0
  214. package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
  215. package/dist/commonjs/generated/src/models/parameters.d.ts +87 -0
  216. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
  217. package/dist/commonjs/generated/src/models/parameters.js +952 -0
  218. package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
  219. package/dist/commonjs/generated/src/operations/fileSystemOperations.d.ts +55 -0
  220. package/dist/commonjs/generated/src/operations/fileSystemOperations.d.ts.map +1 -0
  221. package/dist/commonjs/generated/src/operations/fileSystemOperations.js +236 -0
  222. package/dist/commonjs/generated/src/operations/fileSystemOperations.js.map +1 -0
  223. package/dist/commonjs/generated/src/operations/index.d.ts +4 -0
  224. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
  225. package/dist/commonjs/generated/src/operations/index.js +14 -0
  226. package/dist/commonjs/generated/src/operations/index.js.map +1 -0
  227. package/dist/commonjs/generated/src/operations/pathOperations.d.ts +120 -0
  228. package/dist/commonjs/generated/src/operations/pathOperations.d.ts.map +1 -0
  229. package/dist/commonjs/generated/src/operations/pathOperations.js +596 -0
  230. package/dist/commonjs/generated/src/operations/pathOperations.js.map +1 -0
  231. package/dist/commonjs/generated/src/operations/service.d.ts +18 -0
  232. package/dist/commonjs/generated/src/operations/service.d.ts.map +1 -0
  233. package/dist/commonjs/generated/src/operations/service.js +63 -0
  234. package/dist/commonjs/generated/src/operations/service.js.map +1 -0
  235. package/dist/commonjs/generated/src/operationsInterfaces/fileSystemOperations.d.ts +47 -0
  236. package/dist/commonjs/generated/src/operationsInterfaces/fileSystemOperations.d.ts.map +1 -0
  237. package/{dist-esm/storage-file-datalake/src/generated/src/operations/index.js → dist/commonjs/generated/src/operationsInterfaces/fileSystemOperations.js} +3 -4
  238. package/dist/commonjs/generated/src/operationsInterfaces/fileSystemOperations.js.map +1 -0
  239. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +4 -0
  240. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  241. package/dist/commonjs/generated/src/operationsInterfaces/index.js +14 -0
  242. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
  243. package/dist/commonjs/generated/src/operationsInterfaces/pathOperations.d.ts +112 -0
  244. package/dist/commonjs/generated/src/operationsInterfaces/pathOperations.d.ts.map +1 -0
  245. package/dist/commonjs/generated/src/operationsInterfaces/pathOperations.js +10 -0
  246. package/dist/commonjs/generated/src/operationsInterfaces/pathOperations.js.map +1 -0
  247. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts +10 -0
  248. package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  249. package/dist/commonjs/generated/src/operationsInterfaces/service.js +10 -0
  250. package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -0
  251. package/dist/commonjs/generated/src/storageClient.d.ts +20 -0
  252. package/dist/commonjs/generated/src/storageClient.d.ts.map +1 -0
  253. package/dist/commonjs/generated/src/storageClient.js +52 -0
  254. package/dist/commonjs/generated/src/storageClient.js.map +1 -0
  255. package/dist/commonjs/index.d.ts +23 -0
  256. package/dist/commonjs/index.d.ts.map +1 -0
  257. package/dist/commonjs/index.js +49 -0
  258. package/dist/commonjs/index.js.map +1 -0
  259. package/dist/commonjs/log.d.ts +5 -0
  260. package/dist/commonjs/log.d.ts.map +1 -0
  261. package/dist/commonjs/log.js +11 -0
  262. package/dist/commonjs/log.js.map +1 -0
  263. package/dist/commonjs/models.d.ts +1318 -0
  264. package/dist/commonjs/models.d.ts.map +1 -0
  265. package/dist/commonjs/models.internal.d.ts +2 -0
  266. package/dist/commonjs/models.internal.d.ts.map +1 -0
  267. package/dist/commonjs/models.internal.js +5 -0
  268. package/dist/commonjs/models.internal.js.map +1 -0
  269. package/dist/commonjs/models.js +57 -0
  270. package/dist/commonjs/models.js.map +1 -0
  271. package/dist/commonjs/package.json +3 -0
  272. package/dist/commonjs/sas/AccountSASPermissions.d.ts +61 -0
  273. package/dist/commonjs/sas/AccountSASPermissions.d.ts.map +1 -0
  274. package/dist/commonjs/sas/AccountSASPermissions.js +132 -0
  275. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -0
  276. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +38 -0
  277. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts.map +1 -0
  278. package/dist/commonjs/sas/AccountSASResourceTypes.js +76 -0
  279. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -0
  280. package/dist/commonjs/sas/AccountSASServices.d.ts +40 -0
  281. package/dist/commonjs/sas/AccountSASServices.d.ts.map +1 -0
  282. package/dist/commonjs/sas/AccountSASServices.js +84 -0
  283. package/dist/commonjs/sas/AccountSASServices.js.map +1 -0
  284. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +78 -0
  285. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts.map +1 -0
  286. package/dist/commonjs/sas/AccountSASSignatureValues.js +76 -0
  287. package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -0
  288. package/dist/commonjs/sas/DataLakeSASPermissions.d.ts +65 -0
  289. package/dist/commonjs/sas/DataLakeSASPermissions.d.ts.map +1 -0
  290. package/dist/commonjs/sas/DataLakeSASPermissions.js +139 -0
  291. package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -0
  292. package/dist/commonjs/sas/DataLakeSASSignatureValues.d.ts +205 -0
  293. package/dist/commonjs/sas/DataLakeSASSignatureValues.d.ts.map +1 -0
  294. package/dist/commonjs/sas/DataLakeSASSignatureValues.js +722 -0
  295. package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -0
  296. package/dist/commonjs/sas/DirectorySASPermissions.d.ts +69 -0
  297. package/dist/commonjs/sas/DirectorySASPermissions.d.ts.map +1 -0
  298. package/dist/commonjs/sas/DirectorySASPermissions.js +149 -0
  299. package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -0
  300. package/dist/commonjs/sas/FileSystemSASPermissions.d.ts +69 -0
  301. package/dist/commonjs/sas/FileSystemSASPermissions.d.ts.map +1 -0
  302. package/dist/commonjs/sas/FileSystemSASPermissions.js +149 -0
  303. package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -0
  304. package/dist/commonjs/sas/SASQueryParameters.d.ts +309 -0
  305. package/dist/commonjs/sas/SASQueryParameters.d.ts.map +1 -0
  306. package/dist/commonjs/sas/SASQueryParameters.js +252 -0
  307. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -0
  308. package/dist/commonjs/sas/SasIPRange.d.ts +24 -0
  309. package/dist/commonjs/sas/SasIPRange.d.ts.map +1 -0
  310. package/dist/commonjs/sas/SasIPRange.js +16 -0
  311. package/dist/commonjs/sas/SasIPRange.js.map +1 -0
  312. package/dist/commonjs/transforms.d.ts +51 -0
  313. package/dist/commonjs/transforms.d.ts.map +1 -0
  314. package/dist/commonjs/transforms.js +357 -0
  315. package/dist/commonjs/transforms.js.map +1 -0
  316. package/dist/commonjs/tsdoc-metadata.json +11 -0
  317. package/dist/commonjs/utils/Batch.d.ts +68 -0
  318. package/dist/commonjs/utils/Batch.d.ts.map +1 -0
  319. package/dist/commonjs/utils/Batch.js +126 -0
  320. package/dist/commonjs/utils/Batch.js.map +1 -0
  321. package/dist/commonjs/utils/BufferScheduler.d.ts +158 -0
  322. package/dist/commonjs/utils/BufferScheduler.d.ts.map +1 -0
  323. package/dist/commonjs/utils/BufferScheduler.js +268 -0
  324. package/dist/commonjs/utils/BufferScheduler.js.map +1 -0
  325. package/dist/commonjs/utils/DataLakeAclChangeFailedError.d.ts +16 -0
  326. package/dist/commonjs/utils/DataLakeAclChangeFailedError.d.ts.map +1 -0
  327. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js +17 -0
  328. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js.map +1 -0
  329. package/dist/commonjs/utils/PathClientInternal.d.ts +24 -0
  330. package/dist/commonjs/utils/PathClientInternal.d.ts.map +1 -0
  331. package/dist/commonjs/utils/PathClientInternal.js +28 -0
  332. package/dist/commonjs/utils/PathClientInternal.js.map +1 -0
  333. package/dist/commonjs/utils/constants.d.ts +70 -0
  334. package/dist/commonjs/utils/constants.d.ts.map +1 -0
  335. package/dist/commonjs/utils/constants.js +247 -0
  336. package/dist/commonjs/utils/constants.js.map +1 -0
  337. package/dist/commonjs/utils/tracing.d.ts +6 -0
  338. package/dist/commonjs/utils/tracing.d.ts.map +1 -0
  339. package/dist/commonjs/utils/tracing.js +17 -0
  340. package/dist/commonjs/utils/tracing.js.map +1 -0
  341. package/dist/commonjs/utils/utils.common.d.ts +236 -0
  342. package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
  343. package/dist/commonjs/utils/utils.common.js +595 -0
  344. package/dist/commonjs/utils/utils.common.js.map +1 -0
  345. package/dist/commonjs/utils/utils.d.ts +29 -0
  346. package/dist/commonjs/utils/utils.d.ts.map +1 -0
  347. package/dist/commonjs/utils/utils.js +91 -0
  348. package/dist/commonjs/utils/utils.js.map +1 -0
  349. package/dist/esm/DataLakeFileSystemClient.d.ts +473 -0
  350. package/dist/esm/DataLakeFileSystemClient.d.ts.map +1 -0
  351. package/dist/esm/DataLakeFileSystemClient.js +679 -0
  352. package/dist/esm/DataLakeFileSystemClient.js.map +1 -0
  353. package/dist/esm/DataLakeLeaseClient.d.ts +14 -0
  354. package/dist/esm/DataLakeLeaseClient.d.ts.map +1 -0
  355. package/dist/esm/DataLakeLeaseClient.js +45 -0
  356. package/dist/esm/DataLakeLeaseClient.js.map +1 -0
  357. package/dist/esm/DataLakeServiceClient.d.ts +281 -0
  358. package/dist/esm/DataLakeServiceClient.d.ts.map +1 -0
  359. package/dist/esm/DataLakeServiceClient.js +368 -0
  360. package/dist/esm/DataLakeServiceClient.js.map +1 -0
  361. package/dist/esm/Pipeline.d.ts +52 -0
  362. package/dist/esm/Pipeline.d.ts.map +1 -0
  363. package/dist/esm/Pipeline.js +216 -0
  364. package/dist/esm/Pipeline.js.map +1 -0
  365. package/dist/esm/StorageClient.d.ts +61 -0
  366. package/dist/esm/StorageClient.d.ts.map +1 -0
  367. package/dist/esm/StorageClient.js +51 -0
  368. package/dist/esm/StorageClient.js.map +1 -0
  369. package/dist/esm/StorageContextClient.d.ts +9 -0
  370. package/dist/esm/StorageContextClient.d.ts.map +1 -0
  371. package/dist/esm/StorageContextClient.js +35 -0
  372. package/dist/esm/StorageContextClient.js.map +1 -0
  373. package/dist/esm/clients.d.ts +689 -0
  374. package/dist/esm/clients.d.ts.map +1 -0
  375. package/dist/esm/clients.js +1189 -0
  376. package/dist/esm/clients.js.map +1 -0
  377. package/dist/esm/credentials/StorageSharedKeyCredential.d.ts +2 -0
  378. package/dist/esm/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  379. package/dist/esm/credentials/StorageSharedKeyCredential.js.map +1 -0
  380. package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +34 -0
  381. package/dist/esm/credentials/UserDelegationKeyCredential.d.ts.map +1 -0
  382. package/{dist-esm/storage-file-datalake/src → dist/esm}/credentials/UserDelegationKeyCredential.js +1 -1
  383. package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -0
  384. package/dist/esm/generated/src/index.d.ts +4 -0
  385. package/dist/esm/generated/src/index.d.ts.map +1 -0
  386. package/dist/esm/generated/src/index.js +11 -0
  387. package/dist/esm/generated/src/index.js.map +1 -0
  388. package/dist/esm/generated/src/models/index.d.ts +1091 -0
  389. package/dist/esm/generated/src/models/index.d.ts.map +1 -0
  390. package/dist/esm/generated/src/models/index.js +16 -0
  391. package/dist/esm/generated/src/models/index.js.map +1 -0
  392. package/dist/esm/generated/src/models/mappers.d.ts +53 -0
  393. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
  394. package/dist/esm/generated/src/models/mappers.js +2446 -0
  395. package/dist/esm/generated/src/models/mappers.js.map +1 -0
  396. package/dist/esm/generated/src/models/parameters.d.ts +87 -0
  397. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
  398. package/dist/esm/generated/src/models/parameters.js +948 -0
  399. package/dist/esm/generated/src/models/parameters.js.map +1 -0
  400. package/dist/esm/generated/src/operations/fileSystemOperations.d.ts +55 -0
  401. package/dist/esm/generated/src/operations/fileSystemOperations.d.ts.map +1 -0
  402. package/dist/esm/generated/src/operations/fileSystemOperations.js +231 -0
  403. package/dist/esm/generated/src/operations/fileSystemOperations.js.map +1 -0
  404. package/dist/esm/generated/src/operations/index.d.ts +4 -0
  405. package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
  406. package/dist/esm/generated/src/operations/index.js +11 -0
  407. package/dist/esm/generated/src/operations/index.js.map +1 -0
  408. package/dist/esm/generated/src/operations/pathOperations.d.ts +120 -0
  409. package/dist/esm/generated/src/operations/pathOperations.d.ts.map +1 -0
  410. package/dist/esm/generated/src/operations/pathOperations.js +591 -0
  411. package/dist/esm/generated/src/operations/pathOperations.js.map +1 -0
  412. package/dist/esm/generated/src/operations/service.d.ts +18 -0
  413. package/dist/esm/generated/src/operations/service.d.ts.map +1 -0
  414. package/dist/esm/generated/src/operations/service.js +58 -0
  415. package/dist/esm/generated/src/operations/service.js.map +1 -0
  416. package/dist/esm/generated/src/operationsInterfaces/fileSystemOperations.d.ts +47 -0
  417. package/dist/esm/generated/src/operationsInterfaces/fileSystemOperations.d.ts.map +1 -0
  418. package/dist/esm/generated/src/operationsInterfaces/fileSystemOperations.js +9 -0
  419. package/dist/esm/generated/src/operationsInterfaces/fileSystemOperations.js.map +1 -0
  420. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +4 -0
  421. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  422. package/dist/esm/generated/src/operationsInterfaces/index.js +11 -0
  423. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
  424. package/dist/esm/generated/src/operationsInterfaces/pathOperations.d.ts +112 -0
  425. package/dist/esm/generated/src/operationsInterfaces/pathOperations.d.ts.map +1 -0
  426. package/dist/esm/generated/src/operationsInterfaces/pathOperations.js +9 -0
  427. package/dist/esm/generated/src/operationsInterfaces/pathOperations.js.map +1 -0
  428. package/dist/esm/generated/src/operationsInterfaces/service.d.ts +10 -0
  429. package/dist/esm/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  430. package/dist/esm/generated/src/operationsInterfaces/service.js +9 -0
  431. package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -0
  432. package/dist/esm/generated/src/storageClient.d.ts +20 -0
  433. package/dist/esm/generated/src/storageClient.d.ts.map +1 -0
  434. package/dist/esm/generated/src/storageClient.js +47 -0
  435. package/dist/esm/generated/src/storageClient.js.map +1 -0
  436. package/dist/esm/index.d.ts +23 -0
  437. package/dist/esm/index.d.ts.map +1 -0
  438. package/dist/esm/index.js +23 -0
  439. package/dist/esm/index.js.map +1 -0
  440. package/dist/esm/log.d.ts +5 -0
  441. package/dist/esm/log.d.ts.map +1 -0
  442. package/{dist-esm/storage-blob/src → dist/esm}/log.js +1 -1
  443. package/dist/esm/log.js.map +1 -0
  444. package/dist/esm/models.d.ts +1318 -0
  445. package/dist/esm/models.d.ts.map +1 -0
  446. package/dist/esm/models.internal.d.ts +2 -0
  447. package/dist/esm/models.internal.d.ts.map +1 -0
  448. package/dist/esm/models.internal.js +4 -0
  449. package/dist/esm/models.internal.js.map +1 -0
  450. package/dist/esm/models.js +53 -0
  451. package/dist/esm/models.js.map +1 -0
  452. package/dist/esm/package.json +3 -0
  453. package/dist/esm/sas/AccountSASPermissions.d.ts +61 -0
  454. package/dist/esm/sas/AccountSASPermissions.d.ts.map +1 -0
  455. package/dist/esm/sas/AccountSASPermissions.js +128 -0
  456. package/dist/esm/sas/AccountSASPermissions.js.map +1 -0
  457. package/dist/esm/sas/AccountSASResourceTypes.d.ts +38 -0
  458. package/dist/esm/sas/AccountSASResourceTypes.d.ts.map +1 -0
  459. package/dist/esm/sas/AccountSASResourceTypes.js +72 -0
  460. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -0
  461. package/dist/esm/sas/AccountSASServices.d.ts +40 -0
  462. package/dist/esm/sas/AccountSASServices.d.ts.map +1 -0
  463. package/dist/esm/sas/AccountSASServices.js +80 -0
  464. package/dist/esm/sas/AccountSASServices.js.map +1 -0
  465. package/dist/esm/sas/AccountSASSignatureValues.d.ts +78 -0
  466. package/dist/esm/sas/AccountSASSignatureValues.d.ts.map +1 -0
  467. package/dist/esm/sas/AccountSASSignatureValues.js +72 -0
  468. package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -0
  469. package/dist/esm/sas/DataLakeSASPermissions.d.ts +65 -0
  470. package/dist/esm/sas/DataLakeSASPermissions.d.ts.map +1 -0
  471. package/dist/esm/sas/DataLakeSASPermissions.js +135 -0
  472. package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -0
  473. package/dist/esm/sas/DataLakeSASSignatureValues.d.ts +205 -0
  474. package/dist/esm/sas/DataLakeSASSignatureValues.d.ts.map +1 -0
  475. package/dist/esm/sas/DataLakeSASSignatureValues.js +718 -0
  476. package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -0
  477. package/dist/esm/sas/DirectorySASPermissions.d.ts +69 -0
  478. package/dist/esm/sas/DirectorySASPermissions.d.ts.map +1 -0
  479. package/dist/esm/sas/DirectorySASPermissions.js +145 -0
  480. package/dist/esm/sas/DirectorySASPermissions.js.map +1 -0
  481. package/dist/esm/sas/FileSystemSASPermissions.d.ts +69 -0
  482. package/dist/esm/sas/FileSystemSASPermissions.d.ts.map +1 -0
  483. package/dist/esm/sas/FileSystemSASPermissions.js +145 -0
  484. package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -0
  485. package/dist/esm/sas/SASQueryParameters.d.ts +309 -0
  486. package/dist/esm/sas/SASQueryParameters.d.ts.map +1 -0
  487. package/dist/esm/sas/SASQueryParameters.js +248 -0
  488. package/dist/esm/sas/SASQueryParameters.js.map +1 -0
  489. package/dist/esm/sas/SasIPRange.d.ts +24 -0
  490. package/dist/esm/sas/SasIPRange.d.ts.map +1 -0
  491. package/dist/esm/sas/SasIPRange.js +13 -0
  492. package/dist/esm/sas/SasIPRange.js.map +1 -0
  493. package/dist/esm/transforms.d.ts +51 -0
  494. package/dist/esm/transforms.d.ts.map +1 -0
  495. package/dist/esm/transforms.js +337 -0
  496. package/dist/esm/transforms.js.map +1 -0
  497. package/dist/esm/utils/Batch.d.ts +68 -0
  498. package/dist/esm/utils/Batch.d.ts.map +1 -0
  499. package/dist/esm/utils/Batch.js.map +1 -0
  500. package/dist/esm/utils/BufferScheduler.d.ts +158 -0
  501. package/dist/esm/utils/BufferScheduler.d.ts.map +1 -0
  502. package/{dist-esm/storage-common/src → dist/esm/utils}/BufferScheduler.js +27 -15
  503. package/dist/esm/utils/BufferScheduler.js.map +1 -0
  504. package/dist/esm/utils/DataLakeAclChangeFailedError.d.ts +16 -0
  505. package/dist/esm/utils/DataLakeAclChangeFailedError.d.ts.map +1 -0
  506. package/dist/esm/utils/DataLakeAclChangeFailedError.js +13 -0
  507. package/dist/esm/utils/DataLakeAclChangeFailedError.js.map +1 -0
  508. package/dist/esm/utils/PathClientInternal.d.ts +24 -0
  509. package/dist/esm/utils/PathClientInternal.d.ts.map +1 -0
  510. package/dist/esm/utils/PathClientInternal.js +24 -0
  511. package/dist/esm/utils/PathClientInternal.js.map +1 -0
  512. package/dist/esm/utils/constants.d.ts +70 -0
  513. package/dist/esm/utils/constants.d.ts.map +1 -0
  514. package/{dist-esm/storage-blob/src → dist/esm}/utils/constants.js +85 -67
  515. package/dist/esm/utils/constants.js.map +1 -0
  516. package/dist/esm/utils/tracing.d.ts +6 -0
  517. package/dist/esm/utils/tracing.d.ts.map +1 -0
  518. package/{dist-esm/storage-blob/src → dist/esm}/utils/tracing.js +2 -2
  519. package/dist/esm/utils/tracing.js.map +1 -0
  520. package/dist/esm/utils/utils.common.d.ts +236 -0
  521. package/dist/esm/utils/utils.common.d.ts.map +1 -0
  522. package/{dist-esm/storage-blob/src → dist/esm}/utils/utils.common.js +105 -297
  523. package/dist/esm/utils/utils.common.js.map +1 -0
  524. package/dist/esm/utils/utils.d.ts +29 -0
  525. package/dist/esm/utils/utils.d.ts.map +1 -0
  526. package/{dist-esm/storage-file-datalake/src/utils/utils.node.js → dist/esm/utils/utils.js} +3 -3
  527. package/dist/esm/utils/utils.js.map +1 -0
  528. package/dist/react-native/DataLakeFileSystemClient.d.ts +473 -0
  529. package/dist/react-native/DataLakeFileSystemClient.d.ts.map +1 -0
  530. package/dist/react-native/DataLakeFileSystemClient.js +679 -0
  531. package/dist/react-native/DataLakeFileSystemClient.js.map +1 -0
  532. package/dist/react-native/DataLakeLeaseClient.d.ts +14 -0
  533. package/dist/react-native/DataLakeLeaseClient.d.ts.map +1 -0
  534. package/dist/react-native/DataLakeLeaseClient.js +45 -0
  535. package/dist/react-native/DataLakeLeaseClient.js.map +1 -0
  536. package/dist/react-native/DataLakeServiceClient.d.ts +281 -0
  537. package/dist/react-native/DataLakeServiceClient.d.ts.map +1 -0
  538. package/dist/react-native/DataLakeServiceClient.js +368 -0
  539. package/dist/react-native/DataLakeServiceClient.js.map +1 -0
  540. package/dist/react-native/Pipeline.d.ts +52 -0
  541. package/dist/react-native/Pipeline.d.ts.map +1 -0
  542. package/dist/react-native/Pipeline.js +216 -0
  543. package/dist/react-native/Pipeline.js.map +1 -0
  544. package/dist/react-native/StorageClient.d.ts +61 -0
  545. package/dist/react-native/StorageClient.d.ts.map +1 -0
  546. package/dist/react-native/StorageClient.js +51 -0
  547. package/dist/react-native/StorageClient.js.map +1 -0
  548. package/dist/react-native/StorageContextClient.d.ts +9 -0
  549. package/dist/react-native/StorageContextClient.d.ts.map +1 -0
  550. package/dist/react-native/StorageContextClient.js +35 -0
  551. package/dist/react-native/StorageContextClient.js.map +1 -0
  552. package/dist/react-native/clients.d.ts +689 -0
  553. package/dist/react-native/clients.d.ts.map +1 -0
  554. package/dist/react-native/clients.js +1189 -0
  555. package/dist/react-native/clients.js.map +1 -0
  556. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts +2 -0
  557. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts.map +1 -0
  558. package/dist/react-native/credentials/StorageSharedKeyCredential.js +4 -0
  559. package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +1 -0
  560. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +34 -0
  561. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts.map +1 -0
  562. package/dist/react-native/credentials/UserDelegationKeyCredential.js +31 -0
  563. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -0
  564. package/dist/react-native/generated/src/index.d.ts +4 -0
  565. package/dist/react-native/generated/src/index.d.ts.map +1 -0
  566. package/dist/react-native/generated/src/index.js +11 -0
  567. package/dist/react-native/generated/src/index.js.map +1 -0
  568. package/dist/react-native/generated/src/models/index.d.ts +1091 -0
  569. package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
  570. package/dist/react-native/generated/src/models/index.js +16 -0
  571. package/dist/react-native/generated/src/models/index.js.map +1 -0
  572. package/dist/react-native/generated/src/models/mappers.d.ts +53 -0
  573. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
  574. package/dist/react-native/generated/src/models/mappers.js +2446 -0
  575. package/dist/react-native/generated/src/models/mappers.js.map +1 -0
  576. package/dist/react-native/generated/src/models/parameters.d.ts +87 -0
  577. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
  578. package/dist/react-native/generated/src/models/parameters.js +948 -0
  579. package/dist/react-native/generated/src/models/parameters.js.map +1 -0
  580. package/dist/react-native/generated/src/operations/fileSystemOperations.d.ts +55 -0
  581. package/dist/react-native/generated/src/operations/fileSystemOperations.d.ts.map +1 -0
  582. package/dist/react-native/generated/src/operations/fileSystemOperations.js +231 -0
  583. package/dist/react-native/generated/src/operations/fileSystemOperations.js.map +1 -0
  584. package/dist/react-native/generated/src/operations/index.d.ts +4 -0
  585. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
  586. package/dist/react-native/generated/src/operations/index.js +11 -0
  587. package/dist/react-native/generated/src/operations/index.js.map +1 -0
  588. package/dist/react-native/generated/src/operations/pathOperations.d.ts +120 -0
  589. package/dist/react-native/generated/src/operations/pathOperations.d.ts.map +1 -0
  590. package/dist/react-native/generated/src/operations/pathOperations.js +591 -0
  591. package/dist/react-native/generated/src/operations/pathOperations.js.map +1 -0
  592. package/dist/react-native/generated/src/operations/service.d.ts +18 -0
  593. package/dist/react-native/generated/src/operations/service.d.ts.map +1 -0
  594. package/dist/react-native/generated/src/operations/service.js +58 -0
  595. package/dist/react-native/generated/src/operations/service.js.map +1 -0
  596. package/dist/react-native/generated/src/operationsInterfaces/fileSystemOperations.d.ts +47 -0
  597. package/dist/react-native/generated/src/operationsInterfaces/fileSystemOperations.d.ts.map +1 -0
  598. package/dist/react-native/generated/src/operationsInterfaces/fileSystemOperations.js +9 -0
  599. package/dist/react-native/generated/src/operationsInterfaces/fileSystemOperations.js.map +1 -0
  600. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +4 -0
  601. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  602. package/dist/react-native/generated/src/operationsInterfaces/index.js +11 -0
  603. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
  604. package/dist/react-native/generated/src/operationsInterfaces/pathOperations.d.ts +112 -0
  605. package/dist/react-native/generated/src/operationsInterfaces/pathOperations.d.ts.map +1 -0
  606. package/dist/react-native/generated/src/operationsInterfaces/pathOperations.js +9 -0
  607. package/dist/react-native/generated/src/operationsInterfaces/pathOperations.js.map +1 -0
  608. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts +10 -0
  609. package/dist/react-native/generated/src/operationsInterfaces/service.d.ts.map +1 -0
  610. package/dist/react-native/generated/src/operationsInterfaces/service.js +9 -0
  611. package/dist/react-native/generated/src/operationsInterfaces/service.js.map +1 -0
  612. package/dist/react-native/generated/src/storageClient.d.ts +20 -0
  613. package/dist/react-native/generated/src/storageClient.d.ts.map +1 -0
  614. package/dist/react-native/generated/src/storageClient.js +47 -0
  615. package/dist/react-native/generated/src/storageClient.js.map +1 -0
  616. package/dist/react-native/index.d.ts +23 -0
  617. package/dist/react-native/index.d.ts.map +1 -0
  618. package/dist/react-native/index.js +23 -0
  619. package/dist/react-native/index.js.map +1 -0
  620. package/dist/react-native/log.d.ts +5 -0
  621. package/dist/react-native/log.d.ts.map +1 -0
  622. package/dist/react-native/log.js +8 -0
  623. package/dist/react-native/log.js.map +1 -0
  624. package/dist/react-native/models.d.ts +1318 -0
  625. package/dist/react-native/models.d.ts.map +1 -0
  626. package/dist/react-native/models.internal.d.ts +2 -0
  627. package/dist/react-native/models.internal.d.ts.map +1 -0
  628. package/dist/react-native/models.internal.js +4 -0
  629. package/dist/react-native/models.internal.js.map +1 -0
  630. package/dist/react-native/models.js +53 -0
  631. package/dist/react-native/models.js.map +1 -0
  632. package/dist/react-native/package.json +3 -0
  633. package/dist/react-native/sas/AccountSASPermissions.d.ts +61 -0
  634. package/dist/react-native/sas/AccountSASPermissions.d.ts.map +1 -0
  635. package/dist/react-native/sas/AccountSASPermissions.js +128 -0
  636. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -0
  637. package/dist/react-native/sas/AccountSASResourceTypes.d.ts +38 -0
  638. package/dist/react-native/sas/AccountSASResourceTypes.d.ts.map +1 -0
  639. package/dist/react-native/sas/AccountSASResourceTypes.js +72 -0
  640. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -0
  641. package/dist/react-native/sas/AccountSASServices.d.ts +40 -0
  642. package/dist/react-native/sas/AccountSASServices.d.ts.map +1 -0
  643. package/dist/react-native/sas/AccountSASServices.js +80 -0
  644. package/dist/react-native/sas/AccountSASServices.js.map +1 -0
  645. package/dist/react-native/sas/AccountSASSignatureValues.d.ts +78 -0
  646. package/dist/react-native/sas/AccountSASSignatureValues.d.ts.map +1 -0
  647. package/dist/react-native/sas/AccountSASSignatureValues.js +72 -0
  648. package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -0
  649. package/dist/react-native/sas/DataLakeSASPermissions.d.ts +65 -0
  650. package/dist/react-native/sas/DataLakeSASPermissions.d.ts.map +1 -0
  651. package/dist/react-native/sas/DataLakeSASPermissions.js +135 -0
  652. package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -0
  653. package/dist/react-native/sas/DataLakeSASSignatureValues.d.ts +205 -0
  654. package/dist/react-native/sas/DataLakeSASSignatureValues.d.ts.map +1 -0
  655. package/dist/react-native/sas/DataLakeSASSignatureValues.js +718 -0
  656. package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -0
  657. package/dist/react-native/sas/DirectorySASPermissions.d.ts +69 -0
  658. package/dist/react-native/sas/DirectorySASPermissions.d.ts.map +1 -0
  659. package/dist/react-native/sas/DirectorySASPermissions.js +145 -0
  660. package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -0
  661. package/dist/react-native/sas/FileSystemSASPermissions.d.ts +69 -0
  662. package/dist/react-native/sas/FileSystemSASPermissions.d.ts.map +1 -0
  663. package/dist/react-native/sas/FileSystemSASPermissions.js +145 -0
  664. package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -0
  665. package/dist/react-native/sas/SASQueryParameters.d.ts +309 -0
  666. package/dist/react-native/sas/SASQueryParameters.d.ts.map +1 -0
  667. package/dist/react-native/sas/SASQueryParameters.js +248 -0
  668. package/dist/react-native/sas/SASQueryParameters.js.map +1 -0
  669. package/dist/react-native/sas/SasIPRange.d.ts +24 -0
  670. package/dist/react-native/sas/SasIPRange.d.ts.map +1 -0
  671. package/dist/react-native/sas/SasIPRange.js +13 -0
  672. package/dist/react-native/sas/SasIPRange.js.map +1 -0
  673. package/dist/react-native/transforms.d.ts +51 -0
  674. package/dist/react-native/transforms.d.ts.map +1 -0
  675. package/dist/react-native/transforms.js +337 -0
  676. package/dist/react-native/transforms.js.map +1 -0
  677. package/dist/react-native/utils/Batch.d.ts +68 -0
  678. package/dist/react-native/utils/Batch.d.ts.map +1 -0
  679. package/dist/react-native/utils/Batch.js +122 -0
  680. package/dist/react-native/utils/Batch.js.map +1 -0
  681. package/dist/react-native/utils/BufferScheduler.d.ts +158 -0
  682. package/dist/react-native/utils/BufferScheduler.d.ts.map +1 -0
  683. package/dist/react-native/utils/BufferScheduler.js +264 -0
  684. package/dist/react-native/utils/BufferScheduler.js.map +1 -0
  685. package/dist/react-native/utils/DataLakeAclChangeFailedError.d.ts +16 -0
  686. package/dist/react-native/utils/DataLakeAclChangeFailedError.d.ts.map +1 -0
  687. package/dist/react-native/utils/DataLakeAclChangeFailedError.js +13 -0
  688. package/dist/react-native/utils/DataLakeAclChangeFailedError.js.map +1 -0
  689. package/dist/react-native/utils/PathClientInternal.d.ts +24 -0
  690. package/dist/react-native/utils/PathClientInternal.d.ts.map +1 -0
  691. package/dist/react-native/utils/PathClientInternal.js +24 -0
  692. package/dist/react-native/utils/PathClientInternal.js.map +1 -0
  693. package/dist/react-native/utils/constants.d.ts +70 -0
  694. package/dist/react-native/utils/constants.d.ts.map +1 -0
  695. package/dist/react-native/utils/constants.js +244 -0
  696. package/dist/react-native/utils/constants.js.map +1 -0
  697. package/dist/react-native/utils/tracing.d.ts +6 -0
  698. package/dist/react-native/utils/tracing.d.ts.map +1 -0
  699. package/dist/react-native/utils/tracing.js +14 -0
  700. package/dist/react-native/utils/tracing.js.map +1 -0
  701. package/dist/react-native/utils/utils.common.d.ts +236 -0
  702. package/dist/react-native/utils/utils.common.d.ts.map +1 -0
  703. package/dist/react-native/utils/utils.common.js +564 -0
  704. package/dist/react-native/utils/utils.common.js.map +1 -0
  705. package/dist/react-native/utils/utils.d.ts +29 -0
  706. package/dist/react-native/utils/utils.d.ts.map +1 -0
  707. package/{dist-esm/storage-blob/src/utils/utils.node.js → dist/react-native/utils/utils.js} +4 -51
  708. package/dist/react-native/utils/utils.js.map +1 -0
  709. package/package.json +70 -83
  710. package/dist/index.js +0 -9735
  711. package/dist/index.js.map +0 -1
  712. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js +0 -19
  713. package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +0 -1
  714. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js +0 -26
  715. package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +0 -1
  716. package/dist-esm/storage-blob/src/log.js.map +0 -1
  717. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js +0 -20
  718. package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +0 -1
  719. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js +0 -29
  720. package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +0 -1
  721. package/dist-esm/storage-blob/src/policies/RequestPolicy.js +0 -40
  722. package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +0 -1
  723. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +0 -47
  724. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +0 -1
  725. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +0 -31
  726. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +0 -1
  727. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js +0 -18
  728. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.browser.js.map +0 -1
  729. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js +0 -27
  730. package/dist-esm/storage-blob/src/policies/StorageCorrectContentLengthPolicy.js.map +0 -1
  731. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +0 -229
  732. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +0 -1
  733. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +0 -180
  734. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +0 -1
  735. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +0 -141
  736. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +0 -1
  737. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +0 -18
  738. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +0 -1
  739. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +0 -132
  740. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +0 -1
  741. package/dist-esm/storage-blob/src/utils/Batch.js.map +0 -1
  742. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js +0 -111
  743. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +0 -1
  744. package/dist-esm/storage-blob/src/utils/Mutex.js +0 -65
  745. package/dist-esm/storage-blob/src/utils/Mutex.js.map +0 -1
  746. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +0 -119
  747. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +0 -1
  748. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js +0 -73
  749. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js.map +0 -1
  750. package/dist-esm/storage-blob/src/utils/cache.js +0 -11
  751. package/dist-esm/storage-blob/src/utils/cache.js.map +0 -1
  752. package/dist-esm/storage-blob/src/utils/constants.js.map +0 -1
  753. package/dist-esm/storage-blob/src/utils/tracing.js.map +0 -1
  754. package/dist-esm/storage-blob/src/utils/utils.common.js.map +0 -1
  755. package/dist-esm/storage-blob/src/utils/utils.node.js.map +0 -1
  756. package/dist-esm/storage-common/src/BufferScheduler.browser.js +0 -8
  757. package/dist-esm/storage-common/src/BufferScheduler.browser.js.map +0 -1
  758. package/dist-esm/storage-common/src/BufferScheduler.js.map +0 -1
  759. package/dist-esm/storage-common/src/BuffersStream.js +0 -83
  760. package/dist-esm/storage-common/src/BuffersStream.js.map +0 -1
  761. package/dist-esm/storage-common/src/PooledBuffer.js +0 -87
  762. package/dist-esm/storage-common/src/PooledBuffer.js.map +0 -1
  763. package/dist-esm/storage-common/src/index.browser.js +0 -4
  764. package/dist-esm/storage-common/src/index.browser.js.map +0 -1
  765. package/dist-esm/storage-common/src/index.js +0 -4
  766. package/dist-esm/storage-common/src/index.js.map +0 -1
  767. package/dist-esm/storage-file-datalake/src/DataLakeFileSystemClient.js.map +0 -1
  768. package/dist-esm/storage-file-datalake/src/DataLakeLeaseClient.js.map +0 -1
  769. package/dist-esm/storage-file-datalake/src/DataLakeServiceClient.js.map +0 -1
  770. package/dist-esm/storage-file-datalake/src/Pipeline.js.map +0 -1
  771. package/dist-esm/storage-file-datalake/src/StorageClient.js.map +0 -1
  772. package/dist-esm/storage-file-datalake/src/StorageContextClient.js.map +0 -1
  773. package/dist-esm/storage-file-datalake/src/clients.js.map +0 -1
  774. package/dist-esm/storage-file-datalake/src/credentials/StorageSharedKeyCredential.browser.js.map +0 -1
  775. package/dist-esm/storage-file-datalake/src/credentials/StorageSharedKeyCredential.js.map +0 -1
  776. package/dist-esm/storage-file-datalake/src/credentials/UserDelegationKeyCredential.browser.js.map +0 -1
  777. package/dist-esm/storage-file-datalake/src/credentials/UserDelegationKeyCredential.js.map +0 -1
  778. package/dist-esm/storage-file-datalake/src/generated/src/index.js.map +0 -1
  779. package/dist-esm/storage-file-datalake/src/generated/src/models/index.js.map +0 -1
  780. package/dist-esm/storage-file-datalake/src/generated/src/models/mappers.js.map +0 -1
  781. package/dist-esm/storage-file-datalake/src/generated/src/models/parameters.js.map +0 -1
  782. package/dist-esm/storage-file-datalake/src/generated/src/operations/fileSystemOperations.js.map +0 -1
  783. package/dist-esm/storage-file-datalake/src/generated/src/operations/index.js.map +0 -1
  784. package/dist-esm/storage-file-datalake/src/generated/src/operations/pathOperations.js.map +0 -1
  785. package/dist-esm/storage-file-datalake/src/generated/src/operations/service.js.map +0 -1
  786. package/dist-esm/storage-file-datalake/src/generated/src/operationsInterfaces/fileSystemOperations.js.map +0 -1
  787. package/dist-esm/storage-file-datalake/src/generated/src/operationsInterfaces/index.js.map +0 -1
  788. package/dist-esm/storage-file-datalake/src/generated/src/operationsInterfaces/pathOperations.js.map +0 -1
  789. package/dist-esm/storage-file-datalake/src/generated/src/operationsInterfaces/service.js.map +0 -1
  790. package/dist-esm/storage-file-datalake/src/generated/src/storageClient.js.map +0 -1
  791. package/dist-esm/storage-file-datalake/src/index.browser.js.map +0 -1
  792. package/dist-esm/storage-file-datalake/src/index.js +0 -23
  793. package/dist-esm/storage-file-datalake/src/index.js.map +0 -1
  794. package/dist-esm/storage-file-datalake/src/log.js.map +0 -1
  795. package/dist-esm/storage-file-datalake/src/models.internal.js.map +0 -1
  796. package/dist-esm/storage-file-datalake/src/models.js.map +0 -1
  797. package/dist-esm/storage-file-datalake/src/sas/AccountSASPermissions.js.map +0 -1
  798. package/dist-esm/storage-file-datalake/src/sas/AccountSASResourceTypes.js.map +0 -1
  799. package/dist-esm/storage-file-datalake/src/sas/AccountSASServices.js.map +0 -1
  800. package/dist-esm/storage-file-datalake/src/sas/AccountSASSignatureValues.js.map +0 -1
  801. package/dist-esm/storage-file-datalake/src/sas/DataLakeSASPermissions.js.map +0 -1
  802. package/dist-esm/storage-file-datalake/src/sas/DataLakeSASSignatureValues.js.map +0 -1
  803. package/dist-esm/storage-file-datalake/src/sas/DirectorySASPermissions.js.map +0 -1
  804. package/dist-esm/storage-file-datalake/src/sas/FileSystemSASPermissions.js.map +0 -1
  805. package/dist-esm/storage-file-datalake/src/sas/SASQueryParameters.js.map +0 -1
  806. package/dist-esm/storage-file-datalake/src/sas/SasIPRange.js.map +0 -1
  807. package/dist-esm/storage-file-datalake/src/transforms.js.map +0 -1
  808. package/dist-esm/storage-file-datalake/src/utils/Batch.js.map +0 -1
  809. package/dist-esm/storage-file-datalake/src/utils/BufferScheduler.js.map +0 -1
  810. package/dist-esm/storage-file-datalake/src/utils/DataLakeAclChangeFailedError.js.map +0 -1
  811. package/dist-esm/storage-file-datalake/src/utils/PathClientInternal.js.map +0 -1
  812. package/dist-esm/storage-file-datalake/src/utils/constants.js.map +0 -1
  813. package/dist-esm/storage-file-datalake/src/utils/tracing.js.map +0 -1
  814. package/dist-esm/storage-file-datalake/src/utils/utils.browser.js +0 -39
  815. package/dist-esm/storage-file-datalake/src/utils/utils.browser.js.map +0 -1
  816. package/dist-esm/storage-file-datalake/src/utils/utils.common.js.map +0 -1
  817. package/dist-esm/storage-file-datalake/src/utils/utils.node.js.map +0 -1
  818. package/types/latest/storage-file-datalake.d.ts +0 -5102
  819. /package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/models/index.js +0 -0
  820. /package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/models/mappers.js +0 -0
  821. /package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operationsInterfaces/fileSystemOperations.js +0 -0
  822. /package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operationsInterfaces/pathOperations.js +0 -0
  823. /package/{dist-esm/storage-file-datalake/src → dist/browser}/generated/src/operationsInterfaces/service.js +0 -0
  824. /package/{dist-esm/storage-file-datalake/src → dist/browser}/log.js +0 -0
  825. /package/{dist-esm/storage-file-datalake/src → dist/browser}/models.internal.js +0 -0
  826. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/AccountSASPermissions.js +0 -0
  827. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/AccountSASResourceTypes.js +0 -0
  828. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/AccountSASServices.js +0 -0
  829. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/DataLakeSASPermissions.js +0 -0
  830. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/DirectorySASPermissions.js +0 -0
  831. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/FileSystemSASPermissions.js +0 -0
  832. /package/{dist-esm/storage-file-datalake/src → dist/browser}/sas/SasIPRange.js +0 -0
  833. /package/{dist-esm/storage-blob/src → dist/browser}/utils/Batch.js +0 -0
  834. /package/{dist-esm/storage-file-datalake/src → dist/browser}/utils/DataLakeAclChangeFailedError.js +0 -0
  835. /package/{dist-esm/storage-file-datalake/src → dist/esm}/credentials/StorageSharedKeyCredential.js +0 -0
  836. /package/{dist-esm/storage-file-datalake/src → dist/esm}/utils/Batch.js +0 -0
@@ -0,0 +1,1195 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DataLakeFileClient = exports.DataLakeDirectoryClient = exports.DataLakePathClient = void 0;
6
+ const core_auth_1 = require("@azure/core-auth");
7
+ const core_util_1 = require("@azure/core-util");
8
+ const Pipeline_js_1 = require("./Pipeline.js");
9
+ const storage_blob_1 = require("@azure/storage-blob");
10
+ const storage_blob_2 = require("@azure/storage-blob");
11
+ const StorageSharedKeyCredential_js_1 = require("./credentials/StorageSharedKeyCredential.js");
12
+ const storage_common_1 = require("@azure/storage-common");
13
+ const DataLakeLeaseClient_js_1 = require("./DataLakeLeaseClient.js");
14
+ const index_js_1 = require("./generated/src/operations/index.js");
15
+ const DataLakeSASSignatureValues_js_1 = require("./sas/DataLakeSASSignatureValues.js");
16
+ const StorageClient_js_1 = require("./StorageClient.js");
17
+ const transforms_js_1 = require("./transforms.js");
18
+ const Batch_js_1 = require("./utils/Batch.js");
19
+ const constants_js_1 = require("./utils/constants.js");
20
+ const DataLakeAclChangeFailedError_js_1 = require("./utils/DataLakeAclChangeFailedError.js");
21
+ const tracing_js_1 = require("./utils/tracing.js");
22
+ const utils_common_js_1 = require("./utils/utils.common.js");
23
+ const utils_js_1 = require("./utils/utils.js");
24
+ /**
25
+ * A DataLakePathClient represents a URL to the Azure Storage path (directory or file).
26
+ */
27
+ class DataLakePathClient extends StorageClient_js_1.StorageClient {
28
+ /**
29
+ * SetAccessControlRecursiveInternal operation sets the Access Control on a path and sub paths.
30
+ *
31
+ * @param mode - Mode \"set\" sets POSIX access control rights on files and directories,
32
+ * Mode \"modify\" modifies one or more POSIX access control rights that pre-exist on files and directories,
33
+ * Mode \"remove\" removes one or more POSIX access control rights that were present earlier on files and directories.
34
+ * @param acl - The POSIX access control list for the file or directory.
35
+ * @param options - Optional. Options
36
+ */
37
+ async setAccessControlRecursiveInternal(mode, acl, options = {}) {
38
+ if (options.maxBatches !== undefined && options.maxBatches < 1) {
39
+ throw RangeError(`Options maxBatches must be larger than 0.`);
40
+ }
41
+ if (options.batchSize !== undefined && options.batchSize < 1) {
42
+ throw RangeError(`Options batchSize must be larger than 0.`);
43
+ }
44
+ const result = {
45
+ counters: {
46
+ failedChangesCount: 0,
47
+ changedDirectoriesCount: 0,
48
+ changedFilesCount: 0,
49
+ },
50
+ continuationToken: undefined,
51
+ };
52
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setAccessControlRecursiveInternal", options, async (updatedOptions) => {
53
+ var _a, _b, _c, _d, _e, _f;
54
+ let continuationToken = options.continuationToken;
55
+ let batchCounter = 0;
56
+ let reachMaxBatches = false;
57
+ do {
58
+ let response;
59
+ try {
60
+ response = await this.pathContext.setAccessControlRecursive(mode, Object.assign(Object.assign({}, updatedOptions), { acl: (0, transforms_js_1.toAclString)(acl), maxRecords: options.batchSize, continuation: continuationToken, forceFlag: options.continueOnFailure }));
61
+ }
62
+ catch (e) {
63
+ throw new DataLakeAclChangeFailedError_js_1.DataLakeAclChangeFailedError(e, continuationToken);
64
+ }
65
+ batchCounter++;
66
+ continuationToken = response.continuation;
67
+ // Update result
68
+ result.continuationToken = continuationToken;
69
+ result.counters.failedChangesCount += (_a = response.failureCount) !== null && _a !== void 0 ? _a : 0;
70
+ result.counters.changedDirectoriesCount += (_b = response.directoriesSuccessful) !== null && _b !== void 0 ? _b : 0;
71
+ result.counters.changedFilesCount += (_c = response.filesSuccessful) !== null && _c !== void 0 ? _c : 0;
72
+ // Progress event call back
73
+ if (options.onProgress) {
74
+ const progress = {
75
+ batchFailures: (0, transforms_js_1.toAccessControlChangeFailureArray)(response.failedEntries),
76
+ batchCounters: {
77
+ failedChangesCount: (_d = response.failureCount) !== null && _d !== void 0 ? _d : 0,
78
+ changedDirectoriesCount: (_e = response.directoriesSuccessful) !== null && _e !== void 0 ? _e : 0,
79
+ changedFilesCount: (_f = response.filesSuccessful) !== null && _f !== void 0 ? _f : 0,
80
+ },
81
+ aggregateCounters: result.counters,
82
+ continuationToken: continuationToken,
83
+ };
84
+ options.onProgress(progress);
85
+ }
86
+ reachMaxBatches =
87
+ options.maxBatches === undefined ? false : batchCounter >= options.maxBatches;
88
+ } while (continuationToken && !reachMaxBatches);
89
+ return result;
90
+ });
91
+ }
92
+ constructor(url, credentialOrPipeline,
93
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
94
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
95
+ options) {
96
+ if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
97
+ super(url, credentialOrPipeline);
98
+ }
99
+ else {
100
+ let credential;
101
+ if (credentialOrPipeline === undefined) {
102
+ credential = new storage_blob_2.AnonymousCredential();
103
+ }
104
+ else {
105
+ credential = credentialOrPipeline;
106
+ }
107
+ const pipeline = (0, Pipeline_js_1.newPipeline)(credential, options);
108
+ super(url, pipeline);
109
+ }
110
+ this.pathContext = new index_js_1.PathOperationsImpl(this.storageClientContext);
111
+ this.blobClient = new storage_blob_1.BlobClient(this.blobEndpointUrl, this.pipeline);
112
+ }
113
+ /**
114
+ * Name of current file system.
115
+ *
116
+ * @readonly
117
+ */
118
+ get fileSystemName() {
119
+ return this.blobClient.containerName;
120
+ }
121
+ /**
122
+ * Name of current path (directory or file).
123
+ *
124
+ * @readonly
125
+ */
126
+ get name() {
127
+ return this.blobClient.name;
128
+ }
129
+ /**
130
+ * Convert current DataLakePathClient to DataLakeDirectoryClient if current path is a directory.
131
+ *
132
+ */
133
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
134
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
135
+ toDirectoryClient() {
136
+ return new DataLakeDirectoryClient(this.dfsEndpointUrl, this.pipeline);
137
+ }
138
+ /**
139
+ * Convert current DataLakePathClient to DataLakeFileClient if current path is a file.
140
+ *
141
+ */
142
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
143
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
144
+ toFileClient() {
145
+ return new DataLakeFileClient(this.dfsEndpointUrl, this.pipeline);
146
+ }
147
+ /**
148
+ * Get a {@link DataLakeLeaseClient} that manages leases on the path (directory or file).
149
+ *
150
+ * @param proposeLeaseId - Optional. Initial proposed lease Id.
151
+ */
152
+ getDataLakeLeaseClient(proposeLeaseId) {
153
+ return new DataLakeLeaseClient_js_1.DataLakeLeaseClient(this.blobClient.getBlobLeaseClient(proposeLeaseId));
154
+ }
155
+ /**
156
+ * Create a directory or path.
157
+ *
158
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
159
+ *
160
+ * @param resourceType - Resource type, "directory" or "file".
161
+ * @param options - Optional. Options when creating path.
162
+ */
163
+ async create(resourceType, options = {}) {
164
+ options.conditions = options.conditions || {};
165
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-create", options, async (updatedOptions) => {
166
+ (0, utils_common_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
167
+ let expiryOptions;
168
+ let expiresOn;
169
+ if (typeof options.expiresOn === "number" && Number.isFinite(options.expiresOn)) {
170
+ expiryOptions = "RelativeToNow";
171
+ expiresOn = String(Math.round(options.expiresOn));
172
+ }
173
+ else if (options.expiresOn instanceof Date) {
174
+ expiryOptions = "Absolute";
175
+ expiresOn = options.expiresOn.toUTCString();
176
+ }
177
+ else if (options.expiresOn) {
178
+ throw new Error(`Value for expiresOn is invalid: ${options.expiresOn}`);
179
+ }
180
+ return (0, utils_common_js_1.assertResponse)(await this.pathContext.create(Object.assign(Object.assign({}, updatedOptions), { resource: resourceType, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, properties: (0, transforms_js_1.toProperties)(options.metadata), cpkInfo: options.customerProvidedKey, acl: options.acl ? (0, transforms_js_1.toAclString)(options.acl) : undefined, expiryOptions,
181
+ expiresOn })));
182
+ });
183
+ }
184
+ /**
185
+ * Create a directory or file. If the resource already exists, it is not changed.
186
+ *
187
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
188
+ *
189
+ * @param resourceType - Resource type, "directory" or "file".
190
+ * @param options -
191
+ */
192
+ async createIfNotExists(resourceType, options = {}) {
193
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-createIfNotExists", options, async (updatedOptions) => {
194
+ var _a, _b;
195
+ try {
196
+ const conditions = { ifNoneMatch: constants_js_1.ETagAny };
197
+ const res = await this.create(resourceType, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }));
198
+ return Object.assign({ succeeded: true }, res);
199
+ }
200
+ catch (e) {
201
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "PathAlreadyExists") {
202
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
203
+ }
204
+ throw e;
205
+ }
206
+ });
207
+ }
208
+ /**
209
+ * Returns true if the Data Lake file represented by this client exists; false otherwise.
210
+ *
211
+ * NOTE: use this function with care since an existing file might be deleted by other clients or
212
+ * applications. Vice versa new files might be added by other clients or applications after this
213
+ * function completes.
214
+ *
215
+ * @param options - options to Exists operation.
216
+ */
217
+ async exists(options = {}) {
218
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-exists", options, async (updatedOptions) => {
219
+ return this.blobClient.exists(Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(updatedOptions.customerProvidedKey) }));
220
+ });
221
+ }
222
+ /**
223
+ * Delete current path (directory or file).
224
+ *
225
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete
226
+ *
227
+ * @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
228
+ * @param options - Optional. Options when deleting path.
229
+ */
230
+ async delete(recursive, options = {}) {
231
+ options.conditions = options.conditions || {};
232
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-delete", options, async (updatedOptions) => {
233
+ if (this.isTokenCredential === undefined) {
234
+ this.isTokenCredential = false;
235
+ this.pipeline.factories.forEach((factory) => {
236
+ if ((0, core_auth_1.isTokenCredential)(factory.credential)) {
237
+ this.isTokenCredential = true;
238
+ }
239
+ });
240
+ if ((0, core_auth_1.isTokenCredential)(this.pipeline._credential)) {
241
+ this.isTokenCredential = true;
242
+ }
243
+ }
244
+ const paginated = recursive === true && this.isTokenCredential === true;
245
+ let continuation;
246
+ let response;
247
+ // How to handle long delete loop?
248
+ do {
249
+ response = (0, utils_common_js_1.assertResponse)(await this.pathContext.delete(Object.assign(Object.assign({}, updatedOptions), { continuation,
250
+ recursive, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, abortSignal: options.abortSignal, paginated })));
251
+ continuation = response.continuation;
252
+ } while (continuation);
253
+ return response;
254
+ });
255
+ }
256
+ /**
257
+ * Delete current path (directory or file) if it exists.
258
+ *
259
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete
260
+ *
261
+ * @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
262
+ * @param options -
263
+ */
264
+ async deleteIfExists(recursive, options = {}) {
265
+ options.conditions = options.conditions || {};
266
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-deleteIfExists", options, async (updatedOptions) => {
267
+ var _a, _b;
268
+ try {
269
+ const res = await this.delete(recursive, updatedOptions);
270
+ return Object.assign({ succeeded: true }, res);
271
+ }
272
+ catch (e) {
273
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "PathNotFound") {
274
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
275
+ }
276
+ throw e;
277
+ }
278
+ });
279
+ }
280
+ /**
281
+ * Returns the access control data for a path (directory of file).
282
+ *
283
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/getproperties
284
+ *
285
+ * @param options - Optional. Options when getting file access control.
286
+ */
287
+ async getAccessControl(options = {}) {
288
+ options.conditions = options.conditions || {};
289
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-getAccessControl", options, async (updatedOptions) => {
290
+ const response = (0, utils_common_js_1.assertResponse)(await this.pathContext.getProperties(Object.assign(Object.assign({}, updatedOptions), { action: "getAccessControl", upn: options.userPrincipalName, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, abortSignal: options.abortSignal })));
291
+ return Object.assign(Object.assign({}, response), { _response: response._response, permissions: (0, transforms_js_1.toPermissions)(response.permissions), acl: (0, transforms_js_1.toAcl)(response.acl) });
292
+ });
293
+ }
294
+ /**
295
+ * Set the access control data for a path (directory of file).
296
+ *
297
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
298
+ *
299
+ * @param acl - The POSIX access control list for the file or directory.
300
+ * @param options - Optional. Options when setting path access control.
301
+ */
302
+ async setAccessControl(acl, options = {}) {
303
+ options.conditions = options.conditions || {};
304
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setAccessControl", options, async (updatedOptions) => {
305
+ return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl(Object.assign(Object.assign({}, updatedOptions), { acl: (0, transforms_js_1.toAclString)(acl), leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions })));
306
+ });
307
+ }
308
+ /**
309
+ * Sets the Access Control on a path and sub paths.
310
+ *
311
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
312
+ *
313
+ * @param acl - The POSIX access control list for the file or directory.
314
+ * @param options - Optional. Options
315
+ */
316
+ async setAccessControlRecursive(acl, options = {}) {
317
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setAccessControlRecursive", options, async (updatedOptions) => {
318
+ return this.setAccessControlRecursiveInternal("set", acl, updatedOptions);
319
+ });
320
+ }
321
+ /**
322
+ * Modifies the Access Control on a path and sub paths.
323
+ *
324
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
325
+ *
326
+ * @param acl - The POSIX access control list for the file or directory.
327
+ * @param options - Optional. Options
328
+ */
329
+ async updateAccessControlRecursive(acl, options = {}) {
330
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-updateAccessControlRecursive", options, async (updatedOptions) => {
331
+ return this.setAccessControlRecursiveInternal("modify", acl, updatedOptions);
332
+ });
333
+ }
334
+ /**
335
+ * Removes the Access Control on a path and sub paths.
336
+ *
337
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
338
+ *
339
+ * @param acl - The POSIX access control list for the file or directory.
340
+ * @param options - Optional. Options
341
+ */
342
+ async removeAccessControlRecursive(acl, options = {}) {
343
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-removeAccessControlRecursive", options, async (updatedOptions) => {
344
+ return this.setAccessControlRecursiveInternal("remove", acl, updatedOptions);
345
+ });
346
+ }
347
+ /**
348
+ * Sets the file permissions on a path.
349
+ *
350
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
351
+ *
352
+ * @param permissions - The POSIX access permissions for the file owner, the file owning group, and others.
353
+ * @param options - Optional. Options when setting path permissions.
354
+ */
355
+ async setPermissions(permissions, options = {}) {
356
+ options.conditions = options.conditions || {};
357
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setPermissions", options, async (updatedOptions) => {
358
+ return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl(Object.assign(Object.assign({}, updatedOptions), { permissions: (0, transforms_js_1.toPermissionsString)(permissions), leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions })));
359
+ });
360
+ }
361
+ /**
362
+ * Returns all user-defined metadata, standard HTTP properties, and system properties
363
+ * for the path (directory or file).
364
+ *
365
+ * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
366
+ * they originally contained uppercase characters. This differs from the metadata keys returned by
367
+ * the methods of {@link DataLakeFileSystemClient} that list paths using the `includeMetadata` option, which
368
+ * will retain their original casing.
369
+ *
370
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob-properties
371
+ *
372
+ * @param options - Optional. Options when getting path properties.
373
+ */
374
+ async getProperties(options = {}) {
375
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-getProperties", options, async (updatedOptions) => {
376
+ const response = await this.blobClient.getProperties(Object.assign(Object.assign({}, options), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
377
+ return (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(response);
378
+ });
379
+ }
380
+ /**
381
+ * Sets system properties on the path (directory or file).
382
+ *
383
+ * If no value provided, or no value provided for the specified blob HTTP headers,
384
+ * these blob HTTP headers without a value will be cleared.
385
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
386
+ *
387
+ * @param httpHeaders -
388
+ * @param options -
389
+ */
390
+ async setHttpHeaders(httpHeaders, options = {}) {
391
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setHttpHeaders", options, async (updatedOptions) => {
392
+ return this.blobClient.setHTTPHeaders({
393
+ blobCacheControl: httpHeaders.cacheControl,
394
+ blobContentType: httpHeaders.contentType,
395
+ blobContentMD5: httpHeaders.contentMD5,
396
+ blobContentEncoding: httpHeaders.contentEncoding,
397
+ blobContentLanguage: httpHeaders.contentLanguage,
398
+ blobContentDisposition: httpHeaders.contentDisposition,
399
+ }, updatedOptions);
400
+ });
401
+ }
402
+ /**
403
+ * Sets user-defined metadata for the specified path (directory of file) as one or more name-value pairs.
404
+ *
405
+ * If no option provided, or no metadata defined in the parameter, the path
406
+ * metadata will be removed.
407
+ *
408
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata
409
+ *
410
+ * @param metadata - Optional. Replace existing metadata with this value.
411
+ * If no value provided the existing metadata will be removed.
412
+ * @param options - Optional. Options when setting path metadata.
413
+ */
414
+ async setMetadata(metadata, options = {}) {
415
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setMetadata", options, async (updatedOptions) => {
416
+ return this.blobClient.setMetadata(metadata, Object.assign(Object.assign({}, options), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
417
+ });
418
+ }
419
+ async move(destinationPathOrFileSystem, destinationPathOrOptions, options) {
420
+ let destinationFileSystem = this.fileSystemName;
421
+ let destinationPath = destinationPathOrFileSystem;
422
+ let pathMoveOptions;
423
+ if (typeof destinationPathOrOptions === "string") {
424
+ destinationFileSystem = destinationPathOrFileSystem;
425
+ destinationPath = destinationPathOrOptions;
426
+ pathMoveOptions = options !== null && options !== void 0 ? options : {};
427
+ }
428
+ else {
429
+ pathMoveOptions = destinationPathOrOptions !== null && destinationPathOrOptions !== void 0 ? destinationPathOrOptions : {};
430
+ }
431
+ const renameSource = (0, utils_common_js_1.getURLPathAndQuery)(this.dfsEndpointUrl);
432
+ const split = destinationPath.split("?");
433
+ let destinationUrl;
434
+ if (split.length === 2) {
435
+ const renameDestination = `/${destinationFileSystem}/${split[0]}`;
436
+ destinationUrl = (0, utils_common_js_1.setURLPath)(this.dfsEndpointUrl, renameDestination);
437
+ destinationUrl = (0, utils_common_js_1.setURLQueries)(destinationUrl, split[1]);
438
+ }
439
+ else if (split.length === 1) {
440
+ const renameDestination = `/${destinationFileSystem}/${destinationPath}`;
441
+ destinationUrl = (0, utils_common_js_1.setURLPath)(this.dfsEndpointUrl, renameDestination);
442
+ }
443
+ else {
444
+ throw new RangeError("Destination path should not contain more than one query string");
445
+ }
446
+ const destPathClient = new DataLakePathClient(destinationUrl, this.pipeline);
447
+ return tracing_js_1.tracingClient.withSpan("DataLakePathClient-move", pathMoveOptions, async (updatedOptions) => {
448
+ var _a, _b, _c, _d, _e;
449
+ return (0, utils_common_js_1.assertResponse)(await destPathClient.pathContext.create(Object.assign(Object.assign({}, updatedOptions), { mode: "legacy", // By default
450
+ renameSource, sourceLeaseId: (_a = pathMoveOptions.conditions) === null || _a === void 0 ? void 0 : _a.leaseId, leaseAccessConditions: pathMoveOptions.destinationConditions, sourceModifiedAccessConditions: {
451
+ sourceIfMatch: (_b = pathMoveOptions.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
452
+ sourceIfNoneMatch: (_c = pathMoveOptions.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,
453
+ sourceIfModifiedSince: (_d = pathMoveOptions.conditions) === null || _d === void 0 ? void 0 : _d.ifModifiedSince,
454
+ sourceIfUnmodifiedSince: (_e = pathMoveOptions.conditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
455
+ }, modifiedAccessConditions: pathMoveOptions.destinationConditions, abortSignal: pathMoveOptions.abortSignal })));
456
+ });
457
+ }
458
+ }
459
+ exports.DataLakePathClient = DataLakePathClient;
460
+ /**
461
+ * A DataLakeDirectoryClient represents a URL to the Azure Storage directory.
462
+ */
463
+ class DataLakeDirectoryClient extends DataLakePathClient {
464
+ async create(resourceTypeOrOptions, options = {}) {
465
+ if (resourceTypeOrOptions === "file") {
466
+ throw TypeError(`DataLakeDirectoryClient:create() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeFileClient for file creation.`);
467
+ }
468
+ let pathCreateOptions;
469
+ if (resourceTypeOrOptions === "directory") {
470
+ pathCreateOptions = options;
471
+ }
472
+ else {
473
+ pathCreateOptions = resourceTypeOrOptions !== null && resourceTypeOrOptions !== void 0 ? resourceTypeOrOptions : {};
474
+ }
475
+ return tracing_js_1.tracingClient.withSpan("DataLakeDirectoryClient-create", pathCreateOptions, async (updatedOptions) => {
476
+ return super.create("directory", updatedOptions);
477
+ });
478
+ }
479
+ async createIfNotExists(resourceTypeOrOptions, options = {}) {
480
+ if (resourceTypeOrOptions === "file") {
481
+ throw TypeError(`DataLakeDirectoryClient:createIfNotExists() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeFileClient for file creation.`);
482
+ }
483
+ if (resourceTypeOrOptions !== "directory") {
484
+ options = resourceTypeOrOptions || {};
485
+ }
486
+ return tracing_js_1.tracingClient.withSpan("DataLakeDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
487
+ return super.createIfNotExists("directory", Object.assign({}, updatedOptions));
488
+ });
489
+ }
490
+ /**
491
+ * Creates a {@link DataLakeDirectoryClient} object under current directory.
492
+ *
493
+ * @param subdirectoryName - Subdirectory name.
494
+ */
495
+ getSubdirectoryClient(subdirectoryName) {
496
+ return new DataLakeDirectoryClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(subdirectoryName)), this.pipeline);
497
+ }
498
+ /**
499
+ * Creates a {@link DataLakeFileClient} object under current directory.
500
+ *
501
+ * @param fileName -
502
+ */
503
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
504
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
505
+ getFileClient(fileName) {
506
+ return new DataLakeFileClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(fileName)), this.pipeline);
507
+ }
508
+ /**
509
+ * Only available for clients constructed with a shared key credential.
510
+ *
511
+ * Generates a Service Shared Access Signature (SAS) URI based on the client properties
512
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
513
+ *
514
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
515
+ *
516
+ * @param options - Optional parameters.
517
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
518
+ */
519
+ generateSasUrl(options) {
520
+ return new Promise((resolve) => {
521
+ if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
522
+ throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
523
+ }
524
+ const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), this.credential).toString();
525
+ resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
526
+ });
527
+ }
528
+ /**
529
+ * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
530
+ * and parameters passed in.
531
+ *
532
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
533
+ *
534
+ * @param options - Optional parameters.
535
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
536
+ */
537
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
538
+ generateSasStringToSign(options) {
539
+ if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
540
+ throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
541
+ }
542
+ return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), this.credential).stringToSign;
543
+ }
544
+ /**
545
+ * Generates a Service Shared Access Signature (SAS) URI based on the client properties
546
+ * and parameters passed in. The SAS is signed by the input user delegation key.
547
+ *
548
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
549
+ *
550
+ * @param options - Optional parameters.
551
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
552
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
553
+ */
554
+ generateUserDelegationSasUrl(options, userDelegationKey) {
555
+ return new Promise((resolve) => {
556
+ const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), userDelegationKey, this.accountName).toString();
557
+ resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
558
+ });
559
+ }
560
+ /**
561
+ * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
562
+ * and parameters passed in The SAS is signed by the input user delegation key.
563
+ *
564
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
565
+ *
566
+ * @param options - Optional parameters.
567
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
568
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
569
+ */
570
+ generateUserDelegationSasStringToSign(options, userDelegationKey) {
571
+ return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), userDelegationKey, this.accountName).stringToSign;
572
+ }
573
+ }
574
+ exports.DataLakeDirectoryClient = DataLakeDirectoryClient;
575
+ /**
576
+ * A DataLakeFileClient represents a URL to the Azure Storage file.
577
+ */
578
+ class DataLakeFileClient extends DataLakePathClient {
579
+ constructor(url, credentialOrPipeline,
580
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
581
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
582
+ options) {
583
+ if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
584
+ super(url, credentialOrPipeline);
585
+ }
586
+ else {
587
+ let credential;
588
+ if (credentialOrPipeline === undefined) {
589
+ credential = new storage_blob_2.AnonymousCredential();
590
+ }
591
+ else {
592
+ credential = credentialOrPipeline;
593
+ }
594
+ const pipeline = (0, Pipeline_js_1.newPipeline)(credential, options);
595
+ super(url, pipeline);
596
+ }
597
+ this.pathContextInternal = new index_js_1.PathOperationsImpl(this.storageClientContext);
598
+ this.blockBlobClientInternal = new storage_blob_1.BlockBlobClient(this.blobEndpointUrl, this.pipeline);
599
+ this.pathContextInternalToBlobEndpoint = new index_js_1.PathOperationsImpl(this.storageClientContextToBlobEndpoint);
600
+ }
601
+ async create(resourceTypeOrOptions, options = {}) {
602
+ if (resourceTypeOrOptions === "directory") {
603
+ throw TypeError(`DataLakeFileClient:create() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeDirectoryClient for directory creation.`);
604
+ }
605
+ let pathCreateOptions;
606
+ if (resourceTypeOrOptions === "file") {
607
+ pathCreateOptions = options;
608
+ }
609
+ else {
610
+ pathCreateOptions = resourceTypeOrOptions !== null && resourceTypeOrOptions !== void 0 ? resourceTypeOrOptions : {};
611
+ }
612
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-create", pathCreateOptions, async (updatedOptions) => {
613
+ return super.create("file", updatedOptions);
614
+ });
615
+ }
616
+ async createIfNotExists(resourceTypeOrOptions, options = {}) {
617
+ if (resourceTypeOrOptions === "directory") {
618
+ throw TypeError(`DataLakeFileClient:createIfNotExists() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeDirectoryClient for directory creation.`);
619
+ }
620
+ if (resourceTypeOrOptions !== "file") {
621
+ options = resourceTypeOrOptions || {};
622
+ }
623
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-createIfNotExists", options, async (updatedOptions) => {
624
+ return super.createIfNotExists("file", updatedOptions);
625
+ });
626
+ }
627
+ /**
628
+ * Downloads a file from the service, including its metadata and properties.
629
+ *
630
+ * * In Node.js, data returns in a Readable stream readableStreamBody
631
+ * * In browsers, data returns in a promise contentAsBlob
632
+ *
633
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob
634
+ *
635
+ * * Example usage (Node.js):
636
+ *
637
+ * ```ts snippet:ReadmeSampleDownloadFile_Node
638
+ * import { DataLakeServiceClient } from "@azure/storage-file-datalake";
639
+ * import { DefaultAzureCredential } from "@azure/identity";
640
+ *
641
+ * const account = "<account>";
642
+ * const datalakeServiceClient = new DataLakeServiceClient(
643
+ * `https://${account}.dfs.core.windows.net`,
644
+ * new DefaultAzureCredential(),
645
+ * );
646
+ *
647
+ * const fileSystemName = "<file system name>";
648
+ * const fileName = "<file name>";
649
+ * const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
650
+ * const fileClient = fileSystemClient.getFileClient(fileName);
651
+ *
652
+ * // Get file content from position 0 to the end
653
+ * // In Node.js, get downloaded data by accessing downloadResponse.readableStreamBody
654
+ * const downloadResponse = await fileClient.read();
655
+ * if (downloadResponse.readableStreamBody) {
656
+ * const downloaded = await streamToBuffer(downloadResponse.readableStreamBody);
657
+ * console.log("Downloaded file content:", downloaded.toString());
658
+ * }
659
+ *
660
+ * // [Node.js only] A helper method used to read a Node.js readable stream into a Buffer.
661
+ * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise<Buffer> {
662
+ * return new Promise((resolve, reject) => {
663
+ * const chunks: Buffer[] = [];
664
+ * readableStream.on("data", (data) => {
665
+ * chunks.push(data instanceof Buffer ? data : Buffer.from(data));
666
+ * });
667
+ * readableStream.on("end", () => {
668
+ * resolve(Buffer.concat(chunks));
669
+ * });
670
+ * readableStream.on("error", reject);
671
+ * });
672
+ * }
673
+ * ```
674
+ *
675
+ * Example usage (browser):
676
+ *
677
+ * ```ts snippet:ReadmeSampleDownloadFile_Browser
678
+ * import { DataLakeServiceClient } from "@azure/storage-file-datalake";
679
+ *
680
+ * const account = "<account>";
681
+ * const sas = "<sas token>";
682
+ * const datalakeServiceClient = new DataLakeServiceClient(
683
+ * `https://${account}.dfs.core.windows.net${sas}`,
684
+ * );
685
+ *
686
+ * const fileSystemName = "<file system name>";
687
+ * const fileName = "<file name>";
688
+ * const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
689
+ * const fileClient = fileSystemClient.getFileClient(fileName);
690
+ *
691
+ * // Get file content from position 0 to the end
692
+ * // In browsers, get downloaded data by accessing downloadResponse.contentAsBlob
693
+ * const downloadResponse = await fileClient.read();
694
+ * if (downloadResponse.contentAsBlob) {
695
+ * const blob = await downloadResponse.contentAsBlob;
696
+ * const downloaded = await blob.text();
697
+ * console.log(`Downloaded file content ${downloaded}`);
698
+ * }
699
+ * ```
700
+ *
701
+ * @param offset - Optional. Offset to read file, default value is 0.
702
+ * @param count - Optional. How many bytes to read, default will read from offset to the end.
703
+ * @param options - Optional. Options when reading file.
704
+ */
705
+ async read(offset = 0, count, options = {}) {
706
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-read", options, async (updatedOptions) => {
707
+ const rawResponse = await this.blockBlobClientInternal.download(offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(updatedOptions.customerProvidedKey) }));
708
+ const response = (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(rawResponse);
709
+ if (!core_util_1.isNodeLike && !response.contentAsBlob) {
710
+ response.contentAsBlob = rawResponse.blobBody;
711
+ }
712
+ response.fileContentMD5 = rawResponse.blobContentMD5;
713
+ response._response.parsedHeaders.fileContentMD5 =
714
+ rawResponse._response.parsedHeaders.blobContentMD5;
715
+ delete rawResponse.blobContentMD5;
716
+ delete rawResponse._response.parsedHeaders.blobContentMD5;
717
+ return response;
718
+ });
719
+ }
720
+ /**
721
+ * Uploads data to be appended to a file. Data can only be appended to a file.
722
+ * To apply perviously uploaded data to a file, call flush.
723
+ *
724
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
725
+ *
726
+ * @param body - Content to be uploaded.
727
+ * @param offset - Append offset in bytes.
728
+ * @param length - Length of content to append in bytes.
729
+ * @param options - Optional. Options when appending data.
730
+ */
731
+ async append(body, offset, length, options = {}) {
732
+ options.conditions = options.conditions || {};
733
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-append", options, async (updatedOptions) => {
734
+ (0, utils_common_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
735
+ return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.appendData(body, Object.assign(Object.assign({}, updatedOptions), { pathHttpHeaders: {
736
+ contentMD5: options.transactionalContentMD5,
737
+ }, abortSignal: options.abortSignal, position: offset, contentLength: length, leaseAccessConditions: options.conditions, requestOptions: {
738
+ onUploadProgress: options.onProgress,
739
+ }, cpkInfo: options.customerProvidedKey, flush: options.flush, proposedLeaseId: options.proposedLeaseId, leaseDuration: options.leaseDurationInSeconds, leaseAction: options.leaseAction })));
740
+ });
741
+ }
742
+ /**
743
+ * Flushes (writes) previously appended data to a file.
744
+ *
745
+ * @param position - File position to flush.
746
+ * This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file.
747
+ * It is required when uploading data to be appended to the file and when flushing previously uploaded data to the file.
748
+ * The value must be the position where the data is to be appended. Uploaded data is not immediately flushed, or written,
749
+ * to the file. To flush, the previously uploaded data must be contiguous, the position parameter must be specified and
750
+ * equal to the length of the file after all data has been written, and there must not be a request entity body included
751
+ * with the request.
752
+ * @param options - Optional. Options when flushing data.
753
+ */
754
+ async flush(position, options = {}) {
755
+ options.conditions = options.conditions || {};
756
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-flush", options, async (updatedOptions) => {
757
+ (0, utils_common_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
758
+ return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.flushData(Object.assign(Object.assign({}, updatedOptions), { position, contentLength: 0, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, proposedLeaseId: options.proposedLeaseId, leaseDuration: options.leaseDurationInSeconds, leaseAction: options.leaseAction })));
759
+ });
760
+ }
761
+ // high level functions
762
+ /**
763
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
764
+ *
765
+ * Uploads a local file to a Data Lake file.
766
+ *
767
+ * @param filePath - Full path of the local file
768
+ * @param options -
769
+ */
770
+ async uploadFile(filePath,
771
+ // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
772
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
773
+ options = {}) {
774
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-uploadFile", options, async (updatedOptions) => {
775
+ const size = (await (0, utils_js_1.fsStat)(filePath)).size;
776
+ return this.uploadSeekableInternal((offset, contentSize) => {
777
+ return () => (0, utils_js_1.fsCreateReadStream)(filePath, {
778
+ autoClose: true,
779
+ end: offset + contentSize - 1,
780
+ start: offset,
781
+ });
782
+ }, size, updatedOptions);
783
+ });
784
+ }
785
+ /**
786
+ * Uploads a Buffer(Node.js)/Blob/ArrayBuffer/ArrayBufferView to a File.
787
+ *
788
+ * @param data - Buffer(Node), Blob, ArrayBuffer or ArrayBufferView
789
+ * @param options -
790
+ */
791
+ async upload(data, options = {}) {
792
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-upload", options, async (updatedOptions) => {
793
+ if (core_util_1.isNodeLike) {
794
+ let buffer;
795
+ if (data instanceof Buffer) {
796
+ buffer = data;
797
+ }
798
+ else if (data instanceof ArrayBuffer) {
799
+ buffer = Buffer.from(data);
800
+ }
801
+ else {
802
+ data = data;
803
+ buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
804
+ }
805
+ return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.length, updatedOptions);
806
+ }
807
+ else {
808
+ const browserBlob = new Blob([data]);
809
+ return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
810
+ }
811
+ });
812
+ }
813
+ async uploadSeekableInternal(bodyFactory, size, options = {}) {
814
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-uploadData", options, async (updatedOptions) => {
815
+ var _a;
816
+ if (size > constants_js_1.FILE_MAX_SIZE_BYTES) {
817
+ throw new RangeError(`size must be <= ${constants_js_1.FILE_MAX_SIZE_BYTES}.`);
818
+ }
819
+ // Create the file.
820
+ const createRes = this.create({
821
+ abortSignal: options.abortSignal,
822
+ metadata: options.metadata,
823
+ permissions: options.permissions,
824
+ umask: options.umask,
825
+ conditions: options.conditions,
826
+ pathHttpHeaders: options.pathHttpHeaders,
827
+ customerProvidedKey: updatedOptions.customerProvidedKey,
828
+ tracingOptions: updatedOptions.tracingOptions,
829
+ encryptionContext: updatedOptions.encryptionContext,
830
+ });
831
+ // append() with empty data would return error, so do not continue
832
+ if (size === 0) {
833
+ return createRes;
834
+ }
835
+ else {
836
+ await createRes;
837
+ }
838
+ // After the File is Create, Lease ID is the only valid request parameter.
839
+ options.conditions = { leaseId: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.leaseId };
840
+ if (!options.chunkSize) {
841
+ options.chunkSize = Math.ceil(size / constants_js_1.BLOCK_BLOB_MAX_BLOCKS);
842
+ if (options.chunkSize < constants_js_1.FILE_UPLOAD_DEFAULT_CHUNK_SIZE) {
843
+ options.chunkSize = constants_js_1.FILE_UPLOAD_DEFAULT_CHUNK_SIZE;
844
+ }
845
+ }
846
+ if (options.chunkSize < 1 || options.chunkSize > constants_js_1.FILE_UPLOAD_MAX_CHUNK_SIZE) {
847
+ throw new RangeError(`chunkSize option must be >= 1 and <= ${constants_js_1.FILE_UPLOAD_MAX_CHUNK_SIZE}`);
848
+ }
849
+ if (!options.maxConcurrency) {
850
+ options.maxConcurrency = constants_js_1.DEFAULT_HIGH_LEVEL_CONCURRENCY;
851
+ }
852
+ if (options.maxConcurrency <= 0) {
853
+ throw new RangeError(`maxConcurrency must be > 0.`);
854
+ }
855
+ if (!options.singleUploadThreshold) {
856
+ options.singleUploadThreshold = constants_js_1.FILE_MAX_SINGLE_UPLOAD_THRESHOLD;
857
+ }
858
+ if (options.singleUploadThreshold < 1 ||
859
+ options.singleUploadThreshold > constants_js_1.FILE_MAX_SINGLE_UPLOAD_THRESHOLD) {
860
+ throw new RangeError(`singleUploadThreshold option must be >= 1 and <= ${constants_js_1.FILE_MAX_SINGLE_UPLOAD_THRESHOLD}`);
861
+ }
862
+ // When buffer length <= singleUploadThreshold, this method will use one append/flush call to finish the upload.
863
+ if (size <= options.singleUploadThreshold) {
864
+ await this.append(bodyFactory(0, size), 0, size, {
865
+ abortSignal: options.abortSignal,
866
+ conditions: options.conditions,
867
+ customerProvidedKey: updatedOptions.customerProvidedKey,
868
+ onProgress: options.onProgress,
869
+ tracingOptions: updatedOptions.tracingOptions,
870
+ });
871
+ return this.flush(size, {
872
+ abortSignal: options.abortSignal,
873
+ conditions: options.conditions,
874
+ close: options.close,
875
+ pathHttpHeaders: options.pathHttpHeaders,
876
+ customerProvidedKey: updatedOptions.customerProvidedKey,
877
+ tracingOptions: updatedOptions.tracingOptions,
878
+ });
879
+ }
880
+ const numBlocks = Math.floor((size - 1) / options.chunkSize) + 1;
881
+ if (numBlocks > constants_js_1.BLOCK_BLOB_MAX_BLOCKS) {
882
+ throw new RangeError(`The data's size is too big or the chunkSize is too small;` +
883
+ `the number of chunks must be <= ${constants_js_1.BLOCK_BLOB_MAX_BLOCKS}`);
884
+ }
885
+ let transferProgress = 0;
886
+ const batch = new Batch_js_1.Batch(options.maxConcurrency);
887
+ for (let i = 0; i < numBlocks; i++) {
888
+ batch.addOperation(async () => {
889
+ const start = options.chunkSize * i;
890
+ const end = i === numBlocks - 1 ? size : start + options.chunkSize;
891
+ const contentLength = end - start;
892
+ await this.append(bodyFactory(start, contentLength), start, contentLength, {
893
+ abortSignal: options.abortSignal,
894
+ conditions: options.conditions,
895
+ customerProvidedKey: updatedOptions.customerProvidedKey,
896
+ tracingOptions: updatedOptions.tracingOptions,
897
+ });
898
+ transferProgress += contentLength;
899
+ if (options.onProgress) {
900
+ options.onProgress({ loadedBytes: transferProgress });
901
+ }
902
+ });
903
+ }
904
+ await batch.do();
905
+ return this.flush(size, {
906
+ abortSignal: options.abortSignal,
907
+ conditions: options.conditions,
908
+ close: options.close,
909
+ pathHttpHeaders: options.pathHttpHeaders,
910
+ customerProvidedKey: updatedOptions.customerProvidedKey,
911
+ tracingOptions: updatedOptions.tracingOptions,
912
+ });
913
+ });
914
+ }
915
+ /**
916
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
917
+ *
918
+ * Uploads a Node.js Readable stream into a Data Lake file.
919
+ * This method will try to create a file, then starts uploading chunk by chunk.
920
+ * Please make sure potential size of stream doesn't exceed FILE_MAX_SIZE_BYTES and
921
+ * potential number of chunks doesn't exceed BLOCK_BLOB_MAX_BLOCKS.
922
+ *
923
+ * PERFORMANCE IMPROVEMENT TIPS:
924
+ * * Input stream highWaterMark is better to set a same value with options.chunkSize
925
+ * parameter, which will avoid Buffer.concat() operations.
926
+ *
927
+ * @param stream - Node.js Readable stream.
928
+ * @param options -
929
+ */
930
+ async uploadStream(stream, options = {}) {
931
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-uploadStream", options, async (updatedOptions) => {
932
+ var _a;
933
+ // Create the file
934
+ await this.create({
935
+ abortSignal: options.abortSignal,
936
+ metadata: options.metadata,
937
+ permissions: options.permissions,
938
+ umask: options.umask,
939
+ conditions: options.conditions,
940
+ pathHttpHeaders: options.pathHttpHeaders,
941
+ customerProvidedKey: options.customerProvidedKey,
942
+ tracingOptions: updatedOptions.tracingOptions,
943
+ encryptionContext: updatedOptions.encryptionContext,
944
+ });
945
+ // After the File is Create, Lease ID is the only valid request parameter.
946
+ options.conditions = { leaseId: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.leaseId };
947
+ if (!options.chunkSize) {
948
+ options.chunkSize = constants_js_1.FILE_UPLOAD_DEFAULT_CHUNK_SIZE;
949
+ }
950
+ if (options.chunkSize < 1 || options.chunkSize > constants_js_1.FILE_UPLOAD_MAX_CHUNK_SIZE) {
951
+ throw new RangeError(`chunkSize option must be >= 1 and <= ${constants_js_1.FILE_UPLOAD_MAX_CHUNK_SIZE}`);
952
+ }
953
+ if (!options.maxConcurrency) {
954
+ options.maxConcurrency = constants_js_1.DEFAULT_HIGH_LEVEL_CONCURRENCY;
955
+ }
956
+ if (options.maxConcurrency <= 0) {
957
+ throw new RangeError(`maxConcurrency must be > 0.`);
958
+ }
959
+ let transferProgress = 0;
960
+ const scheduler = new storage_common_1.BufferScheduler(stream, options.chunkSize, options.maxConcurrency, async (body, length, offset) => {
961
+ await this.append(body, offset, length, {
962
+ abortSignal: options.abortSignal,
963
+ conditions: options.conditions,
964
+ customerProvidedKey: options.customerProvidedKey,
965
+ tracingOptions: updatedOptions.tracingOptions,
966
+ });
967
+ // Update progress after block is successfully uploaded to server, in case of block trying
968
+ transferProgress += length;
969
+ if (options.onProgress) {
970
+ options.onProgress({ loadedBytes: transferProgress });
971
+ }
972
+ },
973
+ // concurrency should set a smaller value than maxConcurrency, which is helpful to
974
+ // reduce the possibility when a outgoing handler waits for stream data, in
975
+ // this situation, outgoing handlers are blocked.
976
+ // Outgoing queue shouldn't be empty.
977
+ Math.ceil((options.maxConcurrency / 4) * 3));
978
+ await scheduler.do();
979
+ return this.flush(transferProgress, {
980
+ abortSignal: options.abortSignal,
981
+ conditions: options.conditions,
982
+ close: options.close,
983
+ pathHttpHeaders: options.pathHttpHeaders,
984
+ customerProvidedKey: options.customerProvidedKey,
985
+ tracingOptions: updatedOptions.tracingOptions,
986
+ });
987
+ });
988
+ }
989
+ async readToBuffer(bufferOrOffset, offsetOrCount, countOrOptions, optOptions = {}) {
990
+ let buffer = undefined;
991
+ let offset = 0;
992
+ let count = 0;
993
+ let options = optOptions;
994
+ if (bufferOrOffset instanceof Buffer) {
995
+ buffer = bufferOrOffset;
996
+ offset = offsetOrCount || 0;
997
+ count = typeof countOrOptions === "number" ? countOrOptions : 0;
998
+ }
999
+ else {
1000
+ offset = typeof bufferOrOffset === "number" ? bufferOrOffset : 0;
1001
+ count = typeof offsetOrCount === "number" ? offsetOrCount : 0;
1002
+ options = countOrOptions || {};
1003
+ }
1004
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-readToBuffer", options, async (updatedOptions) => {
1005
+ if (buffer) {
1006
+ return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
1007
+ }
1008
+ else {
1009
+ return this.blockBlobClientInternal.downloadToBuffer(offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
1010
+ }
1011
+ });
1012
+ }
1013
+ /**
1014
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
1015
+ *
1016
+ * Downloads a Data Lake file to a local file.
1017
+ * Fails if the the given file path already exits.
1018
+ * Offset and count are optional, pass 0 and undefined respectively to download the entire file.
1019
+ *
1020
+ * @param filePath -
1021
+ * @param offset - From which position of the file to download.
1022
+ * @param count - How much data to be downloaded. Will download to the end when passing undefined.
1023
+ * @param options - Options to read Data Lake file.
1024
+ * @returns The response data for file read operation,
1025
+ * but with readableStreamBody set to undefined since its
1026
+ * content is already read and written into a local file
1027
+ * at the specified path.
1028
+ */
1029
+ async readToFile(filePath, offset = 0, count, options = {}) {
1030
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-readToFile", options, async (updatedOptions) => {
1031
+ const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey) }));
1032
+ const response = (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(rawResposne);
1033
+ return response;
1034
+ });
1035
+ }
1036
+ /**
1037
+ * Quick query for a JSON or CSV formatted file.
1038
+ *
1039
+ * Example usage (Node.js):
1040
+ *
1041
+ * ```ts snippet:ReadmeSampleQueryFile_Node
1042
+ * import { DataLakeServiceClient } from "@azure/storage-file-datalake";
1043
+ *
1044
+ * const account = "<account>";
1045
+ * const sas = "<sas token>";
1046
+ * const datalakeServiceClient = new DataLakeServiceClient(
1047
+ * `https://${account}.dfs.core.windows.net${sas}`,
1048
+ * );
1049
+ *
1050
+ * const fileSystemName = "<file system name>";
1051
+ * const fileName = "<file name>";
1052
+ * const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
1053
+ * const fileClient = fileSystemClient.getFileClient(fileName);
1054
+ *
1055
+ * // Query and convert a file to a string
1056
+ * const queryResponse = await fileClient.query("select * from BlobStorage");
1057
+ * if (queryResponse.readableStreamBody) {
1058
+ * const responseBuffer = await streamToBuffer(queryResponse.readableStreamBody);
1059
+ * const downloaded = responseBuffer.toString();
1060
+ * console.log(`Query file content: ${downloaded}`);
1061
+ * }
1062
+ *
1063
+ * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise<Buffer> {
1064
+ * return new Promise((resolve, reject) => {
1065
+ * const chunks: Buffer[] = [];
1066
+ * readableStream.on("data", (data) => {
1067
+ * chunks.push(data instanceof Buffer ? data : Buffer.from(data));
1068
+ * });
1069
+ * readableStream.on("end", () => {
1070
+ * resolve(Buffer.concat(chunks));
1071
+ * });
1072
+ * readableStream.on("error", reject);
1073
+ * });
1074
+ * }
1075
+ * ```
1076
+ *
1077
+ * @param query -
1078
+ * @param options -
1079
+ */
1080
+ async query(query, options = {}) {
1081
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-query", options, async (updatedOptions) => {
1082
+ const rawResponse = await this.blockBlobClientInternal.query(query, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey) }));
1083
+ const response = rawResponse;
1084
+ if (!core_util_1.isNodeLike && !response.contentAsBlob) {
1085
+ response.contentAsBlob = rawResponse.blobBody;
1086
+ }
1087
+ response.fileContentMD5 = rawResponse.blobContentMD5;
1088
+ response._response.parsedHeaders.fileContentMD5 =
1089
+ rawResponse._response.parsedHeaders.blobContentMD5;
1090
+ delete rawResponse.blobContentMD5;
1091
+ delete rawResponse._response.parsedHeaders.blobContentMD5;
1092
+ return response;
1093
+ });
1094
+ }
1095
+ /**
1096
+ * Sets an expiry time on a file, once that time is met the file is deleted.
1097
+ *
1098
+ * @param mode -
1099
+ * @param options -
1100
+ */
1101
+ async setExpiry(mode, options = {}) {
1102
+ return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-setExpiry", options, async (updatedOptions) => {
1103
+ var _a;
1104
+ let expiresOn = undefined;
1105
+ if (mode === "RelativeToNow" || mode === "RelativeToCreation") {
1106
+ if (!options.timeToExpireInMs) {
1107
+ throw new Error(`Should specify options.timeToExpireInMs when using mode ${mode}.`);
1108
+ }
1109
+ // MINOR: need check against <= 2**64, but JS number has the precision problem.
1110
+ expiresOn = Math.round(options.timeToExpireInMs).toString();
1111
+ }
1112
+ if (mode === "Absolute") {
1113
+ if (!options.expiresOn) {
1114
+ throw new Error(`Should specify options.expiresOn when using mode ${mode}.`);
1115
+ }
1116
+ const now = new Date();
1117
+ if (!(options.expiresOn.getTime() > now.getTime())) {
1118
+ throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${(_a = options.expiresOn) === null || _a === void 0 ? void 0 : _a.toUTCString()}`);
1119
+ }
1120
+ expiresOn = options.expiresOn.toUTCString();
1121
+ }
1122
+ const adaptedOptions = Object.assign(Object.assign({}, options), { expiresOn });
1123
+ return (0, utils_common_js_1.assertResponse)(await this.pathContextInternalToBlobEndpoint.setExpiry(mode, Object.assign(Object.assign({}, adaptedOptions), { tracingOptions: updatedOptions.tracingOptions })));
1124
+ });
1125
+ }
1126
+ /**
1127
+ * Only available for clients constructed with a shared key credential.
1128
+ *
1129
+ * Generates a Service Shared Access Signature (SAS) URI based on the client properties
1130
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
1131
+ *
1132
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1133
+ *
1134
+ * @param options - Optional parameters.
1135
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1136
+ */
1137
+ generateSasUrl(options) {
1138
+ return new Promise((resolve) => {
1139
+ if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
1140
+ throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1141
+ }
1142
+ const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), this.credential).toString();
1143
+ resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
1144
+ });
1145
+ }
1146
+ /**
1147
+ * Only available for clients constructed with a shared key credential.
1148
+ *
1149
+ * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
1150
+ * and parameters passed in. The SAS is signed by the shared key credential of the client.
1151
+ *
1152
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1153
+ *
1154
+ * @param options - Optional parameters.
1155
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1156
+ */
1157
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
1158
+ generateSasStringToSign(options) {
1159
+ if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
1160
+ throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1161
+ }
1162
+ return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), this.credential).stringToSign;
1163
+ }
1164
+ /**
1165
+ * Generates a Service Shared Access Signature (SAS) URI based on the client properties
1166
+ * and parameters passed in. The SAS is signed by the input user delegation key.
1167
+ *
1168
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1169
+ *
1170
+ * @param options - Optional parameters.
1171
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1172
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1173
+ */
1174
+ generateUserDelegationSasUrl(options, userDelegationKey) {
1175
+ return new Promise((resolve) => {
1176
+ const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), userDelegationKey, this.accountName).toString();
1177
+ resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
1178
+ });
1179
+ }
1180
+ /**
1181
+ * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
1182
+ * and parameters passed in. The SAS is signed by the input user delegation key.
1183
+ *
1184
+ * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1185
+ *
1186
+ * @param options - Optional parameters.
1187
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1188
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1189
+ */
1190
+ generateUserDelegationSasStringToSign(options, userDelegationKey) {
1191
+ return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), userDelegationKey, this.accountName).stringToSign;
1192
+ }
1193
+ }
1194
+ exports.DataLakeFileClient = DataLakeFileClient;
1195
+ //# sourceMappingURL=clients.js.map