@azure/storage-file-share 12.29.0-beta.1 → 12.29.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 (328) hide show
  1. package/dist/browser/AccountSASPermissions.js +32 -34
  2. package/dist/browser/AccountSASPermissions.js.map +1 -1
  3. package/dist/browser/AccountSASResourceTypes.js +12 -14
  4. package/dist/browser/AccountSASResourceTypes.js.map +1 -1
  5. package/dist/browser/AccountSASServices.js +16 -18
  6. package/dist/browser/AccountSASServices.js.map +1 -1
  7. package/dist/browser/AccountSASSignatureValues.d.ts +1 -1
  8. package/dist/browser/AccountSASSignatureValues.d.ts.map +1 -1
  9. package/dist/browser/AccountSASSignatureValues.js.map +1 -1
  10. package/dist/browser/Clients.d.ts +3 -2
  11. package/dist/browser/Clients.d.ts.map +1 -1
  12. package/dist/browser/Clients.js +555 -242
  13. package/dist/browser/Clients.js.map +1 -1
  14. package/dist/browser/FileSASPermissions.js +16 -18
  15. package/dist/browser/FileSASPermissions.js.map +1 -1
  16. package/dist/browser/FileSASSignatureValues.d.ts +1 -1
  17. package/dist/browser/FileSASSignatureValues.d.ts.map +1 -1
  18. package/dist/browser/FileSASSignatureValues.js.map +1 -1
  19. package/dist/browser/FileSystemAttributes.js +43 -45
  20. package/dist/browser/FileSystemAttributes.js.map +1 -1
  21. package/dist/browser/Pipeline.d.ts +2 -4
  22. package/dist/browser/Pipeline.d.ts.map +1 -1
  23. package/dist/browser/Pipeline.js +28 -19
  24. package/dist/browser/Pipeline.js.map +1 -1
  25. package/dist/browser/SASQueryParameters.js +70 -0
  26. package/dist/browser/SASQueryParameters.js.map +1 -1
  27. package/dist/browser/ShareClientInternal.js +1 -0
  28. package/dist/browser/ShareClientInternal.js.map +1 -1
  29. package/dist/browser/ShareSASPermissions.js +20 -22
  30. package/dist/browser/ShareSASPermissions.js.map +1 -1
  31. package/dist/browser/ShareServiceClient.d.ts +1 -1
  32. package/dist/browser/ShareServiceClient.d.ts.map +1 -1
  33. package/dist/browser/ShareServiceClient.js +66 -50
  34. package/dist/browser/ShareServiceClient.js.map +1 -1
  35. package/dist/browser/StorageClient.d.ts +2 -2
  36. package/dist/browser/StorageClient.d.ts.map +1 -1
  37. package/dist/browser/StorageClient.js +23 -0
  38. package/dist/browser/StorageClient.js.map +1 -1
  39. package/dist/browser/StorageContextClient.js +1 -1
  40. package/dist/browser/StorageContextClient.js.map +1 -1
  41. package/dist/browser/generated/src/operations/directory.js +1 -0
  42. package/dist/browser/generated/src/operations/directory.js.map +1 -1
  43. package/dist/browser/generated/src/operations/file.js +1 -0
  44. package/dist/browser/generated/src/operations/file.js.map +1 -1
  45. package/dist/browser/generated/src/operations/service.js +1 -0
  46. package/dist/browser/generated/src/operations/service.js.map +1 -1
  47. package/dist/browser/generated/src/operations/share.js +1 -0
  48. package/dist/browser/generated/src/operations/share.js.map +1 -1
  49. package/dist/browser/generated/src/storageClient.js +15 -4
  50. package/dist/browser/generated/src/storageClient.js.map +1 -1
  51. package/dist/browser/index-browser.d.mts.map +1 -1
  52. package/dist/browser/index-browser.mjs.map +1 -1
  53. package/dist/browser/index.d.ts +1 -7
  54. package/dist/browser/index.js +1 -7
  55. package/dist/browser/utils/Batch.js +29 -21
  56. package/dist/browser/utils/Batch.js.map +1 -1
  57. package/dist/browser/utils/BufferScheduler.js +70 -44
  58. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  59. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  60. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  61. package/dist/browser/utils/constants.d.ts.map +1 -1
  62. package/dist/browser/utils/constants.js +1 -1
  63. package/dist/browser/utils/constants.js.map +1 -1
  64. package/dist/browser/utils/utils.common.js +31 -15
  65. package/dist/browser/utils/utils.common.js.map +1 -1
  66. package/dist/commonjs/AccountSASPermissions.js +32 -34
  67. package/dist/commonjs/AccountSASPermissions.js.map +1 -1
  68. package/dist/commonjs/AccountSASResourceTypes.js +12 -14
  69. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
  70. package/dist/commonjs/AccountSASServices.js +16 -18
  71. package/dist/commonjs/AccountSASServices.js.map +1 -1
  72. package/dist/commonjs/AccountSASSignatureValues.d.ts +1 -1
  73. package/dist/commonjs/AccountSASSignatureValues.d.ts.map +1 -1
  74. package/dist/commonjs/AccountSASSignatureValues.js.map +1 -1
  75. package/dist/commonjs/Clients.d.ts +3 -2
  76. package/dist/commonjs/Clients.d.ts.map +1 -1
  77. package/dist/commonjs/Clients.js +567 -254
  78. package/dist/commonjs/Clients.js.map +1 -1
  79. package/dist/commonjs/FileDownloadResponse.js +2 -0
  80. package/dist/commonjs/FileDownloadResponse.js.map +1 -1
  81. package/dist/commonjs/FileSASPermissions.js +16 -18
  82. package/dist/commonjs/FileSASPermissions.js.map +1 -1
  83. package/dist/commonjs/FileSASSignatureValues.d.ts +1 -1
  84. package/dist/commonjs/FileSASSignatureValues.d.ts.map +1 -1
  85. package/dist/commonjs/FileSASSignatureValues.js.map +1 -1
  86. package/dist/commonjs/FileSystemAttributes.js +43 -45
  87. package/dist/commonjs/FileSystemAttributes.js.map +1 -1
  88. package/dist/commonjs/Pipeline.d.ts +2 -4
  89. package/dist/commonjs/Pipeline.d.ts.map +1 -1
  90. package/dist/commonjs/Pipeline.js +39 -30
  91. package/dist/commonjs/Pipeline.js.map +1 -1
  92. package/dist/commonjs/SASQueryParameters.js +70 -0
  93. package/dist/commonjs/SASQueryParameters.js.map +1 -1
  94. package/dist/commonjs/ShareClientInternal.js +1 -0
  95. package/dist/commonjs/ShareClientInternal.js.map +1 -1
  96. package/dist/commonjs/ShareSASPermissions.js +20 -22
  97. package/dist/commonjs/ShareSASPermissions.js.map +1 -1
  98. package/dist/commonjs/ShareServiceClient.d.ts +1 -1
  99. package/dist/commonjs/ShareServiceClient.d.ts.map +1 -1
  100. package/dist/commonjs/ShareServiceClient.js +72 -56
  101. package/dist/commonjs/ShareServiceClient.js.map +1 -1
  102. package/dist/commonjs/StorageClient.d.ts +2 -2
  103. package/dist/commonjs/StorageClient.d.ts.map +1 -1
  104. package/dist/commonjs/StorageClient.js +23 -0
  105. package/dist/commonjs/StorageClient.js.map +1 -1
  106. package/dist/commonjs/StorageContextClient.js +1 -1
  107. package/dist/commonjs/StorageContextClient.js.map +1 -1
  108. package/dist/commonjs/generated/src/operations/directory.js +1 -0
  109. package/dist/commonjs/generated/src/operations/directory.js.map +1 -1
  110. package/dist/commonjs/generated/src/operations/file.js +1 -0
  111. package/dist/commonjs/generated/src/operations/file.js.map +1 -1
  112. package/dist/commonjs/generated/src/operations/service.js +1 -0
  113. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  114. package/dist/commonjs/generated/src/operations/share.js +1 -0
  115. package/dist/commonjs/generated/src/operations/share.js.map +1 -1
  116. package/dist/commonjs/generated/src/storageClient.js +15 -4
  117. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  118. package/dist/commonjs/index.d.ts +1 -9
  119. package/dist/commonjs/index.d.ts.map +1 -1
  120. package/dist/commonjs/index.js +13 -18
  121. package/dist/commonjs/index.js.map +1 -1
  122. package/dist/commonjs/tsdoc-metadata.json +11 -11
  123. package/dist/commonjs/utils/Batch.js +29 -21
  124. package/dist/commonjs/utils/Batch.js.map +1 -1
  125. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  126. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  127. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  128. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  129. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  130. package/dist/commonjs/utils/constants.js +1 -1
  131. package/dist/commonjs/utils/constants.js.map +1 -1
  132. package/dist/commonjs/utils/utils.common.js +31 -15
  133. package/dist/commonjs/utils/utils.common.js.map +1 -1
  134. package/dist/commonjs/utils/utils.d.ts +1 -1
  135. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  136. package/dist/commonjs/utils/utils.js +5 -5
  137. package/dist/commonjs/utils/utils.js.map +1 -1
  138. package/dist/esm/AccountSASPermissions.js +32 -34
  139. package/dist/esm/AccountSASPermissions.js.map +1 -1
  140. package/dist/esm/AccountSASResourceTypes.js +12 -14
  141. package/dist/esm/AccountSASResourceTypes.js.map +1 -1
  142. package/dist/esm/AccountSASServices.js +16 -18
  143. package/dist/esm/AccountSASServices.js.map +1 -1
  144. package/dist/esm/AccountSASSignatureValues.d.ts +1 -1
  145. package/dist/esm/AccountSASSignatureValues.d.ts.map +1 -1
  146. package/dist/esm/AccountSASSignatureValues.js.map +1 -1
  147. package/dist/esm/Clients.d.ts +3 -2
  148. package/dist/esm/Clients.d.ts.map +1 -1
  149. package/dist/esm/Clients.js +555 -242
  150. package/dist/esm/Clients.js.map +1 -1
  151. package/dist/esm/FileDownloadResponse.js +2 -0
  152. package/dist/esm/FileDownloadResponse.js.map +1 -1
  153. package/dist/esm/FileSASPermissions.js +16 -18
  154. package/dist/esm/FileSASPermissions.js.map +1 -1
  155. package/dist/esm/FileSASSignatureValues.d.ts +1 -1
  156. package/dist/esm/FileSASSignatureValues.d.ts.map +1 -1
  157. package/dist/esm/FileSASSignatureValues.js.map +1 -1
  158. package/dist/esm/FileSystemAttributes.js +43 -45
  159. package/dist/esm/FileSystemAttributes.js.map +1 -1
  160. package/dist/esm/Pipeline.d.ts +2 -4
  161. package/dist/esm/Pipeline.d.ts.map +1 -1
  162. package/dist/esm/Pipeline.js +28 -19
  163. package/dist/esm/Pipeline.js.map +1 -1
  164. package/dist/esm/SASQueryParameters.js +70 -0
  165. package/dist/esm/SASQueryParameters.js.map +1 -1
  166. package/dist/esm/ShareClientInternal.js +1 -0
  167. package/dist/esm/ShareClientInternal.js.map +1 -1
  168. package/dist/esm/ShareSASPermissions.js +20 -22
  169. package/dist/esm/ShareSASPermissions.js.map +1 -1
  170. package/dist/esm/ShareServiceClient.d.ts +1 -1
  171. package/dist/esm/ShareServiceClient.d.ts.map +1 -1
  172. package/dist/esm/ShareServiceClient.js +66 -50
  173. package/dist/esm/ShareServiceClient.js.map +1 -1
  174. package/dist/esm/StorageClient.d.ts +2 -2
  175. package/dist/esm/StorageClient.d.ts.map +1 -1
  176. package/dist/esm/StorageClient.js +23 -0
  177. package/dist/esm/StorageClient.js.map +1 -1
  178. package/dist/esm/StorageContextClient.js +1 -1
  179. package/dist/esm/StorageContextClient.js.map +1 -1
  180. package/dist/esm/generated/src/operations/directory.js +1 -0
  181. package/dist/esm/generated/src/operations/directory.js.map +1 -1
  182. package/dist/esm/generated/src/operations/file.js +1 -0
  183. package/dist/esm/generated/src/operations/file.js.map +1 -1
  184. package/dist/esm/generated/src/operations/service.js +1 -0
  185. package/dist/esm/generated/src/operations/service.js.map +1 -1
  186. package/dist/esm/generated/src/operations/share.js +1 -0
  187. package/dist/esm/generated/src/operations/share.js.map +1 -1
  188. package/dist/esm/generated/src/storageClient.js +15 -4
  189. package/dist/esm/generated/src/storageClient.js.map +1 -1
  190. package/dist/esm/index.d.ts +1 -9
  191. package/dist/esm/index.d.ts.map +1 -1
  192. package/dist/esm/index.js +1 -9
  193. package/dist/esm/index.js.map +1 -1
  194. package/dist/esm/utils/Batch.js +29 -21
  195. package/dist/esm/utils/Batch.js.map +1 -1
  196. package/dist/esm/utils/BufferScheduler.js +70 -44
  197. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  198. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  199. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  200. package/dist/esm/utils/constants.d.ts.map +1 -1
  201. package/dist/esm/utils/constants.js +1 -1
  202. package/dist/esm/utils/constants.js.map +1 -1
  203. package/dist/esm/utils/utils.common.js +31 -15
  204. package/dist/esm/utils/utils.common.js.map +1 -1
  205. package/dist/esm/utils/utils.d.ts +1 -1
  206. package/dist/esm/utils/utils.d.ts.map +1 -1
  207. package/dist/esm/utils/utils.js +2 -2
  208. package/dist/esm/utils/utils.js.map +1 -1
  209. package/dist/react-native/AccountSASPermissions.js +32 -34
  210. package/dist/react-native/AccountSASPermissions.js.map +1 -1
  211. package/dist/react-native/AccountSASResourceTypes.js +12 -14
  212. package/dist/react-native/AccountSASResourceTypes.js.map +1 -1
  213. package/dist/react-native/AccountSASServices.js +16 -18
  214. package/dist/react-native/AccountSASServices.js.map +1 -1
  215. package/dist/react-native/AccountSASSignatureValues.d.ts +1 -1
  216. package/dist/react-native/AccountSASSignatureValues.d.ts.map +1 -1
  217. package/dist/react-native/AccountSASSignatureValues.js.map +1 -1
  218. package/dist/react-native/Clients.d.ts +3 -2
  219. package/dist/react-native/Clients.d.ts.map +1 -1
  220. package/dist/react-native/Clients.js +555 -242
  221. package/dist/react-native/Clients.js.map +1 -1
  222. package/dist/react-native/FileDownloadResponse.js +2 -0
  223. package/dist/react-native/FileDownloadResponse.js.map +1 -1
  224. package/dist/react-native/FileSASPermissions.js +16 -18
  225. package/dist/react-native/FileSASPermissions.js.map +1 -1
  226. package/dist/react-native/FileSASSignatureValues.d.ts +1 -1
  227. package/dist/react-native/FileSASSignatureValues.d.ts.map +1 -1
  228. package/dist/react-native/FileSASSignatureValues.js.map +1 -1
  229. package/dist/react-native/FileSystemAttributes.js +43 -45
  230. package/dist/react-native/FileSystemAttributes.js.map +1 -1
  231. package/dist/react-native/Pipeline.d.ts +2 -4
  232. package/dist/react-native/Pipeline.d.ts.map +1 -1
  233. package/dist/react-native/Pipeline.js +28 -19
  234. package/dist/react-native/Pipeline.js.map +1 -1
  235. package/dist/react-native/SASQueryParameters.js +70 -0
  236. package/dist/react-native/SASQueryParameters.js.map +1 -1
  237. package/dist/react-native/ShareClientInternal.js +1 -0
  238. package/dist/react-native/ShareClientInternal.js.map +1 -1
  239. package/dist/react-native/ShareSASPermissions.js +20 -22
  240. package/dist/react-native/ShareSASPermissions.js.map +1 -1
  241. package/dist/react-native/ShareServiceClient.d.ts +1 -1
  242. package/dist/react-native/ShareServiceClient.d.ts.map +1 -1
  243. package/dist/react-native/ShareServiceClient.js +66 -50
  244. package/dist/react-native/ShareServiceClient.js.map +1 -1
  245. package/dist/react-native/StorageClient.d.ts +2 -2
  246. package/dist/react-native/StorageClient.d.ts.map +1 -1
  247. package/dist/react-native/StorageClient.js +23 -0
  248. package/dist/react-native/StorageClient.js.map +1 -1
  249. package/dist/react-native/StorageContextClient.js +1 -1
  250. package/dist/react-native/StorageContextClient.js.map +1 -1
  251. package/dist/react-native/generated/src/operations/directory.js +1 -0
  252. package/dist/react-native/generated/src/operations/directory.js.map +1 -1
  253. package/dist/react-native/generated/src/operations/file.js +1 -0
  254. package/dist/react-native/generated/src/operations/file.js.map +1 -1
  255. package/dist/react-native/generated/src/operations/service.js +1 -0
  256. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  257. package/dist/react-native/generated/src/operations/share.js +1 -0
  258. package/dist/react-native/generated/src/operations/share.js.map +1 -1
  259. package/dist/react-native/generated/src/storageClient.js +15 -4
  260. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  261. package/dist/react-native/index.d.ts +1 -9
  262. package/dist/react-native/index.d.ts.map +1 -1
  263. package/dist/react-native/index.js +1 -9
  264. package/dist/react-native/index.js.map +1 -1
  265. package/dist/react-native/utils/Batch.js +29 -21
  266. package/dist/react-native/utils/Batch.js.map +1 -1
  267. package/dist/react-native/utils/BufferScheduler.js +70 -44
  268. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  269. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  270. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  271. package/dist/react-native/utils/constants.d.ts.map +1 -1
  272. package/dist/react-native/utils/constants.js +1 -1
  273. package/dist/react-native/utils/constants.js.map +1 -1
  274. package/dist/react-native/utils/utils.common.js +31 -15
  275. package/dist/react-native/utils/utils.common.js.map +1 -1
  276. package/dist/react-native/utils/utils.d.ts +1 -1
  277. package/dist/react-native/utils/utils.d.ts.map +1 -1
  278. package/dist/react-native/utils/utils.js +2 -2
  279. package/dist/react-native/utils/utils.js.map +1 -1
  280. package/package.json +36 -36
  281. package/dist/browser/StorageRetryPolicyFactory.d.ts +0 -56
  282. package/dist/browser/StorageRetryPolicyFactory.d.ts.map +0 -1
  283. package/dist/browser/StorageRetryPolicyFactory.js +0 -26
  284. package/dist/browser/StorageRetryPolicyFactory.js.map +0 -1
  285. package/dist/browser/policies/StorageRetryPolicy.d.ts +0 -75
  286. package/dist/browser/policies/StorageRetryPolicy.d.ts.map +0 -1
  287. package/dist/browser/policies/StorageRetryPolicy.js +0 -218
  288. package/dist/browser/policies/StorageRetryPolicy.js.map +0 -1
  289. package/dist/browser/policies/StorageRetryPolicyV2.d.ts +0 -24
  290. package/dist/browser/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  291. package/dist/browser/policies/StorageRetryPolicyV2.js +0 -174
  292. package/dist/browser/policies/StorageRetryPolicyV2.js.map +0 -1
  293. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +0 -56
  294. package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +0 -1
  295. package/dist/commonjs/StorageRetryPolicyFactory.js +0 -31
  296. package/dist/commonjs/StorageRetryPolicyFactory.js.map +0 -1
  297. package/dist/commonjs/policies/StorageRetryPolicy.d.ts +0 -75
  298. package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +0 -1
  299. package/dist/commonjs/policies/StorageRetryPolicy.js +0 -223
  300. package/dist/commonjs/policies/StorageRetryPolicy.js.map +0 -1
  301. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts +0 -24
  302. package/dist/commonjs/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  303. package/dist/commonjs/policies/StorageRetryPolicyV2.js +0 -178
  304. package/dist/commonjs/policies/StorageRetryPolicyV2.js.map +0 -1
  305. package/dist/esm/StorageRetryPolicyFactory.d.ts +0 -56
  306. package/dist/esm/StorageRetryPolicyFactory.d.ts.map +0 -1
  307. package/dist/esm/StorageRetryPolicyFactory.js +0 -26
  308. package/dist/esm/StorageRetryPolicyFactory.js.map +0 -1
  309. package/dist/esm/policies/StorageRetryPolicy.d.ts +0 -75
  310. package/dist/esm/policies/StorageRetryPolicy.d.ts.map +0 -1
  311. package/dist/esm/policies/StorageRetryPolicy.js +0 -218
  312. package/dist/esm/policies/StorageRetryPolicy.js.map +0 -1
  313. package/dist/esm/policies/StorageRetryPolicyV2.d.ts +0 -24
  314. package/dist/esm/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  315. package/dist/esm/policies/StorageRetryPolicyV2.js +0 -174
  316. package/dist/esm/policies/StorageRetryPolicyV2.js.map +0 -1
  317. package/dist/react-native/StorageRetryPolicyFactory.d.ts +0 -56
  318. package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +0 -1
  319. package/dist/react-native/StorageRetryPolicyFactory.js +0 -26
  320. package/dist/react-native/StorageRetryPolicyFactory.js.map +0 -1
  321. package/dist/react-native/policies/StorageRetryPolicy.d.ts +0 -75
  322. package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +0 -1
  323. package/dist/react-native/policies/StorageRetryPolicy.js +0 -218
  324. package/dist/react-native/policies/StorageRetryPolicy.js.map +0 -1
  325. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts +0 -24
  326. package/dist/react-native/policies/StorageRetryPolicyV2.d.ts.map +0 -1
  327. package/dist/react-native/policies/StorageRetryPolicyV2.js +0 -174
  328. package/dist/react-native/policies/StorageRetryPolicyV2.js.map +0 -1
