@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
@@ -3,15 +3,14 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ShareLeaseClient = exports.ShareFileClient = exports.ShareDirectoryClient = exports.ShareClient = void 0;
6
- const tslib_1 = require("tslib");
7
6
  const core_auth_1 = require("@azure/core-auth");
8
7
  const core_util_1 = require("@azure/core-util");
9
8
  const Pipeline_js_1 = require("./Pipeline.js");
10
9
  const constants_js_1 = require("./utils/constants.js");
11
10
  const utils_common_js_1 = require("./utils/utils.common.js");
12
- const storage_blob_1 = require("@azure/storage-blob");
13
- const storage_blob_2 = require("@azure/storage-blob");
14
- const storage_blob_3 = require("@azure/storage-blob");
11
+ const storage_common_1 = require("@azure/storage-common");
12
+ const storage_common_2 = require("@azure/storage-common");
13
+ const storage_common_3 = require("@azure/storage-common");
15
14
  const tracing_js_1 = require("./utils/tracing.js");
16
15
  const StorageClient_js_1 = require("./StorageClient.js");
17
16
  const FileDownloadResponse_js_1 = require("./FileDownloadResponse.js");
@@ -26,6 +25,12 @@ const FileSASSignatureValues_js_1 = require("./FileSASSignatureValues.js");
26
25
  * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
27
26
  */
28
27
  class ShareClient extends StorageClient_js_1.StorageClient {
28
+ /**
29
+ * Share operation context provided by protocol layer.
30
+ */
31
+ context;
32
+ _name;
33
+ shareClientConfig;
29
34
  /**
30
35
  * The name of the share
31
36
  */
@@ -42,7 +47,7 @@ class ShareClient extends StorageClient_js_1.StorageClient {
42
47
  url = urlOrConnectionString;
43
48
  pipeline = credentialOrPipelineOrShareName;
44
49
  }
45
- else if (credentialOrPipelineOrShareName instanceof storage_blob_1.Credential ||
50
+ else if (credentialOrPipelineOrShareName instanceof storage_common_1.Credential ||
46
51
  (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrShareName)) {
47
52
  // (url: string, credential?: Credential, options?: ShareClientOptions)
48
53
  url = urlOrConnectionString;
@@ -53,7 +58,7 @@ class ShareClient extends StorageClient_js_1.StorageClient {
53
58
  // (url: string, credential?: Credential, options?: ShareClientOptions)
54
59
  // The second parameter is undefined. Use anonymous credential.
55
60
  url = urlOrConnectionString;
56
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_blob_3.AnonymousCredential(), options);
61
+ pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_3.AnonymousCredential(), options);
57
62
  }
58
63
  else if (credentialOrPipelineOrShareName &&
59
64
  typeof credentialOrPipelineOrShareName === "string") {
@@ -62,7 +67,7 @@ class ShareClient extends StorageClient_js_1.StorageClient {
62
67
  const name = credentialOrPipelineOrShareName;
63
68
  if (extractedCreds.kind === "AccountConnString") {
64
69
  if (core_util_1.isNodeLike) {
65
- const sharedKeyCredential = new storage_blob_2.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
70
+ const sharedKeyCredential = new storage_common_2.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
66
71
  url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, name);
67
72
  pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options);
68
73
  }
@@ -72,7 +77,7 @@ class ShareClient extends StorageClient_js_1.StorageClient {
72
77
  }
73
78
  else if (extractedCreds.kind === "SASConnString") {
74
79
  url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, name) + "?" + extractedCreds.accountSas;
75
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_blob_3.AnonymousCredential(), options);
80
+ pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_3.AnonymousCredential(), options);
76
81
  }
77
82
  else {
78
83
  throw new Error("Connection string must be either an Account connection string or a SAS connection string");
@@ -106,7 +111,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
106
111
  */
107
112
  async create(options = {}) {
108
113
  return tracing_js_1.tracingClient.withSpan("ShareClient-create", options, async (updatedOptions) => {
109
- return (0, utils_common_js_1.assertResponse)(await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { enabledProtocols: (0, models_js_1.toShareProtocolsString)(updatedOptions.protocols) })));
114
+ return (0, utils_common_js_1.assertResponse)(await this.context.create({
115
+ ...updatedOptions,
116
+ ...this.shareClientConfig,
117
+ enabledProtocols: (0, models_js_1.toShareProtocolsString)(updatedOptions.protocols),
118
+ }));
110
119
  });
111
120
  }
112
121
  /**
@@ -118,14 +127,20 @@ class ShareClient extends StorageClient_js_1.StorageClient {
118
127
  */
119
128
  async createIfNotExists(options = {}) {
120
129
  return tracing_js_1.tracingClient.withSpan("ShareClient-createIfNotExists", options, async (updatedOptions) => {
121
- var _a, _b;
122
130
  try {
123
131
  const res = await this.create(updatedOptions);
124
- return Object.assign({ succeeded: true }, res);
132
+ return {
133
+ succeeded: true,
134
+ ...res,
135
+ };
125
136
  }
126
137
  catch (e) {
127
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareAlreadyExists") {
128
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
138
+ if (e.details?.errorCode === "ShareAlreadyExists") {
139
+ return {
140
+ succeeded: false,
141
+ ...e.response?.parsedHeaders,
142
+ _response: e.response,
143
+ };
129
144
  }
130
145
  throw e;
131
146
  }
@@ -272,7 +287,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
272
287
  async getProperties(options = {}) {
273
288
  return tracing_js_1.tracingClient.withSpan("ShareClient-getProperties", options, async (updatedOptions) => {
274
289
  const res = (0, utils_common_js_1.assertResponse)(await this.context.getProperties(updatedOptions));
275
- return Object.assign(Object.assign(Object.assign({}, res), this.shareClientConfig), { protocols: (0, models_js_1.toShareProtocols)(res.enabledProtocols) });
290
+ return {
291
+ ...res,
292
+ ...this.shareClientConfig,
293
+ protocols: (0, models_js_1.toShareProtocols)(res.enabledProtocols),
294
+ };
276
295
  });
277
296
  }
278
297
  /**
@@ -285,7 +304,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
285
304
  */
286
305
  async delete(options = {}) {
287
306
  return tracing_js_1.tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
288
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
307
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({
308
+ ...updatedOptions,
309
+ ...this.shareClientConfig,
310
+ }));
289
311
  });
290
312
  }
291
313
  /**
@@ -297,15 +319,21 @@ class ShareClient extends StorageClient_js_1.StorageClient {
297
319
  */
298
320
  async deleteIfExists(options = {}) {
299
321
  return tracing_js_1.tracingClient.withSpan("ShareClient-deleteIfExists", options, async (updatedOptions) => {
300
- var _a, _b, _c;
301
322
  try {
302
323
  const res = await this.delete(updatedOptions);
303
- return Object.assign({ succeeded: true }, res);
324
+ return {
325
+ succeeded: true,
326
+ ...res,
327
+ };
304
328
  }
305
329
  catch (e) {
306
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareNotFound" ||
307
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ShareSnapshotNotFound") {
308
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
330
+ if (e.details?.errorCode === "ShareNotFound" ||
331
+ e.details?.errorCode === "ShareSnapshotNotFound") {
332
+ return {
333
+ succeeded: false,
334
+ ...e.response?.parsedHeaders,
335
+ _response: e.response,
336
+ };
309
337
  }
310
338
  throw e;
311
339
  }
@@ -324,7 +352,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
324
352
  */
325
353
  async setMetadata(metadata, options = {}) {
326
354
  return tracing_js_1.tracingClient.withSpan("ShareClient-setMetadata", options, async (updatedOptions) => {
327
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { metadata })));
355
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
356
+ ...updatedOptions,
357
+ ...this.shareClientConfig,
358
+ metadata,
359
+ }));
328
360
  });
