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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/dist/browser/DataLakeFileSystemClient.d.ts +13 -13
  2. package/dist/browser/DataLakeFileSystemClient.js +136 -93
  3. package/dist/browser/DataLakeFileSystemClient.js.map +1 -1
  4. package/dist/browser/DataLakeLeaseClient.js +1 -0
  5. package/dist/browser/DataLakeLeaseClient.js.map +1 -1
  6. package/dist/browser/DataLakeServiceClient.d.ts +6 -6
  7. package/dist/browser/DataLakeServiceClient.js +28 -11
  8. package/dist/browser/DataLakeServiceClient.js.map +1 -1
  9. package/dist/browser/Pipeline.js +24 -15
  10. package/dist/browser/Pipeline.js.map +1 -1
  11. package/dist/browser/StorageClient.js +43 -3
  12. package/dist/browser/StorageClient.js.map +1 -1
  13. package/dist/browser/StorageContextClient.js +2 -3
  14. package/dist/browser/StorageContextClient.js.map +1 -1
  15. package/dist/browser/clients.d.ts +33 -33
  16. package/dist/browser/clients.js +269 -89
  17. package/dist/browser/clients.js.map +1 -1
  18. package/dist/browser/generated/src/operations/fileSystemOperations.js +1 -0
  19. package/dist/browser/generated/src/operations/fileSystemOperations.js.map +1 -1
  20. package/dist/browser/generated/src/operations/pathOperations.js +1 -0
  21. package/dist/browser/generated/src/operations/pathOperations.js.map +1 -1
  22. package/dist/browser/generated/src/operations/service.js +1 -0
  23. package/dist/browser/generated/src/operations/service.js.map +1 -1
  24. package/dist/browser/generated/src/storageClient.js +15 -4
  25. package/dist/browser/generated/src/storageClient.js.map +1 -1
  26. package/dist/browser/index-browser.d.mts.map +1 -1
  27. package/dist/browser/index-browser.mjs.map +1 -1
  28. package/dist/browser/index.d.ts +1 -1
  29. package/dist/browser/index.js +1 -1
  30. package/dist/browser/models.d.ts +1 -1
  31. package/dist/browser/models.js.map +1 -1
  32. package/dist/browser/sas/AccountSASPermissions.d.ts +1 -1
  33. package/dist/browser/sas/AccountSASPermissions.js +34 -36
  34. package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
  35. package/dist/browser/sas/AccountSASResourceTypes.d.ts +1 -1
  36. package/dist/browser/sas/AccountSASResourceTypes.js +13 -15
  37. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
  38. package/dist/browser/sas/AccountSASServices.js +16 -18
  39. package/dist/browser/sas/AccountSASServices.js.map +1 -1
  40. package/dist/browser/sas/AccountSASSignatureValues.d.ts +3 -3
  41. package/dist/browser/sas/AccountSASSignatureValues.js +1 -1
  42. package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -1
  43. package/dist/browser/sas/DataLakeSASPermissions.js +39 -41
  44. package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -1
  45. package/dist/browser/sas/DataLakeSASSignatureValues.d.ts +1 -1
  46. package/dist/browser/sas/DataLakeSASSignatureValues.js +4 -3
  47. package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -1
  48. package/dist/browser/sas/DirectorySASPermissions.d.ts +1 -1
  49. package/dist/browser/sas/DirectorySASPermissions.js +44 -46
  50. package/dist/browser/sas/DirectorySASPermissions.js.map +1 -1
  51. package/dist/browser/sas/FileSystemSASPermissions.d.ts +1 -1
  52. package/dist/browser/sas/FileSystemSASPermissions.js +44 -46
  53. package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -1
  54. package/dist/browser/sas/SASQueryParameters.d.ts +2 -2
  55. package/dist/browser/sas/SASQueryParameters.js +131 -2
  56. package/dist/browser/sas/SASQueryParameters.js.map +1 -1
  57. package/dist/browser/transforms.js +8 -1
  58. package/dist/browser/transforms.js.map +1 -1
  59. package/dist/browser/utils/Batch.js +29 -21
  60. package/dist/browser/utils/Batch.js.map +1 -1
  61. package/dist/browser/utils/BufferScheduler.js +70 -44
  62. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  63. package/dist/browser/utils/DataLakeAclChangeFailedError.js +8 -0
  64. package/dist/browser/utils/DataLakeAclChangeFailedError.js.map +1 -1
  65. package/dist/browser/utils/PathClientInternal.js +4 -0
  66. package/dist/browser/utils/PathClientInternal.js.map +1 -1
  67. package/dist/browser/utils/constants.d.ts.map +1 -1
  68. package/dist/browser/utils/constants.js +1 -1
  69. package/dist/browser/utils/constants.js.map +1 -1
  70. package/dist/browser/utils/utils.common.d.ts +2 -2
  71. package/dist/browser/utils/utils.common.js +5 -7
  72. package/dist/browser/utils/utils.common.js.map +1 -1
  73. package/dist/commonjs/DataLakeFileSystemClient.d.ts +13 -13
  74. package/dist/commonjs/DataLakeFileSystemClient.js +136 -93
  75. package/dist/commonjs/DataLakeFileSystemClient.js.map +1 -1
  76. package/dist/commonjs/DataLakeLeaseClient.js +1 -0
  77. package/dist/commonjs/DataLakeLeaseClient.js.map +1 -1
  78. package/dist/commonjs/DataLakeServiceClient.d.ts +6 -6
  79. package/dist/commonjs/DataLakeServiceClient.js +28 -11
  80. package/dist/commonjs/DataLakeServiceClient.js.map +1 -1
  81. package/dist/commonjs/Pipeline.js +32 -23
  82. package/dist/commonjs/Pipeline.js.map +1 -1
  83. package/dist/commonjs/StorageClient.js +43 -3
  84. package/dist/commonjs/StorageClient.js.map +1 -1
  85. package/dist/commonjs/StorageContextClient.js +2 -3
  86. package/dist/commonjs/StorageContextClient.js.map +1 -1
  87. package/dist/commonjs/clients.d.ts +33 -33
  88. package/dist/commonjs/clients.js +269 -89
  89. package/dist/commonjs/clients.js.map +1 -1
  90. package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +1 -1
  91. package/dist/commonjs/credentials/UserDelegationKeyCredential.js +13 -1
  92. package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
  93. package/dist/commonjs/generated/src/operations/fileSystemOperations.js +1 -0
  94. package/dist/commonjs/generated/src/operations/fileSystemOperations.js.map +1 -1
  95. package/dist/commonjs/generated/src/operations/pathOperations.js +1 -0
  96. package/dist/commonjs/generated/src/operations/pathOperations.js.map +1 -1
  97. package/dist/commonjs/generated/src/operations/service.js +1 -0
  98. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  99. package/dist/commonjs/generated/src/storageClient.js +15 -4
  100. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  101. package/dist/commonjs/models.d.ts +1 -1
  102. package/dist/commonjs/models.js.map +1 -1
  103. package/dist/commonjs/sas/AccountSASPermissions.d.ts +1 -1
  104. package/dist/commonjs/sas/AccountSASPermissions.js +34 -36
  105. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
  106. package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +1 -1
  107. package/dist/commonjs/sas/AccountSASResourceTypes.js +13 -15
  108. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
  109. package/dist/commonjs/sas/AccountSASServices.js +16 -18
  110. package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
  111. package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +3 -3
  112. package/dist/commonjs/sas/AccountSASSignatureValues.js +1 -1
  113. package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -1
  114. package/dist/commonjs/sas/DataLakeSASPermissions.js +39 -41
  115. package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -1
  116. package/dist/commonjs/sas/DataLakeSASSignatureValues.d.ts +1 -1
  117. package/dist/commonjs/sas/DataLakeSASSignatureValues.js +4 -3
  118. package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -1
  119. package/dist/commonjs/sas/DirectorySASPermissions.d.ts +1 -1
  120. package/dist/commonjs/sas/DirectorySASPermissions.js +44 -46
  121. package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -1
  122. package/dist/commonjs/sas/FileSystemSASPermissions.d.ts +1 -1
  123. package/dist/commonjs/sas/FileSystemSASPermissions.js +44 -46
  124. package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -1
  125. package/dist/commonjs/sas/SASQueryParameters.d.ts +2 -2
  126. package/dist/commonjs/sas/SASQueryParameters.js +131 -2
  127. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
  128. package/dist/commonjs/transforms.js +8 -1
  129. package/dist/commonjs/transforms.js.map +1 -1
  130. package/dist/commonjs/tsdoc-metadata.json +11 -11
  131. package/dist/commonjs/utils/Batch.js +29 -21
  132. package/dist/commonjs/utils/Batch.js.map +1 -1
  133. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  134. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  135. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js +8 -0
  136. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js.map +1 -1
  137. package/dist/commonjs/utils/PathClientInternal.js +4 -0
  138. package/dist/commonjs/utils/PathClientInternal.js.map +1 -1
  139. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  140. package/dist/commonjs/utils/constants.js +1 -1
  141. package/dist/commonjs/utils/constants.js.map +1 -1
  142. package/dist/commonjs/utils/utils.common.d.ts +2 -2
  143. package/dist/commonjs/utils/utils.common.js +5 -7
  144. package/dist/commonjs/utils/utils.common.js.map +1 -1
  145. package/dist/commonjs/utils/utils.d.ts +1 -1
  146. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  147. package/dist/commonjs/utils/utils.js +4 -4
  148. package/dist/commonjs/utils/utils.js.map +1 -1
  149. package/dist/esm/DataLakeFileSystemClient.d.ts +13 -13
  150. package/dist/esm/DataLakeFileSystemClient.js +136 -93
  151. package/dist/esm/DataLakeFileSystemClient.js.map +1 -1
  152. package/dist/esm/DataLakeLeaseClient.js +1 -0
  153. package/dist/esm/DataLakeLeaseClient.js.map +1 -1
  154. package/dist/esm/DataLakeServiceClient.d.ts +6 -6
  155. package/dist/esm/DataLakeServiceClient.js +28 -11
  156. package/dist/esm/DataLakeServiceClient.js.map +1 -1
  157. package/dist/esm/Pipeline.js +24 -15
  158. package/dist/esm/Pipeline.js.map +1 -1
  159. package/dist/esm/StorageClient.js +43 -3
  160. package/dist/esm/StorageClient.js.map +1 -1
  161. package/dist/esm/StorageContextClient.js +2 -3
  162. package/dist/esm/StorageContextClient.js.map +1 -1
  163. package/dist/esm/clients.d.ts +33 -33
  164. package/dist/esm/clients.js +269 -89
  165. package/dist/esm/clients.js.map +1 -1
  166. package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +1 -1
  167. package/dist/esm/credentials/UserDelegationKeyCredential.js +13 -1
  168. package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
  169. package/dist/esm/generated/src/operations/fileSystemOperations.js +1 -0
  170. package/dist/esm/generated/src/operations/fileSystemOperations.js.map +1 -1
  171. package/dist/esm/generated/src/operations/pathOperations.js +1 -0
  172. package/dist/esm/generated/src/operations/pathOperations.js.map +1 -1
  173. package/dist/esm/generated/src/operations/service.js +1 -0
  174. package/dist/esm/generated/src/operations/service.js.map +1 -1
  175. package/dist/esm/generated/src/storageClient.js +15 -4
  176. package/dist/esm/generated/src/storageClient.js.map +1 -1
  177. package/dist/esm/models.d.ts +1 -1
  178. package/dist/esm/models.js.map +1 -1
  179. package/dist/esm/sas/AccountSASPermissions.d.ts +1 -1
  180. package/dist/esm/sas/AccountSASPermissions.js +34 -36
  181. package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
  182. package/dist/esm/sas/AccountSASResourceTypes.d.ts +1 -1
  183. package/dist/esm/sas/AccountSASResourceTypes.js +13 -15
  184. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
  185. package/dist/esm/sas/AccountSASServices.js +16 -18
  186. package/dist/esm/sas/AccountSASServices.js.map +1 -1
  187. package/dist/esm/sas/AccountSASSignatureValues.d.ts +3 -3
  188. package/dist/esm/sas/AccountSASSignatureValues.js +1 -1
  189. package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -1
  190. package/dist/esm/sas/DataLakeSASPermissions.js +39 -41
  191. package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -1
  192. package/dist/esm/sas/DataLakeSASSignatureValues.d.ts +1 -1
  193. package/dist/esm/sas/DataLakeSASSignatureValues.js +4 -3
  194. package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -1
  195. package/dist/esm/sas/DirectorySASPermissions.d.ts +1 -1
  196. package/dist/esm/sas/DirectorySASPermissions.js +44 -46
  197. package/dist/esm/sas/DirectorySASPermissions.js.map +1 -1
  198. package/dist/esm/sas/FileSystemSASPermissions.d.ts +1 -1
  199. package/dist/esm/sas/FileSystemSASPermissions.js +44 -46
  200. package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -1
  201. package/dist/esm/sas/SASQueryParameters.d.ts +2 -2
  202. package/dist/esm/sas/SASQueryParameters.js +131 -2
  203. package/dist/esm/sas/SASQueryParameters.js.map +1 -1
  204. package/dist/esm/transforms.js +8 -1
  205. package/dist/esm/transforms.js.map +1 -1
  206. package/dist/esm/utils/Batch.js +29 -21
  207. package/dist/esm/utils/Batch.js.map +1 -1
  208. package/dist/esm/utils/BufferScheduler.js +70 -44
  209. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  210. package/dist/esm/utils/DataLakeAclChangeFailedError.js +8 -0
  211. package/dist/esm/utils/DataLakeAclChangeFailedError.js.map +1 -1
  212. package/dist/esm/utils/PathClientInternal.js +4 -0
  213. package/dist/esm/utils/PathClientInternal.js.map +1 -1
  214. package/dist/esm/utils/constants.d.ts.map +1 -1
  215. package/dist/esm/utils/constants.js +1 -1
  216. package/dist/esm/utils/constants.js.map +1 -1
  217. package/dist/esm/utils/utils.common.d.ts +2 -2
  218. package/dist/esm/utils/utils.common.js +5 -7
  219. package/dist/esm/utils/utils.common.js.map +1 -1
  220. package/dist/esm/utils/utils.d.ts +1 -1
  221. package/dist/esm/utils/utils.d.ts.map +1 -1
  222. package/dist/esm/utils/utils.js +2 -2
  223. package/dist/esm/utils/utils.js.map +1 -1
  224. package/dist/react-native/DataLakeFileSystemClient.d.ts +13 -13
  225. package/dist/react-native/DataLakeFileSystemClient.js +136 -93
  226. package/dist/react-native/DataLakeFileSystemClient.js.map +1 -1
  227. package/dist/react-native/DataLakeLeaseClient.js +1 -0
  228. package/dist/react-native/DataLakeLeaseClient.js.map +1 -1
  229. package/dist/react-native/DataLakeServiceClient.d.ts +6 -6
  230. package/dist/react-native/DataLakeServiceClient.js +28 -11
  231. package/dist/react-native/DataLakeServiceClient.js.map +1 -1
  232. package/dist/react-native/Pipeline.js +24 -15
  233. package/dist/react-native/Pipeline.js.map +1 -1
  234. package/dist/react-native/StorageClient.js +43 -3
  235. package/dist/react-native/StorageClient.js.map +1 -1
  236. package/dist/react-native/StorageContextClient.js +2 -3
  237. package/dist/react-native/StorageContextClient.js.map +1 -1
  238. package/dist/react-native/clients.d.ts +33 -33
  239. package/dist/react-native/clients.js +269 -89
  240. package/dist/react-native/clients.js.map +1 -1
  241. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -1
  242. package/dist/react-native/credentials/UserDelegationKeyCredential.js +13 -1
  243. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
  244. package/dist/react-native/generated/src/operations/fileSystemOperations.js +1 -0
  245. package/dist/react-native/generated/src/operations/fileSystemOperations.js.map +1 -1
  246. package/dist/react-native/generated/src/operations/pathOperations.js +1 -0
  247. package/dist/react-native/generated/src/operations/pathOperations.js.map +1 -1
  248. package/dist/react-native/generated/src/operations/service.js +1 -0
  249. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  250. package/dist/react-native/generated/src/storageClient.js +15 -4
  251. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  252. package/dist/react-native/models.d.ts +1 -1
  253. package/dist/react-native/models.js.map +1 -1
  254. package/dist/react-native/sas/AccountSASPermissions.d.ts +1 -1
  255. package/dist/react-native/sas/AccountSASPermissions.js +34 -36
  256. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
  257. package/dist/react-native/sas/AccountSASResourceTypes.d.ts +1 -1
  258. package/dist/react-native/sas/AccountSASResourceTypes.js +13 -15
  259. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
  260. package/dist/react-native/sas/AccountSASServices.js +16 -18
  261. package/dist/react-native/sas/AccountSASServices.js.map +1 -1
  262. package/dist/react-native/sas/AccountSASSignatureValues.d.ts +3 -3
  263. package/dist/react-native/sas/AccountSASSignatureValues.js +1 -1
  264. package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -1
  265. package/dist/react-native/sas/DataLakeSASPermissions.js +39 -41
  266. package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -1
  267. package/dist/react-native/sas/DataLakeSASSignatureValues.d.ts +1 -1
  268. package/dist/react-native/sas/DataLakeSASSignatureValues.js +4 -3
  269. package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -1
  270. package/dist/react-native/sas/DirectorySASPermissions.d.ts +1 -1
  271. package/dist/react-native/sas/DirectorySASPermissions.js +44 -46
  272. package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -1
  273. package/dist/react-native/sas/FileSystemSASPermissions.d.ts +1 -1
  274. package/dist/react-native/sas/FileSystemSASPermissions.js +44 -46
  275. package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -1
  276. package/dist/react-native/sas/SASQueryParameters.d.ts +2 -2
  277. package/dist/react-native/sas/SASQueryParameters.js +131 -2
  278. package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
  279. package/dist/react-native/transforms.js +8 -1
  280. package/dist/react-native/transforms.js.map +1 -1
  281. package/dist/react-native/utils/Batch.js +29 -21
  282. package/dist/react-native/utils/Batch.js.map +1 -1
  283. package/dist/react-native/utils/BufferScheduler.js +70 -44
  284. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  285. package/dist/react-native/utils/DataLakeAclChangeFailedError.js +8 -0
  286. package/dist/react-native/utils/DataLakeAclChangeFailedError.js.map +1 -1
  287. package/dist/react-native/utils/PathClientInternal.js +4 -0
  288. package/dist/react-native/utils/PathClientInternal.js.map +1 -1
  289. package/dist/react-native/utils/constants.d.ts.map +1 -1
  290. package/dist/react-native/utils/constants.js +1 -1
  291. package/dist/react-native/utils/constants.js.map +1 -1
  292. package/dist/react-native/utils/utils.common.d.ts +2 -2
  293. package/dist/react-native/utils/utils.common.js +5 -7
  294. package/dist/react-native/utils/utils.common.js.map +1 -1
  295. package/dist/react-native/utils/utils.d.ts +1 -1
  296. package/dist/react-native/utils/utils.d.ts.map +1 -1
  297. package/dist/react-native/utils/utils.js +2 -2
  298. package/dist/react-native/utils/utils.js.map +1 -1
  299. package/package.json +8 -8