@@ -1,14 +1,13 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __asyncGenerator, __asyncValues, __await } from "tslib";
4
3
  import { isTokenCredential } from "@azure/core-auth";
5
4
  import { isNodeLike } from "@azure/core-util";
6
5
  import { isPipelineLike, newPipeline } from "./Pipeline.js";
7
6
  import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, } from "./utils/constants.js";
8
7
  import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, removeEmptyString, asSharePermission, parseOctalFileMode, toOctalFileMode, } from "./utils/utils.common.js";
9
- import { Credential } from "@azure/storage-blob";
10
- import { StorageSharedKeyCredential } from "@azure/storage-blob";
11
- import { AnonymousCredential } from "@azure/storage-blob";
8
+ import { Credential } from "@azure/storage-common";
9
+ import { StorageSharedKeyCredential } from "@azure/storage-common";
10
+ import { AnonymousCredential } from "@azure/storage-common";
12
11
  import { tracingClient } from "./utils/tracing.js";
13
12
  import { StorageClient } from "./StorageClient.js";
14
13
  import { FileDownloadResponse } from "./FileDownloadResponse.js";
@@ -23,6 +22,12 @@ import { generateFileSASQueryParameters, generateFileSASQueryParametersInternal,
23
22
  * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
24
23
  */
25
24
  export class ShareClient extends StorageClient {
25
+ /**
26
+ * Share operation context provided by protocol layer.
27
+ */
28
+ context;
29
+ _name;
30
+ shareClientConfig;
26
31
  /**
27
32
  * The name of the share
28
33
  */
@@ -103,7 +108,11 @@ export class ShareClient extends StorageClient {
103
108
  */
104
109
  async create(options = {}) {
105
110
  return tracingClient.withSpan("ShareClient-create", options, async (updatedOptions) => {
106
- return assertResponse(await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { enabledProtocols: toShareProtocolsString(updatedOptions.protocols) })));
111
+ return assertResponse(await this.context.create({
112
+ ...updatedOptions,
113
+ ...this.shareClientConfig,
114
+ enabledProtocols: toShareProtocolsString(updatedOptions.protocols),
115
+ }));
107
116
  });
108
117
  }
109
118
  /**
@@ -115,14 +124,20 @@ export class ShareClient extends StorageClient {
115
124
  */
116
125
  async createIfNotExists(options = {}) {
117
126
  return tracingClient.withSpan("ShareClient-createIfNotExists", options, async (updatedOptions) => {
118
- var _a, _b;
119
127
  try {
120
128
  const res = await this.create(updatedOptions);
121
- return Object.assign({ succeeded: true }, res);
129
+ return {
130
+ succeeded: true,
131
+ ...res,
132
+ };
122
133
  }
123
134
  catch (e) {
124
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareAlreadyExists") {
125
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
135
+ if (e.details?.errorCode === "ShareAlreadyExists") {
136
+ return {
137
+ succeeded: false,
138
+ ...e.response?.parsedHeaders,
139
+ _response: e.response,
140
+ };
126
141
  }
127
142
  throw e;
128
143
  }
@@ -269,7 +284,11 @@ export class ShareClient extends StorageClient {
269
284
  async getProperties(options = {}) {
270
285
  return tracingClient.withSpan("ShareClient-getProperties", options, async (updatedOptions) => {
271
286
  const res = assertResponse(await this.context.getProperties(updatedOptions));
272
- return Object.assign(Object.assign(Object.assign({}, res), this.shareClientConfig), { protocols: toShareProtocols(res.enabledProtocols) });
287
+ return {
288
+ ...res,
289
+ ...this.shareClientConfig,
290
+ protocols: toShareProtocols(res.enabledProtocols),
291
+ };
273
292
  });
274
293
  }
275
294
  /**
@@ -282,7 +301,10 @@ export class ShareClient extends StorageClient {
282
301
  */
283
302
  async delete(options = {}) {
284
303
  return tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
285
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
304
+ return assertResponse(await this.context.delete({
305
+ ...updatedOptions,
306
+ ...this.shareClientConfig,
307
+ }));
286
308
  });
287
309
  }
288
310
  /**
@@ -294,15 +316,21 @@ export class ShareClient extends StorageClient {
294
316
  */
295
317
  async deleteIfExists(options = {}) {
296
318
  return tracingClient.withSpan("ShareClient-deleteIfExists", options, async (updatedOptions) => {
297
- var _a, _b, _c;
298
319
  try {
299
320
  const res = await this.delete(updatedOptions);
300
- return Object.assign({ succeeded: true }, res);
321
+ return {
322
+ succeeded: true,
323
+ ...res,
324
+ };
301
325
  }
302
326
  catch (e) {
303
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareNotFound" ||
304
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ShareSnapshotNotFound") {
305
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
327
+ if (e.details?.errorCode === "ShareNotFound" ||
328
+ e.details?.errorCode === "ShareSnapshotNotFound") {
329
+ return {
330
+ succeeded: false,
331
+ ...e.response?.parsedHeaders,
332
+ _response: e.response,
333
+ };
306
334
  }
307
335
  throw e;
308
336
  }
@@ -321,7 +349,11 @@ export class ShareClient extends StorageClient {
321
349
  */
322
350
  async setMetadata(metadata, options = {}) {
323
351
  return tracingClient.withSpan("ShareClient-setMetadata", options, async (updatedOptions) => {
324
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { metadata })));
352
+ return assertResponse(await this.context.setMetadata({
353
+ ...updatedOptions,
354
+ ...this.shareClientConfig,
355
+ metadata,
356
+ }));
325
357
  });
326
358
  }
327
359
  /**
@@ -338,7 +370,10 @@ export class ShareClient extends StorageClient {
338
370
  */
339
371
  async getAccessPolicy(options = {}) {
340
372
  return tracingClient.withSpan("ShareClient-getAccessPolicy", options, async (updatedOptions) => {
341
- const response = assertResponse(await this.context.getAccessPolicy(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
373
+ const response = assertResponse(await this.context.getAccessPolicy({
374
+ ...updatedOptions,
375
+ ...this.shareClientConfig,
376
+ }));
342
377
  const res = {
343
378
  _response: response._response,
344
379
  date: response.date,
@@ -388,23 +423,26 @@ export class ShareClient extends StorageClient {
388
423
  */
389
424
  async setAccessPolicy(shareAcl, options = {}) {
390
425
  return tracingClient.withSpan("ShareClient-setAccessPolicy", options, async (updatedOptions) => {
391
- var _a, _b, _c;
392
426
  const acl = [];
393
427
  for (const identifier of shareAcl || []) {
394
428
  acl.push({
395
429
  accessPolicy: {
396
- expiresOn: ((_a = identifier.accessPolicy) === null || _a === void 0 ? void 0 : _a.expiresOn)
430
+ expiresOn: identifier.accessPolicy?.expiresOn
397
431
  ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)
398
432
  : undefined,
399
- permissions: (_b = identifier.accessPolicy) === null || _b === void 0 ? void 0 : _b.permissions,
400
- startsOn: ((_c = identifier.accessPolicy) === null || _c === void 0 ? void 0 : _c.startsOn)
433
+ permissions: identifier.accessPolicy?.permissions,
434
+ startsOn: identifier.accessPolicy?.startsOn
401
435
  ? truncatedISO8061Date(identifier.accessPolicy.startsOn)
402
436
  : undefined,
403
437
  },
404
438
  id: identifier.id,
405
439
  });
406
440
  }
407
- return assertResponse(await this.context.setAccessPolicy(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { shareAcl: acl })));
441
+ return assertResponse(await this.context.setAccessPolicy({
442
+ ...updatedOptions,
443
+ ...this.shareClientConfig,
444
+ shareAcl: acl,
445
+ }));
408
446
  });
409
447
  }
410
448
  /**
@@ -415,7 +453,10 @@ export class ShareClient extends StorageClient {
415
453
  */
416
454
  async createSnapshot(options = {}) {
417
455
  return tracingClient.withSpan("ShareClient-createSnapshot", options, async (updatedOptions) => {
418
- return assertResponse(await this.context.createSnapshot(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
456
+ return assertResponse(await this.context.createSnapshot({
457
+ ...updatedOptions,
458
+ ...this.shareClientConfig,
459
+ }));
419
460
  });
420
461
  }
421
462
  /**
@@ -429,7 +470,11 @@ export class ShareClient extends StorageClient {
429
470
  */
430
471
  async setQuota(quotaInGB, options = {}) {
431
472
  return tracingClient.withSpan("ShareClient-setQuota", options, async (updatedOptions) => {
432
- return assertResponse(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { quota: quotaInGB })));
473
+ return assertResponse(await this.context.setProperties({
474
+ ...updatedOptions,
475
+ ...this.shareClientConfig,
476
+ quota: quotaInGB,
477
+ }));
433
478
  });
434
479
  }
435
480
  /**
@@ -440,7 +485,12 @@ export class ShareClient extends StorageClient {
440
485
  */
441
486
  async setProperties(options = {}) {
442
487
  return tracingClient.withSpan("ShareClient-setProperties", options, async (updatedOptions) => {
443
- return assertResponse(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, options), this.shareClientConfig), { quota: options.quotaInGB, tracingOptions: updatedOptions.tracingOptions })));
488
+ return assertResponse(await this.context.setProperties({
489
+ ...options,
490
+ ...this.shareClientConfig,
491
+ quota: options.quotaInGB,
492
+ tracingOptions: updatedOptions.tracingOptions,
493
+ }));
444
494
  });
445
495
  }
446
496
  /**
@@ -451,9 +501,12 @@ export class ShareClient extends StorageClient {
451
501
  */
452
502
  async getStatistics(options = {}) {
453
503
  return tracingClient.withSpan("ShareClient-getStatistics", options, async (updatedOptions) => {
454
- const response = assertResponse(await this.context.getStatistics(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
504
+ const response = assertResponse(await this.context.getStatistics({
505
+ ...updatedOptions,
506
+ ...this.shareClientConfig,
507
+ }));
455
508
  const GBBytes = 1024 * 1024 * 1024;
456
- return Object.assign(Object.assign({}, response), { shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) });
509
+ return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };
457
510
  });
458
511
  }
459
512
  /**
@@ -466,7 +519,10 @@ export class ShareClient extends StorageClient {
466
519
  */
467
520
  async createPermission(filePermission, options = {}) {
468
521
  return tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
469
- return assertResponse(await this.context.createPermission(asSharePermission(filePermission), Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
522
+ return assertResponse(await this.context.createPermission(asSharePermission(filePermission), {
523
+ ...updatedOptions,
524
+ ...this.shareClientConfig,
525
+ }));
470
526
  });
471
527
  }
472
528
  /**
@@ -479,7 +535,10 @@ export class ShareClient extends StorageClient {
479
535
  */
480
536
  async getPermission(filePermissionKey, options = {}) {
481
537
  return tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
482
- return assertResponse(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
538
+ return assertResponse(await this.context.getPermission(filePermissionKey, {
539
+ ...updatedOptions,
540
+ ...this.shareClientConfig,
541
+ }));
483
542
  });
484
543
  }
485
544
  /**
@@ -506,7 +565,10 @@ export class ShareClient extends StorageClient {
506
565
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
507
566
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
508
567
  }
509
- const sas = generateFileSASQueryParameters(Object.assign({ shareName: this.name }, options), this.credential).toString();
568
+ const sas = generateFileSASQueryParameters({
569
+ shareName: this.name,
570
+ ...options,
571
+ }, this.credential).toString();
510
572
  return appendToURLQuery(this.url, sas);
511
573
  }
512
574
  /**
@@ -525,13 +587,24 @@ export class ShareClient extends StorageClient {
525
587
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
526
588
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
527
589
  }
528
- return generateFileSASQueryParametersInternal(Object.assign({ shareName: this.name }, options), this.credential).stringToSign;
590
+ return generateFileSASQueryParametersInternal({
591
+ shareName: this.name,
592
+ ...options,
593
+ }, this.credential).stringToSign;
529
594
  }
530
595
  }
531
596
  /**
532
597
  * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
533
598
  */
534
599
  export class ShareDirectoryClient extends StorageClient {
600
+ /**
601
+ * context provided by protocol layer.
602
+ */
603
+ context;
604
+ _shareName;
605
+ _path;
606
+ _name;
607
+ shareClientConfig;
535
608
  /**
536
609
  * The share name corresponding to this directory client
537
610
  */
@@ -587,16 +660,29 @@ export class ShareDirectoryClient extends StorageClient {
587
660
  options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
588
661
  }
589
662
  return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
590
- var _a, _b, _c;
591
- const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
663
+ const rawResponse = await this.context.create({
664
+ ...updatedOptions,
665
+ fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
666
+ fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
667
+ fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
668
+ fileAttributes: updatedOptions.fileAttributes
592
669
  ? fileAttributesToString(updatedOptions.fileAttributes)
593
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
594
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
670
+ : undefined,
671
+ owner: updatedOptions.posixProperties?.owner,
672
+ group: updatedOptions.posixProperties?.group,
673
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
674
+ ...this.shareClientConfig,
675
+ });
676
+ const wrappedRes = {
677
+ ...rawResponse,
678
+ _response: rawResponse._response, // _response is made non-enumerable,
679
+ posixProperties: {
595
680
  fileMode: parseOctalFileMode(rawResponse.fileMode),
596
681
  fileType: rawResponse.nfsFileType,
597
682
  owner: rawResponse.owner,
598
683
  group: rawResponse.group,
599
- } });
684
+ },
685
+ };
600
686
  return assertResponse(wrappedRes);
601
687
  });