329
361
  }
330
362
  /**
@@ -341,7 +373,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
341
373
  */
342
374
  async getAccessPolicy(options = {}) {
343
375
  return tracing_js_1.tracingClient.withSpan("ShareClient-getAccessPolicy", options, async (updatedOptions) => {
344
- const response = (0, utils_common_js_1.assertResponse)(await this.context.getAccessPolicy(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
376
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.getAccessPolicy({
377
+ ...updatedOptions,
378
+ ...this.shareClientConfig,
379
+ }));
345
380
  const res = {
346
381
  _response: response._response,
347
382
  date: response.date,
@@ -391,23 +426,26 @@ class ShareClient extends StorageClient_js_1.StorageClient {
391
426
  */
392
427
  async setAccessPolicy(shareAcl, options = {}) {
393
428
  return tracing_js_1.tracingClient.withSpan("ShareClient-setAccessPolicy", options, async (updatedOptions) => {
394
- var _a, _b, _c;
395
429
  const acl = [];
396
430
  for (const identifier of shareAcl || []) {
397
431
  acl.push({
398
432
  accessPolicy: {
399
- expiresOn: ((_a = identifier.accessPolicy) === null || _a === void 0 ? void 0 : _a.expiresOn)
433
+ expiresOn: identifier.accessPolicy?.expiresOn
400
434
  ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn)
401
435
  : undefined,
402
- permissions: (_b = identifier.accessPolicy) === null || _b === void 0 ? void 0 : _b.permissions,
403
- startsOn: ((_c = identifier.accessPolicy) === null || _c === void 0 ? void 0 : _c.startsOn)
436
+ permissions: identifier.accessPolicy?.permissions,
437
+ startsOn: identifier.accessPolicy?.startsOn
404
438
  ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn)
405
439
  : undefined,
406
440
  },
407
441
  id: identifier.id,
408
442
  });
409
443
  }
410
- return (0, utils_common_js_1.assertResponse)(await this.context.setAccessPolicy(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { shareAcl: acl })));
444
+ return (0, utils_common_js_1.assertResponse)(await this.context.setAccessPolicy({
445
+ ...updatedOptions,
446
+ ...this.shareClientConfig,
447
+ shareAcl: acl,
448
+ }));
411
449
  });
412
450
  }
413
451
  /**
@@ -418,7 +456,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
418
456
  */
419
457
  async createSnapshot(options = {}) {
420
458
  return tracing_js_1.tracingClient.withSpan("ShareClient-createSnapshot", options, async (updatedOptions) => {
421
- return (0, utils_common_js_1.assertResponse)(await this.context.createSnapshot(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
459
+ return (0, utils_common_js_1.assertResponse)(await this.context.createSnapshot({
460
+ ...updatedOptions,
461
+ ...this.shareClientConfig,
462
+ }));
422
463
  });
423
464
  }
424
465
  /**
@@ -432,7 +473,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
432
473
  */
433
474
  async setQuota(quotaInGB, options = {}) {
434
475
  return tracing_js_1.tracingClient.withSpan("ShareClient-setQuota", options, async (updatedOptions) => {
435
- return (0, utils_common_js_1.assertResponse)(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { quota: quotaInGB })));
476
+ return (0, utils_common_js_1.assertResponse)(await this.context.setProperties({
477
+ ...updatedOptions,
478
+ ...this.shareClientConfig,
479
+ quota: quotaInGB,
480
+ }));
436
481
  });
437
482
  }
438
483
  /**
@@ -443,7 +488,12 @@ class ShareClient extends StorageClient_js_1.StorageClient {
443
488
  */
444
489
  async setProperties(options = {}) {
445
490
  return tracing_js_1.tracingClient.withSpan("ShareClient-setProperties", options, async (updatedOptions) => {
446
- return (0, utils_common_js_1.assertResponse)(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, options), this.shareClientConfig), { quota: options.quotaInGB, tracingOptions: updatedOptions.tracingOptions })));
491
+ return (0, utils_common_js_1.assertResponse)(await this.context.setProperties({
492
+ ...options,
493
+ ...this.shareClientConfig,
494
+ quota: options.quotaInGB,
495
+ tracingOptions: updatedOptions.tracingOptions,
496
+ }));
447
497
  });
448
498
  }
449
499
  /**
@@ -454,9 +504,12 @@ class ShareClient extends StorageClient_js_1.StorageClient {
454
504
  */
455
505
  async getStatistics(options = {}) {
456
506
  return tracing_js_1.tracingClient.withSpan("ShareClient-getStatistics", options, async (updatedOptions) => {
457
- const response = (0, utils_common_js_1.assertResponse)(await this.context.getStatistics(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
507
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.getStatistics({
508
+ ...updatedOptions,
509
+ ...this.shareClientConfig,
510
+ }));
458
511
  const GBBytes = 1024 * 1024 * 1024;
459
- return Object.assign(Object.assign({}, response), { shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) });
512
+ return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };
460
513
  });
461
514
  }
462
515
  /**
@@ -469,7 +522,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
469
522
  */
470
523
  async createPermission(filePermission, options = {}) {
471
524
  return tracing_js_1.tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
472
- return (0, utils_common_js_1.assertResponse)(await this.context.createPermission((0, utils_common_js_1.asSharePermission)(filePermission), Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
525
+ return (0, utils_common_js_1.assertResponse)(await this.context.createPermission((0, utils_common_js_1.asSharePermission)(filePermission), {
526
+ ...updatedOptions,
527
+ ...this.shareClientConfig,
528
+ }));
473
529
  });
474
530
  }
475
531
  /**
@@ -482,7 +538,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
482
538
  */
483
539
  async getPermission(filePermissionKey, options = {}) {
484
540
  return tracing_js_1.tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
485
- return (0, utils_common_js_1.assertResponse)(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
541
+ return (0, utils_common_js_1.assertResponse)(await this.context.getPermission(filePermissionKey, {
542
+ ...updatedOptions,
543
+ ...this.shareClientConfig,
544
+ }));
486
545
  });
487
546
  }
488
547
  /**
@@ -506,10 +565,13 @@ class ShareClient extends StorageClient_js_1.StorageClient {
506
565
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
507
566
  */
508
567
  generateSasUrl(options) {
509
- if (!(this.credential instanceof storage_blob_2.StorageSharedKeyCredential)) {
568
+ if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
510
569
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
511
570
  }
512
- const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)(Object.assign({ shareName: this.name }, options), this.credential).toString();
571
+ const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)({
572
+ shareName: this.name,
573
+ ...options,
574
+ }, this.credential).toString();
513
575
  return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
514
576
  }
515
577
  /**
@@ -525,10 +587,13 @@ class ShareClient extends StorageClient_js_1.StorageClient {
525
587
  */
526
588
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
527
589
  generateSasStringToSign(options) {
528
- if (!(this.credential instanceof storage_blob_2.StorageSharedKeyCredential)) {
590
+ if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
529
591
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
530
592
  }
531
- return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)(Object.assign({ shareName: this.name }, options), this.credential).stringToSign;
593
+ return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)({
594
+ shareName: this.name,
595
+ ...options,
596
+ }, this.credential).stringToSign;
532
597
  }