@@ -22,6 +22,15 @@ import { fsCreateReadStream, fsStat } from "./utils/utils.js";
22
22
  * A DataLakePathClient represents a URL to the Azure Storage path (directory or file).
23
23
  */
24
24
  export class DataLakePathClient extends StorageClient {
25
+ /**
26
+ * pathContext provided by protocol layer.
27
+ */
28
+ pathContext;
29
+ /**
30
+ * blobClient provided by `@azure/storage-blob` package.
31
+ */
32
+ blobClient;
33
+ isTokenCredential;
25
34
  /**
26
35
  * SetAccessControlRecursiveInternal operation sets the Access Control on a path and sub paths.
27
36
  *
@@ -47,14 +56,19 @@ export class DataLakePathClient extends StorageClient {
47
56
  continuationToken: undefined,
48
57
  };
49
58
  return tracingClient.withSpan("DataLakePathClient-setAccessControlRecursiveInternal", options, async (updatedOptions) => {
50
- var _a, _b, _c, _d, _e, _f;
51
59
  let continuationToken = options.continuationToken;
52
60
  let batchCounter = 0;
53
61
  let reachMaxBatches = false;
54
62
  do {
55
63
  let response;
56
64
  try {
57
- response = await this.pathContext.setAccessControlRecursive(mode, Object.assign(Object.assign({}, updatedOptions), { acl: toAclString(acl), maxRecords: options.batchSize, continuation: continuationToken, forceFlag: options.continueOnFailure }));
65
+ response = await this.pathContext.setAccessControlRecursive(mode, {
66
+ ...updatedOptions,
67
+ acl: toAclString(acl),
68
+ maxRecords: options.batchSize,
69
+ continuation: continuationToken,
70
+ forceFlag: options.continueOnFailure,
71
+ });
58
72
  }
59
73
  catch (e) {
60
74
  throw new DataLakeAclChangeFailedError(e, continuationToken);
@@ -63,17 +77,17 @@ export class DataLakePathClient extends StorageClient {
63
77
  continuationToken = response.continuation;
64
78
  // Update result
65
79
  result.continuationToken = continuationToken;
66
- result.counters.failedChangesCount += (_a = response.failureCount) !== null && _a !== void 0 ? _a : 0;
67
- result.counters.changedDirectoriesCount += (_b = response.directoriesSuccessful) !== null && _b !== void 0 ? _b : 0;
68
- result.counters.changedFilesCount += (_c = response.filesSuccessful) !== null && _c !== void 0 ? _c : 0;
80
+ result.counters.failedChangesCount += response.failureCount ?? 0;
81
+ result.counters.changedDirectoriesCount += response.directoriesSuccessful ?? 0;
82
+ result.counters.changedFilesCount += response.filesSuccessful ?? 0;
69
83
  // Progress event call back
70
84
  if (options.onProgress) {
71
85
  const progress = {
72
86
  batchFailures: toAccessControlChangeFailureArray(response.failedEntries),
73
87
  batchCounters: {
74
- failedChangesCount: (_d = response.failureCount) !== null && _d !== void 0 ? _d : 0,
75
- changedDirectoriesCount: (_e = response.directoriesSuccessful) !== null && _e !== void 0 ? _e : 0,
76
- changedFilesCount: (_f = response.filesSuccessful) !== null && _f !== void 0 ? _f : 0,
88
+ failedChangesCount: response.failureCount ?? 0,
89
+ changedDirectoriesCount: response.directoriesSuccessful ?? 0,
90
+ changedFilesCount: response.filesSuccessful ?? 0,
77
91
  },
78
92
  aggregateCounters: result.counters,
79
93
  continuationToken: continuationToken,
@@ -152,7 +166,7 @@ export class DataLakePathClient extends StorageClient {
152
166
  /**
153
167
  * Create a directory or path.
154
168
  *
155
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
169
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
156
170
  *
157
171
  * @param resourceType - Resource type, "directory" or "file".
158
172
  * @param options - Optional. Options when creating path.
@@ -174,29 +188,48 @@ export class DataLakePathClient extends StorageClient {
174
188
  else if (options.expiresOn) {
175
189
  throw new Error(`Value for expiresOn is invalid: ${options.expiresOn}`);
176
190
  }
177
- return assertResponse(await this.pathContext.create(Object.assign(Object.assign({}, updatedOptions), { resource: resourceType, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, properties: toProperties(options.metadata), cpkInfo: options.customerProvidedKey, acl: options.acl ? toAclString(options.acl) : undefined, expiryOptions,
178
- expiresOn })));
191
+ return assertResponse(await this.pathContext.create({
192
+ ...updatedOptions,
193
+ resource: resourceType,
194
+ leaseAccessConditions: options.conditions,
195
+ modifiedAccessConditions: options.conditions,
196
+ properties: toProperties(options.metadata),
197
+ cpkInfo: options.customerProvidedKey,
198
+ acl: options.acl ? toAclString(options.acl) : undefined,
199
+ expiryOptions,
200
+ expiresOn,
201
+ }));
179
202
  });
180
203
  }
181
204
  /**
182
205
  * Create a directory or file. If the resource already exists, it is not changed.
183
206
  *
184
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
207
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
185
208
  *
186
209
  * @param resourceType - Resource type, "directory" or "file".
187
210
  * @param options -
188
211
  */
189
212
  async createIfNotExists(resourceType, options = {}) {
190
213
  return tracingClient.withSpan("DataLakePathClient-createIfNotExists", options, async (updatedOptions) => {
191
- var _a, _b;
192
214
  try {
193
215
  const conditions = { ifNoneMatch: ETagAny };
194
- const res = await this.create(resourceType, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }));
195
- return Object.assign({ succeeded: true }, res);
216
+ const res = await this.create(resourceType, {
217
+ ...options,
218
+ conditions,
219
+ tracingOptions: updatedOptions.tracingOptions,
220
+ });
221
+ return {
222
+ succeeded: true,
223
+ ...res,
224
+ };
196
225
  }
197
226
  catch (e) {
198
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "PathAlreadyExists") {
199
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
227
+ if (e.details?.errorCode === "PathAlreadyExists") {
228
+ return {
229
+ succeeded: false,
230
+ ...e.response?.parsedHeaders,
231
+ _response: e.response,
232
+ };
200
233
  }
201
234
  throw e;
202
235
  }
@@ -213,13 +246,16 @@ export class DataLakePathClient extends StorageClient {
213
246
  */
214
247
  async exists(options = {}) {
215
248
  return tracingClient.withSpan("DataLakeFileClient-exists", options, async (updatedOptions) => {
216
- return this.blobClient.exists(Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey) }));
249
+ return this.blobClient.exists({
250
+ ...updatedOptions,
251
+ customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey),
252
+ });
217
253
  });