602
688
  }
@@ -609,14 +695,20 @@ export class ShareDirectoryClient extends StorageClient {
609
695
  */
610
696
  async createIfNotExists(options = {}) {
611
697
  return tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
612
- var _a, _b;
613
698
  try {
614
699
  const res = await this.create(updatedOptions);
615
- return Object.assign({ succeeded: true }, res);
700
+ return {
701
+ succeeded: true,
702
+ ...res,
703
+ };
616
704
  }
617
705
  catch (e) {
618
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceAlreadyExists") {
619
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
706
+ if (e.details?.errorCode === "ResourceAlreadyExists") {
707
+ return {
708
+ succeeded: false,
709
+ ...e.response?.parsedHeaders,
710
+ _response: e.response,
711
+ };
620
712
  }
621
713
  throw e;
622
714
  }
@@ -632,15 +724,28 @@ export class ShareDirectoryClient extends StorageClient {
632
724
  async setProperties(properties = {}) {
633
725
  properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
634
726
  return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
635
- var _a, _b, _c;
636
- const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
727
+ const rawResponse = await this.context.setProperties({
728
+ ...updatedOptions,
729
+ fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
730
+ fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
731
+ fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
732
+ fileAttributes: updatedOptions.fileAttributes
637
733
  ? fileAttributesToString(updatedOptions.fileAttributes)
638
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
639
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
734
+ : undefined,
735
+ owner: updatedOptions.posixProperties?.owner,
736
+ group: updatedOptions.posixProperties?.group,
737
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
738
+ ...this.shareClientConfig,
739
+ });
740
+ return assertResponse({
741
+ ...rawResponse,
742
+ _response: rawResponse._response,
743
+ posixProperties: {
640
744
  fileMode: parseOctalFileMode(rawResponse.fileMode),
641
745
  owner: rawResponse.owner,
642
746
  group: rawResponse.group,
643
- } }));
747
+ },
748
+ });
644
749
  });