533
598
  }
534
599
  exports.ShareClient = ShareClient;
@@ -536,6 +601,14 @@ exports.ShareClient = ShareClient;
536
601
  * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
537
602
  */
538
603
  class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
604
+ /**
605
+ * context provided by protocol layer.
606
+ */
607
+ context;
608
+ _shareName;
609
+ _path;
610
+ _name;
611
+ shareClientConfig;
539
612
  /**
540
613
  * The share name corresponding to this directory client
541
614
  */
@@ -562,13 +635,13 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
562
635
  if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
563
636
  pipeline = credentialOrPipeline;
564
637
  }
565
- else if (credentialOrPipeline instanceof storage_blob_1.Credential ||
638
+ else if (credentialOrPipeline instanceof storage_common_1.Credential ||
566
639
  (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
567
640
  pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
568
641
  }
569
642
  else {
570
643
  // The second parameter is undefined. Use anonymous credential.
571
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_blob_3.AnonymousCredential(), options);
644
+ pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_3.AnonymousCredential(), options);
572
645
  }
573
646
  super(url, pipeline);
574
647
  ({
@@ -591,16 +664,29 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
591
664
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions)(options);
592
665
  }
593
666
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
594
- var _a, _b, _c;
595
- const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
667
+ const rawResponse = await this.context.create({
668
+ ...updatedOptions,
669
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
670
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
671
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
672
+ fileAttributes: updatedOptions.fileAttributes
596
673
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
597
- : 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: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
598
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
674
+ : undefined,
675
+ owner: updatedOptions.posixProperties?.owner,
676
+ group: updatedOptions.posixProperties?.group,
677
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
678
+ ...this.shareClientConfig,
679
+ });
680
+ const wrappedRes = {
681
+ ...rawResponse,
682
+ _response: rawResponse._response, // _response is made non-enumerable,
683
+ posixProperties: {
599
684
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
600
685
  fileType: rawResponse.nfsFileType,
601
686
  owner: rawResponse.owner,
602
687
  group: rawResponse.group,
603
- } });
688
+ },
689
+ };
604
690
  return (0, utils_common_js_1.assertResponse)(wrappedRes);
605
691
  });
606
692
  }
@@ -613,14 +699,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
613
699
  */
614
700
  async createIfNotExists(options = {}) {
615
701
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
616
- var _a, _b;
617
702
  try {
618
703
  const res = await this.create(updatedOptions);
619
- return Object.assign({ succeeded: true }, res);
704
+ return {
705
+ succeeded: true,
706
+ ...res,
707
+ };
620
708
  }
621
709
  catch (e) {
622
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceAlreadyExists") {
623
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
710
+ if (e.details?.errorCode === "ResourceAlreadyExists") {
711
+ return {
712
+ succeeded: false,
713
+ ...e.response?.parsedHeaders,
714
+ _response: e.response,
715
+ };
624
716
  }
625
717
  throw e;
626
718
  }
@@ -636,15 +728,28 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
636
728
  async setProperties(properties = {}) {
637
729
  properties = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(properties);
638
730
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
639
- var _a, _b, _c;
640
- const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
731
+ const rawResponse = await this.context.setProperties({
732
+ ...updatedOptions,
733
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
734
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
735
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
736
+ fileAttributes: updatedOptions.fileAttributes
641
737
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
642
- : 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: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
643
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
738
+ : undefined,
739
+ owner: updatedOptions.posixProperties?.owner,
740
+ group: updatedOptions.posixProperties?.group,
741
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
742
+ ...this.shareClientConfig,
743
+ });
744
+ return (0, utils_common_js_1.assertResponse)({
745
+ ...rawResponse,
746
+ _response: rawResponse._response,
747
+ posixProperties: {
644
748
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
645
749
  owner: rawResponse.owner,
646
750
  group: rawResponse.group,
647
- } }));
751
+ },
752
+ });
648
753
  });
649
754
  }
650
755
  /**
@@ -805,7 +910,7 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
805
910
  async exists(options = {}) {
806
911
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
807
912
  try {
808
- await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
913
+ await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });
809
914
  return true;
810
915
  }
811
916
  catch (e) {
@@ -827,13 +932,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
827
932
  */
828
933
  async getProperties(options = {}) {
829
934
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
830
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
831
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
935
+ const rawResponse = await this.context.getProperties({
936
+ ...updatedOptions,
937
+ ...this.shareClientConfig,
938
+ });
939
+ return (0, utils_common_js_1.assertResponse)({
940
+ ...rawResponse,
941
+ _response: rawResponse._response,
942
+ posixProperties: {
832
943
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
833
944
  owner: rawResponse.owner,
834
945
  group: rawResponse.group,
835
946
  fileType: rawResponse.nfsFileType,
836
- } }));
947
+ },
948
+ });
837
949
  });
838
950
  }
839
951
  /**
@@ -846,7 +958,7 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
846
958
  */
847
959
  async delete(options = {}) {
848
960
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
849
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
961
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
850
962
  });
851
963
  }
852
964
  /**
@@ -858,15 +970,21 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
858
970
  */
859
971
  async deleteIfExists(options = {}) {
860
972
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
861
- var _a, _b, _c;
862
973
  try {
863
974
  const res = await this.delete(updatedOptions);
864
- return Object.assign({ succeeded: true }, res);
975
+ return {
976
+ succeeded: true,
977
+ ...res,
978
+ };
865
979
  }
866
980
  catch (e) {
867
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
868
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
869
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
981
+ if (e.details?.errorCode === "ResourceNotFound" ||
982
+ e.details?.errorCode === "ParentNotFound") {
983
+ return {
984
+ succeeded: false,
985
+ ...e.response?.parsedHeaders,
986
+ _response: e.response,
987
+ };
870
988
  }
871
989
  throw e;
872
990
  }
@@ -882,7 +1000,11 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
882
1000
  */
883
1001
  async setMetadata(metadata, options = {}) {
884
1002
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
885
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
1003
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
1004
+ ...updatedOptions,
1005
+ metadata,
1006
+ ...this.shareClientConfig,
1007
+ }));
886
1008
  });
887
1009
  }
888
1010
  /**
@@ -897,52 +1019,35 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
897
1019
  * items. The marker value is opaque to the client.
898
1020
  * @param options - Options to list files and directories operation.
899
1021
  */
900
- iterateFilesAndDirectoriesSegments(marker_1) {
901
- return tslib_1.__asyncGenerator(this, arguments, function* iterateFilesAndDirectoriesSegments_1(marker, options = {}) {
902
- if (options.prefix === "") {
903
- options.prefix = undefined;
904
- }
905
- let listFilesAndDirectoriesResponse;
906
- do {
907
- listFilesAndDirectoriesResponse = yield tslib_1.__await(this.listFilesAndDirectoriesSegment(marker, options));
908
- marker = listFilesAndDirectoriesResponse.continuationToken;
909
- yield yield tslib_1.__await(yield tslib_1.__await(listFilesAndDirectoriesResponse));
910
- } while (marker);
911
- });
1022
+ async *iterateFilesAndDirectoriesSegments(marker, options = {}) {
1023
+ if (options.prefix === "") {
1024
+ options.prefix = undefined;
1025
+ }
1026
+ let listFilesAndDirectoriesResponse;
1027
+ do {
1028
+ listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);
1029
+ marker = listFilesAndDirectoriesResponse.continuationToken;
1030
+ yield await listFilesAndDirectoriesResponse;
1031
+ } while (marker);
912
1032
  }