218
254
  }
219
255
  /**
220
256
  * Delete current path (directory or file).
221
257
  *
222
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete
258
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
223
259
  *
224
260
  * @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
225
261
  * @param options - Optional. Options when deleting path.
@@ -243,8 +279,15 @@ export class DataLakePathClient extends StorageClient {
243
279
  let response;
244
280
  // How to handle long delete loop?
245
281
  do {
246
- response = assertResponse(await this.pathContext.delete(Object.assign(Object.assign({}, updatedOptions), { continuation,
247
- recursive, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, abortSignal: options.abortSignal, paginated })));
282
+ response = assertResponse(await this.pathContext.delete({
283
+ ...updatedOptions,
284
+ continuation,
285
+ recursive,
286
+ leaseAccessConditions: options.conditions,
287
+ modifiedAccessConditions: options.conditions,
288
+ abortSignal: options.abortSignal,
289
+ paginated,
290
+ }));
248
291
  continuation = response.continuation;
249
292
  } while (continuation);
250
293
  return response;
@@ -253,7 +296,7 @@ export class DataLakePathClient extends StorageClient {
253
296
  /**
254
297
  * Delete current path (directory or file) if it exists.
255
298
  *
256
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete
299
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
257
300
  *
258
301
  * @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
259
302
  * @param options -
@@ -261,14 +304,20 @@ export class DataLakePathClient extends StorageClient {
261
304
  async deleteIfExists(recursive, options = {}) {
262
305
  options.conditions = options.conditions || {};
263
306
  return tracingClient.withSpan("DataLakePathClient-deleteIfExists", options, async (updatedOptions) => {
264
- var _a, _b;
265
307
  try {
266
308
  const res = await this.delete(recursive, updatedOptions);
267
- return Object.assign({ succeeded: true }, res);
309
+ return {
310
+ succeeded: true,
311
+ ...res,
312
+ };
268
313
  }
269
314
  catch (e) {
270
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "PathNotFound") {
271
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
315
+ if (e.details?.errorCode === "PathNotFound") {
316
+ return {
317
+ succeeded: false,
318
+ ...e.response?.parsedHeaders,
319
+ _response: e.response,
320
+ };
272
321
  }
273
322
  throw e;
274
323
  }
@@ -277,21 +326,33 @@ export class DataLakePathClient extends StorageClient {
277
326
  /**
278
327
  * Returns the access control data for a path (directory of file).
279
328
  *
280
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/getproperties
329
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/getproperties
281
330
  *
282
331
  * @param options - Optional. Options when getting file access control.
283
332
  */