645
750
  }
646
751
  /**
@@ -801,7 +906,7 @@ export class ShareDirectoryClient extends StorageClient {
801
906
  async exists(options = {}) {
802
907
  return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
803
908
  try {
804
- await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
909
+ await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });
805
910
  return true;
806
911
  }
807
912
  catch (e) {
@@ -823,13 +928,20 @@ export class ShareDirectoryClient extends StorageClient {
823
928
  */
824
929
  async getProperties(options = {}) {
825
930
  return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
826
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
827
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
931
+ const rawResponse = await this.context.getProperties({
932
+ ...updatedOptions,
933
+ ...this.shareClientConfig,
934
+ });
935
+ return assertResponse({
936
+ ...rawResponse,
937
+ _response: rawResponse._response,
938
+ posixProperties: {
828
939
  fileMode: parseOctalFileMode(rawResponse.fileMode),
829
940
  owner: rawResponse.owner,
830
941
  group: rawResponse.group,
831
942
  fileType: rawResponse.nfsFileType,
832
- } }));
943
+ },
944
+ });
833
945
  });
834
946
  }
835
947
  /**
@@ -842,7 +954,7 @@ export class ShareDirectoryClient extends StorageClient {
842
954
  */
843
955
  async delete(options = {}) {
844
956
  return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
845
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
957
+ return assertResponse(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
846
958
  });
847
959
  }
848
960
  /**
@@ -854,15 +966,21 @@ export class ShareDirectoryClient extends StorageClient {
854
966
  */
855
967
  async deleteIfExists(options = {}) {
856
968
  return tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
857
- var _a, _b, _c;
858
969
  try {
859
970
  const res = await this.delete(updatedOptions);
860
- return Object.assign({ succeeded: true }, res);
971
+ return {
972
+ succeeded: true,
973
+ ...res,
974
+ };
861
975
  }
862
976
  catch (e) {
863
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
864
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
865
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
977
+ if (e.details?.errorCode === "ResourceNotFound" ||
978
+ e.details?.errorCode === "ParentNotFound") {
979
+ return {
980
+ succeeded: false,
981
+ ...e.response?.parsedHeaders,
982
+ _response: e.response,
983
+ };
866
984
  }
867
985
  throw e;
868
986
  }
@@ -878,7 +996,11 @@ export class ShareDirectoryClient extends StorageClient {
878
996
  */
879
997
  async setMetadata(metadata, options = {}) {
880
998
  return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
881
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
999
+ return assertResponse(await this.context.setMetadata({
1000
+ ...updatedOptions,
1001
+ metadata,
1002
+ ...this.shareClientConfig,
1003
+ }));
882
1004
  });
883
1005
  }