913
1033
  /**
914
1034
  * Returns an AsyncIterableIterator for file and directory items
915
1035
  *
916
1036
  * @param options - Options to list files and directories operation.
917
1037
  */
918
- listFilesAndDirectoriesItems() {
919
- return tslib_1.__asyncGenerator(this, arguments, function* listFilesAndDirectoriesItems_1(options = {}) {
920
- var _a, e_1, _b, _c;
921
- if (options.prefix === "") {
922
- options.prefix = undefined;
923
- }
924
- let marker;
925
- try {
926
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
927
- _c = _f.value;
928
- _d = false;
929
- const listFilesAndDirectoriesResponse = _c;
930
- for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
931
- yield yield tslib_1.__await(Object.assign({ kind: "file" }, file));
932
- }
933
- for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
934
- yield yield tslib_1.__await(Object.assign({ kind: "directory" }, directory));
935
- }
936
- }
1038
+ async *listFilesAndDirectoriesItems(options = {}) {
1039
+ if (options.prefix === "") {
1040
+ options.prefix = undefined;
1041
+ }
1042
+ let marker;
1043
+ for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(marker, options)) {
1044
+ for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
1045
+ yield { kind: "file", ...file };
937
1046
  }
938
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
939
- finally {
940
- try {
941
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
942
- }
943
- finally { if (e_1) throw e_1.error; }
1047
+ for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
1048
+ yield { kind: "directory", ...directory };
944
1049
  }
945
- });
1050
+ }
946
1051
  }
947
1052
  /**
948
1053
  * Returns an async iterable iterator to list all the files and directories
@@ -1110,7 +1215,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1110
1215
  if (options.prefix === "") {
1111
1216
  options.prefix = undefined;
1112
1217
  }
1113
- const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
1218
+ const updatedOptions = {
1219
+ ...options,
1220
+ ...(include.length > 0 ? { include: include } : {}),
1221
+ };
1114
1222
  // AsyncIterableIterator to iterate over files and directories
1115
1223
  const iter = this.listFilesAndDirectoriesItems(updatedOptions);
1116
1224
  return {
@@ -1130,7 +1238,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1130
1238
  * Return an AsyncIterableIterator that works a page at a time
1131
1239
  */
1132
1240
  byPage: (settings = {}) => {
1133
- return this.iterateFilesAndDirectoriesSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, updatedOptions));
1241
+ return this.iterateFilesAndDirectoriesSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
1242
+ maxResults: settings.maxPageSize,
1243
+ ...updatedOptions,
1244
+ });
1134
1245
  },
1135
1246
  };
1136
1247
  }
@@ -1148,8 +1259,18 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1148
1259
  options.prefix = undefined;
1149
1260
  }
1150
1261
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
1151
- const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1152
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse._response.parsedBody) }) });
1262
+ const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.listFilesAndDirectoriesSegment({
1263
+ ...updatedOptions,
1264
+ marker,
1265
+ ...this.shareClientConfig,
1266
+ }));
1267
+ const wrappedResponse = {
1268
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse),
1269
+ _response: {
1270
+ ...rawResponse._response,
1271
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse._response.parsedBody),
1272
+ }, // _response is made non-enumerable
1273
+ };
1153
1274
  return wrappedResponse;
1154
1275
  });
1155
1276
  }
@@ -1163,47 +1284,30 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1163
1284
  * set of list items.
1164
1285
  * @param options - Options to list handles operation.
1165
1286
  */
1166
- iterateHandleSegments(marker_1) {
1167
- return tslib_1.__asyncGenerator(this, arguments, function* iterateHandleSegments_1(marker, options = {}) {
1168
- let listHandlesResponse;
1169
- if (!!marker || marker === undefined) {
1170
- do {
1171
- listHandlesResponse = yield tslib_1.__await(this.listHandlesSegment(marker, options));
1172
- marker = listHandlesResponse.continuationToken;
1173
- yield yield tslib_1.__await(yield tslib_1.__await(listHandlesResponse));
1174
- } while (marker);
1175
- }
1176
- });
1287
+ async *iterateHandleSegments(marker, options = {}) {
1288
+ let listHandlesResponse;
1289
+ if (!!marker || marker === undefined) {
1290
+ do {
1291
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
1292
+ marker = listHandlesResponse.continuationToken;
1293
+ yield await listHandlesResponse;
1294
+ } while (marker);
1295
+ }
1177
1296
  }
1178
1297
  /**
1179
1298
  * Returns an AsyncIterableIterator for handles
1180
1299
  *
1181
1300
  * @param options - Options to list handles operation.
1182
1301
  */
1183
- listHandleItems() {
1184
- return tslib_1.__asyncGenerator(this, arguments, function* listHandleItems_1(options = {}) {
1185
- var _a, e_2, _b, _c;
1186
- let marker;
1187
- try {
1188
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1189
- _c = _f.value;
1190
- _d = false;
1191
- const listHandlesResponse = _c;
1192
- if (listHandlesResponse.handleList) {
1193
- for (const handle of listHandlesResponse.handleList) {
1194
- yield yield tslib_1.__await(handle);
1195
- }
1196
- }
1302
+ async *listHandleItems(options = {}) {
1303
+ let marker;
1304
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
1305
+ if (listHandlesResponse.handleList) {
1306
+ for (const handle of listHandlesResponse.handleList) {
1307
+ yield handle;
1197
1308
  }
1198
1309
  }
1199
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1200
- finally {
1201
- try {
1202
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
1203
- }
1204
- finally { if (e_2) throw e_2.error; }
1205
- }
1206
- });
1310
+ }
1207
1311
  }
1208
1312
  /**
1209
1313
  * Returns an async iterable iterator to list all the handles.
@@ -1348,7 +1452,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1348
1452
  * Return an AsyncIterableIterator that works a page at a time
1349
1453
  */
1350
1454
  byPage: (settings = {}) => {
1351
- return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, options));
1455
+ return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
1456
+ maxResults: settings.maxPageSize,
1457
+ ...options,
1458
+ });
1352
1459
  },
1353
1460
  };
1354
1461
  }
@@ -1366,13 +1473,23 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1366
1473
  async listHandlesSegment(marker, options = {}) {
1367
1474
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
1368
1475
  marker = marker === "" ? undefined : marker;
1369
- const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1476
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles({
1477
+ ...updatedOptions,
1478
+ marker,
1479
+ ...this.shareClientConfig,
1480
+ }));
1370
1481
  // TODO: Protocol layer issue that when handle list is in returned XML
1371
1482
  // response.handleList is an empty string
1372
1483
  if (response.handleList === "") {
1373
1484
  response.handleList = undefined;
1374
1485
  }
1375
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody) }) });
1486
+ const wrappedResponse = {
1487
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response),
1488
+ _response: {
1489
+ ...response._response,
1490
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody),
1491
+ },
1492
+ };
1376
1493
  return wrappedResponse;
1377
1494
  });
1378
1495
  }
@@ -1389,12 +1506,19 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1389
1506
  */