284
333
  async getAccessControl(options = {}) {
285
334
  options.conditions = options.conditions || {};
286
335
  return tracingClient.withSpan("DataLakePathClient-getAccessControl", options, async (updatedOptions) => {
287
- const response = assertResponse(await this.pathContext.getProperties(Object.assign(Object.assign({}, updatedOptions), { action: "getAccessControl", upn: options.userPrincipalName, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, abortSignal: options.abortSignal })));
288
- return Object.assign(Object.assign({}, response), { _response: response._response, permissions: toPermissions(response.permissions), acl: toAcl(response.acl) });
336
+ const response = assertResponse(await this.pathContext.getProperties({
337
+ ...updatedOptions,
338
+ action: "getAccessControl",
339
+ upn: options.userPrincipalName,
340
+ leaseAccessConditions: options.conditions,
341
+ modifiedAccessConditions: options.conditions,
342
+ abortSignal: options.abortSignal,
343
+ }));
344
+ return {
345
+ ...response,
346
+ _response: response._response,
347
+ permissions: toPermissions(response.permissions),
348
+ acl: toAcl(response.acl),
349
+ };
289
350
  });
290
351
  }
291
352
  /**
292
353
  * Set the access control data for a path (directory of file).
293
354
  *
294
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
355
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
295
356
  *
296
357
  * @param acl - The POSIX access control list for the file or directory.
297
358
  * @param options - Optional. Options when setting path access control.
@@ -299,13 +360,18 @@ export class DataLakePathClient extends StorageClient {
299
360
  async setAccessControl(acl, options = {}) {
300
361
  options.conditions = options.conditions || {};
301
362
  return tracingClient.withSpan("DataLakePathClient-setAccessControl", options, async (updatedOptions) => {
302
- return assertResponse(await this.pathContext.setAccessControl(Object.assign(Object.assign({}, updatedOptions), { acl: toAclString(acl), leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions })));
363
+ return assertResponse(await this.pathContext.setAccessControl({
364
+ ...updatedOptions,
365
+ acl: toAclString(acl),
366
+ leaseAccessConditions: options.conditions,
367
+ modifiedAccessConditions: options.conditions,
368
+ }));
303
369
  });
304
370
  }
305
371
  /**
306
372
  * Sets the Access Control on a path and sub paths.
307
373
  *
308
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
374
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
309
375
  *
310
376
  * @param acl - The POSIX access control list for the file or directory.
311
377
  * @param options - Optional. Options
@@ -318,7 +384,7 @@ export class DataLakePathClient extends StorageClient {
318
384
  /**
319
385
  * Modifies the Access Control on a path and sub paths.
320
386
  *
321
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
387
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
322
388
  *
323
389
  * @param acl - The POSIX access control list for the file or directory.
324
390
  * @param options - Optional. Options
@@ -331,7 +397,7 @@ export class DataLakePathClient extends StorageClient {
331
397
  /**
332
398
  * Removes the Access Control on a path and sub paths.
333
399
  *
334
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
400
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
335
401
  *
336
402
  * @param acl - The POSIX access control list for the file or directory.
337
403
  * @param options - Optional. Options
@@ -344,7 +410,7 @@ export class DataLakePathClient extends StorageClient {
344
410
  /**
345
411
  * Sets the file permissions on a path.
346
412
  *
347
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
413
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
348
414
  *
349
415
  * @param permissions - The POSIX access permissions for the file owner, the file owning group, and others.
350
416
  * @param options - Optional. Options when setting path permissions.
@@ -352,7 +418,12 @@ export class DataLakePathClient extends StorageClient {
352
418
  async setPermissions(permissions, options = {}) {
353
419
  options.conditions = options.conditions || {};
354
420
  return tracingClient.withSpan("DataLakePathClient-setPermissions", options, async (updatedOptions) => {
355
- return assertResponse(await this.pathContext.setAccessControl(Object.assign(Object.assign({}, updatedOptions), { permissions: toPermissionsString(permissions), leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions })));
421
+ return assertResponse(await this.pathContext.setAccessControl({
422
+ ...updatedOptions,
423
+ permissions: toPermissionsString(permissions),
424
+ leaseAccessConditions: options.conditions,
425
+ modifiedAccessConditions: options.conditions,
426
+ }));
356
427
  });
357
428
  }
358
429
  /**
@@ -364,13 +435,17 @@ export class DataLakePathClient extends StorageClient {
364
435
  * the methods of {@link DataLakeFileSystemClient} that list paths using the `includeMetadata` option, which
365
436
  * will retain their original casing.
366
437
  *
367
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob-properties
438
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties
368
439
  *
369
440
  * @param options - Optional. Options when getting path properties.
370
441
  */