884
1006
  /**
@@ -893,52 +1015,35 @@ export class ShareDirectoryClient extends StorageClient {
893
1015
  * items. The marker value is opaque to the client.
894
1016
  * @param options - Options to list files and directories operation.
895
1017
  */
896
- iterateFilesAndDirectoriesSegments(marker_1) {
897
- return __asyncGenerator(this, arguments, function* iterateFilesAndDirectoriesSegments_1(marker, options = {}) {
898
- if (options.prefix === "") {
899
- options.prefix = undefined;
900
- }
901
- let listFilesAndDirectoriesResponse;
902
- do {
903
- listFilesAndDirectoriesResponse = yield __await(this.listFilesAndDirectoriesSegment(marker, options));
904
- marker = listFilesAndDirectoriesResponse.continuationToken;
905
- yield yield __await(yield __await(listFilesAndDirectoriesResponse));
906
- } while (marker);
907
- });
1018
+ async *iterateFilesAndDirectoriesSegments(marker, options = {}) {
1019
+ if (options.prefix === "") {
1020
+ options.prefix = undefined;
1021
+ }
1022
+ let listFilesAndDirectoriesResponse;
1023
+ do {
1024
+ listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);
1025
+ marker = listFilesAndDirectoriesResponse.continuationToken;
1026
+ yield await listFilesAndDirectoriesResponse;
1027
+ } while (marker);
908
1028
  }
909
1029
  /**
910
1030
  * Returns an AsyncIterableIterator for file and directory items
911
1031
  *
912
1032
  * @param options - Options to list files and directories operation.
913
1033
  */
914
- listFilesAndDirectoriesItems() {
915
- return __asyncGenerator(this, arguments, function* listFilesAndDirectoriesItems_1(options = {}) {
916
- var _a, e_1, _b, _c;
917
- if (options.prefix === "") {
918
- options.prefix = undefined;
919
- }
920
- let marker;
921
- try {
922
- for (var _d = true, _e = __asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
923
- _c = _f.value;
924
- _d = false;
925
- const listFilesAndDirectoriesResponse = _c;
926
- for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
927
- yield yield __await(Object.assign({ kind: "file" }, file));
928
- }
929
- for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
930
- yield yield __await(Object.assign({ kind: "directory" }, directory));
931
- }
932
- }
1034
+ async *listFilesAndDirectoriesItems(options = {}) {
1035
+ if (options.prefix === "") {
1036
+ options.prefix = undefined;
1037
+ }
1038
+ let marker;
1039
+ for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(marker, options)) {
1040
+ for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
1041
+ yield { kind: "file", ...file };
933
1042
  }
934
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
935
- finally {
936
- try {
937
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
938
- }
939
- finally { if (e_1) throw e_1.error; }
1043
+ for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
1044
+ yield { kind: "directory", ...directory };
940
1045
  }
941
- });
1046
+ }
942
1047
  }
943
1048
  /**
944
1049
  * Returns an async iterable iterator to list all the files and directories
@@ -1106,7 +1211,10 @@ export class ShareDirectoryClient extends StorageClient {
1106
1211
  if (options.prefix === "") {
1107
1212
  options.prefix = undefined;
1108
1213
  }
1109
- const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
1214
+ const updatedOptions = {
1215
+ ...options,
1216
+ ...(include.length > 0 ? { include: include } : {}),
1217
+ };
1110
1218
  // AsyncIterableIterator to iterate over files and directories
1111
1219
  const iter = this.listFilesAndDirectoriesItems(updatedOptions);
1112
1220
  return {
@@ -1126,7 +1234,10 @@ export class ShareDirectoryClient extends StorageClient {
1126
1234
  * Return an AsyncIterableIterator that works a page at a time
1127
1235
  */
1128
1236
  byPage: (settings = {}) => {
1129
- return this.iterateFilesAndDirectoriesSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, updatedOptions));
1237
+ return this.iterateFilesAndDirectoriesSegments(removeEmptyString(settings.continuationToken), {
1238
+ maxResults: settings.maxPageSize,
1239
+ ...updatedOptions,
1240
+ });
1130
1241
  },
1131
1242
  };
1132
1243
  }
@@ -1144,8 +1255,18 @@ export class ShareDirectoryClient extends StorageClient {
1144
1255
  options.prefix = undefined;
1145
1256
  }
1146
1257
  return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
1147
- const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1148
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
1258
+ const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment({
1259
+ ...updatedOptions,
1260
+ marker,
1261
+ ...this.shareClientConfig,
1262
+ }));
1263
+ const wrappedResponse = {
1264
+ ...ConvertInternalResponseOfListFiles(rawResponse),
1265
+ _response: {
1266
+ ...rawResponse._response,
1267
+ parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody),
1268
+ }, // _response is made non-enumerable
1269
+ };
1149
1270
  return wrappedResponse;
1150
1271
  });
1151
1272
  }
@@ -1159,47 +1280,30 @@ export class ShareDirectoryClient extends StorageClient {
1159
1280
  * set of list items.
1160
1281
  * @param options - Options to list handles operation.
1161
1282
  */
1162
- iterateHandleSegments(marker_1) {
1163
- return __asyncGenerator(this, arguments, function* iterateHandleSegments_1(marker, options = {}) {
1164
- let listHandlesResponse;
1165
- if (!!marker || marker === undefined) {
1166
- do {
1167
- listHandlesResponse = yield __await(this.listHandlesSegment(marker, options));
1168
- marker = listHandlesResponse.continuationToken;
1169
- yield yield __await(yield __await(listHandlesResponse));
1170
- } while (marker);
1171
- }
1172
- });
1283
+ async *iterateHandleSegments(marker, options = {}) {
1284
+ let listHandlesResponse;
1285
+ if (!!marker || marker === undefined) {
1286
+ do {
1287
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
1288
+ marker = listHandlesResponse.continuationToken;
1289
+ yield await listHandlesResponse;
1290
+ } while (marker);
1291
+ }
1173
1292
  }
1174
1293
  /**
1175
1294
  * Returns an AsyncIterableIterator for handles
1176
1295
  *
1177
1296
  * @param options - Options to list handles operation.
1178
1297
  */
1179
- listHandleItems() {
1180
- return __asyncGenerator(this, arguments, function* listHandleItems_1(options = {}) {
1181
- var _a, e_2, _b, _c;
1182
- let marker;
1183
- try {
1184
- for (var _d = true, _e = __asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
1185
- _c = _f.value;
1186
- _d = false;
1187
- const listHandlesResponse = _c;
1188
- if (listHandlesResponse.handleList) {
1189
- for (const handle of listHandlesResponse.handleList) {
1190
- yield yield __await(handle);
1191
- }
1192
- }
1298
+ async *listHandleItems(options = {}) {
1299
+ let marker;
1300
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
1301
+ if (listHandlesResponse.handleList) {
1302
+ for (const handle of listHandlesResponse.handleList) {
1303
+ yield handle;
1193
1304
  }
1194
1305
  }
1195
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1196
- finally {
1197
- try {
1198
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
1199
- }
1200
- finally { if (e_2) throw e_2.error; }
1201
- }
1202
- });
1306
+ }
1203
1307
  }
1204
1308
  /**
1205
1309
  * Returns an async iterable iterator to list all the handles.
@@ -1344,7 +1448,10 @@ export class ShareDirectoryClient extends StorageClient {
1344
1448
  * Return an AsyncIterableIterator that works a page at a time
1345
1449
  */
1346
1450
  byPage: (settings = {}) => {
1347
- return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, options));
1451
+ return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {
1452
+ maxResults: settings.maxPageSize,
1453
+ ...options,
1454
+ });
1348
1455
  },
1349
1456
  };
1350
1457
  }
@@ -1362,13 +1469,23 @@ export class ShareDirectoryClient extends StorageClient {
1362
1469
  async listHandlesSegment(marker, options = {}) {
1363
1470
  return tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
1364
1471
  marker = marker === "" ? undefined : marker;
1365
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1472
+ const response = assertResponse(await this.context.listHandles({
1473
+ ...updatedOptions,
1474
+ marker,
1475
+ ...this.shareClientConfig,
1476
+ }));
1366
1477
  // TODO: Protocol layer issue that when handle list is in returned XML
1367
1478
  // response.handleList is an empty string
1368
1479
  if (response.handleList === "") {
1369
1480
  response.handleList = undefined;
1370
1481
  }
1371
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
1482
+ const wrappedResponse = {
1483
+ ...ConvertInternalResponseOfListHandles(response),
1484
+ _response: {
1485
+ ...response._response,
1486
+ parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),
1487
+ },
1488
+ };
1372
1489
  return wrappedResponse;
1373
1490
  });
1374
1491
  }
@@ -1385,12 +1502,19 @@ export class ShareDirectoryClient extends StorageClient {
1385
1502
  */
1386
1503
  async forceCloseHandlesSegment(marker, options = {}) {
1387
1504
  return tracingClient.withSpan("ShareDirectoryClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
1388
- var _a, _b;
1389
1505
  if (marker === "") {
1390
1506
  marker = undefined;
1391
1507
  }
1392
- const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1393
- return Object.assign(Object.assign({}, rawResponse), { closedHandlesCount: (_a = rawResponse.numberOfHandlesClosed) !== null && _a !== void 0 ? _a : 0, closeFailureCount: (_b = rawResponse.numberOfHandlesFailedToClose) !== null && _b !== void 0 ? _b : 0 });
1508
+ const rawResponse = assertResponse(await this.context.forceCloseHandles("*", {
1509
+ ...updatedOptions,
1510
+ marker,
1511
+ ...this.shareClientConfig,
1512
+ }));
1513
+ return {
1514
+ ...rawResponse,
1515
+ closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,
1516
+ closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,
1517
+ };
1394
1518
  });
1395
1519
  }