1390
1507
  async forceCloseHandlesSegment(marker, options = {}) {
1391
1508
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
1392
- var _a, _b;
1393
1509
  if (marker === "") {
1394
1510
  marker = undefined;
1395
1511
  }
1396
- const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1397
- 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 });
1512
+ const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.forceCloseHandles("*", {
1513
+ ...updatedOptions,
1514
+ marker,
1515
+ ...this.shareClientConfig,
1516
+ }));
1517
+ return {
1518
+ ...rawResponse,
1519
+ closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,
1520
+ closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,
1521
+ };
1398
1522
  });
1399
1523
  }
1400
1524
  /**
@@ -1439,7 +1563,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1439
1563
  if (handleId === "*") {
1440
1564
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
1441
1565
  }
1442
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1566
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
1567
+ ...updatedOptions,
1568
+ ...this.shareClientConfig,
1569
+ });
1443
1570
  const response = rawResponse;
1444
1571
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
1445
1572
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -1495,15 +1622,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1495
1622
  }
1496
1623
  const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
1497
1624
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
1498
- const response = (0, utils_common_js_1.assertResponse)(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1625
+ const response = (0, utils_common_js_1.assertResponse)(await destDirectory.context.rename(this.url, {
1626
+ ...updatedOptions,
1627
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1499
1628
  ? {
1500
1629
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
1501
1630
  }
1502
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1631
+ : undefined,
1632
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1503
1633
  ? {
1504
1634
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
1505
1635
  }
1506
- : undefined }), this.shareClientConfig)));
1636
+ : undefined,
1637
+ ...this.shareClientConfig,
1638
+ }));
1507
1639
  return {
1508
1640
  destinationDirectoryClient: destDirectory,
1509
1641
  directoryRenameResponse: response,
@@ -1516,6 +1648,14 @@ exports.ShareDirectoryClient = ShareDirectoryClient;
1516
1648
  * A ShareFileClient represents a URL to an Azure Storage file.
1517
1649
  */
1518
1650
  class ShareFileClient extends StorageClient_js_1.StorageClient {
1651
+ /**
1652
+ * context provided by protocol layer.
1653
+ */
1654
+ context;
1655
+ _shareName;
1656
+ _path;
1657
+ _name;
1658
+ shareClientConfig;
1519
1659
  /**
1520
1660
  * The share name corresponding to this file client
1521
1661
  */
@@ -1542,13 +1682,13 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1542
1682
  if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
1543
1683
  pipeline = credentialOrPipeline;
1544
1684
  }
1545
- else if (credentialOrPipeline instanceof storage_blob_1.Credential ||
1685
+ else if (credentialOrPipeline instanceof storage_common_1.Credential ||
1546
1686
  (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
1547
1687
  pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
1548
1688
  }
1549
1689
  else {
1550
1690
  // The second parameter is undefined. Use anonymous credential.
1551
- pipeline = (0, Pipeline_js_1.newPipeline)(new storage_blob_3.AnonymousCredential(), options);
1691
+ pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_3.AnonymousCredential(), options);
1552
1692
  }
1553
1693
  super(url, pipeline);
1554
1694
  ({
@@ -1613,16 +1753,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1613
1753
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions)(options);
1614
1754
  options.fileHttpHeaders = options.fileHttpHeaders || {};
1615
1755
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
1616
- var _a, _b, _c, _d;
1617
- const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1756
+ const rawResponse = await this.context.create(size, {
1757
+ ...updatedOptions,
1758
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
1759
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
1760
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
1761
+ fileAttributes: updatedOptions.fileAttributes
1618
1762
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1619
- : 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: (0, utils_common_js_1.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));
1620
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1763
+ : undefined,
1764
+ owner: updatedOptions.posixProperties?.owner,
1765
+ group: updatedOptions.posixProperties?.group,
1766
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
1767
+ nfsFileType: updatedOptions.posixProperties?.fileType,
1768
+ ...this.shareClientConfig,
1769
+ });
1770
+ const wrappedRes = {
1771
+ ...rawResponse,
1772
+ _response: rawResponse._response, // _response is made non-enumerable,
1773
+ posixProperties: {
1621
1774
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1622
1775
  fileType: rawResponse.nfsFileType,
1623
1776
  owner: rawResponse.owner,
1624
1777
  group: rawResponse.group,
1625
- } });
1778
+ },
1779
+ };
1626
1780
  return (0, utils_common_js_1.assertResponse)(wrappedRes);
1627
1781
  });
1628
1782
  }
@@ -1712,15 +1866,24 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1712
1866
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
1713
1867
  }
1714
1868
  const downloadFullFile = offset === 0 && !count;
1715
- const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
1869
+ const rawResponse = await this.context.download({
1870
+ ...updatedOptions,
1871
+ requestOptions: {
1716
1872
  onDownloadProgress: core_util_1.isNodeLike ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
1717
- }, range: downloadFullFile ? undefined : (0, Range_js_1.rangeToString)({ offset, count }) }), this.shareClientConfig));
1718
- const res = (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1873
+ },
1874
+ range: downloadFullFile ? undefined : (0, Range_js_1.rangeToString)({ offset, count }),
1875
+ ...this.shareClientConfig,
1876
+ });
1877
+ const res = (0, utils_common_js_1.assertResponse)({
1878
+ ...rawResponse,
1879
+ _response: rawResponse._response, // _response is made non-enumerable,
1880
+ posixProperties: {
1719
1881
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1720
1882
  owner: rawResponse.owner,
1721
1883
  group: rawResponse.group,
1722
1884
  linkCount: rawResponse.linkCount,
1723
- } }));
1885
+ },
1886
+ });
1724
1887
  // Return browser response immediately
1725
1888
  if (!core_util_1.isNodeLike) {
1726
1889
  return res;
@@ -1750,7 +1913,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1750
1913
  // chunkDownloadOptions.range
1751
1914
  // }, options: ${JSON.stringify(chunkDownloadOptions)}`
1752
1915
  // );
1753
- const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
1916
+ const downloadRes = await this.context.download({
1917
+ ...updatedOptions,
1918
+ ...updatedDownloadOptions,
1919
+ ...this.shareClientConfig, // TODO: confirm whether this is needed
1920
+ });
1754
1921
  if (!(downloadRes.etag === res.etag)) {
1755
1922
  throw new Error("File has been modified concurrently");
1756
1923
  }
@@ -1794,14 +1961,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1794
1961
  */
1795
1962
  async getProperties(options = {}) {
1796
1963
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
1797
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1798
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1964
+ const rawResponse = await this.context.getProperties({
1965
+ ...updatedOptions,
1966
+ ...this.shareClientConfig,
1967
+ });
1968
+ return (0, utils_common_js_1.assertResponse)({
1969
+ ...rawResponse,
1970
+ _response: rawResponse._response, // _response is made non-enumerable,
1971
+ posixProperties: {
1799
1972
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1800
1973
  fileType: rawResponse.nfsFileType,
1801
1974
  owner: rawResponse.owner,
1802
1975
  group: rawResponse.group,
1803
1976
  linkCount: rawResponse.linkCount,
1804
- } }));
1977
+ },
1978
+ });
1805
1979
  });
1806
1980
  }