371
442
  async getProperties(options = {}) {
372
443
  return tracingClient.withSpan("DataLakePathClient-getProperties", options, async (updatedOptions) => {
373
- const response = await this.blobClient.getProperties(Object.assign(Object.assign({}, options), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
444
+ const response = await this.blobClient.getProperties({
445
+ ...options,
446
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
447
+ tracingOptions: updatedOptions.tracingOptions,
448
+ });
374
449
  return ParsePathGetPropertiesExtraHeaderValues(response);
375
450
  });
376
451
  }
@@ -379,7 +454,7 @@ export class DataLakePathClient extends StorageClient {
379
454
  *
380
455
  * If no value provided, or no value provided for the specified blob HTTP headers,
381
456
  * these blob HTTP headers without a value will be cleared.
382
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
457
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
383
458
  *
384
459
  * @param httpHeaders -
385
460
  * @param options -
@@ -402,7 +477,7 @@ export class DataLakePathClient extends StorageClient {
402
477
  * If no option provided, or no metadata defined in the parameter, the path
403
478
  * metadata will be removed.
404
479
  *
405
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata
480
+ * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata
406
481
  *
407
482
  * @param metadata - Optional. Replace existing metadata with this value.
408
483
  * If no value provided the existing metadata will be removed.
@@ -410,7 +485,11 @@ export class DataLakePathClient extends StorageClient {
410
485
  */
411
486
  async setMetadata(metadata, options = {}) {
412
487
  return tracingClient.withSpan("DataLakePathClient-setMetadata", options, async (updatedOptions) => {
413
- return this.blobClient.setMetadata(metadata, Object.assign(Object.assign({}, options), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
488
+ return this.blobClient.setMetadata(metadata, {
489
+ ...options,
490
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
491
+ tracingOptions: updatedOptions.tracingOptions,
492
+ });
414
493
  });
415
494
  }
416
495
  async move(destinationPathOrFileSystem, destinationPathOrOptions, options) {
@@ -420,10 +499,10 @@ export class DataLakePathClient extends StorageClient {
420
499
  if (typeof destinationPathOrOptions === "string") {
421
500
  destinationFileSystem = destinationPathOrFileSystem;
422
501
  destinationPath = destinationPathOrOptions;
423
- pathMoveOptions = options !== null && options !== void 0 ? options : {};
502
+ pathMoveOptions = options ?? {};
424
503
  }
425
504
  else {
426
- pathMoveOptions = destinationPathOrOptions !== null && destinationPathOrOptions !== void 0 ? destinationPathOrOptions : {};
505
+ pathMoveOptions = destinationPathOrOptions ?? {};
427
506
  }
428
507
  const renameSource = getURLPathAndQuery(this.dfsEndpointUrl);
429
508
  const split = destinationPath.split("?");
@@ -442,14 +521,21 @@ export class DataLakePathClient extends StorageClient {
442
521
  }
443
522
  const destPathClient = new DataLakePathClient(destinationUrl, this.pipeline);
444
523
  return tracingClient.withSpan("DataLakePathClient-move", pathMoveOptions, async (updatedOptions) => {
445
- var _a, _b, _c, _d, _e;
446
- return assertResponse(await destPathClient.pathContext.create(Object.assign(Object.assign({}, updatedOptions), { mode: "legacy", // By default
447
- renameSource, sourceLeaseId: (_a = pathMoveOptions.conditions) === null || _a === void 0 ? void 0 : _a.leaseId, leaseAccessConditions: pathMoveOptions.destinationConditions, sourceModifiedAccessConditions: {
448
- sourceIfMatch: (_b = pathMoveOptions.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch,
449
- sourceIfNoneMatch: (_c = pathMoveOptions.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,
450
- sourceIfModifiedSince: (_d = pathMoveOptions.conditions) === null || _d === void 0 ? void 0 : _d.ifModifiedSince,
451
- sourceIfUnmodifiedSince: (_e = pathMoveOptions.conditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince,
452
- }, modifiedAccessConditions: pathMoveOptions.destinationConditions, abortSignal: pathMoveOptions.abortSignal })));
524
+ return assertResponse(await destPathClient.pathContext.create({
525
+ ...updatedOptions,
526
+ mode: "legacy", // By default
527
+ renameSource,
528
+ sourceLeaseId: pathMoveOptions.conditions?.leaseId,
529
+ leaseAccessConditions: pathMoveOptions.destinationConditions,
530
+ sourceModifiedAccessConditions: {
531
+ sourceIfMatch: pathMoveOptions.conditions?.ifMatch,
532
+ sourceIfNoneMatch: pathMoveOptions.conditions?.ifNoneMatch,
533
+ sourceIfModifiedSince: pathMoveOptions.conditions?.ifModifiedSince,
534
+ sourceIfUnmodifiedSince: pathMoveOptions.conditions?.ifUnmodifiedSince,
535
+ },
536
+ modifiedAccessConditions: pathMoveOptions.destinationConditions,
537
+ abortSignal: pathMoveOptions.abortSignal,
538
+ }));
453
539
  });
454
540
  }
455
541
  }
@@ -466,7 +552,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
466
552
  pathCreateOptions = options;
467
553
  }
468
554
  else {
469
- pathCreateOptions = resourceTypeOrOptions !== null && resourceTypeOrOptions !== void 0 ? resourceTypeOrOptions : {};
555
+ pathCreateOptions = resourceTypeOrOptions ?? {};
470
556
  }
471
557
  return tracingClient.withSpan("DataLakeDirectoryClient-create", pathCreateOptions, async (updatedOptions) => {
472
558
  return super.create("directory", updatedOptions);
@@ -480,7 +566,9 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
480
566
  options = resourceTypeOrOptions || {};
481
567
  }
482
568
  return tracingClient.withSpan("DataLakeDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
483
- return super.createIfNotExists("directory", Object.assign({}, updatedOptions));
569
+ return super.createIfNotExists("directory", {
570
+ ...updatedOptions,
571
+ });
484
572
  });
485
573
  }
486
574
  /**
@@ -507,7 +595,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
507
595
  * Generates a Service Shared Access Signature (SAS) URI based on the client properties
508
596
  * and parameters passed in. The SAS is signed by the shared key credential of the client.
509
597
  *
510
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
598
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
511
599
  *
512
600
  * @param options - Optional parameters.
513
601
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
@@ -517,7 +605,12 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
517
605
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
518
606
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
519
607
  }
520
- const sas = generateDataLakeSASQueryParameters(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), this.credential).toString();
608
+ const sas = generateDataLakeSASQueryParameters({
609
+ fileSystemName: this.fileSystemName,
610
+ pathName: this.name,
611
+ isDirectory: true,
612
+ ...options,
613
+ }, this.credential).toString();
521
614
  resolve(appendToURLQuery(this.url, sas));
522
615
  });
523
616
  }
@@ -525,7 +618,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
525
618
  * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
526
619
  * and parameters passed in.
527
620
  *
528
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
621
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
529
622
  *
530
623
  * @param options - Optional parameters.
531
624
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
@@ -535,13 +628,18 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
535
628
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
536
629
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
537
630
  }
538
- return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), this.credential).stringToSign;
631
+ return generateDataLakeSASQueryParametersInternal({
632
+ fileSystemName: this.fileSystemName,
633
+ pathName: this.name,
634
+ isDirectory: true,
635
+ ...options,
636
+ }, this.credential).stringToSign;
539
637
  }
540
638
  /**
541
639
  * Generates a Service Shared Access Signature (SAS) URI based on the client properties
542
640
  * and parameters passed in. The SAS is signed by the input user delegation key.
543
641
  *
544
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
642
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
545
643
  *
546
644
  * @param options - Optional parameters.
547
645
  * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
@@ -549,7 +647,12 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
549
647
  */
550
648
  generateUserDelegationSasUrl(options, userDelegationKey) {
551
649
  return new Promise((resolve) => {
552
- const sas = generateDataLakeSASQueryParameters(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), userDelegationKey, this.accountName).toString();
650
+ const sas = generateDataLakeSASQueryParameters({
651
+ fileSystemName: this.fileSystemName,
652
+ pathName: this.name,
653
+ isDirectory: true,
654
+ ...options,
655
+ }, userDelegationKey, this.accountName).toString();
553
656
  resolve(appendToURLQuery(this.url, sas));
554
657
  });
555
658
  }
@@ -557,20 +660,37 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
557
660
  * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
558
661
  * and parameters passed in The SAS is signed by the input user delegation key.
559
662
  *
560
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
663
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
561
664
  *
562
665
  * @param options - Optional parameters.
563
666
  * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
564
667
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
565
668
  */
566
669
  generateUserDelegationSasStringToSign(options, userDelegationKey) {
567
- return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name, isDirectory: true }, options), userDelegationKey, this.accountName).stringToSign;
670
+ return generateDataLakeSASQueryParametersInternal({
671
+ fileSystemName: this.fileSystemName,
672
+ pathName: this.name,
673
+ isDirectory: true,
674
+ ...options,
675
+ }, userDelegationKey, this.accountName).stringToSign;
568
676
  }
569
677
  }
570
678
  /**
571
679
  * A DataLakeFileClient represents a URL to the Azure Storage file.
572
680
  */
573
681
  export class DataLakeFileClient extends DataLakePathClient {
682
+ /**
683
+ * pathContextInternal provided by protocol layer.
684
+ */
685
+ pathContextInternal;
686
+ /**
687
+ * pathContextInternal provided by protocol layer, with its url pointing to the Blob endpoint.
688
+ */
689
+ pathContextInternalToBlobEndpoint;
690
+ /**
691
+ * blockBlobClientInternal provided by `@azure/storage-blob` package.
692
+ */
693
+ blockBlobClientInternal;
574
694
  constructor(url, credentialOrPipeline,
575
695
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
576
696
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
@@ -602,7 +722,7 @@ export class DataLakeFileClient extends DataLakePathClient {
602
722
  pathCreateOptions = options;
603
723
  }
604
724
  else {
605
- pathCreateOptions = resourceTypeOrOptions !== null && resourceTypeOrOptions !== void 0 ? resourceTypeOrOptions : {};
725
+ pathCreateOptions = resourceTypeOrOptions ?? {};
606
726
  }
607
727
  return tracingClient.withSpan("DataLakeFileClient-create", pathCreateOptions, async (updatedOptions) => {
608
728
  return super.create("file", updatedOptions);
@@ -625,7 +745,7 @@ export class DataLakeFileClient extends DataLakePathClient {
625
745
  * * In Node.js, data returns in a Readable stream readableStreamBody
626
746
  * * In browsers, data returns in a promise contentAsBlob
627
747
  *
628
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob
748
+ * @see https://learn.microsoft.com/rest/api/storageservices/get-blob
629
749
  *
630
750
  * * Example usage (Node.js):
631
751
  *
@@ -699,7 +819,10 @@ export class DataLakeFileClient extends DataLakePathClient {
699
819
  */
700
820
  async read(offset = 0, count, options = {}) {
701
821
  return tracingClient.withSpan("DataLakeFileClient-read", options, async (updatedOptions) => {
702
- const rawResponse = await this.blockBlobClientInternal.download(offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey) }));
822
+ const rawResponse = await this.blockBlobClientInternal.download(offset, count, {
823
+ ...updatedOptions,
824
+ customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey),
825
+ });
703
826
  const response = ParsePathGetPropertiesExtraHeaderValues(rawResponse);
704
827
  if (!isNodeLike && !response.contentAsBlob) {
705
828
  response.contentAsBlob = rawResponse.blobBody;
@@ -716,7 +839,7 @@ export class DataLakeFileClient extends DataLakePathClient {
716
839
  * Uploads data to be appended to a file. Data can only be appended to a file.
717
840
  * To apply perviously uploaded data to a file, call flush.
718
841
  *
719
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update
842
+ * @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
720
843
  *
721
844
  * @param body - Content to be uploaded.
722
845
  * @param offset - Append offset in bytes.
@@ -727,11 +850,24 @@ export class DataLakeFileClient extends DataLakePathClient {
727
850
  options.conditions = options.conditions || {};
728
851
  return tracingClient.withSpan("DataLakeFileClient-append", options, async (updatedOptions) => {
729
852
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
730
- return assertResponse(await this.pathContextInternal.appendData(body, Object.assign(Object.assign({}, updatedOptions), { pathHttpHeaders: {
853
+ return assertResponse(await this.pathContextInternal.appendData(body, {
854
+ ...updatedOptions,
855
+ pathHttpHeaders: {
731
856
  contentMD5: options.transactionalContentMD5,
732
- }, abortSignal: options.abortSignal, position: offset, contentLength: length, leaseAccessConditions: options.conditions, requestOptions: {
857
+ },
858
+ abortSignal: options.abortSignal,
859
+ position: offset,
860
+ contentLength: length,
861
+ leaseAccessConditions: options.conditions,
862
+ requestOptions: {
733
863
  onUploadProgress: options.onProgress,
734
- }, cpkInfo: options.customerProvidedKey, flush: options.flush, proposedLeaseId: options.proposedLeaseId, leaseDuration: options.leaseDurationInSeconds, leaseAction: options.leaseAction })));
864
+ },
865
+ cpkInfo: options.customerProvidedKey,
866
+ flush: options.flush,
867
+ proposedLeaseId: options.proposedLeaseId,
868
+ leaseDuration: options.leaseDurationInSeconds,
869
+ leaseAction: options.leaseAction,
870
+ }));
735
871
  });
736
872
  }
737
873
  /**
@@ -750,7 +886,17 @@ export class DataLakeFileClient extends DataLakePathClient {
750
886
  options.conditions = options.conditions || {};
751
887
  return tracingClient.withSpan("DataLakeFileClient-flush", options, async (updatedOptions) => {
752
888
  ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
753
- return 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 })));
889
+ return assertResponse(await this.pathContextInternal.flushData({
890
+ ...updatedOptions,
891
+ position,
892
+ contentLength: 0,
893
+ leaseAccessConditions: options.conditions,
894
+ modifiedAccessConditions: options.conditions,
895
+ cpkInfo: options.customerProvidedKey,
896
+ proposedLeaseId: options.proposedLeaseId,
897
+ leaseDuration: options.leaseDurationInSeconds,
898
+ leaseAction: options.leaseAction,
899
+ }));
754
900
  });
755
901
  }
756
902
  // high level functions
@@ -807,7 +953,6 @@ export class DataLakeFileClient extends DataLakePathClient {
807
953
  }
808
954
  async uploadSeekableInternal(bodyFactory, size, options = {}) {
809
955
  return tracingClient.withSpan("DataLakeFileClient-uploadData", options, async (updatedOptions) => {
810
- var _a;
811
956
  if (size > FILE_MAX_SIZE_BYTES) {
812
957
  throw new RangeError(`size must be <= ${FILE_MAX_SIZE_BYTES}.`);
813
958
  }
@@ -831,7 +976,7 @@ export class DataLakeFileClient extends DataLakePathClient {
831
976
  await createRes;
832
977
  }
833
978
  // After the File is Create, Lease ID is the only valid request parameter.
834
- options.conditions = { leaseId: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.leaseId };
979
+ options.conditions = { leaseId: options.conditions?.leaseId };
835
980
  if (!options.chunkSize) {
836
981
  options.chunkSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
837
982
  if (options.chunkSize < FILE_UPLOAD_DEFAULT_CHUNK_SIZE) {
@@ -924,7 +1069,6 @@ export class DataLakeFileClient extends DataLakePathClient {
924
1069
  */
925
1070
  async uploadStream(stream, options = {}) {
926
1071
  return tracingClient.withSpan("DataLakeFileClient-uploadStream", options, async (updatedOptions) => {
927
- var _a;
928
1072
  // Create the file
929
1073
  await this.create({
930
1074
  abortSignal: options.abortSignal,
@@ -938,7 +1082,7 @@ export class DataLakeFileClient extends DataLakePathClient {
938
1082
  encryptionContext: updatedOptions.encryptionContext,
939
1083
  });
940
1084
  // After the File is Create, Lease ID is the only valid request parameter.
941
- options.conditions = { leaseId: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.leaseId };
1085
+ options.conditions = { leaseId: options.conditions?.leaseId };
942
1086
  if (!options.chunkSize) {
943
1087
  options.chunkSize = FILE_UPLOAD_DEFAULT_CHUNK_SIZE;
944
1088
  }
@@ -998,10 +1142,22 @@ export class DataLakeFileClient extends DataLakePathClient {
998
1142
  }
999
1143
  return tracingClient.withSpan("DataLakeFileClient-readToBuffer", options, async (updatedOptions) => {
1000
1144
  if (buffer) {
1001
- return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
1145
+ return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, {
1146
+ ...options,
1147
+ maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
1148
+ blockSize: options.chunkSize,
1149
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
1150
+ tracingOptions: updatedOptions.tracingOptions,
1151
+ });
1002
1152
  }
1003
1153
  else {
1004
- return this.blockBlobClientInternal.downloadToBuffer(offset, count, Object.assign(Object.assign({}, options), { maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk, blockSize: options.chunkSize, customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey), tracingOptions: updatedOptions.tracingOptions }));
1154
+ return this.blockBlobClientInternal.downloadToBuffer(offset, count, {
1155
+ ...options,
1156
+ maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
1157
+ blockSize: options.chunkSize,
1158
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
1159
+ tracingOptions: updatedOptions.tracingOptions,
1160
+ });
1005
1161
  }
1006
1162
  });
1007
1163
  }
@@ -1023,7 +1179,10 @@ export class DataLakeFileClient extends DataLakePathClient {
1023
1179
  */
1024
1180
  async readToFile(filePath, offset = 0, count, options = {}) {
1025
1181
  return tracingClient.withSpan("DataLakeFileClient-readToFile", options, async (updatedOptions) => {
1026
- const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey) }));
1182
+ const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, {
1183
+ ...updatedOptions,
1184
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
1185
+ });
1027
1186
  const response = ParsePathGetPropertiesExtraHeaderValues(rawResposne);
1028
1187
  return response;
1029
1188
  });
@@ -1074,7 +1233,10 @@ export class DataLakeFileClient extends DataLakePathClient {
1074
1233
  */
1075
1234
  async query(query, options = {}) {
1076
1235
  return tracingClient.withSpan("DataLakeFileClient-query", options, async (updatedOptions) => {
1077
- const rawResponse = await this.blockBlobClientInternal.query(query, Object.assign(Object.assign({}, updatedOptions), { customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey) }));
1236
+ const rawResponse = await this.blockBlobClientInternal.query(query, {
1237
+ ...updatedOptions,
1238
+ customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
1239
+ });
1078
1240
  const response = rawResponse;
1079
1241
  if (!isNodeLike && !response.contentAsBlob) {
1080
1242
  response.contentAsBlob = rawResponse.blobBody;
@@ -1095,7 +1257,6 @@ export class DataLakeFileClient extends DataLakePathClient {
1095
1257
  */
1096
1258
  async setExpiry(mode, options = {}) {
1097
1259
  return tracingClient.withSpan("DataLakeFileClient-setExpiry", options, async (updatedOptions) => {
1098
- var _a;
1099
1260
  let expiresOn = undefined;
1100
1261
  if (mode === "RelativeToNow" || mode === "RelativeToCreation") {
1101
1262
  if (!options.timeToExpireInMs) {
@@ -1110,12 +1271,15 @@ export class DataLakeFileClient extends DataLakePathClient {
1110
1271
  }
1111
1272
  const now = new Date();
1112
1273
  if (!(options.expiresOn.getTime() > now.getTime())) {
1113
- 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()}`);
1274
+ throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${options.expiresOn?.toUTCString()}`);
1114
1275
  }
1115
1276
  expiresOn = options.expiresOn.toUTCString();
1116
1277
  }
1117
- const adaptedOptions = Object.assign(Object.assign({}, options), { expiresOn });
1118
- return assertResponse(await this.pathContextInternalToBlobEndpoint.setExpiry(mode, Object.assign(Object.assign({}, adaptedOptions), { tracingOptions: updatedOptions.tracingOptions })));
1278
+ const adaptedOptions = { ...options, expiresOn };
1279
+ return assertResponse(await this.pathContextInternalToBlobEndpoint.setExpiry(mode, {
1280
+ ...adaptedOptions,
1281
+ tracingOptions: updatedOptions.tracingOptions,
1282
+ }));
1119
1283
  });
1120
1284
  }
1121
1285
  /**
@@ -1124,7 +1288,7 @@ export class DataLakeFileClient extends DataLakePathClient {
1124
1288
  * Generates a Service Shared Access Signature (SAS) URI based on the client properties
1125
1289
  * and parameters passed in. The SAS is signed by the shared key credential of the client.
1126
1290
  *
1127
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1291
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1128
1292
  *
1129
1293
  * @param options - Optional parameters.
1130
1294
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
@@ -1134,7 +1298,11 @@ export class DataLakeFileClient extends DataLakePathClient {
1134
1298
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
1135
1299
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1136
1300
  }
1137
- const sas = generateDataLakeSASQueryParameters(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), this.credential).toString();
1301
+ const sas = generateDataLakeSASQueryParameters({
1302
+ fileSystemName: this.fileSystemName,
1303
+ pathName: this.name,
1304
+ ...options,
1305
+ }, this.credential).toString();
1138
1306
  resolve(appendToURLQuery(this.url, sas));
1139
1307
  });
1140
1308
  }
@@ -1144,7 +1312,7 @@ export class DataLakeFileClient extends DataLakePathClient {
1144
1312
  * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
1145
1313
  * and parameters passed in. The SAS is signed by the shared key credential of the client.
1146
1314
  *
1147
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1315
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1148
1316
  *
1149
1317
  * @param options - Optional parameters.
1150
1318
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
@@ -1154,13 +1322,17 @@ export class DataLakeFileClient extends DataLakePathClient {
1154
1322
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
1155
1323
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
1156
1324
  }
1157
- return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), this.credential).stringToSign;
1325
+ return generateDataLakeSASQueryParametersInternal({
1326
+ fileSystemName: this.fileSystemName,
1327
+ pathName: this.name,
1328
+ ...options,
1329
+ }, this.credential).stringToSign;
1158
1330
  }
1159
1331
  /**
1160
1332
  * Generates a Service Shared Access Signature (SAS) URI based on the client properties
1161
1333
  * and parameters passed in. The SAS is signed by the input user delegation key.
1162
1334
  *
1163
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1335
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1164
1336
  *
1165
1337
  * @param options - Optional parameters.
1166
1338
  * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
@@ -1168,7 +1340,11 @@ export class DataLakeFileClient extends DataLakePathClient {
1168
1340
  */
1169
1341
  generateUserDelegationSasUrl(options, userDelegationKey) {
1170
1342
  return new Promise((resolve) => {
1171
- const sas = generateDataLakeSASQueryParameters(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), userDelegationKey, this.accountName).toString();
1343
+ const sas = generateDataLakeSASQueryParameters({
1344
+ fileSystemName: this.fileSystemName,
1345
+ pathName: this.name,
1346
+ ...options,
1347
+ }, userDelegationKey, this.accountName).toString();
1172
1348
  resolve(appendToURLQuery(this.url, sas));
1173
1349
  });
1174
1350
  }
@@ -1176,14 +1352,18 @@ export class DataLakeFileClient extends DataLakePathClient {
1176
1352
  * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
1177
1353
  * and parameters passed in. The SAS is signed by the input user delegation key.
1178
1354
  *
1179
- * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
1355
+ * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
1180
1356
  *
1181
1357
  * @param options - Optional parameters.
1182
1358
  * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
1183
1359
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
1184
1360
  */
1185
1361
  generateUserDelegationSasStringToSign(options, userDelegationKey) {
1186
- return generateDataLakeSASQueryParametersInternal(Object.assign({ fileSystemName: this.fileSystemName, pathName: this.name }, options), userDelegationKey, this.accountName).stringToSign;
1362
+ return generateDataLakeSASQueryParametersInternal({
1363
+ fileSystemName: this.fileSystemName,
1364
+ pathName: this.name,
1365
+ ...options,
1366
+ }, userDelegationKey, this.accountName).stringToSign;
1187
1367
  }
1188
1368
  }
1189
1369
  //# sourceMappingURL=clients.js.map