1396
1520
  /**
@@ -1435,7 +1559,10 @@ export class ShareDirectoryClient extends StorageClient {
1435
1559
  if (handleId === "*") {
1436
1560
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
1437
1561
  }
1438
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1562
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
1563
+ ...updatedOptions,
1564
+ ...this.shareClientConfig,
1565
+ });
1439
1566
  const response = rawResponse;
1440
1567
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
1441
1568
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -1491,15 +1618,20 @@ export class ShareDirectoryClient extends StorageClient {
1491
1618
  }
1492
1619
  const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
1493
1620
  return tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
1494
- const response = assertResponse(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1621
+ const response = assertResponse(await destDirectory.context.rename(this.url, {
1622
+ ...updatedOptions,
1623
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1495
1624
  ? {
1496
1625
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
1497
1626
  }
1498
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1627
+ : undefined,
1628
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1499
1629
  ? {
1500
1630
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
1501
1631
  }
1502
- : undefined }), this.shareClientConfig)));
1632
+ : undefined,
1633
+ ...this.shareClientConfig,
1634
+ }));
1503
1635
  return {
1504
1636
  destinationDirectoryClient: destDirectory,
1505
1637
  directoryRenameResponse: response,
@@ -1511,6 +1643,14 @@ export class ShareDirectoryClient extends StorageClient {
1511
1643
  * A ShareFileClient represents a URL to an Azure Storage file.
1512
1644
  */
1513
1645
  export class ShareFileClient extends StorageClient {
1646
+ /**
1647
+ * context provided by protocol layer.
1648
+ */
1649
+ context;
1650
+ _shareName;
1651
+ _path;
1652
+ _name;
1653
+ shareClientConfig;
1514
1654
  /**
1515
1655
  * The share name corresponding to this file client
1516
1656
  */
@@ -1608,16 +1748,30 @@ export class ShareFileClient extends StorageClient {
1608
1748
  options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
1609
1749
  options.fileHttpHeaders = options.fileHttpHeaders || {};
1610
1750
  return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
1611
- var _a, _b, _c, _d;
1612
- const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1751
+ const rawResponse = await this.context.create(size, {
1752
+ ...updatedOptions,
1753
+ fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
1754
+ fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
1755
+ fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
1756
+ fileAttributes: updatedOptions.fileAttributes
1613
1757
  ? fileAttributesToString(updatedOptions.fileAttributes)
1614
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), nfsFileType: (_d = updatedOptions.posixProperties) === null || _d === void 0 ? void 0 : _d.fileType }), this.shareClientConfig));
1615
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1758
+ : undefined,
1759
+ owner: updatedOptions.posixProperties?.owner,
1760
+ group: updatedOptions.posixProperties?.group,
1761
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
1762
+ nfsFileType: updatedOptions.posixProperties?.fileType,
1763
+ ...this.shareClientConfig,
1764
+ });
1765
+ const wrappedRes = {
1766
+ ...rawResponse,
1767
+ _response: rawResponse._response, // _response is made non-enumerable,
1768
+ posixProperties: {
1616
1769
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1617
1770
  fileType: rawResponse.nfsFileType,
1618
1771
  owner: rawResponse.owner,
1619
1772
  group: rawResponse.group,
1620
- } });
1773
+ },
1774
+ };
1621
1775
  return assertResponse(wrappedRes);
1622
1776
  });
1623
1777
  }
@@ -1707,15 +1861,24 @@ export class ShareFileClient extends StorageClient {
1707
1861
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
1708
1862
  }
1709
1863
  const downloadFullFile = offset === 0 && !count;
1710
- const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
1864
+ const rawResponse = await this.context.download({
1865
+ ...updatedOptions,
1866
+ requestOptions: {
1711
1867
  onDownloadProgress: isNodeLike ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
1712
- }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig));
1713
- const res = assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1868
+ },
1869
+ range: downloadFullFile ? undefined : rangeToString({ offset, count }),
1870
+ ...this.shareClientConfig,
1871
+ });
1872
+ const res = assertResponse({
1873
+ ...rawResponse,
1874
+ _response: rawResponse._response, // _response is made non-enumerable,
1875
+ posixProperties: {
1714
1876
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1715
1877
  owner: rawResponse.owner,
1716
1878
  group: rawResponse.group,
1717
1879
  linkCount: rawResponse.linkCount,
1718
- } }));
1880
+ },
1881
+ });
1719
1882
  // Return browser response immediately
1720
1883
  if (!isNodeLike) {
1721
1884
  return res;
@@ -1745,7 +1908,11 @@ export class ShareFileClient extends StorageClient {
1745
1908
  // chunkDownloadOptions.range
1746
1909
  // }, options: ${JSON.stringify(chunkDownloadOptions)}`
1747
1910
  // );
1748
- const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
1911
+ const downloadRes = await this.context.download({
1912
+ ...updatedOptions,
1913
+ ...updatedDownloadOptions,
1914
+ ...this.shareClientConfig, // TODO: confirm whether this is needed
1915
+ });
1749
1916
  if (!(downloadRes.etag === res.etag)) {
1750
1917
  throw new Error("File has been modified concurrently");
1751
1918
  }
@@ -1789,14 +1956,21 @@ export class ShareFileClient extends StorageClient {
1789
1956
  */
1790
1957
  async getProperties(options = {}) {
1791
1958
  return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
1792
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1793
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1959
+ const rawResponse = await this.context.getProperties({
1960
+ ...updatedOptions,
1961
+ ...this.shareClientConfig,
1962
+ });
1963
+ return assertResponse({
1964
+ ...rawResponse,
1965
+ _response: rawResponse._response, // _response is made non-enumerable,
1966
+ posixProperties: {
1794
1967
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1795
1968
  fileType: rawResponse.nfsFileType,
1796
1969
  owner: rawResponse.owner,
1797
1970
  group: rawResponse.group,
1798
1971
  linkCount: rawResponse.linkCount,
1799
- } }));
1972
+ },
1973
+ });
1800
1974
  });
1801
1975
  }
1802
1976
  /**
@@ -1812,16 +1986,29 @@ export class ShareFileClient extends StorageClient {
1812
1986
  properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
1813
1987
  properties.fileHttpHeaders = properties.fileHttpHeaders || {};
1814
1988
  return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
1815
- var _a, _b, _c;
1816
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1989
+ const rawResponse = await this.context.setHttpHeaders({
1990
+ ...updatedOptions,
1991
+ fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
1992
+ fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
1993
+ fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
1994
+ fileAttributes: updatedOptions.fileAttributes
1817
1995
  ? fileAttributesToString(updatedOptions.fileAttributes)
1818
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1819
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1996
+ : undefined,
1997
+ owner: updatedOptions.posixProperties?.owner,
1998
+ group: updatedOptions.posixProperties?.group,
1999
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
2000
+ ...this.shareClientConfig,
2001
+ });
2002
+ return assertResponse({
2003
+ ...rawResponse,
2004
+ _response: rawResponse._response, // _response is made non-enumerable,
2005
+ posixProperties: {
1820
2006
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1821
2007
  owner: rawResponse.owner,
1822
2008
  group: rawResponse.group,
1823
2009
  linkCount: rawResponse.linkCount,
1824
- } }));
2010
+ },
2011
+ });
1825
2012
  });
1826
2013
  }
1827
2014
  /**
@@ -1843,7 +2030,7 @@ export class ShareFileClient extends StorageClient {
1843
2030
  */
1844
2031
  async delete(options = {}) {
1845
2032
  return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
1846
- return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2033
+ return assertResponse(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
1847
2034
  });
1848
2035
  }
1849
2036
  /**
@@ -1864,15 +2051,21 @@ export class ShareFileClient extends StorageClient {
1864
2051
  */
1865
2052
  async deleteIfExists(options = {}) {
1866
2053
  return tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
1867
- var _a, _b, _c;
1868
2054
  try {
1869
2055
  const res = await this.delete(updatedOptions);
1870
- return Object.assign({ succeeded: true }, res);
2056
+ return {
2057
+ succeeded: true,
2058
+ ...res,
2059
+ };
1871
2060
  }
1872
2061
  catch (e) {
1873
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
1874
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
1875
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
2062
+ if (e.details?.errorCode === "ResourceNotFound" ||
2063
+ e.details?.errorCode === "ParentNotFound") {
2064
+ return {
2065
+ succeeded: false,
2066
+ ...e.response?.parsedHeaders,
2067
+ _response: e.response,
2068
+ };
1876
2069
  }
1877
2070
  throw e;
1878
2071
  }
@@ -1894,16 +2087,30 @@ export class ShareFileClient extends StorageClient {
1894
2087
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
1895
2088
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
1896
2089
  return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
1897
- var _a, _b, _c;
1898
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
2090
+ const rawResponse = await this.context.setHttpHeaders({
2091
+ ...updatedOptions,
2092
+ fileHttpHeaders,
2093
+ fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),
2094
+ fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),
2095
+ fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),
2096
+ fileAttributes: updatedOptions.fileAttributes
1899
2097
  ? fileAttributesToString(updatedOptions.fileAttributes)
1900
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1901
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2098
+ : undefined,
2099
+ owner: updatedOptions.posixProperties?.owner,
2100
+ group: updatedOptions.posixProperties?.group,
2101
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
2102
+ ...this.shareClientConfig,
2103
+ });
2104
+ return assertResponse({
2105
+ ...rawResponse,
2106
+ _response: rawResponse._response, // _response is made non-enumerable,
2107
+ posixProperties: {
1902
2108
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1903
2109
  owner: rawResponse.owner,
1904
2110
  group: rawResponse.group,
1905
2111
  linkCount: rawResponse.linkCount,
1906
- } }));
2112
+ },
2113
+ });
1907
2114
  });