1807
1981
  /**
@@ -1817,16 +1991,29 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1817
1991
  properties = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(properties);
1818
1992
  properties.fileHttpHeaders = properties.fileHttpHeaders || {};
1819
1993
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
1820
- var _a, _b, _c;
1821
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1994
+ const rawResponse = await this.context.setHttpHeaders({
1995
+ ...updatedOptions,
1996
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
1997
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
1998
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
1999
+ fileAttributes: updatedOptions.fileAttributes
1822
2000
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1823
- : 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: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1824
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2001
+ : undefined,
2002
+ owner: updatedOptions.posixProperties?.owner,
2003
+ group: updatedOptions.posixProperties?.group,
2004
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2005
+ ...this.shareClientConfig,
2006
+ });
2007
+ return (0, utils_common_js_1.assertResponse)({
2008
+ ...rawResponse,
2009
+ _response: rawResponse._response, // _response is made non-enumerable,
2010
+ posixProperties: {
1825
2011
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1826
2012
  owner: rawResponse.owner,
1827
2013
  group: rawResponse.group,
1828
2014
  linkCount: rawResponse.linkCount,
1829
- } }));
2015
+ },
2016
+ });
1830
2017
  });
1831
2018
  }
1832
2019
  /**
@@ -1848,7 +2035,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1848
2035
  */
1849
2036
  async delete(options = {}) {
1850
2037
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
1851
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2038
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
1852
2039
  });
1853
2040
  }
1854
2041
  /**
@@ -1869,15 +2056,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1869
2056
  */
1870
2057
  async deleteIfExists(options = {}) {
1871
2058
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
1872
- var _a, _b, _c;
1873
2059
  try {
1874
2060
  const res = await this.delete(updatedOptions);
1875
- return Object.assign({ succeeded: true }, res);
2061
+ return {
2062
+ succeeded: true,
2063
+ ...res,
2064
+ };
1876
2065
  }
1877
2066
  catch (e) {
1878
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
1879
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
1880
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
2067
+ if (e.details?.errorCode === "ResourceNotFound" ||
2068
+ e.details?.errorCode === "ParentNotFound") {
2069
+ return {
2070
+ succeeded: false,
2071
+ ...e.response?.parsedHeaders,
2072
+ _response: e.response,
2073
+ };
1881
2074
  }
1882
2075
  throw e;
1883
2076
  }
@@ -1899,16 +2092,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1899
2092
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
1900
2093
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(options);
1901
2094
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
1902
- var _a, _b, _c;
1903
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
2095
+ const rawResponse = await this.context.setHttpHeaders({
2096
+ ...updatedOptions,
2097
+ fileHttpHeaders,
2098
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
2099
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
2100
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
2101
+ fileAttributes: updatedOptions.fileAttributes
1904
2102
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1905
- : 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: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1906
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2103
+ : undefined,
2104
+ owner: updatedOptions.posixProperties?.owner,
2105
+ group: updatedOptions.posixProperties?.group,
2106
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2107
+ ...this.shareClientConfig,
2108
+ });
2109
+ return (0, utils_common_js_1.assertResponse)({
2110
+ ...rawResponse,
2111
+ _response: rawResponse._response, // _response is made non-enumerable,
2112
+ posixProperties: {
1907
2113
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1908
2114
  owner: rawResponse.owner,
1909
2115
  group: rawResponse.group,
1910
2116
  linkCount: rawResponse.linkCount,
1911
- } }));
2117
+ },
2118
+ });
1912
2119
  });
1913
2120
  }
1914
2121
  /**
@@ -1929,14 +2136,28 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1929
2136
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
1930
2137
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(options);
1931
2138
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
1932
- var _a, _b, _c;
1933
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: (0, models_js_1.fileChangeTimeToString)(options.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(options.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(options.lastWriteTime), fileAttributes: (0, models_js_1.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: (0, utils_common_js_1.toOctalFileMode)((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1934
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2139
+ const rawResponse = await this.context.setHttpHeaders({
2140
+ ...updatedOptions,
2141
+ fileContentLength: length,
2142
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(options.changeTime),
2143
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(options.creationTime),
2144
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(options.lastWriteTime),
2145
+ fileAttributes: (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes),
2146
+ owner: updatedOptions.posixProperties?.owner,
2147
+ group: updatedOptions.posixProperties?.group,
2148
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(options.posixProperties?.fileMode),
2149
+ ...this.shareClientConfig,
2150
+ });
2151
+ return (0, utils_common_js_1.assertResponse)({
2152
+ ...rawResponse,
2153
+ _response: rawResponse._response,
2154
+ posixProperties: {
1935
2155
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1936
2156
  owner: rawResponse.owner,
1937
2157
  group: rawResponse.group,
1938
2158
  linkCount: rawResponse.linkCount,
1939
- } }));
2159
+ },
2160
+ });
1940
2161
  });
1941
2162
  }
1942
2163
  /**
@@ -1952,7 +2173,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1952
2173
  */
1953
2174
  async setMetadata(metadata = {}, options = {}) {
1954
2175
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
1955
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
2176
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
2177
+ ...updatedOptions,
2178
+ metadata,
2179
+ ...this.shareClientConfig,
2180
+ }));
1956
2181
  });
1957
2182
  }
1958
2183
  /**
@@ -2008,9 +2233,14 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2008
2233
  if (contentLength > constants_js_1.FILE_RANGE_MAX_SIZE_BYTES) {
2009
2234
  throw new RangeError(`offset must be < ${constants_js_1.FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2010
2235
  }
2011
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
2236
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "update", contentLength, {
2237
+ ...updatedOptions,
2238
+ requestOptions: {
2012
2239
  onUploadProgress: updatedOptions.onProgress,
2013
- }, body }), this.shareClientConfig)));
2240
+ },
2241
+ body,
2242
+ ...this.shareClientConfig,
2243
+ }));
2014
2244
  });
2015
2245
  }
2016
2246
  /**
@@ -2031,7 +2261,13 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2031
2261
  if (count <= 0 || count > constants_js_1.FILE_RANGE_MAX_SIZE_BYTES) {
2032
2262
  throw new RangeError(`count must be > 0 and <= ${constants_js_1.FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2033
2263
  }
2034
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRangeFromURL((0, Range_js_1.rangeToString)({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(updatedOptions.sourceAuthorization) }), this.shareClientConfig)));
2264
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRangeFromURL((0, Range_js_1.rangeToString)({ offset: destOffset, count }), sourceURL, 0, {
2265
+ ...updatedOptions,
2266
+ sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }),
2267
+ sourceModifiedAccessConditions: updatedOptions.sourceConditions,
2268
+ copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(updatedOptions.sourceAuthorization),
2269
+ ...this.shareClientConfig,
2270
+ }));
2035
2271
  });
2036
2272
  }
2037
2273
  /**
@@ -2047,7 +2283,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2047
2283
  if (offset < 0 || contentLength <= 0) {
2048
2284
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
2049
2285
  }
2050
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2286
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "clear", 0, { ...updatedOptions, ...this.shareClientConfig }));
2051
2287
  });
2052
2288
  }
2053
2289
  /**
@@ -2057,12 +2293,20 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2057
2293
  */
2058
2294
  async getRangeList(options = {}) {
2059
2295
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
2060
- const originalResponse = (0, utils_common_js_1.assertResponse)(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined }), this.shareClientConfig)));
2296
+ const originalResponse = (0, utils_common_js_1.assertResponse)(await this.context.getRangeList({
2297
+ ...updatedOptions,
2298
+ range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined,
2299
+ ...this.shareClientConfig,
2300
+ }));
2061
2301
  // Only returns ranges, ignoring clearRanges.
2062
2302
  const parsedBody = originalResponse._response.parsedBody.ranges
2063
2303
  ? originalResponse._response.parsedBody.ranges