1908
2115
  }
1909
2116
  /**
@@ -1924,14 +2131,28 @@ export class ShareFileClient extends StorageClient {
1924
2131
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
1925
2132
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
1926
2133
  return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
1927
- var _a, _b, _c;
1928
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileAttributes: fileAttributesToString(updatedOptions.fileAttributes), owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1929
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2134
+ const rawResponse = await this.context.setHttpHeaders({
2135
+ ...updatedOptions,
2136
+ fileContentLength: length,
2137
+ fileChangeOn: fileChangeTimeToString(options.changeTime),
2138
+ fileCreatedOn: fileCreationTimeToString(options.creationTime),
2139
+ fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime),
2140
+ fileAttributes: fileAttributesToString(updatedOptions.fileAttributes),
2141
+ owner: updatedOptions.posixProperties?.owner,
2142
+ group: updatedOptions.posixProperties?.group,
2143
+ fileMode: toOctalFileMode(options.posixProperties?.fileMode),
2144
+ ...this.shareClientConfig,
2145
+ });
2146
+ return assertResponse({
2147
+ ...rawResponse,
2148
+ _response: rawResponse._response,
2149
+ posixProperties: {
1930
2150
  fileMode: parseOctalFileMode(rawResponse.fileMode),
1931
2151
  owner: rawResponse.owner,
1932
2152
  group: rawResponse.group,
1933
2153
  linkCount: rawResponse.linkCount,
1934
- } }));
2154
+ },
2155
+ });
1935
2156
  });
1936
2157
  }
1937
2158
  /**
@@ -1947,7 +2168,11 @@ export class ShareFileClient extends StorageClient {
1947
2168
  */
1948
2169
  async setMetadata(metadata = {}, options = {}) {
1949
2170
  return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
1950
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
2171
+ return assertResponse(await this.context.setMetadata({
2172
+ ...updatedOptions,
2173
+ metadata,
2174
+ ...this.shareClientConfig,
2175
+ }));
1951
2176
  });
1952
2177
  }
1953
2178
  /**
@@ -2003,9 +2228,14 @@ export class ShareFileClient extends StorageClient {
2003
2228
  if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
2004
2229
  throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2005
2230
  }
2006
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
2231
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, {
2232
+ ...updatedOptions,
2233
+ requestOptions: {
2007
2234
  onUploadProgress: updatedOptions.onProgress,
2008
- }, body }), this.shareClientConfig)));
2235
+ },
2236
+ body,
2237
+ ...this.shareClientConfig,
2238
+ }));
2009
2239
  });
2010
2240
  }
2011
2241
  /**
@@ -2026,7 +2256,13 @@ export class ShareFileClient extends StorageClient {
2026
2256
  if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
2027
2257
  throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2028
2258
  }
2029
- return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization) }), this.shareClientConfig)));
2259
+ return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, {
2260
+ ...updatedOptions,
2261
+ sourceRange: rangeToString({ offset: sourceOffset, count }),
2262
+ sourceModifiedAccessConditions: updatedOptions.sourceConditions,
2263
+ copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization),
2264
+ ...this.shareClientConfig,
2265
+ }));
2030
2266
  });
2031
2267
  }
2032
2268
  /**
@@ -2042,7 +2278,7 @@ export class ShareFileClient extends StorageClient {
2042
2278
  if (offset < 0 || contentLength <= 0) {
2043
2279
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
2044
2280
  }
2045
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2281
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, { ...updatedOptions, ...this.shareClientConfig }));
2046
2282
  });
2047
2283
  }
2048
2284
  /**
@@ -2052,12 +2288,20 @@ export class ShareFileClient extends StorageClient {
2052
2288
  */
2053
2289
  async getRangeList(options = {}) {
2054
2290
  return tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
2055
- const originalResponse = assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
2291
+ const originalResponse = assertResponse(await this.context.getRangeList({
2292
+ ...updatedOptions,
2293
+ range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,
2294
+ ...this.shareClientConfig,
2295
+ }));
2056
2296
  // Only returns ranges, ignoring clearRanges.
2057
2297
  const parsedBody = originalResponse._response.parsedBody.ranges
2058
2298
  ? originalResponse._response.parsedBody.ranges
2059
2299
  : [];
2060
- return Object.assign(Object.assign({}, originalResponse), { _response: Object.assign(Object.assign({}, originalResponse._response), { parsedBody }), rangeList: originalResponse.ranges ? originalResponse.ranges : [] });
2300
+ return {
2301
+ ...originalResponse,
2302
+ _response: { ...originalResponse._response, parsedBody },
2303
+ rangeList: originalResponse.ranges ? originalResponse.ranges : [],
2304
+ };
2061
2305
  });
2062
2306
  }
2063
2307
  /**
@@ -2068,7 +2312,13 @@ export class ShareFileClient extends StorageClient {
2068
2312
  */
2069
2313
  async getRangeListDiff(prevShareSnapshot, options = {}) {
2070
2314
  return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
2071
- return assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, supportRename: options.includeRenames, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
2315
+ return assertResponse(await this.context.getRangeList({
2316
+ ...updatedOptions,
2317
+ prevsharesnapshot: prevShareSnapshot,
2318
+ supportRename: options.includeRenames,
2319
+ range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,
2320
+ ...this.shareClientConfig,
2321
+ }));
2072
2322
  });
2073
2323
  }
2074
2324
  /**
@@ -2085,8 +2335,15 @@ export class ShareFileClient extends StorageClient {
2085
2335
  */
2086
2336
  async startCopyFromURL(copySource, options = {}) {
2087
2337
  return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
2088
- var _a, _b, _c;
2089
- return assertResponse(await this.context.startCopy(copySource, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), fileModeCopyMode: updatedOptions.fileModeCopyMode, fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode })));
2338
+ return assertResponse(await this.context.startCopy(copySource, {
2339
+ ...updatedOptions,
2340
+ ...this.shareClientConfig,
2341
+ owner: updatedOptions.posixProperties?.owner,
2342
+ group: updatedOptions.posixProperties?.group,
2343
+ fileMode: toOctalFileMode(updatedOptions.posixProperties?.fileMode),
2344
+ fileModeCopyMode: updatedOptions.fileModeCopyMode,
2345
+ fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode,
2346
+ }));
2090
2347
  });
2091
2348
  }
2092
2349
  /**
@@ -2099,7 +2356,7 @@ export class ShareFileClient extends StorageClient {
2099
2356
  */
2100
2357
  async abortCopyFromURL(copyId, options = {}) {
2101
2358
  return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
2102
- return assertResponse(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2359
+ return assertResponse(await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }));
2103
2360
  });
2104
2361
  }
2105
2362
  // High Level functions
@@ -2437,13 +2694,23 @@ export class ShareFileClient extends StorageClient {
2437
2694
  async listHandlesSegment(marker, options = {}) {
2438
2695
  return tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
2439
2696
  marker = marker === "" ? undefined : marker;
2440
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
2697
+ const response = assertResponse(await this.context.listHandles({
2698
+ ...updatedOptions,
2699
+ ...this.shareClientConfig,
2700
+ marker,
2701
+ }));
2441
2702
  // TODO: Protocol layer issue that when handle list is in returned XML
2442
2703
  // response.handleList is an empty string
2443
2704
  if (response.handleList === "") {
2444
2705
  response.handleList = undefined;
2445
2706
  }
2446
- const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
2707
+ const wrappedResponse = {
2708
+ ...ConvertInternalResponseOfListHandles(response),
2709
+ _response: {
2710
+ ...response._response,
2711
+ parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),
2712
+ },
2713
+ };
2447
2714
  return wrappedResponse;
2448
2715
  });
2449
2716
  }
@@ -2457,47 +2724,30 @@ export class ShareFileClient extends StorageClient {
2457
2724
  * set of list items.
2458
2725
  * @param options - Options to list handles operation.
2459
2726
  */
2460
- iterateHandleSegments(marker_1) {
2461
- return __asyncGenerator(this, arguments, function* iterateHandleSegments_2(marker, options = {}) {
2462
- let listHandlesResponse;
2463
- if (!!marker || marker === undefined) {
2464
- do {
2465
- listHandlesResponse = yield __await(this.listHandlesSegment(marker, options));
2466
- marker = listHandlesResponse.continuationToken;
2467
- yield yield __await(listHandlesResponse);
2468
- } while (marker);
2469
- }
2470
- });
2727
+ async *iterateHandleSegments(marker, options = {}) {
2728
+ let listHandlesResponse;
2729
+ if (!!marker || marker === undefined) {
2730
+ do {
2731
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
2732
+ marker = listHandlesResponse.continuationToken;
2733
+ yield listHandlesResponse;
2734
+ } while (marker);
2735
+ }
2471
2736
  }
2472
2737
  /**
2473
2738
  * Returns an AsyncIterableIterator for handles
2474
2739
  *
2475
2740
  * @param options - Options to list handles operation.
2476
2741
  */
2477
- listHandleItems() {
2478
- return __asyncGenerator(this, arguments, function* listHandleItems_2(options = {}) {
2479
- var _a, e_3, _b, _c;
2480
- let marker;
2481
- try {
2482
- for (var _d = true, _e = __asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
2483
- _c = _f.value;
2484
- _d = false;
2485
- const listHandlesResponse = _c;
2486
- if (listHandlesResponse.handleList) {
2487
- for (const handle of listHandlesResponse.handleList) {
2488
- yield yield __await(handle);
2489
- }
2490
- }
2742
+ async *listHandleItems(options = {}) {
2743
+ let marker;
2744
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
2745
+ if (listHandlesResponse.handleList) {
2746
+ for (const handle of listHandlesResponse.handleList) {
2747
+ yield handle;
2491
2748
  }
2492
2749
  }
2493
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2494
- finally {
2495
- try {
2496
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
2497
- }
2498
- finally { if (e_3) throw e_3.error; }
2499
- }
2500
- });
2750
+ }
2501
2751
  }
2502
2752
  /**
2503
2753
  * Returns an async iterable iterator to list all the handles.
@@ -2529,7 +2779,10 @@ export class ShareFileClient extends StorageClient {
2529
2779
  * Return an AsyncIterableIterator that works a page at a time
2530
2780
  */
2531
2781
  byPage: (settings = {}) => {
2532
- return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), Object.assign({ maxPageSize: settings.maxPageSize }, options));
2782
+ return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {
2783
+ maxPageSize: settings.maxPageSize,
2784
+ ...options,
2785
+ });
2533
2786
  },
2534
2787
  };