2064
2304
  : [];
2065
- return Object.assign(Object.assign({}, originalResponse), { _response: Object.assign(Object.assign({}, originalResponse._response), { parsedBody }), rangeList: originalResponse.ranges ? originalResponse.ranges : [] });
2305
+ return {
2306
+ ...originalResponse,
2307
+ _response: { ...originalResponse._response, parsedBody },
2308
+ rangeList: originalResponse.ranges ? originalResponse.ranges : [],
2309
+ };
2066
2310
  });
2067
2311
  }
2068
2312
  /**
@@ -2073,7 +2317,13 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2073
2317
  */
2074
2318
  async getRangeListDiff(prevShareSnapshot, options = {}) {
2075
2319
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
2076
- return (0, utils_common_js_1.assertResponse)(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, supportRename: options.includeRenames, range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined }), this.shareClientConfig)));
2320
+ return (0, utils_common_js_1.assertResponse)(await this.context.getRangeList({
2321
+ ...updatedOptions,
2322
+ prevsharesnapshot: prevShareSnapshot,
2323
+ supportRename: options.includeRenames,
2324
+ range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined,
2325
+ ...this.shareClientConfig,
2326
+ }));
2077
2327
  });
2078
2328
  }
2079
2329
  /**
@@ -2090,8 +2340,15 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2090
2340
  */
2091
2341
  async startCopyFromURL(copySource, options = {}) {
2092
2342
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
2093
- var _a, _b, _c;
2094
- return (0, utils_common_js_1.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: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), fileModeCopyMode: updatedOptions.fileModeCopyMode, fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode })));
2343
+ return (0, utils_common_js_1.assertResponse)(await this.context.startCopy(copySource, {
2344
+ ...updatedOptions,
2345
+ ...this.shareClientConfig,
2346
+ owner: updatedOptions.posixProperties?.owner,
2347
+ group: updatedOptions.posixProperties?.group,
2348
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2349
+ fileModeCopyMode: updatedOptions.fileModeCopyMode,
2350
+ fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode,
2351
+ }));
2095
2352
  });
2096
2353
  }
2097
2354
  /**
@@ -2104,7 +2361,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2104
2361
  */
2105
2362
  async abortCopyFromURL(copyId, options = {}) {
2106
2363
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
2107
- return (0, utils_common_js_1.assertResponse)(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2364
+ return (0, utils_common_js_1.assertResponse)(await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }));
2108
2365
  });
2109
2366
  }
2110
2367
  // High Level functions
@@ -2442,13 +2699,23 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2442
2699
  async listHandlesSegment(marker, options = {}) {
2443
2700
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
2444
2701
  marker = marker === "" ? undefined : marker;
2445
- const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
2702
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles({
2703
+ ...updatedOptions,
2704
+ ...this.shareClientConfig,
2705
+ marker,
2706
+ }));
2446
2707
  // TODO: Protocol layer issue that when handle list is in returned XML
2447
2708
  // response.handleList is an empty string
2448
2709
  if (response.handleList === "") {
2449
2710
  response.handleList = undefined;
2450
2711
  }
2451
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody) }) });
2712
+ const wrappedResponse = {
2713
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response),
2714
+ _response: {
2715
+ ...response._response,
2716
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody),
2717
+ },
2718
+ };
2452
2719
  return wrappedResponse;
2453
2720
  });
2454
2721
  }
@@ -2462,47 +2729,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2462
2729
  * set of list items.
2463
2730
  * @param options - Options to list handles operation.
2464
2731
  */
2465
- iterateHandleSegments(marker_1) {
2466
- return tslib_1.__asyncGenerator(this, arguments, function* iterateHandleSegments_2(marker, options = {}) {
2467
- let listHandlesResponse;
2468
- if (!!marker || marker === undefined) {
2469
- do {
2470
- listHandlesResponse = yield tslib_1.__await(this.listHandlesSegment(marker, options));
2471
- marker = listHandlesResponse.continuationToken;
2472
- yield yield tslib_1.__await(listHandlesResponse);
2473
- } while (marker);
2474
- }
2475
- });
2732
+ async *iterateHandleSegments(marker, options = {}) {
2733
+ let listHandlesResponse;
2734
+ if (!!marker || marker === undefined) {
2735
+ do {
2736
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
2737
+ marker = listHandlesResponse.continuationToken;
2738
+ yield listHandlesResponse;
2739
+ } while (marker);
2740
+ }
2476
2741
  }
2477
2742
  /**
2478
2743
  * Returns an AsyncIterableIterator for handles
2479
2744
  *
2480
2745
  * @param options - Options to list handles operation.
2481
2746
  */
2482
- listHandleItems() {
2483
- return tslib_1.__asyncGenerator(this, arguments, function* listHandleItems_2(options = {}) {
2484
- var _a, e_3, _b, _c;
2485
- let marker;
2486
- try {
2487
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
2488
- _c = _f.value;
2489
- _d = false;
2490
- const listHandlesResponse = _c;
2491
- if (listHandlesResponse.handleList) {
2492
- for (const handle of listHandlesResponse.handleList) {
2493
- yield yield tslib_1.__await(handle);
2494
- }
2495
- }
2747
+ async *listHandleItems(options = {}) {
2748
+ let marker;
2749
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
2750
+ if (listHandlesResponse.handleList) {
2751
+ for (const handle of listHandlesResponse.handleList) {
2752
+ yield handle;
2496
2753
  }
2497
2754
  }
2498
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2499
- finally {
2500
- try {
2501
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
2502
- }
2503
- finally { if (e_3) throw e_3.error; }
2504
- }
2505
- });
2755
+ }
2506
2756
  }
2507
2757
  /**
2508
2758
  * Returns an async iterable iterator to list all the handles.
@@ -2534,7 +2784,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2534
2784
  * Return an AsyncIterableIterator that works a page at a time
2535
2785
  */
2536
2786
  byPage: (settings = {}) => {
2537
- return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxPageSize: settings.maxPageSize }, options));
2787
+ return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
2788
+ maxPageSize: settings.maxPageSize,
2789
+ ...options,
2790
+ });
2538
2791
  },
2539
2792
  };
2540
2793
  }
@@ -2552,7 +2805,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2552
2805
  async forceCloseHandlesSegment(marker, options = {}) {
2553
2806
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
2554
2807
  marker = marker === "" ? undefined : marker;
2555
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
2808
+ const rawResponse = await this.context.forceCloseHandles("*", {
2809
+ ...updatedOptions,
2810
+ ...this.shareClientConfig,
2811
+ marker,
2812
+ });
2556
2813
  const response = rawResponse;
2557
2814
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2558
2815
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2599,7 +2856,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2599
2856
  if (handleId === "*") {
2600
2857
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
2601
2858
  }
2602
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2859
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
2860
+ ...updatedOptions,
2861
+ ...this.shareClientConfig,
2862
+ });
2603
2863
  const response = rawResponse;
2604
2864
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2605
2865
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2614,14 +2874,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2614
2874
  */