2535
2788
  }
@@ -2547,7 +2800,11 @@ export class ShareFileClient extends StorageClient {
2547
2800
  async forceCloseHandlesSegment(marker, options = {}) {
2548
2801
  return tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
2549
2802
  marker = marker === "" ? undefined : marker;
2550
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
2803
+ const rawResponse = await this.context.forceCloseHandles("*", {
2804
+ ...updatedOptions,
2805
+ ...this.shareClientConfig,
2806
+ marker,
2807
+ });
2551
2808
  const response = rawResponse;
2552
2809
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2553
2810
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2594,7 +2851,10 @@ export class ShareFileClient extends StorageClient {
2594
2851
  if (handleId === "*") {
2595
2852
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
2596
2853
  }
2597
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2854
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
2855
+ ...updatedOptions,
2856
+ ...this.shareClientConfig,
2857
+ });
2598
2858
  const response = rawResponse;
2599
2859
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2600
2860
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2609,14 +2869,21 @@ export class ShareFileClient extends StorageClient {
2609
2869
  */
2610
2870
  async createHardLink(targetFile, options = {}) {
2611
2871
  return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
2612
- const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2613
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2872
+ const rawResponse = await this.context.createHardLink(targetFile, {
2873
+ ...updatedOptions,
2874
+ ...this.shareClientConfig,
2875
+ });
2876
+ return assertResponse({
2877
+ ...rawResponse,
2878
+ _response: rawResponse._response, // _response is made non-enumerable,
2879
+ posixProperties: {
2614
2880
  fileMode: parseOctalFileMode(rawResponse.fileMode),
2615
2881
  fileType: rawResponse.nfsFileType,
2616
2882
  owner: rawResponse.owner,
2617
2883
  group: rawResponse.group,
2618
2884
  linkCount: rawResponse.linkCount,
2619
- } }));
2885
+ },
2886
+ });
2620
2887
  });
2621
2888
  }
2622
2889
  /**
@@ -2628,13 +2895,20 @@ export class ShareFileClient extends StorageClient {
2628
2895
  */
2629
2896
  async createSymbolicLink(linkText, options = {}) {
2630
2897
  return tracingClient.withSpan("ShareFileClient-createSymbolicLink", options, async (updatedOptions) => {
2631
- const rawResponse = await this.context.createSymbolicLink(linkText, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2632
- return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2898
+ const rawResponse = await this.context.createSymbolicLink(linkText, {
2899
+ ...updatedOptions,
2900
+ ...this.shareClientConfig,
2901
+ });
2902
+ return assertResponse({
2903
+ ...rawResponse,
2904
+ _response: rawResponse._response, // _response is made non-enumerable,
2905
+ posixProperties: {
2633
2906
  fileMode: parseOctalFileMode(rawResponse.fileMode),
2634
2907
  owner: rawResponse.owner,
2635
2908
  group: rawResponse.group,
2636
2909
  fileType: rawResponse.nfsFileType,
2637
- } }));
2910
+ },
2911
+ });
2638
2912
  });
2639
2913
  }
2640
2914
  /**
@@ -2643,7 +2917,10 @@ export class ShareFileClient extends StorageClient {
2643
2917
  */
2644
2918
  async getSymbolicLink(options = {}) {
2645
2919
  return tracingClient.withSpan("ShareFileClient-getSymbolicLink", options, async (updatedOptions) => {
2646
- return assertResponse(await this.context.getSymbolicLink(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2920
+ return assertResponse(await this.context.getSymbolicLink({
2921
+ ...updatedOptions,
2922
+ ...this.shareClientConfig,
2923
+ }));
2647
2924
  });
2648
2925
  }
2649
2926
  /**
@@ -2670,7 +2947,11 @@ export class ShareFileClient extends StorageClient {
2670
2947
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
2671
2948
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2672
2949
  }
2673
- const sas = generateFileSASQueryParameters(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).toString();
2950
+ const sas = generateFileSASQueryParameters({
2951
+ shareName: this.shareName,
2952
+ filePath: this.path,
2953
+ ...options,
2954
+ }, this.credential).toString();
2674
2955
  return appendToURLQuery(this.url, sas);
2675
2956
  }
2676
2957
  /**
@@ -2689,7 +2970,11 @@ export class ShareFileClient extends StorageClient {
2689
2970
  if (!(this.credential instanceof StorageSharedKeyCredential)) {
2690
2971
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2691
2972
  }
2692
- return generateFileSASQueryParametersInternal(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).stringToSign;
2973
+ return generateFileSASQueryParametersInternal({
2974
+ shareName: this.shareName,
2975
+ filePath: this.path,
2976
+ ...options,
2977
+ }, this.credential).stringToSign;
2693
2978
  }
2694
2979
  /**
2695
2980
  * Renames a file.
@@ -2744,19 +3029,25 @@ export class ShareFileClient extends StorageClient {
2744
3029
  }
2745
3030
  const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
2746
3031
  return tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
2747
- const response = assertResponse(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
3032
+ const response = assertResponse(await destFile.context.rename(this.url, {
3033
+ ...updatedOptions,
3034
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
2748
3035
  ? {
2749
3036
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
2750
3037
  }
2751
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
3038
+ : undefined,
3039
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
2752
3040
  ? {
2753
3041
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
2754
3042
  }
2755
- : undefined, fileHttpHeaders: options.contentType
3043
+ : undefined,
3044
+ fileHttpHeaders: options.contentType
2756
3045
  ? {
2757
3046
  fileContentType: options.contentType,
2758
3047
  }
2759
- : undefined }), this.shareClientConfig)));
3048
+ : undefined,
3049
+ ...this.shareClientConfig,
3050
+ }));
2760
3051
  return {
2761
3052
  destinationFileClient: destFile,
2762
3053
  fileRenameResponse: response,
@@ -2771,6 +3062,10 @@ export class ShareFileClient extends StorageClient {
2771
3062
  * @see https://learn.microsoft.com/rest/api/storageservices/lease-share
2772
3063
  */
2773
3064
  export class ShareLeaseClient {
3065
+ _leaseId;
3066
+ _url;
3067
+ fileOrShare;
3068
+ shareClientConfig;
2774
3069
  /**
2775
3070
  * Gets the lease Id.
2776
3071
  *
@@ -2817,7 +3112,12 @@ export class ShareLeaseClient {
2817
3112
  */
2818
3113
  async acquireLease(duration = -1, options = {}) {
2819
3114
  return tracingClient.withSpan("ShareLeaseClient-acquireLease", options, async (updatedOptions) => {
2820
- return assertResponse(await this.fileOrShare.acquireLease(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { duration, proposedLeaseId: this._leaseId })));
3115
+ return assertResponse(await this.fileOrShare.acquireLease({
3116
+ ...updatedOptions,
3117
+ ...this.shareClientConfig,
3118
+ duration,
3119
+ proposedLeaseId: this._leaseId,
3120
+ }));
2821
3121
  });
2822
3122
  }
2823
3123
  /**
@@ -2829,7 +3129,11 @@ export class ShareLeaseClient {
2829
3129
  */
2830
3130
  async changeLease(proposedLeaseId, options = {}) {
2831
3131
  return tracingClient.withSpan("ShareLeaseClient-changeLease", options, async (updatedOptions) => {
2832
- const response = assertResponse(await this.fileOrShare.changeLease(this._leaseId, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { proposedLeaseId })));
3132
+ const response = assertResponse(await this.fileOrShare.changeLease(this._leaseId, {
3133
+ ...updatedOptions,
3134
+ ...this.shareClientConfig,
3135
+ proposedLeaseId,
3136
+ }));
2833
3137
  this._leaseId = proposedLeaseId;
2834
3138
  return response;
2835
3139
  });
@@ -2843,7 +3147,10 @@ export class ShareLeaseClient {
2843
3147
  */
2844
3148
  async releaseLease(options = {}) {
2845
3149
  return tracingClient.withSpan("ShareLeaseClient-releaseLease", options, async (updatedOptions) => {
2846
- return assertResponse(await this.fileOrShare.releaseLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3150
+ return assertResponse(await this.fileOrShare.releaseLease(this._leaseId, {
3151
+ ...updatedOptions,
3152
+ ...this.shareClientConfig,
3153
+ }));
2847
3154
  });
2848
3155
  }
2849
3156
  /**
@@ -2854,7 +3161,10 @@ export class ShareLeaseClient {
2854
3161
  */
2855
3162
  async breakLease(options = {}) {
2856
3163
  return tracingClient.withSpan("ShareLeaseClient-breakLease", options, async (updatedOptions) => {
2857
- return assertResponse(await this.fileOrShare.breakLease(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3164
+ return assertResponse(await this.fileOrShare.breakLease({
3165
+ ...updatedOptions,
3166
+ ...this.shareClientConfig,
3167
+ }));
2858
3168
  });
2859
3169
  }
2860
3170
  /**
@@ -2870,7 +3180,10 @@ export class ShareLeaseClient {
2870
3180
  if (isFile(this.fileOrShare)) {
2871
3181
  throw new RangeError("The renewLease operation is not available for lease on file.");
2872
3182
  }
2873
- return assertResponse(await this.fileOrShare.renewLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3183
+ return assertResponse(await this.fileOrShare.renewLease(this._leaseId, {
3184
+ ...updatedOptions,
3185
+ ...this.shareClientConfig,
3186
+ }));
2874
3187
  });
2875
3188
  }
2876
3189
  }