2615
2875
  async createHardLink(targetFile, options = {}) {
2616
2876
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
2617
- const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2618
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2877
+ const rawResponse = await this.context.createHardLink(targetFile, {
2878
+ ...updatedOptions,
2879
+ ...this.shareClientConfig,
2880
+ });
2881
+ return (0, utils_common_js_1.assertResponse)({
2882
+ ...rawResponse,
2883
+ _response: rawResponse._response, // _response is made non-enumerable,
2884
+ posixProperties: {
2619
2885
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
2620
2886
  fileType: rawResponse.nfsFileType,
2621
2887
  owner: rawResponse.owner,
2622
2888
  group: rawResponse.group,
2623
2889
  linkCount: rawResponse.linkCount,
2624
- } }));
2890
+ },
2891
+ });
2625
2892
  });
2626
2893
  }
2627
2894
  /**
@@ -2633,13 +2900,20 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2633
2900
  */
2634
2901
  async createSymbolicLink(linkText, options = {}) {
2635
2902
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-createSymbolicLink", options, async (updatedOptions) => {
2636
- const rawResponse = await this.context.createSymbolicLink(linkText, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2637
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2903
+ const rawResponse = await this.context.createSymbolicLink(linkText, {
2904
+ ...updatedOptions,
2905
+ ...this.shareClientConfig,
2906
+ });
2907
+ return (0, utils_common_js_1.assertResponse)({
2908
+ ...rawResponse,
2909
+ _response: rawResponse._response, // _response is made non-enumerable,
2910
+ posixProperties: {
2638
2911
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
2639
2912
  owner: rawResponse.owner,
2640
2913
  group: rawResponse.group,
2641
2914
  fileType: rawResponse.nfsFileType,
2642
- } }));
2915
+ },
2916
+ });
2643
2917
  });
2644
2918
  }
2645
2919
  /**
@@ -2648,7 +2922,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2648
2922
  */
2649
2923
  async getSymbolicLink(options = {}) {
2650
2924
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getSymbolicLink", options, async (updatedOptions) => {
2651
- return (0, utils_common_js_1.assertResponse)(await this.context.getSymbolicLink(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2925
+ return (0, utils_common_js_1.assertResponse)(await this.context.getSymbolicLink({
2926
+ ...updatedOptions,
2927
+ ...this.shareClientConfig,
2928
+ }));
2652
2929
  });
2653
2930
  }
2654
2931
  /**
@@ -2672,10 +2949,14 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2672
2949
  * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
2673
2950
  */
2674
2951
  generateSasUrl(options) {
2675
- if (!(this.credential instanceof storage_blob_2.StorageSharedKeyCredential)) {
2952
+ if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
2676
2953
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2677
2954
  }
2678
- const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).toString();
2955
+ const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)({
2956
+ shareName: this.shareName,
2957
+ filePath: this.path,
2958
+ ...options,
2959
+ }, this.credential).toString();
2679
2960
  return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
2680
2961
  }
2681
2962
  /**
@@ -2691,10 +2972,14 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2691
2972
  */
2692
2973
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
2693
2974
  generateSasStringToSign(options) {
2694
- if (!(this.credential instanceof storage_blob_2.StorageSharedKeyCredential)) {
2975
+ if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
2695
2976
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2696
2977
  }
2697
- return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).stringToSign;
2978
+ return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)({
2979
+ shareName: this.shareName,
2980
+ filePath: this.path,
2981
+ ...options,
2982
+ }, this.credential).stringToSign;
2698
2983
  }
2699
2984
  /**
2700
2985
  * Renames a file.
@@ -2749,19 +3034,25 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2749
3034
  }
2750
3035
  const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
2751
3036
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
2752
- const response = (0, utils_common_js_1.assertResponse)(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
3037
+ const response = (0, utils_common_js_1.assertResponse)(await destFile.context.rename(this.url, {
3038
+ ...updatedOptions,
3039
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
2753
3040
  ? {
2754
3041
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
2755
3042
  }
2756
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
3043
+ : undefined,
3044
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
2757
3045
  ? {
2758
3046
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
2759
3047
  }
2760
- : undefined, fileHttpHeaders: options.contentType
3048
+ : undefined,
3049
+ fileHttpHeaders: options.contentType
2761
3050
  ? {
2762
3051
  fileContentType: options.contentType,
2763
3052
  }
2764
- : undefined }), this.shareClientConfig)));
3053
+ : undefined,
3054
+ ...this.shareClientConfig,
3055
+ }));
2765
3056
  return {
2766
3057
  destinationFileClient: destFile,
2767
3058
  fileRenameResponse: response,
@@ -2777,6 +3068,10 @@ exports.ShareFileClient = ShareFileClient;
2777
3068
  * @see https://learn.microsoft.com/rest/api/storageservices/lease-share
2778
3069
  */
2779
3070
  class ShareLeaseClient {
3071
+ _leaseId;
3072
+ _url;
3073
+ fileOrShare;
3074
+ shareClientConfig;
2780
3075
  /**
2781
3076
  * Gets the lease Id.
2782
3077
  *
@@ -2823,7 +3118,12 @@ class ShareLeaseClient {
2823
3118
  */
2824
3119
  async acquireLease(duration = -1, options = {}) {
2825
3120
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-acquireLease", options, async (updatedOptions) => {
2826
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.acquireLease(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { duration, proposedLeaseId: this._leaseId })));
3121
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.acquireLease({
3122
+ ...updatedOptions,
3123
+ ...this.shareClientConfig,
3124
+ duration,
3125
+ proposedLeaseId: this._leaseId,
3126
+ }));
2827
3127
  });
2828
3128
  }
2829
3129
  /**
@@ -2835,7 +3135,11 @@ class ShareLeaseClient {
2835
3135
  */
2836
3136
  async changeLease(proposedLeaseId, options = {}) {
2837
3137
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-changeLease", options, async (updatedOptions) => {
2838
- const response = (0, utils_common_js_1.assertResponse)(await this.fileOrShare.changeLease(this._leaseId, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { proposedLeaseId })));
3138
+ const response = (0, utils_common_js_1.assertResponse)(await this.fileOrShare.changeLease(this._leaseId, {
3139
+ ...updatedOptions,
3140
+ ...this.shareClientConfig,
3141
+ proposedLeaseId,
3142
+ }));
2839
3143
  this._leaseId = proposedLeaseId;
2840
3144
  return response;
2841
3145
  });
@@ -2849,7 +3153,10 @@ class ShareLeaseClient {
2849
3153
  */
2850
3154
  async releaseLease(options = {}) {
2851
3155
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-releaseLease", options, async (updatedOptions) => {
2852
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.releaseLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3156
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.releaseLease(this._leaseId, {
3157
+ ...updatedOptions,
3158
+ ...this.shareClientConfig,
3159
+ }));
2853
3160
  });
2854
3161
  }
2855
3162
  /**
@@ -2860,7 +3167,10 @@ class ShareLeaseClient {
2860
3167
  */
2861
3168
  async breakLease(options = {}) {
2862
3169
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-breakLease", options, async (updatedOptions) => {
2863
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.breakLease(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3170
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.breakLease({
3171
+ ...updatedOptions,
3172
+ ...this.shareClientConfig,
3173
+ }));
2864
3174
  });
2865
3175
  }
2866
3176
  /**
@@ -2876,7 +3186,10 @@ class ShareLeaseClient {
2876
3186
  if (isFile(this.fileOrShare)) {
2877
3187
  throw new RangeError("The renewLease operation is not available for lease on file.");
2878
3188
  }
2879
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.renewLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3189
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.renewLease(this._leaseId, {
3190
+ ...updatedOptions,
3191
+ ...this.shareClientConfig,
3192
+ }));
2880
3193
  });
2881
3194
  }
2882
3195
  }